0.10.2 update

This commit is contained in:
MakhamDev 2022-11-14 09:16:15 +07:00
parent ac92032cb1
commit dfa0d82620
83 changed files with 875 additions and 392 deletions

View file

@ -142,6 +142,7 @@
{"id":{"name":"node_color_from_rgb","path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},"order":5,}, {"id":{"name":"node_color_from_rgb","path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},"order":5,},
{"id":{"name":"node_transform","path":"scripts/node_transform/node_transform.yy",},"order":0,}, {"id":{"name":"node_transform","path":"scripts/node_transform/node_transform.yy",},"order":0,},
{"id":{"name":"curveBox","path":"scripts/curveBox/curveBox.yy",},"order":8,}, {"id":{"name":"curveBox","path":"scripts/curveBox/curveBox.yy",},"order":8,},
{"id":{"name":"sh_gradient_display","path":"shaders/sh_gradient_display/sh_gradient_display.yy",},"order":40,},
{"id":{"name":"s_node_chromatic_abarration","path":"sprites/s_node_chromatic_abarration/s_node_chromatic_abarration.yy",},"order":1,}, {"id":{"name":"s_node_chromatic_abarration","path":"sprites/s_node_chromatic_abarration/s_node_chromatic_abarration.yy",},"order":1,},
{"id":{"name":"node_blur_directional","path":"scripts/node_blur_directional/node_blur_directional.yy",},"order":26,}, {"id":{"name":"node_blur_directional","path":"scripts/node_blur_directional/node_blur_directional.yy",},"order":26,},
{"id":{"name":"s_hamburger","path":"sprites/s_hamburger/s_hamburger.yy",},"order":13,}, {"id":{"name":"s_hamburger","path":"sprites/s_hamburger/s_hamburger.yy",},"order":13,},
@ -178,6 +179,7 @@
{"id":{"name":"sh_twirl","path":"shaders/sh_twirl/sh_twirl.yy",},"order":19,}, {"id":{"name":"sh_twirl","path":"shaders/sh_twirl/sh_twirl.yy",},"order":19,},
{"id":{"name":"s_node_shape","path":"sprites/s_node_shape/s_node_shape.yy",},"order":40,}, {"id":{"name":"s_node_shape","path":"sprites/s_node_shape/s_node_shape.yy",},"order":40,},
{"id":{"name":"s_checkbox","path":"sprites/s_checkbox/s_checkbox.yy",},"order":11,}, {"id":{"name":"s_checkbox","path":"sprites/s_checkbox/s_checkbox.yy",},"order":11,},
{"id":{"name":"string_formatting","path":"scripts/string_formatting/string_formatting.yy",},"order":7,},
{"id":{"name":"s_button_lime","path":"sprites/s_button_lime/s_button_lime.yy",},"order":1,}, {"id":{"name":"s_button_lime","path":"sprites/s_button_lime/s_button_lime.yy",},"order":1,},
{"id":{"name":"node_level_selector","path":"scripts/node_level_selector/node_level_selector.yy",},"order":39,}, {"id":{"name":"node_level_selector","path":"scripts/node_level_selector/node_level_selector.yy",},"order":39,},
{"id":{"name":"node_posterize","path":"scripts/node_posterize/node_posterize.yy",},"order":10,}, {"id":{"name":"node_posterize","path":"scripts/node_posterize/node_posterize.yy",},"order":10,},
@ -413,6 +415,7 @@
{"id":{"name":"s_textbox","path":"sprites/s_textbox/s_textbox.yy",},"order":3,}, {"id":{"name":"s_textbox","path":"sprites/s_textbox/s_textbox.yy",},"order":3,},
{"id":{"name":"ase_reader","path":"scripts/ase_reader/ase_reader.yy",},"order":1,}, {"id":{"name":"ase_reader","path":"scripts/ase_reader/ase_reader.yy",},"order":1,},
{"id":{"name":"node_path","path":"scripts/node_path/node_path.yy",},"order":8,}, {"id":{"name":"node_path","path":"scripts/node_path/node_path.yy",},"order":8,},
{"id":{"name":"node_wrap_area","path":"scripts/node_wrap_area/node_wrap_area.yy",},"order":11,},
{"id":{"name":"sh_seperate_shape_sep","path":"shaders/sh_seperate_shape_sep/sh_seperate_shape_sep.yy",},"order":3,}, {"id":{"name":"sh_seperate_shape_sep","path":"shaders/sh_seperate_shape_sep/sh_seperate_shape_sep.yy",},"order":3,},
{"id":{"name":"s_node_image_sequence","path":"sprites/s_node_image_sequence/s_node_image_sequence.yy",},"order":68,}, {"id":{"name":"s_node_image_sequence","path":"sprites/s_node_image_sequence/s_node_image_sequence.yy",},"order":68,},
{"id":{"name":"s_noti_icon_warning","path":"sprites/s_noti_icon_warning/s_noti_icon_warning.yy",},"order":3,}, {"id":{"name":"s_noti_icon_warning","path":"sprites/s_noti_icon_warning/s_noti_icon_warning.yy",},"order":3,},

View file

@ -3,7 +3,7 @@ event_inherited();
#region data #region data
dialog_w = ui(796); dialog_w = ui(796);
dialog_h = ui(428); dialog_h = ui(468);
name = "Gradient editor"; name = "Gradient editor";
gradient = noone; gradient = noone;
@ -28,6 +28,11 @@ event_inherited();
destroy_on_click_out = true; destroy_on_click_out = true;
sl_position = new slider(0, 100, 0.1, function(val) {
if(key_selecting == noone) return;
setKeyPosition(key_selecting, val / 100);
}, function() { removeKeyOverlap(key_selecting); })
function resetHSV() { function resetHSV() {
hue = color_get_hue(current_color); hue = color_get_hue(current_color);
sat = color_get_saturation(current_color); sat = color_get_saturation(current_color);
@ -49,6 +54,24 @@ event_inherited();
key_selecting = grad[| 0]; key_selecting = grad[| 0];
} }
function setKeyPosition(key, position) {
key.time = position;
ds_list_remove(gradient, key);
gradient_add(gradient, key, false);
}
function removeKeyOverlap(key) {
for(var i = 0; i < ds_list_size(gradient); i++) {
var _key = gradient[| i];
if(_key == key || _key.time != key.time)
continue;
_key.value = key.value;
ds_list_remove(gradient, key);
}
}
dropper_active = false; dropper_active = false;
dropper_color = c_white; dropper_color = c_white;
#endregion #endregion

View file

@ -99,7 +99,7 @@ if !ready exit;
if(buttonInstant(s_button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, "Key blending", s_grad_blend) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, "Key blending", s_grad_blend) == 2) {
if(grad_data != noone) if(grad_data != noone)
grad_data[| 0] = !grad_data[| 0]; grad_data[| 0] = (grad_data[| 0] + 1) % 3;
} }
bx -= ui(32); bx -= ui(32);
#endregion #endregion
@ -110,30 +110,24 @@ if !ready exit;
var hover = noone; var hover = noone;
for(var i = 0; i < ds_list_size(gradient); i++) { for(var i = 0; i < ds_list_size(gradient); i++) {
var _k = gradient[| i]; var _k = gradient[| i];
var _c = _k.value;
var _kx = gr_x + _k.time * gr_w; var _kx = gr_x + _k.time * gr_w;
var _in = _k == key_selecting? 1 : 0; var _in = _k == key_selecting? 1 : 0;
draw_sprite_ui_uniform(s_prop_gradient, _in, _kx, gr_y + gr_h / 2, 1); draw_sprite_ui_uniform(s_prop_gradient, _in, _kx, gr_y + gr_h / 2, 1, _c);
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx - ui(6), gr_y, _kx + ui(6), gr_y + gr_h)) { if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx - ui(6), gr_y, _kx + ui(6), gr_y + gr_h)) {
draw_sprite_ui_uniform(s_prop_gradient, _in, _kx, gr_y + gr_h / 2, 1.2); draw_sprite_ui_uniform(s_prop_gradient, _in, _kx, gr_y + gr_h / 2, 1.2, _c);
hover = _k; hover = _k;
} }
} }
if(key_dragging) { if(key_dragging) {
var tt = clamp((mouse_mx - gr_x) / gr_w, 0, 1); var tt = clamp((mouse_mx - gr_x) / gr_w, 0, 1);
key_dragging.time = tt; setKeyPosition(key_dragging, tt);
var _index = ds_list_find_index(gradient, key_dragging);
ds_list_delete(gradient, _index);
gradient_add(gradient, key_dragging, false);
if(mouse_check_button_released(mb_left)) { if(mouse_check_button_released(mb_left)) {
var _index = ds_list_find_index(gradient, key_dragging); removeKeyOverlap(key_dragging);
ds_list_delete(gradient, _index);
gradient_add(gradient, key_dragging, true);
key_dragging = noone; key_dragging = noone;
} }
} }
@ -171,11 +165,22 @@ if !ready exit;
} }
} }
} }
var op_x = content_x + ui(20);
var op_y = gr_y + gr_h + ui(12);
draw_set_text(f_p0, fa_left, fa_center, c_ui_blue_white);
draw_text(op_x, op_y + TEXTBOX_HEIGHT / 2, "Position")
var txt = key_selecting? key_selecting.time * 100 : "-";
sl_position.active = sFOCUS;
sl_position.hover = sHOVER;
sl_position.draw(op_x + ui(100), op_y, ui(content_w - 140), TEXTBOX_HEIGHT, txt, mouse_ui);
#endregion #endregion
#region color surface #region color surface
var col_x = content_x + ui(20); var col_x = content_x + ui(20);
var col_y = dialog_y + ui(96); var col_y = dialog_y + ui(136);
draw_sprite_stretched(s_ui_panel_bg, 0, col_x - ui(8), col_y - ui(8), ui(256 + 16), ui(256 + 16)); draw_sprite_stretched(s_ui_panel_bg, 0, col_x - ui(8), col_y - ui(8), ui(256 + 16), ui(256 + 16));

View file

@ -70,7 +70,7 @@
if(array_length(menu[i]) > 2) { if(array_length(menu[i]) > 2) {
if(menu[i][2] == ">") { if(menu[i][2] == ">") {
draw_sprite_ui_uniform(s_arrow_16, 0, dialog_x + dialog_w - ui(20), yy + hght / 2, 1, c_ui_blue_dkgrey); draw_sprite_ui_uniform(s_arrow_16, 0, dialog_x + dialog_w - ui(20), yy + hght / 2, 1, c_ui_blue_grey);
} else if(is_array(menu[i][2])) { } else if(is_array(menu[i][2])) {
var _key = find_hotkey(menu[i][2][0], menu[i][2][1]); var _key = find_hotkey(menu[i][2][0], menu[i][2][1]);
if(_key) { if(_key) {

View file

@ -2,7 +2,7 @@
event_inherited(); event_inherited();
#region data #region data
dialog_w = ui(600); dialog_w = ui(720);
dialog_h = ui(360); dialog_h = ui(360);
dialog_resizable = true; dialog_resizable = true;
@ -20,10 +20,12 @@ event_inherited();
var hh = 32; var hh = 32;
var yy = _y; var yy = _y;
var txw = sp_noti.w - ui(48 + 16 + 20); var txw = sp_noti.w - ui(48 + 48 + 20);
var amo = ds_list_size(STATUSES);
for( var i = 0; i < ds_list_size(STATUSES); i++ ) { for( var i = 0; i < ds_list_size(STATUSES); i++ ) {
var noti = STATUSES[| i]; var index = amo - 1 - i;
var noti = STATUSES[| index];
if(noti.type & filter == 0) continue; if(noti.type & filter == 0) continue;
var _w = sp_noti.w - ui(12); var _w = sp_noti.w - ui(12);
@ -32,10 +34,10 @@ event_inherited();
draw_sprite_stretched_ext(s_node_name, 0, 0, yy + ui(2), _w, _h - ui(4), c_ui_blue_grey, 1); draw_sprite_stretched_ext(s_node_name, 0, 0, yy + ui(2), _w, _h - ui(4), c_ui_blue_grey, 1);
if(noti.life_max > 0) { if(noti.life_max > 0) {
var _nwx = sp_noti.w - ui(12) - ui(44); var _nwx = sp_noti.w - ui(12) - ui(40);
var _nw = _nwx * noti.life / noti.life_max; var _nw = _nwx * noti.life / noti.life_max;
draw_sprite_stretched_ext(s_node_name, 0, ui(44), yy + ui(2), _nw, _h - ui(4), c_ui_blue_ltgrey, 0.5); draw_sprite_stretched_ext(s_node_name, 0, ui(40), yy + ui(2), _nw, _h - ui(4), c_ui_blue_white, 1);
} }
draw_sprite_stretched_ext(s_node_name, 0, 0, yy + ui(2), ui(48), _h - ui(4), noti.color, 1); draw_sprite_stretched_ext(s_node_name, 0, 0, yy + ui(2), ui(48), _h - ui(4), noti.color, 1);
@ -43,8 +45,11 @@ event_inherited();
if(noti.icon) if(noti.icon)
draw_sprite_ui(noti.icon, 1, ui(24), yy + _h / 2); draw_sprite_ui(noti.icon, 1, ui(24), yy + _h / 2);
draw_set_text(f_p1, fa_left, fa_center, c_ui_blue_white); draw_set_text(f_p3, fa_right, fa_center, c_ui_blue_grey);
draw_text_ext(ui(48 + 16), yy + _h / 2, noti.txt, -1, txw); draw_text_ext(ui(48 + 48 - 8), yy + _h / 2, noti.time, -1, txw);
draw_set_text(f_p2, fa_left, fa_center, c_ui_blue_white);
draw_text_ext(ui(48 + 48), yy + _h / 2, noti.txt, -1, txw);
if(noti.onClick != noone && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) { if(noti.onClick != noone && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) {
draw_sprite_stretched_ext(s_node_active, 0, 0, yy + ui(2), _w, _h - ui(4), c_white, 1); draw_sprite_stretched_ext(s_node_active, 0, 0, yy + ui(2), _w, _h - ui(4), c_white, 1);

View file

@ -105,6 +105,15 @@ event_inherited();
}) })
]); ]);
ds_list_add(pref_global, [
"Expand hovering panel",
"expand_hover",
new checkBox(function() {
PREF_MAP[? "expand_hover"] = !PREF_MAP[? "expand_hover"];
PREF_SAVE();
})
]);
//NODE //NODE
ds_list_add(pref_node, "Particle"); ds_list_add(pref_node, "Particle");

View file

@ -44,6 +44,8 @@
addHotkey("", "Undo", "Z", MOD_KEY.ctrl, function() { UNDO(); }); addHotkey("", "Undo", "Z", MOD_KEY.ctrl, function() { UNDO(); });
addHotkey("", "Redo", "Z", MOD_KEY.ctrl | MOD_KEY.shift, function() { REDO(); }); addHotkey("", "Redo", "Z", MOD_KEY.ctrl | MOD_KEY.shift, function() { REDO(); });
addHotkey("", "Full panel", vk_tab, MOD_KEY.none, set_focus_fullscreen);
addHotkey("", "Render all", vk_f5, MOD_KEY.none, function() { addHotkey("", "Render all", vk_f5, MOD_KEY.none, function() {
UPDATE |= RENDER_TYPE.full; UPDATE |= RENDER_TYPE.full;
}); });

View file

@ -1,7 +1,7 @@
/// @description init /// @description init
#region panels #region panels
if(PANEL_MAIN != 0) if(PANEL_MAIN != 0) {
PANEL_MAIN.draw(); PANEL_MAIN.draw();
else } else
setPanel(); setPanel();
#endregion #endregion

View file

@ -95,7 +95,6 @@
file_dnd_set_enabled(true); file_dnd_set_enabled(true);
if(file_dnd_filelist != "" && file_dnd_filelist != 0) { if(file_dnd_filelist != "" && file_dnd_filelist != 0) {
show_debug_message(file_dnd_filelist);
file_dropping = file_dnd_filelist; file_dropping = file_dnd_filelist;
if(string_pos("\n", file_dropping) == 1) if(string_pos("\n", file_dropping) == 1)
file_dropping = string_replace(file_dropping, "\n", ""); file_dropping = string_replace(file_dropping, "\n", "");

View file

@ -36,7 +36,7 @@
renderAll(); renderAll();
UPDATE = RENDER_TYPE.none; UPDATE = RENDER_TYPE.none;
} else if(UPDATE & RENDER_TYPE.partial) { } else if(UPDATE & RENDER_TYPE.partial) {
show_debug_message("Update partial stack size = " + string(ds_stack_size(RENDER_STACK))); noti_warning("Update partial stack size to " + string(ds_stack_size(RENDER_STACK)));
renderUpdated(); renderUpdated();
UPDATE = RENDER_TYPE.none; UPDATE = RENDER_TYPE.none;
} }

View file

@ -15,12 +15,10 @@ function APPEND(_path) {
if(_v != SAVEFILE_VERSION) { if(_v != SAVEFILE_VERSION) {
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION); var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn) log_warning("FILE", warn)
noti_warning(warn);
} }
} else { } else {
var warn = "File version mismatch : loading old format to Pixel Composer " + string(SAVEFILE_VERSION); var warn = "File version mismatch : loading old format to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn) log_warning("FILE", warn)
noti_warning(warn);
} }
var _node_list = _map[? "nodes"]; var _node_list = _map[? "nodes"];
@ -45,7 +43,6 @@ function APPEND(_path) {
ds_list_add(node_create, _node); ds_list_add(node_create, _node);
} }
} catch(e) { } catch(e) {
noti_warning("Node load error : " + e.message);
log_warning("APPEND, node", e.longMessage); log_warning("APPEND, node", e.longMessage);
} }
@ -53,7 +50,6 @@ function APPEND(_path) {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
appended_list[| i].postDeserialize(); appended_list[| i].postDeserialize();
} catch(e) { } catch(e) {
noti_warning("Deserialize error : " + e.message);
log_warning("APPEND, deserialize", e.longMessage); log_warning("APPEND, deserialize", e.longMessage);
} }
@ -65,7 +61,6 @@ function APPEND(_path) {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
appended_list[| i].postConnect(); appended_list[| i].postConnect();
} catch(e) { } catch(e) {
noti_warning("Connect error : " + e.message);
log_warning("APPEND, connect", e.longMessage); log_warning("APPEND, connect", e.longMessage);
} }
@ -73,7 +68,6 @@ function APPEND(_path) {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
appended_list[| i].doUpdate(); appended_list[| i].doUpdate();
} catch(e) { } catch(e) {
noti_warning("Update error : " + e.message);
log_warning("APPEND, update", e.longMessage); log_warning("APPEND, update", e.longMessage);
} }
@ -98,18 +92,16 @@ function APPEND(_path) {
} }
if(!ds_queue_empty(CONNECTION_CONFLICT)) if(!ds_queue_empty(CONNECTION_CONFLICT))
noti_warning("Some connection(s) is unsolved. This may caused by render node not being update properly, or image path is broken."); log_warning("APPEND", "Some connection(s) is unsolved. This may caused by render node not being update properly, or image path is broken.");
} catch(e) { } catch(e) {
noti_warning("Conflict solver error : " + e.message); log_warning("APPEND, Conflict solver error : ", e.longMessage);
log_warning("APPEND, solver", e.longMessage);
} }
} }
APPENDING = false; APPENDING = false;
PANEL_ANIMATION.updatePropertyList(); PANEL_ANIMATION.updatePropertyList();
log_message("FILE", "append file " + _path); log_message("FILE", "append file " + _path, s_noti_icon_file_load);
noti_status("Collection loaded", s_noti_icon_file_load);
ds_map_destroy(_map); ds_map_destroy(_map);
return node_create; return node_create;

