浏览代码

Use .json extension for config file

luboslenco 3 年之前
父节点
当前提交
6ed75da33e
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Sources/arm/Config.hx

+ 4 - 4
Sources/arm/Config.hx

@@ -30,7 +30,7 @@ class Config {
 
 
 	public static function load(done: Void->Void) {
 	public static function load(done: Void->Void) {
 		try {
 		try {
-			Data.getBlob((Path.isProtected() ? Krom.savePath() : "") + "config.arm", function(blob: kha.Blob) {
+			Data.getBlob((Path.isProtected() ? Krom.savePath() : "") + "config.json", function(blob: kha.Blob) {
 				configLoaded = true;
 				configLoaded = true;
 				raw = Json.parse(blob.toString());
 				raw = Json.parse(blob.toString());
 
 
@@ -40,7 +40,7 @@ class Config {
 		catch (e: Dynamic) {
 		catch (e: Dynamic) {
 			#if krom_linux
 			#if krom_linux
 			try { // Protected directory
 			try { // Protected directory
-				Data.getBlob(Krom.savePath() + "config.arm", function(blob: kha.Blob) {
+				Data.getBlob(Krom.savePath() + "config.json", function(blob: kha.Blob) {
 					configLoaded = true;
 					configLoaded = true;
 					raw = Json.parse(blob.toString());
 					raw = Json.parse(blob.toString());
 					done();
 					done();
@@ -58,12 +58,12 @@ class Config {
 	public static function save() {
 	public static function save() {
 		// Use system application data folder
 		// Use system application data folder
 		// when running from protected path like "Program Files"
 		// when running from protected path like "Program Files"
-		var path = (Path.isProtected() ? Krom.savePath() : Path.data() + Path.sep) + "config.arm";
+		var path = (Path.isProtected() ? Krom.savePath() : Path.data() + Path.sep) + "config.json";
 		var bytes = Bytes.ofString(Json.stringify(raw));
 		var bytes = Bytes.ofString(Json.stringify(raw));
 		Krom.fileSaveBytes(path, bytes.getData());
 		Krom.fileSaveBytes(path, bytes.getData());
 
 
 		#if krom_linux // Protected directory
 		#if krom_linux // Protected directory
-		if (!File.exists(path)) Krom.fileSaveBytes(Krom.savePath() + "config.arm", bytes.getData());
+		if (!File.exists(path)) Krom.fileSaveBytes(Krom.savePath() + "config.json", bytes.getData());
 		#end
 		#end
 	}
 	}