Pixel-Composer/scripts/window_functions/window_functions.gml
2023-09-26 19:45:15 +07:00

23 lines
569 B
Plaintext

function close_program() {
PREF_SAVE();
if(PREF_MAP[? "clear_temp_on_close"]) directory_destroy(DIRECTORY + "temp");
game_end();
}
function window_close() {
var noSave = true;
for( var i = 0, n = array_length(PROJECTS); i < n; i++ ) {
var project = PROJECTS[i];
//print($"Project {filename_name_only(project)} modified: {project.modified} readonly: {project.readonly}");
if(project.modified && !project.readonly) {
var dia = dialogCall(o_dialog_exit,,,, true);
dia.project = project;
noSave = false;
}
}
if(noSave) close_program();
}