2023-06-17 14:30:49 +02:00
|
|
|
/// @description
|
|
|
|
#region setup
|
|
|
|
window_set_size(640, 480);
|
|
|
|
display_set_gui_size(640, 480);
|
|
|
|
|
|
|
|
window_set_caption("Pixel Composer crashed")
|
|
|
|
window_set_position(
|
|
|
|
(display_get_width() - 640) / 2,
|
2023-09-21 12:05:06 +02:00
|
|
|
(display_get_height() - 480) / 2); // center window
|
2023-06-17 14:30:49 +02:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region directory
|
|
|
|
globalvar DIRECTORY, APP_DIRECTORY;
|
|
|
|
DIRECTORY = "";
|
|
|
|
|
|
|
|
if(OS == os_windows) {
|
|
|
|
APP_DIRECTORY = environment_get_variable("userprofile") + "\\AppData\\Local\\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
|
|
|
|
APP_DIRECTORY = string(home_dir) + "/PixelComposer/";
|
|
|
|
}
|
|
|
|
|
|
|
|
var perstPath = APP_DIRECTORY + "persistPreference.json";
|
|
|
|
if(file_exists(perstPath)) {
|
|
|
|
PRESIST_PREF = json_load_struct(perstPath);
|
|
|
|
DIRECTORY = struct_has(PRESIST_PREF, "path")? PRESIST_PREF.path : "";
|
|
|
|
}
|
|
|
|
|
|
|
|
var dir_valid = DIRECTORY != "" && directory_exists(DIRECTORY);
|
|
|
|
if(!dir_valid) DIRECTORY = APP_DIRECTORY;
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region log
|
|
|
|
path = DIRECTORY + "log/crash_log.txt";
|
|
|
|
if(!file_exists(path)) game_end(1);
|
|
|
|
|
2023-11-13 07:11:52 +01:00
|
|
|
crash_content = file_read_all(path);
|
2023-10-04 05:52:20 +02:00
|
|
|
log_surface = surface_create(1, 1);
|
|
|
|
log_y = 0;
|
|
|
|
log_y_to = 0;
|
2023-06-17 14:30:49 +02:00
|
|
|
|
2023-10-04 05:52:20 +02:00
|
|
|
LOCALE = { config: { per_character_line_break: true } }
|
2023-06-17 14:30:49 +02:00
|
|
|
|
|
|
|
win_w = 640;
|
2023-09-21 12:05:06 +02:00
|
|
|
win_h = 480;
|
2023-06-17 14:30:49 +02:00
|
|
|
#endregion
|