thpj5/scripts/scr_files_init/scr_files_init.gml

31 lines
820 B
Plaintext
Raw Permalink Normal View History

function scr_files_init(){
if (!variable_global_exists( "global.default_save" ) ) {
global.default_save = -1;
}
if (!ds_exists(global.default_save, ds_type_map) ) {
global.default_save = ds_map_create();
}
if (!variable_global_exists( "global.loaded_file" ) ) {
global.loaded_file = -1;
}
if (!ds_exists(global.loaded_file, ds_type_map) ) {
global.loaded_file = ds_map_create();
}
//initialize default save data
global.default_save[? SAVE_CHNUM ] = 1;
global.default_save[? SAVE_LINENUM ] = 0;
scr_files_load( SAVE_DEFAULTS );
//initialize save files
if ( !file_exists(SAVE_FILE_NAME_A) ) {
scr_files_save(SAVE_FILE_NAME_A);
}
if (!file_exists(SAVE_FILE_NAME_B) ) {
scr_files_save(SAVE_FILE_NAME_B);
}
if (!file_exists(SAVE_FILE_NAME_C) ) {
scr_files_save(SAVE_FILE_NAME_C);
}
}