mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-23 21:46:17 +01:00
Fix restart buton not working.
This commit is contained in:
parent
9dc560d92f
commit
f2f69b1b03
10 changed files with 30 additions and 20 deletions
|
@ -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(mouse_check_button_pressed(mb_left)) {
|
||||
EnvironmentUnsetVariable("process_id");
|
||||
|
||||
var path = executable_get_pathname();
|
||||
shell_execute_async(path, "--crashed");
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
#region log
|
||||
var path = "log_temp.txt";
|
||||
var f = file_text_open_append(path);
|
||||
var t = _log_template();
|
||||
file_text_write_string(f, "[MESSAGE] " + t + "session begin" + "\n");
|
||||
file_text_write_string(f, $"[MESSAGE] {_log_template()}session begin\n");
|
||||
file_text_close(f);
|
||||
|
||||
gpu_set_tex_mip_enable(mip_off);
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
|
||||
PRESIST_PREF.path = DIRECTORY;
|
||||
json_save_struct(perstPath, PRESIST_PREF);
|
||||
|
||||
directory_verify(DIRECTORY);
|
||||
directory_set_current_working(DIRECTORY);
|
||||
|
||||
METADATA = __getdefaultMetaData();
|
||||
#endregion
|
||||
|
@ -105,8 +105,7 @@
|
|||
if(parameter_count() > 1) {
|
||||
var path = parameter_string(1);
|
||||
if(path == "--crashed") {
|
||||
if(PREFERENCES.show_crash_dialog)
|
||||
dialogCall(o_dialog_crashed);
|
||||
if(PREFERENCES.show_crash_dialog) dialogCall(o_dialog_crashed);
|
||||
} else {
|
||||
path = string_replace_all(path, "\n", "");
|
||||
path = string_replace_all(path, "\"", "");
|
||||
|
@ -114,8 +113,6 @@
|
|||
if(file_exists(path) && filename_ext(path) == ".pxc") {
|
||||
file_open_parameter = path;
|
||||
alarm[2] = 3;
|
||||
|
||||
directory_set_current_working(DIRECTORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ _HOVERING_ELEMENT = noone;
|
|||
window_set_cursor(CURSOR);
|
||||
_cursor = CURSOR;
|
||||
}
|
||||
|
||||
CURSOR = cr_default;
|
||||
|
||||
if(!gameframe_is_minimized() && (win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1)) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#endregion
|
||||
|
||||
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)} > ";
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
|
|||
} #endregion
|
||||
|
||||
static postDeserialize = function() { #region
|
||||
refreshCacheGroup();
|
||||
|
||||
if(!struct_has(load_map, "cache")) return;
|
||||
cache_content = json_try_parse(load_map.cache);
|
||||
cache_loading_progress = 0;
|
||||
|
|
|
@ -76,6 +76,8 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
|
|||
} #endregion
|
||||
|
||||
static postDeserialize = function() { #region
|
||||
refreshCacheGroup();
|
||||
|
||||
if(!struct_has(load_map, "cache")) return;
|
||||
cache_content = json_try_parse(load_map.cache);
|
||||
cache_loading_progress = 0;
|
||||
|
|
|
@ -30,22 +30,33 @@ function __Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
} #endregion
|
||||
|
||||
static enableNodeGroup = function() { #region
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
||||
cache_group_members[i].renderActive = true;
|
||||
clearCache(true);
|
||||
} #endregion
|
||||
|
||||
static disableNodeGroup = function() { #region
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
if(IS_PLAYING && CURRENT_FRAME == TOTAL_FRAMES - 1)
|
||||
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
||||
cache_group_members[i].renderActive = false;
|
||||
} #endregion
|
||||
|
||||
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++ ) {
|
||||
cache_group_members[i] = PROJECT.nodeMap[? attributes.cache_group[i]];
|
||||
cache_group_members[i].cache_group = self;
|
||||
if(!ds_map_exists(PROJECT.nodeMap, attributes.cache_group[i])) {
|
||||
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
|
||||
|
||||
|
@ -226,9 +237,4 @@ function __Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
draw_set_alpha(1);
|
||||
} #endregion
|
||||
|
||||
static attributeDeserialize = function(attr) { #region
|
||||
struct_override(attributes, attr);
|
||||
refreshCacheGroup();
|
||||
} #endregion
|
||||
}
|
|
@ -1681,7 +1681,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
else node_id = load_map.id;
|
||||
|
||||
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"))
|
||||
setDisplayName(load_map.name);
|
||||
|
|
|
@ -20,7 +20,7 @@ void main() {
|
|||
for( i = 0.; i < _w; i++ )
|
||||
for( j = 0.; j < _h; j++ ) {
|
||||
col = texture2D( texture, vec2(i, j) / dimension);
|
||||
if(col.r > 0.) {
|
||||
if(col.a > 0.) {
|
||||
gl_FragColor = vec4(i);
|
||||
return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ void main() {
|
|||
for( i = 0.; i < _h; i++ )
|
||||
for( j = bbox.x; j < _w; j++ ) {
|
||||
col = texture2D( texture, vec2(j, i) / dimension);
|
||||
if(col.r > 0.) {
|
||||
if(col.a > 0.) {
|
||||
gl_FragColor = vec4(i);
|
||||
return;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
|||
for( i = _w; i >= bbox.x; i-- )
|
||||
for( j = bbox.y; j < _h; j++ ) {
|
||||
col = texture2D( texture, vec2(i, j) / dimension);
|
||||
if(col.r > 0.) {
|
||||
if(col.a > 0.) {
|
||||
gl_FragColor = vec4(i);
|
||||
return;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ void main() {
|
|||
for( i = _h; i >= bbox.y; i-- )
|
||||
for( j = bbox.x; j <= bbox.z; j++ ) {
|
||||
col = texture2D( texture, vec2(j, i) / dimension);
|
||||
if(col.r > 0.) {
|
||||
if(col.a > 0.) {
|
||||
gl_FragColor = vec4(i);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue