Fix restart buton not working.

This commit is contained in:
Tanasart 2023-11-05 10:19:19 +07:00
parent 9dc560d92f
commit f2f69b1b03
10 changed files with 30 additions and 20 deletions

View file

@ -127,6 +127,8 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
if(point_in_rectangle(mouse_mx, mouse_my, bx0, by0, bx0 + bw, by0 + bh)) { if(point_in_rectangle(mouse_mx, mouse_my, bx0, by0, bx0 + bw, by0 + bh)) {
if(mouse_check_button_pressed(mb_left)) { if(mouse_check_button_pressed(mb_left)) {
EnvironmentUnsetVariable("process_id");
var path = executable_get_pathname(); var path = executable_get_pathname();
shell_execute_async(path, "--crashed"); shell_execute_async(path, "--crashed");
} }

View file

@ -2,8 +2,7 @@
#region log #region log
var path = "log_temp.txt"; var path = "log_temp.txt";
var f = file_text_open_append(path); var f = file_text_open_append(path);
var t = _log_template(); file_text_write_string(f, $"[MESSAGE] {_log_template()}session begin\n");
file_text_write_string(f, "[MESSAGE] " + t + "session begin" + "\n");
file_text_close(f); file_text_close(f);
gpu_set_tex_mip_enable(mip_off); gpu_set_tex_mip_enable(mip_off);

View file

@ -41,8 +41,8 @@
PRESIST_PREF.path = DIRECTORY; PRESIST_PREF.path = DIRECTORY;
json_save_struct(perstPath, PRESIST_PREF); json_save_struct(perstPath, PRESIST_PREF);
directory_verify(DIRECTORY); directory_verify(DIRECTORY);
directory_set_current_working(DIRECTORY);
METADATA = __getdefaultMetaData(); METADATA = __getdefaultMetaData();
#endregion #endregion
@ -105,8 +105,7 @@
if(parameter_count() > 1) { if(parameter_count() > 1) {
var path = parameter_string(1); var path = parameter_string(1);
if(path == "--crashed") { if(path == "--crashed") {
if(PREFERENCES.show_crash_dialog) if(PREFERENCES.show_crash_dialog) dialogCall(o_dialog_crashed);
dialogCall(o_dialog_crashed);
} else { } else {
path = string_replace_all(path, "\n", ""); path = string_replace_all(path, "\n", "");
path = string_replace_all(path, "\"", ""); path = string_replace_all(path, "\"", "");
@ -114,8 +113,6 @@
if(file_exists(path) && filename_ext(path) == ".pxc") { if(file_exists(path) && filename_ext(path) == ".pxc") {
file_open_parameter = path; file_open_parameter = path;
alarm[2] = 3; alarm[2] = 3;
directory_set_current_working(DIRECTORY);
} }
} }
} }

View file

@ -26,6 +26,7 @@ _HOVERING_ELEMENT = noone;
window_set_cursor(CURSOR); window_set_cursor(CURSOR);
_cursor = CURSOR; _cursor = CURSOR;
} }
CURSOR = cr_default; CURSOR = cr_default;
if(!gameframe_is_minimized() && (win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1)) { if(!gameframe_is_minimized() && (win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1)) {

View file

@ -12,6 +12,7 @@
#endregion #endregion
function _log_template() { function _log_template() {
gml_pragma("forceinline");
return $"{current_year}/{current_month}/{current_day} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > "; return $"{current_year}/{current_month}/{current_day} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > ";
} }

View file

@ -52,6 +52,8 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
} #endregion } #endregion
static postDeserialize = function() { #region static postDeserialize = function() { #region
refreshCacheGroup();
if(!struct_has(load_map, "cache")) return; if(!struct_has(load_map, "cache")) return;
cache_content = json_try_parse(load_map.cache); cache_content = json_try_parse(load_map.cache);
cache_loading_progress = 0; cache_loading_progress = 0;

View file

@ -76,6 +76,8 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
} #endregion } #endregion
static postDeserialize = function() { #region static postDeserialize = function() { #region
refreshCacheGroup();
if(!struct_has(load_map, "cache")) return; if(!struct_has(load_map, "cache")) return;
cache_content = json_try_parse(load_map.cache); cache_content = json_try_parse(load_map.cache);
cache_loading_progress = 0; cache_loading_progress = 0;

View file

@ -30,22 +30,33 @@ function __Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} #endregion } #endregion
static enableNodeGroup = function() { #region static enableNodeGroup = function() { #region
if(LOADING || APPENDING) return;
for( var i = 0, n = array_length(cache_group_members); i < n; i++ ) for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
cache_group_members[i].renderActive = true; cache_group_members[i].renderActive = true;
clearCache(true); clearCache(true);
} #endregion } #endregion
static disableNodeGroup = function() { #region static disableNodeGroup = function() { #region
if(LOADING || APPENDING) return;
if(IS_PLAYING && CURRENT_FRAME == TOTAL_FRAMES - 1) if(IS_PLAYING && CURRENT_FRAME == TOTAL_FRAMES - 1)
for( var i = 0, n = array_length(cache_group_members); i < n; i++ ) for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
cache_group_members[i].renderActive = false; cache_group_members[i].renderActive = false;
} #endregion } #endregion
static refreshCacheGroup = function() { #region static refreshCacheGroup = function() { #region
cache_group_members = array_create(array_length(attributes.cache_group)); cache_group_members = [];
for( var i = 0, n = array_length(attributes.cache_group); i < n; i++ ) { for( var i = 0, n = array_length(attributes.cache_group); i < n; i++ ) {
cache_group_members[i] = PROJECT.nodeMap[? attributes.cache_group[i]]; if(!ds_map_exists(PROJECT.nodeMap, attributes.cache_group[i])) {
cache_group_members[i].cache_group = self; print($"Node not found {attributes.cache_group[i]}");
continue;
}
var _node = PROJECT.nodeMap[? attributes.cache_group[i]];
array_push(cache_group_members, _node);
_node.cache_group = self;
} }
} #endregion } #endregion
@ -226,9 +237,4 @@ function __Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_set_alpha(1); draw_set_alpha(1);
} #endregion } #endregion
static attributeDeserialize = function(attr) { #region
struct_override(attributes, attr);
refreshCacheGroup();
} #endregion
} }