View file

@ -14,16 +14,22 @@ function __log(title, str, fname = "log.txt") {
show_debug_message(str); show_debug_message(str);
} }
function log_message(title, str) { function log_message(title, str, icon = s_noti_icon_log) {
__log("[MESSAGE] ", string(title) + " : " + string(str)); __log("[MESSAGE] ", string(title) + ": " + string(str));
noti_status(string(title) + ": " + string(str), icon);
} }
function log_warning(title, str) { function log_warning(title, str) {
__log("[WARNING] ", string(title) + " : " + string(str)); __log("[WARNING] ", string(title) + ": " + string(str));
noti_warning(string(title) + ": " + string(str));
} }
function log_crash(str) { function log_crash(str) {
__log("[ERROR] ", string(str)); __log("[ERROR] ", string(str));
noti_error(string(str));
} }
function log_newline() { function log_newline() {

View file

@ -1,32 +1,41 @@
enum GRADIENT_INTER { enum GRADIENT_INTER {
smooth, smooth,
none none,
hue
} }
function draw_gradient(_x, _y, _w, _h, _grad, _int = GRADIENT_INTER.smooth) { function draw_gradient(_x, _y, _w, _h, _grad, _int = GRADIENT_INTER.smooth) {
static RES = 48; static RES = 48;
var _step = _w / RES; var _step = _w / RES;
var _ox, _oc; var _ox, _oc;
for(var i = 0; i <= RES; i++) { var uniform_grad_blend = shader_get_uniform(sh_gradient_display, "gradient_blend");
var _nx = _x + _step * i; var uniform_grad = shader_get_uniform(sh_gradient_display, "gradient_color");
var _nc = gradient_eval(_grad, i / RES, _int); var uniform_grad_time = shader_get_uniform(sh_gradient_display, "gradient_time");
var uniform_grad_key = shader_get_uniform(sh_gradient_display, "gradient_keys");
var _grad_color = [];
var _grad_time = [];
if(i) { for(var i = 0; i < ds_list_size(_grad); i++) {
switch(_int) { _grad_color[i * 4 + 0] = color_get_red(_grad[| i].value) / 255;
case GRADIENT_INTER.smooth : _grad_color[i * 4 + 1] = color_get_green(_grad[| i].value) / 255;
draw_rectangle_color(_ox, _y, _nx, _y + _h, _oc, _nc, _nc, _oc, false); _grad_color[i * 4 + 2] = color_get_blue(_grad[| i].value) / 255;
break; _grad_color[i * 4 + 3] = 1;
case GRADIENT_INTER.none : _grad_time[i] = _grad[| i].time;
draw_set_color(_nc); }
draw_rectangle(_ox, _y, _nx, _y + _h, false);
break; if(ds_list_empty(_grad)) {
} draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
} } else {
shader_set(sh_gradient_display);
_ox = _nx; shader_set_uniform_i(uniform_grad_blend, _int);
_oc = _nc; shader_set_uniform_f_array(uniform_grad, _grad_color);
shader_set_uniform_f_array(uniform_grad_time, _grad_time);
shader_set_uniform_i(uniform_grad_key, ds_list_size(_grad));
draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _w, _h)
shader_reset();
} }
} }

View file

@ -1,12 +1,11 @@
{ {
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "gradients_function",
"isDnD": false, "isDnD": false,
"isCompatibility": false, "isCompatibility": false,
"parent": { "parent": {
"name": "value", "name": "value",
"path": "folders/functions/value.yy", "path": "folders/functions/value.yy",
}, },
"resourceVersion": "1.0",
"name": "gradients_function",
"tags": [],
"resourceType": "GMScript",
} }

View file

@ -17,12 +17,12 @@ function LOAD() {
function LOAD_PATH(path, readonly = false) { function LOAD_PATH(path, readonly = false) {
if(!file_exists(path)) { if(!file_exists(path)) {
noti_warning("File not found"); log_warning("LOAD", "File not found");
return false; return false;
} }
if(filename_ext(path) != ".json" && filename_ext(path) != ".pxc") { if(filename_ext(path) != ".json" && filename_ext(path) != ".pxc") {
noti_warning("File not a valid project"); log_warning("LOAD", "File not a valid project");
return false; return false;
} }
@ -47,13 +47,11 @@ function LOAD_PATH(path, readonly = false) {
var _v = _map[? "version"]; var _v = _map[? "version"];
if(_v != SAVEFILE_VERSION) { if(_v != SAVEFILE_VERSION) {
var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION); var warn = "File version mismatch : loading file verion " + string(_v) + " to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn) log_warning("LOAD", warn);
noti_warning(warn);
} }
} else { } else {
var warn = "File version mismatch : loading old format to Pixel Composer " + string(SAVEFILE_VERSION); var warn = "File version mismatch : loading old format to Pixel Composer " + string(SAVEFILE_VERSION);
log_warning("FILE", warn) log_warning("LOAD", warn);
noti_warning(warn);
} }
nodeCleanUp(); nodeCleanUp();
@ -67,8 +65,7 @@ function LOAD_PATH(path, readonly = false) {
if(_node) ds_list_add(create_list, _node); if(_node) ds_list_add(create_list, _node);
} }
} catch(e) { } catch(e) {
noti_warning("Node load error : " + e.message); log_warning("LOAD", e.longMessage);
log_warning("LOAD, node", e.longMessage);
} }
} }
@ -79,7 +76,6 @@ function LOAD_PATH(path, readonly = false) {
ANIMATOR.framerate = ds_map_try_get(_anim_map, "framerate"); ANIMATOR.framerate = ds_map_try_get(_anim_map, "framerate");
} }
} catch(e) { } catch(e) {
noti_warning("Animator load error : " + e.message);
log_warning("LOAD, animator", e.longMessage); log_warning("LOAD, animator", e.longMessage);
} }
@ -89,7 +85,6 @@ function LOAD_PATH(path, readonly = false) {
for(var i = 0; i < ds_list_size(create_list); i++) for(var i = 0; i < ds_list_size(create_list); i++)
create_list[| i].loadGroup(); create_list[| i].loadGroup();
} catch(e) { } catch(e) {
noti_warning("Group load error : " + e.message);
log_warning("LOAD, group", e.longMessage); log_warning("LOAD, group", e.longMessage);
} }
@ -97,7 +92,6 @@ function LOAD_PATH(path, readonly = false) {
for(var i = 0; i < ds_list_size(create_list); i++) for(var i = 0; i < ds_list_size(create_list); i++)
create_list[| i].postDeserialize(); create_list[| i].postDeserialize();
} catch(e) { } catch(e) {
noti_warning("Deserialize error : " + e.message);
log_warning("LOAD, deserialize", e.longMessage); log_warning("LOAD, deserialize", e.longMessage);
} }
@ -109,7 +103,6 @@ function LOAD_PATH(path, readonly = false) {
for(var i = 0; i < ds_list_size(create_list); i++) for(var i = 0; i < ds_list_size(create_list); i++)
create_list[| i].postConnect(); create_list[| i].postConnect();
} catch(e) { } catch(e) {
noti_warning("Connect error : " + e.message);
log_warning("LOAD, connect", e.longMessage); log_warning("LOAD, connect", e.longMessage);
} }
@ -117,7 +110,6 @@ function LOAD_PATH(path, readonly = false) {
for(var i = 0; i < ds_list_size(create_list); i++) for(var i = 0; i < ds_list_size(create_list); i++)
create_list[| i].doUpdate(); create_list[| i].doUpdate();
} catch(e) { } catch(e) {
noti_warning("Update error : " + e.message);
log_warning("LOAD, update", e.longMessage); log_warning("LOAD, update", e.longMessage);
} }
@ -137,9 +129,8 @@ function LOAD_PATH(path, readonly = false) {
} }
if(!ds_queue_empty(CONNECTION_CONFLICT)) if(!ds_queue_empty(CONNECTION_CONFLICT))
noti_warning("Some connection(s) is unsolved. This may caused by render node not being update properly, or image path is broken."); log_warning("LOAD", "Some connection(s) is unsolved. This may caused by render node not being update properly, or image path is broken.");
} catch(e) { } catch(e) {
noti_warning("Conflict solver error : " + e.message);
log_warning("LOAD, connect solver", e.longMessage); log_warning("LOAD, connect solver", e.longMessage);
} }
} }
@ -150,8 +141,7 @@ function LOAD_PATH(path, readonly = false) {
PANEL_GRAPH.fullView(); PANEL_GRAPH.fullView();
PANEL_ANIMATION.updatePropertyList(); PANEL_ANIMATION.updatePropertyList();
log_message("FILE", "load at " + path); log_message("FILE", "load " + path, s_noti_icon_file_load);
noti_status("File loaded", s_noti_icon_file_load);
ds_map_destroy(_map); ds_map_destroy(_map);
return true; return true;

View file

@ -70,7 +70,7 @@ function Node_Collection(_x, _y) : Node(_x, _y) constructor {
render_time += nodes[| i].render_time; render_time += nodes[| i].render_time;
} }
if(PANEL_GRAPH.node_focus == self && FOCUS == PANEL_GRAPH.panel && DOUBLE_CLICK) { if(PANEL_GRAPH.node_focus == self && panelFocus(PANEL_GRAPH) && DOUBLE_CLICK) {
PANEL_GRAPH.addContext(self); PANEL_GRAPH.addContext(self);
DOUBLE_CLICK = false; DOUBLE_CLICK = false;
} }

View file

@ -11,6 +11,7 @@ function Node_Color_Data(_x, _y) : Node_Value_Processor(_x, _y) constructor {
w = 96; w = 96;
inputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); inputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
inputs[| 0].setVisible(true, true);
outputs[| 0] = nodeValue(0, "Red", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0); outputs[| 0] = nodeValue(0, "Red", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 1] = nodeValue(1, "Green", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0); outputs[| 1] = nodeValue(1, "Green", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);

View file

@ -1,12 +1,11 @@
{ {
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_color_data",
"isDnD": false, "isDnD": false,
"isCompatibility": false, "isCompatibility": false,
"parent": { "parent": {
"name": "color", "name": "color",
"path": "folders/nodes/data/color.yy", "path": "folders/nodes/data/color.yy",
}, },
"resourceVersion": "1.0",
"name": "node_color_data",
"tags": [],
"resourceType": "GMScript",
} }

View file

@ -675,7 +675,6 @@ function Node(_x, _y) constructor {
NODE_MAP[? _group].add(self); NODE_MAP[? _group].add(self);
} else { } else {
var txt = "Group load failed. Can't find node ID " + string(_group); var txt = "Group load failed. Can't find node ID " + string(_group);
noti_warning(txt);
log_warning("LOAD", txt); log_warning("LOAD", txt);
} }
} }

View file

@ -66,11 +66,17 @@ function Node_Image_Sheet(_x, _y) : Node(_x, _y) constructor {
doUpdate(); doUpdate();
}, "Generate"] ); }, "Generate"] );
inputs[| 11] = nodeValue(11, "Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.button, [ function() {
var _amo = inputs[| 2].getValue();
ANIMATOR.frames_total = max(1, _amo - 1);
}, "Sync frames"] );
input_display_list = [ input_display_list = [
["Sprite", false], 0, 1, 6, 10, ["Sprite", false], 0, 1, 6, 10,
["Sheet", false], 2, 3, 9, 4, 5, ["Sheet", false], 2, 3, 9, 4, 5,
["Output", false], 7, 8 ["Output", false], 7, 8, 11
]; ];
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE); outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);

View file

