Mac stuff

This commit is contained in:
Tanasart 2023-03-22 14:29:29 +07:00
parent f1e1a7c906
commit 918b2a989e
3 changed files with 12 additions and 7 deletions

View file

@ -7,10 +7,15 @@
if(OS == os_windows)
DIRECTORY = environment_get_variable("userprofile") + "/AppData/Local/PixelComposer/";
else if(OS == os_macosx)
DIRECTORY = string(environment_get_variable("HOME")) + "/PixelComposer/";
else if(OS == os_macosx) {
var home_dir = environment_get_variable("HOME");
if(string(home_dir) == "0")
log_message("DIRECTORY", "Directory not found.");
else
DIRECTORY = string(home_dir) + "/PixelComposer/";
}
show_debug_message(DIRECTORY);
if(!directory_exists(DIRECTORY))
directory_create(DIRECTORY);
if(!directory_exists(DIRECTORY + "temp"))
@ -18,6 +23,8 @@
METADATA = __getdefaultMetaData();
PREF_LOAD();
log_clear();
log_newline();
log_message("SESSION", "Begin");
@ -36,7 +43,7 @@
__initNodes();
__initSteamUGC();
PREF_LOAD();
PREF_APPLY();
loadFonts();
loadGraphic(PREF_MAP[? "theme"]);
loadColor(PREF_MAP[? "theme"]);

View file

@ -215,9 +215,9 @@ function MetaDataManager() constructor {
METADATA = noone;
function __getdefaultMetaData() {
var path = DIRECTORY + "meta.json";
var meta = new MetaDataManager();
var path = DIRECTORY + "meta.json";
if(!file_exists(path)) return meta;
var over = json_load(path);
return meta.deserialize(over);

View file

@ -233,8 +233,6 @@
}
ds_map_destroy(map);
PREF_APPLY();
}
function PREF_APPLY() {