Improve config handling
This commit is contained in:
+3
-6
@@ -21,6 +21,7 @@ class Main {
|
||||
static var tasks: Int;
|
||||
|
||||
public static function main() {
|
||||
Krom.setApplicationName("ArmorPaint");
|
||||
tasks = 1;
|
||||
tasks++; Config.load(function() { tasks--; start(); });
|
||||
#if arm_physics
|
||||
@@ -47,7 +48,7 @@ class Main {
|
||||
if (lasti >= 0) title = title.substr(lasti + 1);
|
||||
if (title.endsWith(".exe")) title = title.substr(0, title.length - 4);
|
||||
#else
|
||||
var title = "ArmorPaint";
|
||||
var title = "untitled - ArmorPaint";
|
||||
#end
|
||||
|
||||
var options: kha.SystemOptions = {
|
||||
@@ -67,13 +68,9 @@ class Main {
|
||||
};
|
||||
|
||||
System.start(options, function(window: Window) {
|
||||
#if (!arm_player)
|
||||
kha.Window.get(0).title = "untitled - ArmorPaint";
|
||||
#end
|
||||
Krom.setApplicationName("ArmorPaint");
|
||||
iron.App.init(function() {
|
||||
Scene.setActive("Scene", function(o: Object) {
|
||||
if (Path.isProtected()) Config.load(function() {}, true);
|
||||
Config.init();
|
||||
Uniforms.init();
|
||||
var path = new RenderPath();
|
||||
Inc.init(path);
|
||||
|
||||
@@ -17,9 +17,9 @@ class Config {
|
||||
public static var keymap: Dynamic;
|
||||
public static var configLoaded = false;
|
||||
|
||||
public static function load(done: Void->Void, fromSavePath = false) {
|
||||
public static function load(done: Void->Void) {
|
||||
try {
|
||||
Data.getBlob((fromSavePath ? Krom.savePath() : "") + "config.arm", function(blob: kha.Blob) {
|
||||
Data.getBlob((Path.isProtected() ? Krom.savePath() : "") + "config.arm", function(blob: kha.Blob) {
|
||||
configLoaded = true;
|
||||
raw = Json.parse(blob.toString());
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user