@ -156,6 +156,7 @@ function valueAnimator(_val, _prop) constructor {
if(!ds_list_exist(values, _key)) return 0; if(!ds_list_exist(values, _key)) return 0;
MODIFIED = true; MODIFIED = true;
_time = clamp(_time, 0, ANIMATOR.frames_total);
_key.time = _time; _key.time = _time;
ds_list_remove(values, _key); ds_list_remove(values, _key);

View file

@ -81,6 +81,7 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
addNodeObject(transform, "Polar", s_node_polar, "Node_Polar", Node_create_Polar); addNodeObject(transform, "Polar", s_node_polar, "Node_Polar", Node_create_Polar);
addNodeObject(transform, "Nine slice", s_node_9patch, "Node_9Slice", Node_create_9Slice, ["9", "splice"]); addNodeObject(transform, "Nine slice", s_node_9patch, "Node_9Slice", Node_create_9Slice, ["9", "splice"]);
addNodeObject(transform, "Padding", s_node_padding, "Node_Padding", Node_create_Padding); addNodeObject(transform, "Padding", s_node_padding, "Node_Padding", Node_create_Padding);
addNodeObject(transform, "Area wrap", s_node_padding, "Node_Wrap_Area", Node_create_Wrap_Area);
var filter = ds_list_create(); var filter = ds_list_create();
addNodeCatagory("Filter", filter); addNodeCatagory("Filter", filter);
@ -214,7 +215,7 @@ function NodeObject(_name, _spr, _create, tags = []) constructor {
var _type = ds_map_try_get(_data, "type", 0); var _type = ds_map_try_get(_data, "type", 0);
if(!ds_map_exists(NODE_CREATE_FUCTION, _type)) { if(!ds_map_exists(NODE_CREATE_FUCTION, _type)) {
show_debug_message("Append ERROR : no type " + _type) noti_error("LOAD: node creation function [" + _type + "] not found.")
return noone; return noone;
} }

View file

@ -549,37 +549,36 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
static setFrom = function(_valueFrom, _update = true, checkRecur = true) { static setFrom = function(_valueFrom, _update = true, checkRecur = true) {
if(_valueFrom == -1 || _valueFrom == undefined) { if(_valueFrom == -1 || _valueFrom == undefined) {
show_debug_message("LOAD : Value from error " + string(_valueFrom)) noti_warning("LOAD: Cannot set node connection from " + string(_valueFrom) + " to " + string(name) + " of node " + string(node.name) + ".");
return false; return false;
} }
if(_valueFrom == value_from) { if(_valueFrom == value_from) {
show_debug_message("setFrom : Repeated connection");
return false; return false;
} }
if(_valueFrom == self) { if(_valueFrom == self) {
show_debug_message("setFrom : Connect to self"); noti_warning("setFrom: Self connection is not allowed.");
return false; return false;
} }
if(value_bit(type) & value_bit(_valueFrom.type) == 0 && !value_type_directional(_valueFrom, self)) { if(value_bit(type) & value_bit(_valueFrom.type) == 0 && !value_type_directional(_valueFrom, self)) {
show_debug_message("setFrom : Type mismatch"); noti_warning("setFrom: Type mismatch");
return false; return false;
} }
if(connect_type == _valueFrom.connect_type) { if(connect_type == _valueFrom.connect_type) {
show_debug_message("setFrom : Connect type mismatch"); noti_warning("setFrom: Connect type mismatch");
return false; return false;
} }
if(checkRecur && _valueFrom.searchNodeBackward(node)) { if(checkRecur && _valueFrom.searchNodeBackward(node)) {
show_debug_message("setFrom : Recursive"); noti_warning("setFrom: Cycle connection");
return false; return false;
} }
if(!accept_array && _valueFrom.isArray()) { if(!accept_array && _valueFrom.isArray()) {
show_debug_message("setFrom : Array mismatch"); noti_warning("setFrom: Array mismatch");
return false; return false;
} }

View file

@ -50,8 +50,7 @@ function Node_Vector2(_x, _y) : Node_Value_Processor(_x, _y) constructor {
inputs[| 1] = nodeValue(1, "y", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) inputs[| 1] = nodeValue(1, "y", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setVisible(true, true); .setVisible(true, true);
outputs[| 0] = nodeValue(0, "Vector", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [ 0, 0 ]) outputs[| 0] = nodeValue(0, "Vector", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [ 0, 0 ]);
.setDisplay(VALUE_DISPLAY.area);
function process_value_data(_data, index = 0) { function process_value_data(_data, index = 0) {
var vec = [ _data[0], _data[1] ]; var vec = [ _data[0], _data[1] ];

View file

@ -1,12 +1,11 @@
{ {
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_vector",
"isDnD": false, "isDnD": false,
"isCompatibility": false, "isCompatibility": false,
"parent": { "parent": {
"name": "number", "name": "number",
"path": "folders/nodes/data/number.yy", "path": "folders/nodes/data/number.yy",
}, },
"resourceVersion": "1.0",
"name": "node_vector",
"tags": [],
"resourceType": "GMScript",
} }

View file

@ -30,7 +30,7 @@ function Node_Wiggler(_x, _y) : Node_Value_Processor(_x, _y) constructor {
["Wiggle", false], 2, 0, 1, ["Wiggle", false], 2, 0, 1,
]; ];
graph_value = array_create(64, 0); random_value = array_create(64, 0);
static onValueUpdate = function(index) { static onValueUpdate = function(index) {
var ran = inputs[| 0].getValue(); var ran = inputs[| 0].getValue();
@ -41,28 +41,30 @@ function Node_Wiggler(_x, _y) : Node_Value_Processor(_x, _y) constructor {
var _fmax = ANIMATOR.frames_total / max(1, max(fre[0], fre[1])); var _fmax = ANIMATOR.frames_total / max(1, max(fre[0], fre[1]));
var _val; var _val;
for( var i = 0; i < 64; i++ ) { for( var i = 0; i < ANIMATOR.frames_total + 1; i++ ) {
_val = getWiggle(ran[0], ran[1], _fmin, _fmax, i, sed); _val = getWiggle(ran[0], ran[1], _fmin, _fmax, i, sed);
graph_value[i] = _val; random_value[i] = _val;
} }
} }
function process_value_data(_data, index = 0) { function process_value_data(_data, index = 0) {
if(array_length(graph_value) != ANIMATOR.frames_total) if(array_length(random_value) != ANIMATOR.frames_total + 1) {
array_resize(graph_value, ANIMATOR.frames_total); array_resize(random_value, ANIMATOR.frames_total + 1);
onValueUpdate(0);
var time = ANIMATOR.current_frame; }
var _ran = _data[0];
var _fmin = ANIMATOR.frames_total / max(1, min(_data[1][0], _data[1][1]));
var _fmax = ANIMATOR.frames_total / max(1, max(_data[1][0], _data[1][1]));
var _val = getWiggle(_ran[0], _ran[1], _fmin, _fmax, time, _data[3]); var time = ANIMATOR.current_frame;
return _val; return random_value[time];
} }
doUpdate(); doUpdate();
static onDrawNode = function(xx, yy, _mx, _my, _s) { static onDrawNode = function(xx, yy, _mx, _my, _s) {
if(array_length(random_value) != ANIMATOR.frames_total + 1) {
array_resize(random_value, ANIMATOR.frames_total + 1);
onValueUpdate(0);
}
var disp = inputs[| 3].getValue(); var disp = inputs[| 3].getValue();
var time = ANIMATOR.current_frame; var time = ANIMATOR.current_frame;
var total_time = ANIMATOR.frames_total; var total_time = ANIMATOR.frames_total;
@ -71,7 +73,7 @@ function Node_Wiggler(_x, _y) : Node_Value_Processor(_x, _y) constructor {
case 0 : case 0 :
min_h = 0; min_h = 0;
draw_set_text(f_h5, fa_center, fa_center, c_white); draw_set_text(f_h5, fa_center, fa_center, c_white);
var str = string(outputs[| 0].getValue()); var str = string(random_value[time]);
var ss = string_scale(str, (w - 16) * _s, (h - 16) * _s - 20); var ss = string_scale(str, (w - 16) * _s, (h - 16) * _s - 20);
draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, ss, ss, 0); draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, ss, ss, 0);
break; break;
@ -103,12 +105,12 @@ function Node_Wiggler(_x, _y) : Node_Value_Processor(_x, _y) constructor {
var _fx = x0 + (time / total_time * ww); var _fx = x0 + (time / total_time * ww);
draw_line(_fx, y0, _fx, y1); draw_line(_fx, y0, _fx, y1);
var lw = ww / (array_length(graph_value) - 1); var lw = ww / (array_length(random_value) - 1);
draw_set_color(c_white); draw_set_color(c_white);
var ox, oy; var ox, oy;
for( var i = 0; i < array_length(graph_value); i++ ) { for( var i = 0; i < array_length(random_value); i++ ) {
var _x = x0 + i * lw; var _x = x0 + i * lw;
var _y = yc - (graph_value[i] - val) / (_ran * 2) * hh; var _y = yc - (random_value[i] - val) / (_ran * 2) * hh;
if(i) if(i)
draw_line(ox, oy, _x, _y); draw_line(ox, oy, _x, _y);

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_blur",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_color_adjustment",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_color_replacement",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_glow",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_outline",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,43 @@
function Node_create_Wrap_Area(_x, _y) {
var node = new Node_Wrap_Area(_x, _y);
ds_list_add(PANEL_GRAPH.nodes_list, node);
return node;
}
function Node_Wrap_Area(_x, _y) : Node_Processor(_x, _y) constructor {
name = "Area wrap";
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue(1, "Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16, 4, 4, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area);
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
static drawOverlay = function(_active, _x, _y, _s, _mx, _my) {
inputs[| 1].drawOverlay(_active, _x, _y, _s, _mx, _my);
}
static process_data = function(_outSurf, _data, _output_index) {
var _inSurf = _data[0];
var _area = _data[1];
var cx = _area[0];
var cy = _area[1];
var cw = _area[2];
var ch = _area[3];
var ww = cw / surface_get_width(_inSurf) * 2;
var hh = ch / surface_get_height(_inSurf) * 2;
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ADD
draw_surface_ext_safe(_inSurf, cx - cw, cy - ch, ww, hh, 0, c_white, 1);
BLEND_NORMAL
surface_reset_target();
return _outSurf;
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_wrap_area",
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "transform",
"path": "folders/nodes/data/transform.yy",
},
}

View file

@ -13,7 +13,7 @@
error = 1 << 2, error = 1 << 2,
} }
function notification(type, str, icon = noone, color = c_ui_blue_dkgrey, life = -1) constructor { function notification(type, str, icon = s_noti_icon_log, color = c_ui_blue_dkgrey, life = -1) constructor {
self.type = type; self.type = type;
self.txt = str; self.txt = str;
self.icon = icon; self.icon = icon;
@ -23,9 +23,11 @@
self.life = life; self.life = life;
self.onClick = noone; self.onClick = noone;
self.time = string_lead_zero(current_hour, 2) + ":" + string_lead_zero(current_minute, 2);
} }
function noti_status(str, icon = noone) { function noti_status(str, icon = s_noti_icon_log) {
ds_list_add(STATUSES, new notification(NOTI_TYPE.log, str, icon)); ds_list_add(STATUSES, new notification(NOTI_TYPE.log, str, icon));
} }

View file

@ -5,7 +5,7 @@ enum KEYFRAME_DRAG_TYPE {
ease_both ease_both
} }
function Panel_Animation(_panel) : PanelContent(_panel) constructor { function Panel_Animation() : PanelContent() constructor {
context_str = "Animation"; context_str = "Animation";
timeline_h = ui(28); timeline_h = ui(28);
@ -13,13 +13,18 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
min_h = ui(48); min_h = ui(48);
tool_width = ui(280); tool_width = ui(280);
timeline_surface = surface_create_valid(w - tool_width, timeline_h); function initSize() {
timeline_mask = surface_create_valid(w - tool_width, timeline_h); timeline_w = w - tool_width - ui(12);
timeline_surface = surface_create_valid(timeline_w, timeline_h);
timeline_mask = surface_create_valid(timeline_w, timeline_h);
dope_sheet_w = w - tool_width;
dope_sheet_h = h - timeline_h - ui(20);
dope_sheet_surface = surface_create_valid(dope_sheet_w, 1);
dope_sheet_mask = surface_create_valid(dope_sheet_w, 1);
}
initSize();
dope_sheet_w = w - tool_width - ui(8);
dope_sheet_h = h - timeline_h - ui(20);
dope_sheet_surface = surface_create_valid(dope_sheet_w, 1);
dope_sheet_mask = surface_create_valid(dope_sheet_w, 1);
dope_sheet_y = 0; dope_sheet_y = 0;
dope_sheet_y_to = 0; dope_sheet_y_to = 0;
dope_sheet_y_max = 0; dope_sheet_y_max = 0;
@ -194,17 +199,17 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
function onResize(dw, dh) { function onResize(dw, dh) {
if(w - tool_width > 1) { if(w - tool_width > 1) {
if(is_surface(timeline_mask) && surface_exists(timeline_mask)) if(is_surface(timeline_mask) && surface_exists(timeline_mask))
surface_size_to(timeline_mask, w - tool_width, timeline_h); surface_size_to(timeline_mask, timeline_w, timeline_h);
else else
timeline_mask = surface_create_valid(w - tool_width, timeline_h); timeline_mask = surface_create_valid(timeline_w, timeline_h);
if(is_surface(timeline_surface) && surface_exists(timeline_surface)) if(is_surface(timeline_surface) && surface_exists(timeline_surface))
surface_size_to(timeline_surface, w - tool_width, timeline_h); surface_size_to(timeline_surface, timeline_w, timeline_h);
else else
timeline_surface = surface_create_valid(w - tool_width, timeline_h); timeline_surface = surface_create_valid(timeline_w, timeline_h);
} }
dope_sheet_w = w - tool_width - ui(8); dope_sheet_w = timeline_w;
dope_sheet_h = h - timeline_h - ui(24); dope_sheet_h = h - timeline_h - ui(24);
if(dope_sheet_h > ui(8)) { if(dope_sheet_h > ui(8)) {
if(is_surface(dope_sheet_mask) && surface_exists(dope_sheet_mask)) if(is_surface(dope_sheet_mask) && surface_exists(dope_sheet_mask))
@ -227,12 +232,12 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
function resetTimelineMask() { function resetTimelineMask() {
if(!surface_exists(timeline_mask)) if(!surface_exists(timeline_mask))
timeline_mask = surface_create_valid(w - tool_width, timeline_h); timeline_mask = surface_create_valid(timeline_w, timeline_h);
surface_set_target(timeline_mask); surface_set_target(timeline_mask);
draw_clear(c_black); draw_clear(c_black);
gpu_set_blendmode(bm_subtract); gpu_set_blendmode(bm_subtract);
draw_sprite_stretched(s_ui_panel_bg, 0, 0, 0, w - tool_width, timeline_h); draw_sprite_stretched(s_ui_panel_bg, 0, 0, 0, timeline_w, timeline_h);
gpu_set_blendmode(bm_normal); gpu_set_blendmode(bm_normal);
surface_reset_target(); surface_reset_target();
@ -270,16 +275,16 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
//TODO: Divide this 800+ lines monstrosity into subfunctions //TODO: Divide this 800+ lines monstrosity into subfunctions
function drawAnimationControl() { function drawAnimationControl(panel) {
var bar_x = tool_width - ui(48); var bar_x = tool_width - ui(48);
var bar_y = h - timeline_h - ui(10); var bar_y = h - timeline_h - ui(10);
var bar_w = w - tool_width; var bar_w = timeline_w;
var bar_h = timeline_h; var bar_h = timeline_h;
var bar_total_w = ANIMATOR.frames_total * ui(timeline_scale); var bar_total_w = ANIMATOR.frames_total * ui(timeline_scale);
resetTimelineMask(); resetTimelineMask();
if(!is_surface(timeline_surface) || !surface_exists(timeline_surface)) if(!is_surface(timeline_surface) || !surface_exists(timeline_surface))
timeline_surface = surface_create_valid(w - tool_width, timeline_h); timeline_surface = surface_create_valid(timeline_w, timeline_h);
if(dope_sheet_h > 8) { if(dope_sheet_h > 8) {
if(!is_surface(dope_sheet_surface) || !surface_exists(dope_sheet_surface)) if(!is_surface(dope_sheet_surface) || !surface_exists(dope_sheet_surface))
@ -291,7 +296,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
#region scroll #region scroll
dope_sheet_y = lerp_float(dope_sheet_y, dope_sheet_y_to, 5); dope_sheet_y = lerp_float(dope_sheet_y, dope_sheet_y_to, 5);
if(HOVER == panel && point_in_rectangle(mx, my, ui(8), ui(8), tool_width, ui(8) + dope_sheet_h)) { if(pHOVER && point_in_rectangle(mx, my, ui(8), ui(8), tool_width, ui(8) + dope_sheet_h)) {
if(mouse_wheel_down()) dope_sheet_y_to = clamp(dope_sheet_y_to - ui(32), -dope_sheet_y_max, 0); if(mouse_wheel_down()) dope_sheet_y_to = clamp(dope_sheet_y_to - ui(32), -dope_sheet_y_max, 0);
if(mouse_wheel_up()) dope_sheet_y_to = clamp(dope_sheet_y_to + ui(32), -dope_sheet_y_max, 0); if(mouse_wheel_up()) dope_sheet_y_to = clamp(dope_sheet_y_to + ui(32), -dope_sheet_y_max, 0);
} }
@ -458,10 +463,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
else if(key.ease_in_type == CURVE_TYPE.damping) else if(key.ease_in_type == CURVE_TYPE.damping)
draw_sprite_stretched_ext(s_timeline_elastic, 0, _tx, key_y - 4, t - _tx, 8, c_ui_blue_dkgrey, 1); draw_sprite_stretched_ext(s_timeline_elastic, 0, _tx, key_y - 4, t - _tx, 8, c_ui_blue_dkgrey, 1);
if(HOVER == panel && point_in_circle(msx, msy, _tx, key_y, ui(6))) { if(pHOVER && point_in_circle(msx, msy, _tx, key_y, ui(6))) {
key_hover = key; key_hover = key;
draw_sprite_ui_uniform(s_timeline_keyframe, 2, _tx, key_y, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_timeline_keyframe, 2, _tx, key_y, 1, c_ui_blue_white);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
keyframe_dragging = prop.animator.values[| k]; keyframe_dragging = prop.animator.values[| k];
keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_in; keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_in;
} }
@ -475,10 +480,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
else if(key.ease_out_type == CURVE_TYPE.damping) else if(key.ease_out_type == CURVE_TYPE.damping)
draw_sprite_stretched_ext(s_timeline_elastic, 0, t, key_y - 4, _tx - t, 8, c_ui_blue_dkgrey, 1); draw_sprite_stretched_ext(s_timeline_elastic, 0, t, key_y - 4, _tx - t, 8, c_ui_blue_dkgrey, 1);
if(HOVER == panel && point_in_circle(msx, msy, _tx, key_y, ui(6))) { if(pHOVER && point_in_circle(msx, msy, _tx, key_y, ui(6))) {
key_hover = key; key_hover = key;
draw_sprite_ui_uniform(s_timeline_keyframe, 3, _tx, key_y, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_timeline_keyframe, 3, _tx, key_y, 1, c_ui_blue_white);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
keyframe_dragging = prop.animator.values[| k]; keyframe_dragging = prop.animator.values[| k];
keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_out; keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_out;
} }
@ -619,11 +624,11 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
var cc = c_ui_blue_grey; var cc = c_ui_blue_grey;
if(HOVER == panel && point_in_circle(msx, msy, t, key_y, ui(8))) { if(pHOVER && point_in_circle(msx, msy, t, key_y, ui(8))) {
cc = c_ui_blue_white; cc = c_ui_blue_white;
key_hover = keyframe; key_hover = keyframe;
if(FOCUS == panel) { if(pFOCUS) {
if(DOUBLE_CLICK) { if(DOUBLE_CLICK) {
keyframe_dragging = keyframe; keyframe_dragging = keyframe;
keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_both; keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_both;
@ -635,7 +640,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe))
cc = c_ui_orange; cc = key_hover == keyframe? c_white : c_ui_orange;
draw_sprite_ui_uniform(s_timeline_keyframe, 1, t, key_y, 1, cc); draw_sprite_ui_uniform(s_timeline_keyframe, 1, t, key_y, 1, cc);
if(ds_list_exist(keyframe_selecting, keyframe)) if(ds_list_exist(keyframe_selecting, keyframe))
@ -662,7 +667,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
} }
if(FOCUS == panel && point_in_rectangle(msx, msy, 0, ui(16), dope_sheet_w, dope_sheet_h)) { if(pFOCUS && point_in_rectangle(msx, msy, 0, ui(16), dope_sheet_w, dope_sheet_h)) {
if(mouse_check_button_pressed(mb_left) || mouse_check_button_pressed(mb_right)) { if(mouse_check_button_pressed(mb_left) || mouse_check_button_pressed(mb_right)) {
if(key_hover == noone) { if(key_hover == noone) {
ds_list_clear(keyframe_selecting); ds_list_clear(keyframe_selecting);
@ -700,7 +705,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
} }
if(FOCUS == panel && mouse_check_button_pressed(mb_right)) { if(pFOCUS && mouse_check_button_pressed(mb_right)) {
if(!ds_list_empty(keyframe_selecting)) { if(!ds_list_empty(keyframe_selecting)) {
dialogCall(o_dialog_menubox, mouse_mx + ui(8), mouse_my + ui(8)) dialogCall(o_dialog_menubox, mouse_mx + ui(8), mouse_my + ui(8))
.setMenu(keyframe_menu); .setMenu(keyframe_menu);
@ -801,9 +806,9 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
key_y += ui(6); key_y += ui(6);
draw_set_color(c_ui_blue_ltgrey); draw_set_color(c_ui_blue_ltgrey);
if(HOVER == panel && point_in_rectangle(msx, msy, 0, key_y - ui(10), tool_width - ui(64), key_y + ui(10))) { if(pHOVER && point_in_rectangle(msx, msy, 0, key_y - ui(10), tool_width - ui(64), key_y + ui(10))) {
draw_sprite_stretched_ext(s_ui_panel_bg, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20), c_ui_blue_ltgrey, 1); draw_sprite_stretched_ext(s_ui_panel_bg, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20), c_ui_blue_ltgrey, 1);
if(FOCUS == panel && msx < tool_width - ui(88) && mouse_check_button_pressed(mb_left)) if(pFOCUS && msx < tool_width - ui(88) && mouse_check_button_pressed(mb_left))
prop.node.anim_show = !prop.node.anim_show; prop.node.anim_show = !prop.node.anim_show;
} else } else
draw_sprite_stretched_ext(s_ui_panel_bg, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20), merge_color(c_ui_blue_white, c_ui_blue_ltgrey, 0.5), 1); draw_sprite_stretched_ext(s_ui_panel_bg, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20), merge_color(c_ui_blue_white, c_ui_blue_ltgrey, 0.5), 1);
@ -812,11 +817,11 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
draw_sprite_stretched(s_node_active, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20)); draw_sprite_stretched(s_node_active, 0, 0, key_y - ui(10), tool_width - ui(64), ui(20));
var tx = tool_width - ui(76 + 16 * 0); var tx = tool_width - ui(76 + 16 * 0);
if(HOVER == panel && point_in_circle(msx, msy, tx, key_y - 1, ui(10))) { if(pHOVER && point_in_circle(msx, msy, tx, key_y - 1, ui(10))) {
draw_sprite_ui_uniform(s_animate_node_go, 0, tx, key_y - 1, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_animate_node_go, 0, tx, key_y - 1, 1, c_ui_blue_white);
TOOLTIP = "Go to node"; TOOLTIP = "Go to node";
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
PANEL_INSPECTOR.inspecting = _node; PANEL_INSPECTOR.inspecting = _node;
ds_list_clear(PANEL_GRAPH.nodes_select_list); ds_list_clear(PANEL_GRAPH.nodes_select_list);
PANEL_GRAPH.node_focus = _node; PANEL_GRAPH.node_focus = _node;
@ -834,10 +839,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
var tx = tool_width - ui(72 + 16 * 3); var tx = tool_width - ui(72 + 16 * 3);
var ty = key_y - 1; var ty = key_y - 1;
if(HOVER == panel && point_in_circle(msx, msy, tx, ty, ui(6))) { if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(s_prop_keyframe, 0, tx, ty, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_prop_keyframe, 0, tx, ty, 1, c_ui_blue_white);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
var _t = -1; var _t = -1;
for(var j = 0; j < ds_list_size(prop.animator.values); j++) { for(var j = 0; j < ds_list_size(prop.animator.values); j++) {
var _key = prop.animator.values[| j]; var _key = prop.animator.values[| j];
@ -852,10 +857,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
draw_sprite_ui_uniform(s_prop_keyframe, 0, tx, ty, 1, c_ui_blue_grey); draw_sprite_ui_uniform(s_prop_keyframe, 0, tx, ty, 1, c_ui_blue_grey);
var tx = tool_width - ui(72 + 16 * 1); var tx = tool_width - ui(72 + 16 * 1);
if(HOVER == panel && point_in_circle(msx, msy, tx, ty, ui(6))) { if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(s_prop_keyframe, 2, tx, ty, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_prop_keyframe, 2, tx, ty, 1, c_ui_blue_white);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
for(var j = 0; j < ds_list_size(prop.animator.values); j++) { for(var j = 0; j < ds_list_size(prop.animator.values); j++) {
var _key = prop.animator.values[| j]; var _key = prop.animator.values[| j];
if(_key.time > ANIMATOR.current_frame) { if(_key.time > ANIMATOR.current_frame) {
@ -869,10 +874,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
draw_sprite_ui_uniform(s_prop_keyframe, 2, tx, ty, 1, c_ui_blue_grey); draw_sprite_ui_uniform(s_prop_keyframe, 2, tx, ty, 1, c_ui_blue_grey);
var tx = tool_width - ui(72 + 16 * 2); var tx = tool_width - ui(72 + 16 * 2);
if(HOVER == panel && point_in_circle(msx, msy, tx, ty, ui(6))) { if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(s_prop_keyframe, 1, tx, ty, 1, c_ui_orange_light); draw_sprite_ui_uniform(s_prop_keyframe, 1, tx, ty, 1, c_ui_orange_light);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
var _add = false; var _add = false;
for(var j = 0; j < ds_list_size(prop.animator.values); j++) { for(var j = 0; j < ds_list_size(prop.animator.values); j++) {
var _key = prop.animator.values[| j]; var _key = prop.animator.values[| j];
@ -894,11 +899,11 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
if(isGraphable(prop.type)) { if(isGraphable(prop.type)) {
var tx = tool_width - ui(68 + 16 * 0); var tx = tool_width - ui(68 + 16 * 0);
if(HOVER == panel && point_in_circle(msx, msy, tx, ty, ui(8))) { if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) {
draw_sprite_ui_uniform(s_timeline_graph, 1, tx, ty, 1, prop.animator.show_graph? c_ui_orange_light : c_ui_blue_white); draw_sprite_ui_uniform(s_timeline_graph, 1, tx, ty, 1, prop.animator.show_graph? c_ui_orange_light : c_ui_blue_white);
TOOLTIP = "Show graph"; TOOLTIP = "Show graph";
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
prop.animator.show_graph = !prop.animator.show_graph; prop.animator.show_graph = !prop.animator.show_graph;
} }
} else } else
@ -906,20 +911,20 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
var tx = tool_width - ui(72 + 16 * 4.5); var tx = tool_width - ui(72 + 16 * 4.5);
if(HOVER == panel && point_in_circle(msx, msy, tx, ty, ui(6))) { if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(s_prop_on_end, prop.on_end, tx, ty, 1, c_ui_blue_white, 1); draw_sprite_ui_uniform(s_prop_on_end, prop.on_end, tx, ty, 1, c_ui_blue_white, 1);
TOOLTIP = "Looping mode " + ON_END_NAME[prop.on_end]; TOOLTIP = "Looping mode " + ON_END_NAME[prop.on_end];
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
prop.on_end = safe_mod(prop.on_end + 1, sprite_get_number(s_prop_on_end)); prop.on_end = safe_mod(prop.on_end + 1, sprite_get_number(s_prop_on_end));
} }
} else } else
draw_sprite_ui_uniform(s_prop_on_end, prop.on_end, tx, ty, 1, c_ui_blue_grey); draw_sprite_ui_uniform(s_prop_on_end, prop.on_end, tx, ty, 1, c_ui_blue_grey);
if(HOVER == panel && point_in_circle(msx, msy, ui(22), key_y - 1, ui(10))) { if(pHOVER && point_in_circle(msx, msy, ui(22), key_y - 1, ui(10))) {
draw_sprite_ui_uniform(s_timeline_clock, 1, ui(22), key_y - 1, 1, c_ui_blue_white); draw_sprite_ui_uniform(s_timeline_clock, 1, ui(22), key_y - 1, 1, c_ui_blue_white);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
prop.animator.is_anim = !prop.animator.is_anim; prop.animator.is_anim = !prop.animator.is_anim;
updatePropertyList(); updatePropertyList();
} }
@ -1046,7 +1051,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
timeline_dragging = false; timeline_dragging = false;
} }
if(HOVER == panel) { if(pHOVER) {
if(point_in_rectangle(mx, my, bar_x, 16, bar_x + bar_w, bar_y - 8)) { if(point_in_rectangle(mx, my, bar_x, 16, bar_x + bar_w, bar_y - 8)) {
if(mouse_wheel_down()) { if(mouse_wheel_down()) {
timeline_scale = max(timeline_scale - 1, 1); timeline_scale = max(timeline_scale - 1, 1);
@ -1074,7 +1079,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
if(mouse_wheel_up()) if(mouse_wheel_up())
timeline_shift_to = clamp(timeline_shift_to + 64, -max(bar_total_w - bar_w, 0), 0); timeline_shift_to = clamp(timeline_shift_to + 64, -max(bar_total_w - bar_w, 0), 0);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
timeline_scubbing = true; timeline_scubbing = true;
timeline_scub_st = ANIMATOR.current_frame; timeline_scub_st = ANIMATOR.current_frame;
_scrub_frame = timeline_scub_st; _scrub_frame = timeline_scub_st;
@ -1082,7 +1087,7 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
} }
if(point_in_rectangle(mx, my, bar_x, 8, bar_x + bar_w, 8 + 16)) { if(point_in_rectangle(mx, my, bar_x, 8, bar_x + bar_w, 8 + 16)) {
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
timeline_scubbing = true; timeline_scubbing = true;
timeline_scub_st = ANIMATOR.current_frame; timeline_scub_st = ANIMATOR.current_frame;
_scrub_frame = timeline_scub_st; _scrub_frame = timeline_scub_st;
@ -1101,49 +1106,49 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
#region control #region control
var bx = ui(8); var bx = ui(8);
var by = h - ui(40); var by = h - ui(40);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Stop", s_sequence_control, 4, ANIMATOR.is_playing? c_ui_orange : c_ui_blue_grey) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Stop", s_sequence_control, 4, ANIMATOR.is_playing? c_ui_orange : c_ui_blue_grey) == 2) {
ANIMATOR.is_playing = false; ANIMATOR.is_playing = false;
ANIMATOR.real_frame = 0; ANIMATOR.real_frame = 0;
} }
bx += ui(36); bx += ui(36);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, ANIMATOR.is_playing? "Pause" : "Play", if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, ANIMATOR.is_playing? "Pause" : "Play",
s_sequence_control, !ANIMATOR.is_playing, ANIMATOR.is_playing? c_ui_orange : c_ui_blue_grey) == 2) s_sequence_control, !ANIMATOR.is_playing, ANIMATOR.is_playing? c_ui_orange : c_ui_blue_grey) == 2)
ANIMATOR.is_playing = !ANIMATOR.is_playing; ANIMATOR.is_playing = !ANIMATOR.is_playing;
bx += ui(36); bx += ui(36);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Go to first frame", s_sequence_control, 3) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Go to first frame", s_sequence_control, 3) == 2) {
ANIMATOR.real_frame = 0; ANIMATOR.real_frame = 0;
ANIMATOR.is_scrubing = true; ANIMATOR.is_scrubing = true;
} }
bx += ui(36); bx += ui(36);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Go to last frame", s_sequence_control, 2) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Go to last frame", s_sequence_control, 2) == 2) {
ANIMATOR.real_frame = ANIMATOR.frames_total; ANIMATOR.real_frame = ANIMATOR.frames_total;
ANIMATOR.is_scrubing = true; ANIMATOR.is_scrubing = true;
} }
bx += ui(36); bx += ui(36);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Previous frame", s_sequence_control, 5) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Previous frame", s_sequence_control, 5) == 2) {
ANIMATOR.real_frame = clamp(ANIMATOR.real_frame - 1, 0, ANIMATOR.frames_total); ANIMATOR.real_frame = clamp(ANIMATOR.real_frame - 1, 0, ANIMATOR.frames_total);
ANIMATOR.is_scrubing = true; ANIMATOR.is_scrubing = true;
} }
bx += ui(36); bx += ui(36);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Next frame", s_sequence_control, 6) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Next frame", s_sequence_control, 6) == 2) {
ANIMATOR.real_frame = clamp(ANIMATOR.real_frame + 1, 0, ANIMATOR.frames_total); ANIMATOR.real_frame = clamp(ANIMATOR.real_frame + 1, 0, ANIMATOR.frames_total);
ANIMATOR.is_scrubing = true; ANIMATOR.is_scrubing = true;
} }
bx = w - ui(40); bx = w - ui(40);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Animation settings", s_animation_setting, 2) == 2) if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Animation settings", s_animation_setting, 2) == 2)
dialogCall(o_dialog_animation, x + bx + 32, y + by - 8); dialogCall(o_dialog_animation, x + bx + 32, y + by - 8);
if(dope_sheet_h > 8) { if(dope_sheet_h > 8) {
by -= ui(40); by -= ui(40);
bx = w - ui(40); bx = w - ui(40);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Scale animation", s_animation_timing, 2) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Scale animation", s_animation_timing, 2) == 2) {
var dia = dialogCall(o_dialog_anim_time_scaler, x + bx + ui(32), y + by - ui(8)); var dia = dialogCall(o_dialog_anim_time_scaler, x + bx + ui(32), y + by - ui(8));
dia.anchor = ANCHOR.right | ANCHOR.bottom; dia.anchor = ANCHOR.right | ANCHOR.bottom;
} }
@ -1151,10 +1156,10 @@ function Panel_Animation(_panel) : PanelContent(_panel) constructor {
#endregion #endregion
} }
function drawContent() { function drawContent(panel) {
draw_clear_alpha(c_ui_blue_black, 0); draw_clear_alpha(c_ui_blue_black, 0);
drawAnimationControl(); drawAnimationControl(panel);
if(timeline_show_time > -1) { if(timeline_show_time > -1) {
TOOLTIP = "Frame " + string(timeline_show_time) + "/" + string(ANIMATOR.frames_total); TOOLTIP = "Frame " + string(timeline_show_time) + "/" + string(ANIMATOR.frames_total);

View file

@ -1,7 +1,12 @@
function Panel_Collection(_panel) : PanelContent(_panel) constructor { function Panel_Collection() : PanelContent() constructor {
expandable = false;
group_w = ui(180); group_w = ui(180);
content_w = w - ui(24) - group_w;
content_h = h - ui(40) - ui(16); function initSize() {
content_w = w - ui(24) - group_w;
content_h = h - ui(40) - ui(16);
}
initSize();
min_w = group_w + ui(40); min_w = group_w + ui(40);
min_h = ui(40); min_h = ui(40);
@ -174,7 +179,7 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
var hh = ui(8); var hh = ui(8);
for(var i = 0; i < ds_list_size(root.subDir); i++) { for(var i = 0; i < ds_list_size(root.subDir); i++) {
var hg = root.subDir[| i].draw(self, ui(8), _y, _m, folderPane.w - ui(16), HOVER == panel, FOCUS == panel, root); var hg = root.subDir[| i].draw(self, ui(8), _y, _m, folderPane.w - ui(16), pHOVER, pFOCUS, root);
hh += hg; hh += hg;
_y += hg; _y += hg;
} }
@ -209,15 +214,15 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
} }
} }
function drawContent() { function drawContent(panel) {
draw_clear_alpha(c_ui_blue_black, 0); draw_clear_alpha(c_ui_blue_black, 0);
var content_y = ui(48); var content_y = ui(48);
draw_sprite_stretched(s_ui_panel_bg, 1, group_w, content_y, content_w + ui(16), content_h); draw_sprite_stretched(s_ui_panel_bg, 1, group_w, content_y, content_w + ui(16), content_h);
contentPane.active = HOVER == panel; contentPane.active = pHOVER;
contentPane.draw(group_w + ui(8), content_y, mx - group_w - ui(8), my - content_y); contentPane.draw(group_w + ui(8), content_y, mx - group_w - ui(8), my - content_y);
folderPane.active = HOVER == panel; folderPane.active = pHOVER;
folderPane.draw(0, content_y, mx, my - content_y); folderPane.draw(0, content_y, mx, my - content_y);
var _x = ui(16); var _x = ui(16);
@ -226,10 +231,11 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
for( var i = 0; i < array_length(roots); i++ ) { for( var i = 0; i < array_length(roots); i++ ) {
var r = roots[i]; var r = roots[i];
var b = buttonInstant(s_button_hide_fill, _x - ui(8), _y - bh / 2, string_width(r[0]) + ui(20), bh, [mx, my], FOCUS == panel, HOVER == panel); var b = buttonInstant(s_button_hide_fill, _x - ui(8), _y - bh / 2, string_width(r[0]) + ui(20), bh, [mx, my], pFOCUS, pHOVER);
if(b == 2) { if(b == 2) {
mode = i; mode = i;
root = r[1]; root = r[1];
context = root;
} }
draw_set_text(f_p0b, fa_left, fa_center, i == mode? c_ui_blue_white : c_ui_blue_dkgrey); draw_set_text(f_p0b, fa_left, fa_center, i == mode? c_ui_blue_white : c_ui_blue_dkgrey);
@ -241,25 +247,22 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
var bx = w - ui(40); var bx = w - ui(40);
var by = ui(12); var by = ui(12);
//tb_search.hover = HOVER == panel; //tb_search.hover = pHOVER;
//tb_search.focus = FOCUS == panel; //tb_search.focus = pFOCUS;
//if(tb_search.focus) //if(tb_search.focus)
// TEXTBOX_ACTIVE = tb_search; // TEXTBOX_ACTIVE = tb_search;
//else if(TEXTBOX_ACTIVE == tb_search) //else if(TEXTBOX_ACTIVE == tb_search)
// TEXTBOX_ACTIVE = noone; // TEXTBOX_ACTIVE = noone;
if(search_string == "") { if(search_string == "") {
if(FOCUS == panel) if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, contentView? "Grid view" : "List view", s_view_mode, contentView) == 2) {
tb_search.editText();
if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], FOCUS == panel, HOVER == panel, contentView? "Grid view" : "List view", s_view_mode, contentView) == 2) {
contentView = !contentView; contentView = !contentView;
} }
bx -= ui(32); bx -= ui(32);
if(mode == 0) { if(mode == 0) {
if(context != root) { if(context != root) {
if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], FOCUS == panel, HOVER == panel, "Add selecting node as collection", s_add_24, 0, c_ui_lime) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, "Add selecting node as collection", s_add_24, 0, c_ui_lime) == 2) {
if(PANEL_INSPECTOR.inspecting != noone) { if(PANEL_INSPECTOR.inspecting != noone) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
data_path = context.path; data_path = context.path;
@ -283,7 +286,7 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], FOCUS == panel, HOVER == panel, "Add folder") == 2) { if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, "Add folder") == 2) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8); var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8);
dia.onModify = function (txt) { dia.onModify = function (txt) {
directory_create(txt); directory_create(txt);
@ -295,14 +298,14 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
bx -= ui(32); bx -= ui(32);
} }
if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], FOCUS == panel, HOVER == panel, "Open in file explorer", s_folder_24) == 2) { if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, "Open in file explorer", s_folder_24) == 2) {
var _contPath = context.path; var _contPath = context.path;
var _windir = environment_get_variable("WINDIR") + "/explorer.exe"; var _windir = environment_get_variable("WINDIR") + "/explorer.exe";
execute_shell_simple(_windir, _contPath); execute_shell_simple(_windir, _contPath);
} }
bx -= ui(32); bx -= ui(32);
if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], FOCUS == panel, HOVER == panel, "Refresh", s_refresh_16) == 2) if(buttonInstant(s_button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, "Refresh", s_refresh_16) == 2)
refreshContext(); refreshContext();
bx -= ui(32); bx -= ui(32);
} else { } else {
@ -317,7 +320,7 @@ function Panel_Collection(_panel) : PanelContent(_panel) constructor {
if(file_dragging.spr) if(file_dragging.spr)
draw_sprite_ext(file_dragging.spr, 0, mx, my, 1, 1, 0, c_white, 0.5); draw_sprite_ext(file_dragging.spr, 0, mx, my, 1, 1, 0, c_white, 0.5);
if(HOVER == PANEL_GRAPH.panel) if(panelHover(PANEL_GRAPH))
dragToGraph(); dragToGraph();
if(mouse_check_button_released(mb_left)) if(mouse_check_button_released(mb_left))

View file

@ -127,11 +127,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function set(_content) { function set(_content) {
content = _content; content = _content;
content.panel = self; content.onSetPanel(self);
content.x = x;
content.y = y;
content.w = w;
content.h = h;
} }
function split_h(_w) { function split_h(_w) {
@ -198,7 +194,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
} }
function stepBegin() { function stepBegin() {
if(content) content.onStepBegin(); if(content) content.onStepBegin(self);
if(dragging == 1) { if(dragging == 1) {
var _mx = clamp(mouse_mx, ui(16), WIN_W - ui(16)); var _mx = clamp(mouse_mx, ui(16), WIN_W - ui(16));
@ -271,12 +267,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(mouse_check_button_released(mb_left)) dragging = -1; if(mouse_check_button_released(mb_left)) dragging = -1;
} else { } else {
for(var i = 0; i < ds_list_size(childs); i++) { if(content != noone) {
var _panel = childs[| i];
_panel.stepBegin();
}
if(ds_list_empty(childs)) {
if(point_in_rectangle(mouse_mx, mouse_my, x + ui(2), y + ui(2), x + w - ui(4), y + h - ui(4))) { if(point_in_rectangle(mouse_mx, mouse_my, x + ui(2), y + ui(2), x + w - ui(4), y + h - ui(4))) {
HOVER = self; HOVER = self;
if(mouse_check_button_pressed(mb_left)) setFocus(self); if(mouse_check_button_pressed(mb_left)) setFocus(self);
@ -285,6 +276,11 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(sFOCUS && content) if(sFOCUS && content)
FOCUS_STR = content.context_str; FOCUS_STR = content.context_str;
} }
} else {
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
_panel.stepBegin();
}
} }
} }
} }
@ -297,47 +293,51 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
} }
function draw() { function draw() {
if(ds_list_empty(childs)) { if(content != noone) {
drawPanel(); drawPanel();
} else { return;
var _drag = true; }
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
if(_panel.content && !_panel.content.draggable)
_drag = false;
}
for(var i = 0; i < ds_list_size(childs); i++) { if(ds_list_empty(childs))
var _panel = childs[| i]; return;
_panel.draw();
var _drag = true;
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
if(_panel.content && !_panel.content.draggable)
_drag = false;
}
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
_panel.draw();
if!(_drag && (HOVER == noone || is_struct(HOVER))) if!(_drag && (HOVER == noone || is_struct(HOVER)))
continue; continue;
switch(_panel.anchor) { switch(_panel.anchor) {
case ANCHOR.left : case ANCHOR.left :
if(!point_in_rectangle(mouse_mx, mouse_my, _panel.x + _panel.w - ui(2), _panel.y, _panel.x + _panel.w + ui(2), _panel.y + _panel.h)) if(!point_in_rectangle(mouse_mx, mouse_my, _panel.x + _panel.w - ui(2), _panel.y, _panel.x + _panel.w + ui(2), _panel.y + _panel.h))
break;
CURSOR = cr_size_we;
if(mouse_check_button_pressed(mb_left)) {
dragging = 1;
drag_sval = _panel.w;
drag_sm = mouse_mx;
}
break; break;
case ANCHOR.top :
if(!point_in_rectangle(mouse_mx, mouse_my, _panel.x, _panel.y + _panel.h - ui(2), _panel.x + _panel.w, _panel.y + _panel.h + ui(2)))
break;
CURSOR = cr_size_ns; CURSOR = cr_size_we;
if(mouse_check_button_pressed(mb_left)) { if(mouse_check_button_pressed(mb_left)) {
dragging = 2; dragging = 1;
drag_sval = _panel.h; drag_sval = _panel.w;
drag_sm = mouse_my; drag_sm = mouse_mx;
} }
break;
case ANCHOR.top :
if(!point_in_rectangle(mouse_mx, mouse_my, _panel.x, _panel.y + _panel.h - ui(2), _panel.x + _panel.w, _panel.y + _panel.h + ui(2)))
break; break;
}
CURSOR = cr_size_ns;
if(mouse_check_button_pressed(mb_left)) {
dragging = 2;
drag_sval = _panel.h;
drag_sm = mouse_my;
}
break;
} }
} }
} }
@ -358,7 +358,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
min_w = content.min_w; min_w = content.min_w;
min_h = content.min_h; min_h = content.min_h;
if(w >= min_w && h >= min_h) if(w >= min_w && h >= min_h)
content.draw(); content.draw(self);
} }
gpu_set_blendmode(bm_subtract); gpu_set_blendmode(bm_subtract);
@ -384,23 +384,25 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
} }
} }
function PanelContent(_panel) constructor { function PanelContent() constructor {
context_str = ""; context_str = "";
panel = _panel;
panel.content = self;
draggable = true; draggable = true;
expandable = true;
x = panel.x;
y = panel.y;
w = panel.w;
h = panel.h;
mx = 0; mx = 0;
my = 0; my = 0;
x = 0;
y = 0;
w = 1;
h = 1;
min_w = ui(32); min_w = ui(32);
min_h = ui(32); min_h = ui(32);
pFOCUS = false;
pHOVER = false;
function refresh() { function refresh() {
onResize(); onResize();
} }
@ -410,7 +412,23 @@ function PanelContent(_panel) constructor {
function onFocusBegin() {} function onFocusBegin() {}
function onFocusEnd() {} function onFocusEnd() {}
function onStepBegin() { function initSize() {}
function setPanelSize(panel) {
x = panel.x;
y = panel.y;
w = panel.w;
h = panel.h;
}
function onSetPanel(panel) {
setPanelSize(panel);
initSize();
onResize();
}
function onStepBegin(panel) {
setPanelSize(panel);
mx = mouse_mx - x; mx = mouse_mx - x;
my = mouse_my - y; my = mouse_my - y;
@ -419,11 +437,14 @@ function PanelContent(_panel) constructor {
function stepBegin() {} function stepBegin() {}
function draw() { function draw(panel) {
drawContent(); pFOCUS = FOCUS == panel;
pHOVER = HOVER == panel;
drawContent(panel);
} }
function drawContent() {} function drawContent(panel) {}
} }
function setFocus(target) { function setFocus(target) {

View file

@ -1,6 +1,9 @@
#region data #region data
globalvar PANEL_MAIN, PANEL_MENU, PANEL_PREVIEW, PANEL_INSPECTOR, PANEL_GRAPH, PANEL_ANIMATION, PANEL_COLLECTION; globalvar PANEL_MAIN, PANEL_MENU, PANEL_PREVIEW, PANEL_INSPECTOR, PANEL_GRAPH, PANEL_ANIMATION, PANEL_COLLECTION;
globalvar FULL_SCREEN_CONTENT;
PANEL_MAIN = 0; PANEL_MAIN = 0;
FULL_SCREEN_CONTENT = noone;
#endregion #endregion
#region panel class #region panel class
@ -35,43 +38,48 @@
function setPanel() { function setPanel() {
PANEL_MAIN = new Panel(noone, 0, 0, WIN_SW, WIN_SH); PANEL_MAIN = new Panel(noone, 0, 0, WIN_SW, WIN_SH);
PANEL_MENU = new Panel_Menu();
PANEL_INSPECTOR = new Panel_Inspector();
PANEL_ANIMATION = new Panel_Animation();
PANEL_PREVIEW = new Panel_Preview();
PANEL_GRAPH = new Panel_Graph();
PANEL_COLLECTION = new Panel_Collection();
var split_menu = PANEL_MAIN.split_v(ui(40)); var split_menu = PANEL_MAIN.split_v(ui(40));
PANEL_MENU = new Panel_Menu(split_menu[0]); split_menu[0].set(PANEL_MENU);
var split_ins = split_menu[1].split_h(ui(-400)); var split_ins = split_menu[1].split_h(ui(-400));
PANEL_INSPECTOR = new Panel_Inspector(split_ins[1]); split_ins[1].set(PANEL_INSPECTOR);
switch(PREF_MAP[? "panel_layout"]) { switch(PREF_MAP[? "panel_layout"]) {
case 0 : case 0 :
var split_anim = split_ins[0].split_v(ui(-48)); var split_anim = split_ins[0].split_v(ui(-48));
PANEL_ANIMATION = new Panel_Animation(split_anim[1]); split_anim[1].set(PANEL_ANIMATION);
var split_prev = split_anim[0].split_v(ui(-500)); var split_prev = split_anim[0].split_v(ui(-500));
PANEL_PREVIEW = new Panel_Preview(split_prev[0]); split_prev[0].set(PANEL_PREVIEW);
split_prev[1].set(PANEL_GRAPH);
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
if(PREF_MAP[? "panel_collection"]) { if(PREF_MAP[? "panel_collection"]) {
var pane = PANEL_GRAPH.panel.split_h(ui(460)); var pane = split_prev[1].split_h(ui(460));
if(pane == noone) break; if(pane == noone) break;
pane[1].set(PANEL_GRAPH); pane[1].set(PANEL_GRAPH);
PANEL_COLLECTION = new Panel_Collection(pane[0]); pane[0].set(PANEL_COLLECTION);
} }
break; break;
case 1 : case 1 :
var split_anim = split_ins[0].split_v(ui(-300)); var split_anim = split_ins[0].split_v(ui(-300));
PANEL_ANIMATION = new Panel_Animation(split_anim[1]); split_anim[1].set(PANEL_ANIMATION);
var split_prev = split_anim[0].split_h(ui(400)); var split_prev = split_anim[0].split_h(ui(400));
PANEL_PREVIEW = new Panel_Preview(split_prev[0]); split_prev[0].set(PANEL_PREVIEW);
split_prev[1].set(PANEL_GRAPH);
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
if(PREF_MAP[? "panel_collection"]) { if(PREF_MAP[? "panel_collection"]) {
var pane = PANEL_ANIMATION.panel.split_h(ui(500)); var pane = split_anim[1].split_h(ui(500));
if(pane == noone) break; if(pane == noone) break;
pane[1].set(PANEL_ANIMATION); pane[1].set(PANEL_ANIMATION);
PANEL_COLLECTION = new Panel_Collection(pane[0]); pane[0].set(PANEL_COLLECTION);
} }
break; break;
} }
@ -98,4 +106,35 @@
return _res; return _res;
} }
#endregion
#region fullscreen
function set_focus_fullscreen() {
if(FULL_SCREEN_CONTENT != noone) {
PANEL_MAIN.childs[| 1].content = noone;
FULL_SCREEN_CONTENT = noone;
return;
}
var panel = PREF_MAP[? "expand_hover"]? HOVER : FOCUS;
if(panel == noone) return;
if(!is_struct(panel)) return;
if(instanceof(panel) != "Panel") return;
if(panel.content == noone) return;
if(!panel.content.expandable) return;
PANEL_MAIN.childs[| 1].set(panel.content);
FULL_SCREEN_CONTENT = panel;
}
#endregion
#region function
function panelHover(content) {
return HOVER && is_struct(HOVER) && instanceof(HOVER) == "Panel" && HOVER.content == content;
}
function panelFocus(content) {
return FOCUS && is_struct(FOCUS) && instanceof(FOCUS) == "Panel" && FOCUS.content == content;
}
#endregion #endregion

View file

@ -1,4 +1,4 @@
function Panel_Graph(_panel) : PanelContent(_panel) constructor { function Panel_Graph() : PanelContent() constructor {
context_str = "Graph"; context_str = "Graph";
scale = [ 0.25, 0.33, 0.5, 0.65, 0.8, 1, 1.2, 1.35, 1.5]; scale = [ 0.25, 0.33, 0.5, 0.65, 0.8, 1, 1.2, 1.35, 1.5];
@ -12,7 +12,11 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
graph_x = round(w / 2 / graph_s); graph_x = round(w / 2 / graph_s);
graph_y = round(h / 2 / graph_s); graph_y = round(h / 2 / graph_s);
} }
toOrigin();
function initSize() {
toOrigin();
}
initSize();
graph_dragging = false; graph_dragging = false;
graph_drag_mx = 0; graph_drag_mx = 0;
@ -217,7 +221,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
graph_dragging = false; graph_dragging = false;
} }
if(mouse_on_graph && FOCUS == panel) { if(mouse_on_graph && pFOCUS) {
var _doDragging = false; var _doDragging = false;
if(mouse_check_button_pressed(mb_middle)) { if(mouse_check_button_pressed(mb_middle)) {
_doDragging = true; _doDragging = true;
@ -236,7 +240,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
} }
} }
if(mouse_on_graph && HOVER == panel) { if(mouse_on_graph && pHOVER) {
var _s = graph_s; var _s = graph_s;
if(mouse_wheel_down()) { if(mouse_wheel_down()) {
graph_s_index = max(0, graph_s_index - 1); graph_s_index = max(0, graph_s_index - 1);
@ -319,7 +323,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
} }
#endregion #endregion
if(mouse_on_graph && FOCUS == panel) { if(mouse_on_graph && pFOCUS) {
if(mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) { if(mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) {
if(keyboard_check(vk_shift)) { if(keyboard_check(vk_shift)) {
if(ds_list_empty(nodes_select_list) && node_focus) if(ds_list_empty(nodes_select_list) && node_focus)
@ -562,7 +566,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
} }
#endregion #endregion
if(mouse_on_graph && FOCUS == panel) { if(mouse_on_graph && pFOCUS) {
if(node_focus && value_focus == noone) { if(node_focus && value_focus == noone) {
if(mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) { if(mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) {
node_dragging = node_focus; node_dragging = node_focus;
@ -618,7 +622,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
nodes_select_drag = false; nodes_select_drag = false;
} }
if(mouse_on_graph && FOCUS == panel && mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) { if(mouse_on_graph && pFOCUS && mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) {
if(!node_focus && !value_focus && !drag_locking) { if(!node_focus && !value_focus && !drag_locking) {
nodes_select_drag = true; nodes_select_drag = true;
nodes_select_mx = mx; nodes_select_mx = mx;
@ -921,7 +925,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
} }
} else { } else {
if(value_focus) { if(value_focus) {
if(FOCUS == panel && mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) { if(pFOCUS && mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control)) {
value_dragging = value_focus; value_dragging = value_focus;
} }
} }
@ -941,7 +945,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
function drawContext() { function drawContext() {
draw_set_text(f_p0, fa_left, fa_center, c_ui_blue_ltgrey); draw_set_text(f_p0, fa_left, fa_center, c_ui_blue_ltgrey);
var xx = ui(16), tt, tw, th; var xx = ui(16), tt, tw, th;
var bh = toolbar_height - ui(10); var bh = toolbar_height - ui(12);
var tbh = h - toolbar_height / 2; var tbh = h - toolbar_height / 2;
draw_set_color(c_ui_blue_ltgrey); draw_set_color(c_ui_blue_ltgrey);
@ -957,7 +961,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
th = string_height(tt); th = string_height(tt);
if(i < ds_list_size(node_context) - 1) { if(i < ds_list_size(node_context) - 1) {
if(buttonInstant(s_button_hide_fill, xx - ui(6), tbh - bh / 2, tw + ui(12), bh, [mx, my], FOCUS == panel, HOVER == panel) == 2) { if(buttonInstant(s_button_hide_fill, xx - ui(6), tbh - bh / 2, tw + ui(12), bh, [mx, my], pFOCUS, pHOVER) == 2) {
node_hover = noone; node_hover = noone;
node_focus = noone; node_focus = noone;
PANEL_PREVIEW.preview_node[0] = noone; PANEL_PREVIEW.preview_node[0] = noone;
@ -1013,7 +1017,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
var tbInd = tb[1](); var tbInd = tb[1]();
var tbTooltip = tb[2](); var tbTooltip = tb[2]();
var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], FOCUS == panel, HOVER == panel, tbTooltip, tbSpr, tbInd); var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pFOCUS, pHOVER, tbTooltip, tbSpr, tbInd);
if(b == 2) tb[3]( { x: x + tbx - ui(14), y: y + tby - ui(14) } ); if(b == 2) tb[3]( { x: x + tbx - ui(14), y: y + tby - ui(14) } );
tbx -= ui(32); tbx -= ui(32);
@ -1160,7 +1164,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
return; return;
} }
function drawContent() { function drawContent(panel) {
dragGraph(); dragGraph();
draw_clear(c_ui_blue_black); draw_clear(c_ui_blue_black);
@ -1183,7 +1187,7 @@ function Panel_Graph(_panel) : PanelContent(_panel) constructor {
if(minimap_show) if(minimap_show)
drawMinimap(); drawMinimap();
if(FOCUS == panel) { if(pFOCUS) {
if(node_focus) node_focus.focusStep(); if(node_focus) node_focus.focusStep();
} }
} }

View file

@ -3,7 +3,7 @@ function Inspector_Custom_Renderer(draw) constructor {
self.draw = draw; self.draw = draw;
} }
function Panel_Inspector(_panel) : PanelContent(_panel) constructor { function Panel_Inspector() : PanelContent() constructor {
context_str = "Inspector"; context_str = "Inspector";
inspecting = noone; inspecting = noone;
@ -12,8 +12,11 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
prop_hover = noone; prop_hover = noone;
prop_selecting = noone; prop_selecting = noone;
content_w = w - ui(32); function initSize() {
content_h = h - top_bar_h - ui(24); content_w = w - ui(32);
content_h = h - top_bar_h - ui(24);
}
initSize();
keyframe_dragging = noone; keyframe_dragging = noone;
keyframe_drag_st = 0; keyframe_drag_st = 0;
@ -28,11 +31,17 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
addHotkey("Inspector", "Copy property", "C", MOD_KEY.ctrl, function() { propSelectCopy(); }); addHotkey("Inspector", "Copy property", "C", MOD_KEY.ctrl, function() { propSelectCopy(); });
addHotkey("Inspector", "Paste property", "V", MOD_KEY.ctrl, function() { propSelectPaste(); }); addHotkey("Inspector", "Paste property", "V", MOD_KEY.ctrl, function() { propSelectPaste(); });
function onResize() {
content_w = w - ui(32);
content_h = h - top_bar_h - ui(24);
contentPane.resize(content_w, content_h);
}
contentPane = new scrollPane(content_w, content_h, function(_y, _m) { contentPane = new scrollPane(content_w, content_h, function(_y, _m) {
var con_w = contentPane.surface_w; var con_w = contentPane.surface_w;
draw_clear_alpha(c_ui_blue_black, 0); draw_clear_alpha(c_ui_blue_black, 0);
if(FOCUS == panel) if(pFOCUS)
if(point_in_rectangle(_m[0], _m[1], 0, 0, con_w, content_h) && mouse_check_button_pressed(mb_left)) if(point_in_rectangle(_m[0], _m[1], 0, 0, con_w, content_h) && mouse_check_button_pressed(mb_left))
prop_selecting = noone; prop_selecting = noone;
@ -57,10 +66,10 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
var txt = jun_disp[0]; var txt = jun_disp[0];
var coll = jun_disp[1]; var coll = jun_disp[1];
if(HOVER == panel && point_in_rectangle(_m[0], _m[1], 0, yy, con_w, yy + ui(32))) { if(pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, con_w, yy + ui(32))) {
draw_sprite_stretched_ext(s_node_name, 0, 0, yy, con_w, ui(32), c_ui_blue_white, 1); draw_sprite_stretched_ext(s_node_name, 0, 0, yy, con_w, ui(32), c_ui_blue_white, 1);
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
jun_disp[@ 1] = !coll; jun_disp[@ 1] = !coll;
} }
} else } else
@ -86,8 +95,8 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
} }
continue; continue;
} else if(is_struct(jun_disp) && instanceof(jun_disp) == "Inspector_Custom_Renderer") { } else if(is_struct(jun_disp) && instanceof(jun_disp) == "Inspector_Custom_Renderer") {
var hov = HOVER == panel; var hov = pHOVER;
var foc = FOCUS == panel; var foc = pFOCUS;
jun_disp.draw(ui(6), yy, con_w - ui(12), _m, hov, foc); jun_disp.draw(ui(6), yy, con_w - ui(12), _m, hov, foc);
hh += jun_disp.h + ui(20); hh += jun_disp.h + ui(20);
continue; continue;
@ -103,7 +112,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
var butx = ui(16); var butx = ui(16);
var index = jun.value_from == noone? jun.animator.is_anim : 2; var index = jun.value_from == noone? jun.animator.is_anim : 2;
draw_sprite_ui_uniform(s_animate_clock, index, butx, lb_y, 1, c_white, 0.8); draw_sprite_ui_uniform(s_animate_clock, index, butx, lb_y, 1, c_white, 0.8);
if(HOVER == panel && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) { if(pHOVER && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
draw_sprite_ui_uniform(s_animate_clock, index, butx, lb_y, 1, c_white, 1); draw_sprite_ui_uniform(s_animate_clock, index, butx, lb_y, 1, c_white, 1);
TOOLTIP = "Toggle animation"; TOOLTIP = "Toggle animation";
@ -119,7 +128,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
butx += ui(20); butx += ui(20);
index = jun.visible; index = jun.visible;
draw_sprite_ui_uniform(s_junc_visible, index, butx, lb_y, 1, c_white, 0.8); draw_sprite_ui_uniform(s_junc_visible, index, butx, lb_y, 1, c_white, 0.8);
if(HOVER == panel && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) { if(pHOVER && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
draw_sprite_ui_uniform(s_junc_visible, index, butx, lb_y, 1, c_white, 1); draw_sprite_ui_uniform(s_junc_visible, index, butx, lb_y, 1, c_white, 1);
TOOLTIP = "Visibility"; TOOLTIP = "Visibility";
@ -136,7 +145,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
if(lineBreak && jun.animator.is_anim) { if(lineBreak && jun.animator.is_anim) {
var bx = w - ui(64); var bx = w - ui(64);
var by = lb_y; var by = lb_y;
if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, FOCUS == panel, HOVER == panel, "", s_prop_keyframe, 2) == 2) { if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "", s_prop_keyframe, 2) == 2) {
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
if(_key.time > ANIMATOR.current_frame) { if(_key.time > ANIMATOR.current_frame) {
@ -156,7 +165,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
} }
} }
if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, FOCUS == panel, HOVER == panel, cc == c_ui_blue_grey? "Add keyframe" : "Remove keyframe", s_prop_keyframe, 1, cc) == 2) { if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, cc == c_ui_blue_grey? "Add keyframe" : "Remove keyframe", s_prop_keyframe, 1, cc) == 2) {
var _add = false; var _add = false;
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
@ -175,7 +184,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
} }
bx -= ui(26); bx -= ui(26);
if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, FOCUS == panel, HOVER == panel, "", s_prop_keyframe, 0) == 2) { if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "", s_prop_keyframe, 0) == 2) {
var _t = -1; var _t = -1;
for(var j = 0; j < ds_list_size(jun.animator.values); j++) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) {
var _key = jun.animator.values[| j]; var _key = jun.animator.values[| j];
@ -195,7 +204,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
draw_line(bx - ui(20), by - lhf, bx - ui(20), by + lhf); draw_line(bx - ui(20), by - lhf, bx - ui(20), by + lhf);
bx -= ui(26 + 12); bx -= ui(26 + 12);
if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, FOCUS == panel, HOVER == panel, "Looping mode " + ON_END_NAME[jun.on_end], s_prop_on_end, jun.on_end) == 2) if(buttonInstant(s_button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, pFOCUS, pHOVER, "Looping mode " + ON_END_NAME[jun.on_end], s_prop_on_end, jun.on_end) == 2)
jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(s_prop_on_end)); jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(s_prop_on_end));
} }
#endregion #endregion
@ -214,8 +223,8 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
var widH = lineBreak? editBoxH : 0; var widH = lineBreak? editBoxH : 0;
if(jun.editWidget) { if(jun.editWidget) {
jun.editWidget.active = FOCUS == panel; jun.editWidget.active = pFOCUS;
jun.editWidget.hover = HOVER == panel; jun.editWidget.hover = pHOVER;
switch(jun.display_type) { switch(jun.display_type) {
case VALUE_DISPLAY.button : case VALUE_DISPLAY.button :
@ -256,8 +265,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
widH = ui(204); widH = ui(204);
break; break;
case VALUE_DISPLAY.puppet_control : case VALUE_DISPLAY.puppet_control :
jun.editWidget.draw(editBoxX, editBoxY, editBoxW, jun.showValue(), _m, ui(16) + x, top_bar_h + y); widH = jun.editWidget.draw(editBoxX, editBoxY, editBoxW, jun.showValue(), _m, ui(16) + x, top_bar_h + y);
widH = ui(164);
break; break;
} }
break; break;
@ -331,18 +339,18 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
hh += lb_h + widH + padd; hh += lb_h + widH + padd;
var _selY = yy - ui(0); var _selY = yy - ui(0);
var _selY1 = max(yy + lb_h, editBoxY + widH + ui(4)); var _selY1 = yy + lb_h + widH + ui(2);
var _selH = _selY1 - _selY; var _selH = _selY1 - _selY;
if(prop_selecting == jun) if(prop_selecting == jun)
draw_sprite_stretched(s_prop_selecting, 1, 4, _selY, contentPane.surface_w - ui(8), _selH); draw_sprite_stretched(s_prop_selecting, 1, 4, _selY, contentPane.surface_w - ui(8), _selH);
if(HOVER == panel && point_in_rectangle(_m[0], _m[1], 4, _selY, contentPane.surface_w - ui(4), _selY + _selH)) { if(pHOVER && point_in_rectangle(_m[0], _m[1], 4, _selY, contentPane.surface_w - ui(4), _selY + _selH)) {
draw_sprite_stretched(s_prop_selecting, 0, 4, _selY, contentPane.surface_w - ui(8), _selH); draw_sprite_stretched(s_prop_selecting, 0, 4, _selY, contentPane.surface_w - ui(8), _selH);
prop_hover = jun; prop_hover = jun;
if(FOCUS == panel) { if(pFOCUS) {
if(mouse_check_button_pressed(mb_left)) if(mouse_check_button_pressed(mb_left))
prop_selecting = jun; prop_selecting = jun;
@ -382,18 +390,12 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
prop_selecting.setString(clipboard_get_text()); prop_selecting.setString(clipboard_get_text());
} }
function onResize() {
content_w = w - ui(32);
content_h = h - top_bar_h - ui(24);
contentPane.resize(content_w, content_h);
}
function drawInspectingNode() { function drawInspectingNode() {
draw_set_text(f_h5, fa_center, fa_top, c_white); draw_set_text(f_h5, fa_center, fa_top, c_white);
tb_node_name.font = f_h5; tb_node_name.font = f_h5;
tb_node_name.hide = true; tb_node_name.hide = true;
tb_node_name.active = FOCUS == panel; tb_node_name.active = pFOCUS;
tb_node_name.hover = HOVER == panel; tb_node_name.hover = pHOVER;
tb_node_name.align = fa_center; tb_node_name.align = fa_center;
tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), inspecting.name, [mx, my]); tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), inspecting.name, [mx, my]);
@ -401,7 +403,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
var bx = w - ui(44); var bx = w - ui(44);
var by = ui(12); var by = ui(12);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "Run node", s_sequence_control, 1) == 2) if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Run node", s_sequence_control, 1) == 2)
inspecting.doUpdate(); inspecting.doUpdate();
} }
@ -409,12 +411,12 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
var bx = ui(8); var bx = ui(8);
var by = ui(12); var by = ui(12);
if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], FOCUS == panel, HOVER == panel, "This node cache output for performance.\nClick to clear all cached frames in this node.", s_cache) = 2) if(buttonInstant(s_button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "This node cache output for performance.\nClick to clear all cached frames in this node.", s_cache) = 2)
inspecting.clearCache(); inspecting.clearCache();
} }
} }
function drawContent() { function drawContent(panel) {
draw_clear_alpha(c_ui_blue_black, 0); draw_clear_alpha(c_ui_blue_black, 0);
lineBreak = w < PREF_MAP[? "inspector_line_break_width"]; lineBreak = w < PREF_MAP[? "inspector_line_break_width"];
@ -423,7 +425,7 @@ function Panel_Inspector(_panel) : PanelContent(_panel) constructor {
if(inspecting) if(inspecting)
drawInspectingNode(); drawInspectingNode();
contentPane.active = HOVER == panel; contentPane.active = pHOVER;
contentPane.draw(ui(16), top_bar_h, mx - ui(16), my - top_bar_h); contentPane.draw(ui(16), top_bar_h, mx - ui(16), my - top_bar_h);
if(PANEL_GRAPH.node_focus && inspecting != PANEL_GRAPH.node_focus) { if(PANEL_GRAPH.node_focus && inspecting != PANEL_GRAPH.node_focus) {

View file

@ -1,4 +1,4 @@
function Panel_Menu(_panel) : PanelContent(_panel) constructor { function Panel_Menu() : PanelContent() constructor {
draggable = false; draggable = false;
noti_flash = 0; noti_flash = 0;
@ -9,6 +9,7 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor {
NEW(); NEW();
}, ["", "New file"] ], }, ["", "New file"] ],
[ "Open...", function() { LOAD(); }, ["", "Open"] ], [ "Open...", function() { LOAD(); }, ["", "Open"] ],
[ "Open...", function() { LOAD(); }, ["", "Open"] ],
[ "Save", function() { SAVE(); }, ["", "Save"] ], [ "Save", function() { SAVE(); }, ["", "Save"] ],
[ "Save as...", function() { SAVE_AS(); }, ["", "Save as"] ], [ "Save as...", function() { SAVE_AS(); }, ["", "Save as"] ],
[ "Recent files", function(_x, _y, _depth) { [ "Recent files", function(_x, _y, _depth) {
@ -76,12 +77,12 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor {
]], ]],
] ]
function drawContent() { function drawContent(panel) {
draw_clear_alpha(c_ui_blue_black, 0); draw_clear_alpha(c_ui_blue_black, 0);
draw_sprite_ui_uniform(icon_24, 0, h / 2, h / 2, 1, c_white); draw_sprite_ui_uniform(icon_24, 0, h / 2, h / 2, 1, c_white);
var xx = h; var xx = h;
if(FOCUS == panel && point_in_rectangle(mx, my, 0, 0, ui(40), ui(32))) { if(pFOCUS && point_in_rectangle(mx, my, 0, 0, ui(40), ui(32))) {
if(mouse_check_button_pressed(mb_left)) { if(mouse_check_button_pressed(mb_left)) {
dialogCall(o_dialog_about); dialogCall(o_dialog_about);
} }
@ -92,11 +93,11 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor {
var ww = string_width(menus[i][0]) + ui(16); var ww = string_width(menus[i][0]) + ui(16);
var xc = xx + ww / 2; var xc = xx + ww / 2;
if(HOVER == panel) { if(pHOVER) {
if(point_in_rectangle(mx, my, xc - ww / 2, 0, xc + ww / 2, h)) { if(point_in_rectangle(mx, my, xc - ww / 2, 0, xc + ww / 2, h)) {
draw_sprite_stretched(s_menu_button, 0, xc - ww / 2, ui(6), ww, h - ui(12)); draw_sprite_stretched(s_menu_button, 0, xc - ww / 2, ui(6), ww, h - ui(12));
if((FOCUS == panel && mouse_check_button_pressed(mb_left)) || instance_exists(o_dialog_menubox)) { if((pFOCUS && mouse_check_button_pressed(mb_left)) || instance_exists(o_dialog_menubox)) {
var dia = dialogCall(o_dialog_menubox, x + xx, y + h); var dia = dialogCall(o_dialog_menubox, x + xx, y + h);
dia.setMenu(menus[i][1]); dia.setMenu(menus[i][1]);
} }
@ -154,10 +155,10 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor {
draw_set_text(f_p0, fa_right, fa_center, c_ui_blue_grey); draw_set_text(f_p0, fa_right, fa_center, c_ui_blue_grey);
var txt = "v. " + string(VERSION_STRING); var txt = "v. " + string(VERSION_STRING);
var ww = string_width(txt); var ww = string_width(txt);
if(HOVER == panel && point_in_rectangle(mx, my, w - ui(16) - ww, 0, w - ui(16), h)) { if(pHOVER && point_in_rectangle(mx, my, w - ui(16) - ww, 0, w - ui(16), h)) {
draw_sprite_stretched(s_menu_button, 0, w - ww - ui(22), ui(6), ww + ui(12), h - ui(12)); draw_sprite_stretched(s_menu_button, 0, w - ww - ui(22), ui(6), ww + ui(12), h - ui(12));
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
dialogCall(o_dialog_release_note); dialogCall(o_dialog_release_note);
} }
} }
@ -169,10 +170,10 @@ function Panel_Menu(_panel) : PanelContent(_panel) constructor {
var txt = " Newer version available "; var txt = " Newer version available ";
var ww = string_width(txt); var ww = string_width(txt);
if(HOVER == panel && point_in_rectangle(mx, my, xx - ww, 0, xx, h)) { if(pHOVER && point_in_rectangle(mx, my, xx - ww, 0, xx, h)) {
draw_sprite_stretched(s_menu_button, 0, xx - ww - ui(6), ui(6), ww + ui(12), h - ui(12)); draw_sprite_stretched(s_menu_button, 0, xx - ww - ui(6), ui(6), ww + ui(12), h - ui(12));
if(FOCUS == panel && mouse_check_button_pressed(mb_left)) { if(pFOCUS && mouse_check_button_pressed(mb_left)) {
url_open("https://makham.itch.io/pixel-composer"); url_open("https://makham.itch.io/pixel-composer");
} }
} }

View file

@ -1,10 +1,14 @@
function Panel_Preview(_panel) : PanelContent(_panel) constructor { function Panel_Preview() : PanelContent() constructor {
context_str = "Preview"; context_str = "Preview";
last_focus = noone; last_focus = noone;
canvas_x = w / 2 - ui(64); function initSize() {
canvas_y = h / 2 - ui(64); canvas_x = w / 2 - ui(64);
canvas_y = h / 2 - ui(64);
}
initSize();
canvas_s = ui(1); canvas_s = ui(1);
canvas_w = ui(128); canvas_w = ui(128);
canvas_h = ui(128); canvas_h = ui(128);
@ -162,7 +166,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
canvas_dragging = false; canvas_dragging = false;
} }
if(FOCUS == panel && HOVER == panel && canvas_hover) { if(pFOCUS && pHOVER && canvas_hover) {
if(mouse_check_button_pressed(mb_middle)) { if(mouse_check_button_pressed(mb_middle)) {
canvas_dragging = true; canvas_dragging = true;
canvas_drag_mx = mx; canvas_drag_mx = mx;
@ -231,10 +235,10 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
ww = max(ww, string_width(_node.outputs[| i].name) + ui(40)); ww = max(ww, string_width(_node.outputs[| i].name) + ui(40));
} }
sbChannel.data_list = chName; sbChannel.data_list = chName;
sbChannel.hover = HOVER == panel; sbChannel.hover = pHOVER;
sbChannel.active = FOCUS == panel; sbChannel.active = pFOCUS;
sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, _node.outputs[| _node.preview_channel].name, [mx, my], panel.x, panel.y); sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, _node.outputs[| _node.preview_channel].name, [mx, my], x, y);
right_menu_y += ui(40); right_menu_y += ui(40);
} }
@ -382,7 +386,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
preview_x_to = 0; preview_x_to = 0;
} }
if(HOVER == panel && my > h - toolbar_height - prev_size - ui(16)) { if(pHOVER && my > h - toolbar_height - prev_size - ui(16)) {
canvas_hover = false; canvas_hover = false;
if(mouse_wheel_down()) preview_x_to = clamp(preview_x_to - prev_size, - preview_x_max, 0); if(mouse_wheel_down()) preview_x_to = clamp(preview_x_to - prev_size, - preview_x_max, 0);
if(mouse_wheel_up()) preview_x_to = clamp(preview_x_to + prev_size, - preview_x_max, 0); if(mouse_wheel_up()) preview_x_to = clamp(preview_x_to + prev_size, - preview_x_max, 0);
@ -403,7 +407,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
draw_set_color(c_ui_blue_grey); draw_set_color(c_ui_blue_grey);
draw_rectangle(xx, yy, xx + prev_w * ss, yy + prev_h * ss, true); draw_rectangle(xx, yy, xx + prev_w * ss, yy + prev_h * ss, true);
if(FOCUS == panel && point_in_rectangle(mx, my, xx, yy, xx + prev_w * ss, yy + prev_h * ss)) { if(pFOCUS && point_in_rectangle(mx, my, xx, yy, xx + prev_w * ss, yy + prev_h * ss)) {
if(mouse_check_button_pressed(mb_left)) { if(mouse_check_button_pressed(mb_left)) {
_node.preview_index = i; _node.preview_index = i;
_node.onValueUpdate(0); _node.onValueUpdate(0);
@ -426,7 +430,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
var by = h - toolbar_height - prev_size - ui(56); var by = h - toolbar_height - prev_size - ui(56);
var bx = ui(10); var bx = ui(10);
var b = buttonInstant(s_button_hide, bx, by, ui(40), ui(40), [mx, my], FOCUS == panel, HOVER == panel); var b = buttonInstant(s_button_hide, bx, by, ui(40), ui(40), [mx, my], pFOCUS, pHOVER);
if(_node.preview_speed == 0) { if(_node.preview_speed == 0) {
if(b) { if(b) {
@ -448,14 +452,14 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
var active = _active; var active = _active;
var _mx = mx; var _mx = mx;
var _my = my; var _my = my;
var isHover = HOVER == panel && mouse_on_preview; var isHover = pHOVER && mouse_on_preview;
if(_node.tools != -1) { if(_node.tools != -1) {
var xx = ui(16); var xx = ui(16);
var yy = ui(16); var yy = ui(16);
for(var i = 0; i < array_length(_node.tools); i++) { for(var i = 0; i < array_length(_node.tools); i++) {
var b = buttonInstant(s_button, xx, yy, ui(40), ui(40), [_mx, _my], FOCUS == panel, isHover); var b = buttonInstant(s_button, xx, yy, ui(40), ui(40), [_mx, _my], pFOCUS, isHover);
if(b > 0) active = false; if(b > 0) active = false;
yy += ui(48); yy += ui(48);
} }
@ -468,14 +472,14 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
var yy = ui(16); var yy = ui(16);
for(var i = 0; i < array_length(_node.tools); i++) { for(var i = 0; i < array_length(_node.tools); i++) {
var b = buttonInstant(s_button, xx, yy, ui(40), ui(40), [_mx, _my], FOCUS == panel, isHover); var b = buttonInstant(s_button, xx, yy, ui(40), ui(40), [_mx, _my], pFOCUS, isHover);
var toggle = false; var toggle = false;
if(b == 1) if(b == 1)
TOOLTIP = _node.tools[i][0]; TOOLTIP = _node.tools[i][0];
else if(b == 2) else if(b == 2)
toggle = true; toggle = true;
if(FOCUS == panel && keyboard_check_pressed(ord(string(i + 1)))) if(pFOCUS && keyboard_check_pressed(ord(string(i + 1))))
toggle = true; toggle = true;
if(toggle) { if(toggle) {
@ -524,7 +528,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
var tbInd = tb[1](); var tbInd = tb[1]();
var tbTooltip = tb[2](); var tbTooltip = tb[2]();
var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], FOCUS == panel, HOVER == panel, tbTooltip, tbSpr, tbInd); var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pFOCUS, pHOVER, tbTooltip, tbSpr, tbInd);
if(b == 2) tb[3]( { x: x + tbx - ui(14), y: y + tby - ui(14) } ); if(b == 2) tb[3]( { x: x + tbx - ui(14), y: y + tby - ui(14) } );
tbx += ui(32); tbx += ui(32);
@ -536,7 +540,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
var tbSpr = tb[0]; var tbSpr = tb[0];
var tbTooltip = tb[1]; var tbTooltip = tb[1];
var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], FOCUS == panel, HOVER == panel, tbTooltip, tbSpr, 0); var b = buttonInstant(s_button_hide, tbx - ui(14), tby - ui(14), ui(28), ui(28), [mx, my], pFOCUS, pHOVER, tbTooltip, tbSpr, 0);
if(b == 2) tb[2](); if(b == 2) tb[2]();
tbx -= ui(32); tbx -= ui(32);
@ -609,7 +613,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
} }
} }
function drawContent() { function drawContent(panel) {
mouse_on_preview = point_in_rectangle(mx, my, 0, 0, w, h - toolbar_height); mouse_on_preview = point_in_rectangle(mx, my, 0, 0, w, h - toolbar_height);
draw_clear(c_ui_blue_black); draw_clear(c_ui_blue_black);
@ -625,7 +629,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
drawPreviewOverlay(); drawPreviewOverlay();
if(PANEL_GRAPH.node_focus) if(PANEL_GRAPH.node_focus)
drawNodeTools(FOCUS == panel, PANEL_GRAPH.node_focus); drawNodeTools(pFOCUS, PANEL_GRAPH.node_focus);
if(last_focus != PANEL_GRAPH.node_focus) { if(last_focus != PANEL_GRAPH.node_focus) {
last_focus = PANEL_GRAPH.node_focus; last_focus = PANEL_GRAPH.node_focus;
tool_index = -1; tool_index = -1;
@ -636,7 +640,7 @@ function Panel_Preview(_panel) : PanelContent(_panel) constructor {
fullView(); fullView();
} }
if(FOCUS == panel) { if(pFOCUS) {
if(mouse_check_button_pressed(mb_right)) { if(mouse_check_button_pressed(mb_right)) {
var dia = dialogCall(o_dialog_menubox, mouse_mx + ui(8), mouse_my + ui(8)); var dia = dialogCall(o_dialog_menubox, mouse_mx + ui(8), mouse_my + ui(8));
dia.setMenu([ dia.setMenu([

View file

@ -34,6 +34,7 @@
PREF_MAP[? "verlet_iteration"] = 4; PREF_MAP[? "verlet_iteration"] = 4;
PREF_MAP[? "collection_preview_speed"] = 60; PREF_MAP[? "collection_preview_speed"] = 60;
PREF_MAP[? "expand_hover"] = false;
#endregion #endregion
#region hotkeys #region hotkeys

View file

@ -72,7 +72,7 @@ function SAVE_AS() {
path += ".pxc"; path += ".pxc";
if(file_exists(path)) if(file_exists(path))
noti_warning("Overrided file : " + path); log_warning("SAVE", "Overrided file : " + path);
SAVE_AT(path); SAVE_AT(path);
SET_PATH(path); SET_PATH(path);
} }
@ -87,8 +87,7 @@ function SAVE_AT(path) {
READONLY = false; READONLY = false;
MODIFIED = false; MODIFIED = false;
log_message("FILE", "save at " + path); log_message("FILE", "save at " + path, s_noti_icon_file_save);
noti_status("File saved", s_noti_icon_file_save);
} }
function SAVE_COLLECTIONS(_list, _path, save_surface = true) { function SAVE_COLLECTIONS(_list, _path, save_surface = true) {

View file

@ -0,0 +1,10 @@
function string_lead_zero(val, digit) {
var len = string_length(string(val));
var zer = digit - len;
var ss = "";
repeat(zer) ss += "0";
ss += string(val);
return ss;
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "string_formatting",
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "string",
"path": "folders/functions/string.yy",
},
}

View file

@ -18,6 +18,40 @@ uniform float radius;
uniform float shift; uniform float shift;
uniform int type; uniform int type;
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 0.0000000001;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float hueDist(float a0, float a1, float t) {
float da = fract(a1 - a0);
float ds = fract(2. * da) - da;
return a0 + ds * t;
}
vec3 hsvMix(vec3 c1, vec3 c2, float t) {
vec3 h1 = rgb2hsv(c1);
vec3 h2 = rgb2hsv(c2);
vec3 h = vec3(0.);
h.x = h.x + hueDist(h1.x, h2.x, t);
h.y = mix(h1.y, h2.y, t);
h.z = mix(h1.z, h2.z, t);
return hsv2rgb(h);
}
vec4 gradientEval(in float prog) { vec4 gradientEval(in float prog) {
vec4 col = vec4(0.); vec4 col = vec4(0.);
@ -29,10 +63,13 @@ vec4 gradientEval(in float prog) {
if(i == 0) if(i == 0)
col = gradient_color[i]; col = gradient_color[i];
else { else {
float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]);
if(gradient_blend == 0) if(gradient_blend == 0)
col = mix(gradient_color[i - 1], gradient_color[i], (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1])); col = mix(gradient_color[i - 1], gradient_color[i], t);
else if(gradient_blend == 1) else if(gradient_blend == 1)
col = gradient_color[i - 1]; col = gradient_color[i - 1];
else if(gradient_blend == 2)
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
} }
break; break;
} }

View file

@ -0,0 +1,80 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
#define TAU 6.28318
uniform int gradient_blend;
uniform vec4 gradient_color[16];
uniform float gradient_time[16];
uniform int gradient_keys;
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 0.0000000001;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float hueDist(float a0, float a1, float t) {
float da = fract(a1 - a0);
float ds = fract(2. * da) - da;
return a0 + ds * t;
}
vec3 hsvMix(vec3 c1, vec3 c2, float t) {
vec3 h1 = rgb2hsv(c1);
vec3 h2 = rgb2hsv(c2);
vec3 h = vec3(0.);
h.x = h.x + hueDist(h1.x, h2.x, t);
h.y = mix(h1.y, h2.y, t);
h.z = mix(h1.z, h2.z, t);
return hsv2rgb(h);
}
vec4 gradientEval(in float prog) {
vec4 col = vec4(0.);
for(int i = 0; i < 16; i++) {
if(gradient_time[i] == prog) {
col = gradient_color[i];
break;
} else if(gradient_time[i] > prog) {
if(i == 0)
col = gradient_color[i];
else {
float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]);
if(gradient_blend == 0)
col = mix(gradient_color[i - 1], gradient_color[i], t);
else if(gradient_blend == 1)
col = gradient_color[i - 1];
else if(gradient_blend == 2)
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
}
break;
}
if(i >= gradient_keys - 1) {
col = gradient_color[gradient_keys - 1];
break;
}
}
return col;
}
void main() {
gl_FragColor = gradientEval(v_vTexcoord.x);
}

View file

@ -0,0 +1,19 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,10 @@
{
"resourceType": "GMShader",
"resourceVersion": "1.0",
"name": "sh_gradient_display",
"type": 1,
"parent": {
"name": "shader",
"path": "folders/shader.yy",
},
}

View file

@ -17,6 +17,40 @@ uniform int gradient_keys;
uniform float alpha_curve[4]; uniform float alpha_curve[4];
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 0.0000000001;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float hueDist(float a0, float a1, float t) {
float da = fract(a1 - a0);
float ds = fract(2. * da) - da;
return a0 + ds * t;
}
vec3 hsvMix(vec3 c1, vec3 c2, float t) {
vec3 h1 = rgb2hsv(c1);
vec3 h2 = rgb2hsv(c2);
vec3 h = vec3(0.);
h.x = h.x + hueDist(h1.x, h2.x, t);
h.y = mix(h1.y, h2.y, t);
h.z = mix(h1.z, h2.z, t);
return hsv2rgb(h);
}
vec4 gradientEval(in float prog) { vec4 gradientEval(in float prog) {
vec4 col = vec4(0.); vec4 col = vec4(0.);
@ -28,10 +62,13 @@ vec4 gradientEval(in float prog) {
if(i == 0) if(i == 0)
col = gradient_color[i]; col = gradient_color[i];
else { else {
float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]);
if(gradient_blend == 0) if(gradient_blend == 0)
col = mix(gradient_color[i - 1], gradient_color[i], (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1])); col = mix(gradient_color[i - 1], gradient_color[i], t);
else if(gradient_blend == 1) else if(gradient_blend == 1)
col = gradient_color[i - 1]; col = gradient_color[i - 1];
else if(gradient_blend == 2)
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
} }
break; break;
} }

View file

@ -1,11 +1,10 @@
{ {
"resourceType": "GMShader",
"resourceVersion": "1.0",
"name": "sh_pixel_cloud",
"type": 1, "type": 1,
"parent": { "parent": {
"name": "generator", "name": "generator",
"path": "folders/shader/generator.yy", "path": "folders/shader/generator.yy",
}, },
"resourceVersion": "1.0",
"name": "sh_pixel_cloud",
"tags": [],
"resourceType": "GMShader",
} }

View file

@ -21,6 +21,40 @@ float random (in vec2 st) {
return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123); return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
} }
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 0.0000000001;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
float hueDist(float a0, float a1, float t) {
float da = fract(a1 - a0);
float ds = fract(2. * da) - da;
return a0 + ds * t;
}
vec3 hsvMix(vec3 c1, vec3 c2, float t) {
vec3 h1 = rgb2hsv(c1);
vec3 h2 = rgb2hsv(c2);
vec3 h = vec3(0.);
h.x = h.x + hueDist(h1.x, h2.x, t);
h.y = mix(h1.y, h2.y, t);
h.z = mix(h1.z, h2.z, t);
return hsv2rgb(h);
}
vec4 gradientEval(in float prog) { vec4 gradientEval(in float prog) {
vec4 col = vec4(0.); vec4 col = vec4(0.);
@ -32,10 +66,13 @@ vec4 gradientEval(in float prog) {
if(i == 0) if(i == 0)
col = gradient_color[i]; col = gradient_color[i];
else { else {
float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]);
if(gradient_blend == 0) if(gradient_blend == 0)
col = mix(gradient_color[i - 1], gradient_color[i], (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1])); col = mix(gradient_color[i - 1], gradient_color[i], t);
else if(gradient_blend == 1) else if(gradient_blend == 1)
col = gradient_color[i - 1]; col = gradient_color[i - 1];
else if(gradient_blend == 2)
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
} }
break; break;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 108 B

View file

@ -11,15 +11,15 @@
"collisionTolerance": 0, "collisionTolerance": 0,
"swfPrecision": 2.525, "swfPrecision": 2.525,
"bbox_left": 0, "bbox_left": 0,
"bbox_right": 15, "bbox_right": 31,
"bbox_top": 0, "bbox_top": 0,
"bbox_bottom": 15, "bbox_bottom": 31,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
"DynamicTexturePage": false, "DynamicTexturePage": false,
"width": 16, "width": 32,
"height": 16, "height": 32,
"textureGroupId": { "textureGroupId": {
"name": "Default", "name": "Default",
"path": "texturegroups/Default", "path": "texturegroups/Default",
@ -58,8 +58,8 @@
"backdropHeight": 768, "backdropHeight": 768,
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 8, "xorigin": 16,
"yorigin": 8, "yorigin": 16,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 138 B

View file

@ -11,15 +11,15 @@
"collisionTolerance": 0, "collisionTolerance": 0,
"swfPrecision": 2.525, "swfPrecision": 2.525,
"bbox_left": 0, "bbox_left": 0,
"bbox_right": 15, "bbox_right": 31,
"bbox_top": 0, "bbox_top": 0,
"bbox_bottom": 15, "bbox_bottom": 31,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
"DynamicTexturePage": false, "DynamicTexturePage": false,
"width": 16, "width": 32,
"height": 16, "height": 32,
"textureGroupId": { "textureGroupId": {
"name": "Default", "name": "Default",
"path": "texturegroups/Default", "path": "texturegroups/Default",
@ -58,8 +58,8 @@
"backdropHeight": 768, "backdropHeight": 768,
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 8, "xorigin": 16,
"yorigin": 8, "yorigin": 16,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 107 B

View file

@ -11,15 +11,15 @@
"collisionTolerance": 0, "collisionTolerance": 0,
"swfPrecision": 2.525, "swfPrecision": 2.525,
"bbox_left": 0, "bbox_left": 0,
"bbox_right": 15, "bbox_right": 31,
"bbox_top": 0, "bbox_top": 0,
"bbox_bottom": 15, "bbox_bottom": 31,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
"DynamicTexturePage": false, "DynamicTexturePage": false,
"width": 16, "width": 32,
"height": 16, "height": 32,
"textureGroupId": { "textureGroupId": {
"name": "Default", "name": "Default",
"path": "texturegroups/Default", "path": "texturegroups/Default",
@ -58,8 +58,8 @@
"backdropHeight": 768, "backdropHeight": 768,
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 8, "xorigin": 16,
"yorigin": 8, "yorigin": 16,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

View file

Before

Width:  |  Height:  |  Size: 424 B

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

View file

@ -28,8 +28,8 @@
"gridX": 0, "gridX": 0,
"gridY": 0, "gridY": 0,
"frames": [ "frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"e4475301-6b04-4220-b7f8-2d7e31d08f22",}, {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"c4775ddb-4a2a-4259-97dc-67f7fcd5652a",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"39d0addc-91f5-48d7-bb9a-c12c1bc4f01d",}, {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"bae26338-1240-4d68-8f0d-114398dd8785",},
], ],
"sequence": { "sequence": {
"resourceType": "GMSequence", "resourceType": "GMSequence",
@ -46,8 +46,8 @@
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",}, "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [ "tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"7c7f88a1-7aee-450a-8b1b-3fe4b952f0c8","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"e4475301-6b04-4220-b7f8-2d7e31d08f22","path":"sprites/s_noti_icon_log/s_noti_icon_log.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",}, {"id":"b0d7c8e6-cf35-4fed-a924-0f78a4ad8e70","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"c4775ddb-4a2a-4259-97dc-67f7fcd5652a","path":"sprites/s_noti_icon_log/s_noti_icon_log.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
{"id":"04455ebb-f0aa-463c-8850-9cd7b7d8ffa9","Key":1.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"39d0addc-91f5-48d7-bb9a-c12c1bc4f01d","path":"sprites/s_noti_icon_log/s_noti_icon_log.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",}, {"id":"0df1203b-c923-4a21-8501-49e46bb51d18","Key":1.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"bae26338-1240-4d68-8f0d-114398dd8785","path":"sprites/s_noti_icon_log/s_noti_icon_log.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
], ],
"visibleRange": null, "visibleRange": null,
@ -66,7 +66,7 @@
"eventStubScript": null, "eventStubScript": null,
}, },
"layers": [ "layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"05d048c4-20eb-4f16-9e0a-1f075199daae","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"89a6fc0f-5321-47a5-b4a2-f77ec2823406","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
], ],
"nineSlice": null, "nineSlice": null,
"parent": { "parent": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

View file

@ -10,16 +10,16 @@
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
"swfPrecision": 2.525, "swfPrecision": 2.525,
"bbox_left": 9, "bbox_left": 8,
"bbox_right": 29, "bbox_right": 31,
"bbox_top": 0, "bbox_top": 0,
"bbox_bottom": 39, "bbox_bottom": 63,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
"DynamicTexturePage": false, "DynamicTexturePage": false,
"width": 40, "width": 40,
"height": 40, "height": 64,
"textureGroupId": { "textureGroupId": {
"name": "Default", "name": "Default",
"path": "texturegroups/Default", "path": "texturegroups/Default",
@ -28,8 +28,8 @@
"gridX": 0, "gridX": 0,
"gridY": 0, "gridY": 0,
"frames": [ "frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"13137766-a784-4cee-afa7-44894e418075",}, {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"6fdcfe59-a47f-4a1d-b0c1-2239b4471118",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"ce97c34d-153f-4c91-a658-deed8cb4d878",}, {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"bcaf2c87-93be-4845-b6e5-cc4bfc4ffbb7",},
], ],
"sequence": { "sequence": {
"resourceType": "GMSequence", "resourceType": "GMSequence",
@ -46,8 +46,8 @@
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",}, "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [ "tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"246e5d7b-d7e8-4190-8a1d-2294f7a22930","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"13137766-a784-4cee-afa7-44894e418075","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",}, {"id":"33f189e4-f7ab-4181-b7a3-d47a3b961ac2","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"6fdcfe59-a47f-4a1d-b0c1-2239b4471118","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
{"id":"bcf2ddf6-2895-4da2-86aa-b367032a2365","Key":1.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"ce97c34d-153f-4c91-a658-deed8cb4d878","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",}, {"id":"397e0105-4bf5-456b-836c-e4360188b823","Key":1.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"bcaf2c87-93be-4845-b6e5-cc4bfc4ffbb7","path":"sprites/s_prop_gradient/s_prop_gradient.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
], ],
"visibleRange": null, "visibleRange": null,
@ -61,12 +61,12 @@
"backdropXOffset": 0.0, "backdropXOffset": 0.0,
"backdropYOffset": 0.0, "backdropYOffset": 0.0,
"xorigin": 20, "xorigin": 20,
"yorigin": 20, "yorigin": 32,
"eventToFunction": {}, "eventToFunction": {},
"eventStubScript": null, "eventStubScript": null,
}, },
"layers": [ "layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"3e0080ca-d344-4374-8767-b056a4798c2d","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"dda89253-cfae-4568-9db2-1d5ce7e9cc16","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
], ],
"nineSlice": null, "nineSlice": null,
"parent": { "parent": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

View file

@ -10,10 +10,10 @@
"edgeFiltering": false, "edgeFiltering": false,
"collisionTolerance": 0, "collisionTolerance": 0,
"swfPrecision": 2.525, "swfPrecision": 2.525,
"bbox_left": 1, "bbox_left": 0,
"bbox_right": 29, "bbox_right": 29,
"bbox_top": 2, "bbox_top": 2,
"bbox_bottom": 30, "bbox_bottom": 31,
"HTile": false, "HTile": false,
"VTile": false, "VTile": false,
"For3D": false, "For3D": false,
@ -28,7 +28,7 @@
"gridX": 0, "gridX": 0,
"gridY": 0, "gridY": 0,
"frames": [ "frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"75fc5c18-1190-4bdc-a93a-90840df417f4",}, {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d082383f-2f78-41a5-a292-252b6c4ce55e",},
], ],
"sequence": { "sequence": {
"resourceType": "GMSequence", "resourceType": "GMSequence",
@ -45,7 +45,7 @@
"moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",}, "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore<MomentsEventKeyframe>",},
"tracks": [ "tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[
{"id":"bc6da1e8-56ba-4e9c-a2fc-d84584f2036a","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"75fc5c18-1190-4bdc-a93a-90840df417f4","path":"sprites/s_timeline_graph/s_timeline_graph.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",}, {"id":"d040c969-a840-4b79-8e50-e744a958370c","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"d082383f-2f78-41a5-a292-252b6c4ce55e","path":"sprites/s_timeline_graph/s_timeline_graph.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe<SpriteFrameKeyframe>",},
],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore<SpriteFrameKeyframe>",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],},
], ],
"visibleRange": null, "visibleRange": null,
@ -64,7 +64,7 @@
"eventStubScript": null, "eventStubScript": null,
}, },
"layers": [ "layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"0e641c29-cf6c-41af-8ce1-4631084d3b49","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"a91426c8-2a05-438a-a81e-5ec6f002904d","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",},
], ],
"nineSlice": null, "nineSlice": null,
"parent": { "parent": {