View file

@ -1681,7 +1681,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
else node_id = load_map.id; else node_id = load_map.id;
PROJECT.nodeMap[? node_id] = self; PROJECT.nodeMap[? node_id] = self;
//print($"D Adding node {node_id} to {PROJECT.path} [{ds_map_size(PROJECT.nodeMap)}]"); //print($"Adding node {node_id} to {PROJECT.path} [{ds_map_size(PROJECT.nodeMap)}]");
if(struct_has(load_map, "name")) if(struct_has(load_map, "name"))
setDisplayName(load_map.name); setDisplayName(load_map.name);

View file

@ -20,7 +20,7 @@ void main() {
for( i = 0.; i < _w; i++ ) for( i = 0.; i < _w; i++ )
for( j = 0.; j < _h; j++ ) { for( j = 0.; j < _h; j++ ) {
col = texture2D( texture, vec2(i, j) / dimension); col = texture2D( texture, vec2(i, j) / dimension);
if(col.r > 0.) { if(col.a > 0.) {
gl_FragColor = vec4(i); gl_FragColor = vec4(i);
return; return;
} }
@ -29,7 +29,7 @@ void main() {
for( i = 0.; i < _h; i++ ) for( i = 0.; i < _h; i++ )
for( j = bbox.x; j < _w; j++ ) { for( j = bbox.x; j < _w; j++ ) {
col = texture2D( texture, vec2(j, i) / dimension); col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) { if(col.a > 0.) {
gl_FragColor = vec4(i); gl_FragColor = vec4(i);
return; return;
} }
@ -38,7 +38,7 @@ void main() {
for( i = _w; i >= bbox.x; i-- ) for( i = _w; i >= bbox.x; i-- )
for( j = bbox.y; j < _h; j++ ) { for( j = bbox.y; j < _h; j++ ) {
col = texture2D( texture, vec2(i, j) / dimension); col = texture2D( texture, vec2(i, j) / dimension);
if(col.r > 0.) { if(col.a > 0.) {
gl_FragColor = vec4(i); gl_FragColor = vec4(i);
return; return;
} }
@ -47,7 +47,7 @@ void main() {
for( i = _h; i >= bbox.y; i-- ) for( i = _h; i >= bbox.y; i-- )
for( j = bbox.x; j <= bbox.z; j++ ) { for( j = bbox.x; j <= bbox.z; j++ ) {
col = texture2D( texture, vec2(j, i) / dimension); col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) { if(col.a > 0.) {
gl_FragColor = vec4(i); gl_FragColor = vec4(i);
return; return;
} }