mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 22:46:19 +01:00
Preset existance check
This commit is contained in:
parent
fc425113bf
commit
f1e1a7c906
2 changed files with 10 additions and 7 deletions
|
@ -9,12 +9,15 @@
|
||||||
directory_create(root);
|
directory_create(root);
|
||||||
|
|
||||||
var _l = root + "/version";
|
var _l = root + "/version";
|
||||||
if(file_exists(_l)) {
|
var _preset_path = "data/Preset.zip";
|
||||||
var res = json_load_struct(_l);
|
if(file_exists(_preset_path)) {
|
||||||
if(!is_struct(res) || !struct_has(res, "version") || res.version < VERSION)
|
if(file_exists(_l)) {
|
||||||
zip_unzip("data/Preset.zip", root);
|
var res = json_load_struct(_l);
|
||||||
} else
|
if(!is_struct(res) || !struct_has(res, "version") || res.version < VERSION)
|
||||||
zip_unzip("data/Preset.zip", root);
|
zip_unzip(_preset_path, root);
|
||||||
|
} else
|
||||||
|
zip_unzip(_preset_path, root);
|
||||||
|
}
|
||||||
json_save_struct(_l, { version: VERSION });
|
json_save_struct(_l, { version: VERSION });
|
||||||
|
|
||||||
global.PRESETS = new DirectoryObject("Presets", root);
|
global.PRESETS = new DirectoryObject("Presets", root);
|
||||||
|
|
Loading…
Reference in a new issue