diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index ed937bc0c..5e1a2cb32 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -76,7 +76,7 @@ {"name":"vector","order":4,"path":"folders/functions/vector.yy",}, {"name":"window","order":27,"path":"folders/functions/window.yy",}, {"name":"main","order":1,"path":"folders/main.yy",}, - {"name":"startup scripts","order":2,"path":"folders/main/startup scripts.yy",}, + {"name":"components","order":2,"path":"folders/main/components.yy",}, {"name":"nodes","order":3,"path":"folders/nodes.yy",}, {"name":"data","order":1,"path":"folders/nodes/data.yy",}, {"name":"3D","order":8,"path":"folders/nodes/data/3D.yy",}, @@ -377,6 +377,7 @@ {"name":"o_dialog_panel","order":13,"path":"objects/o_dialog_panel/o_dialog_panel.yy",}, {"name":"s_node_vfx","order":9,"path":"sprites/s_node_vfx/s_node_vfx.yy",}, {"name":"fd_rectangle_get_velocity_maccormack_weight","order":23,"path":"scripts/fd_rectangle_get_velocity_maccormack_weight/fd_rectangle_get_velocity_maccormack_weight.yy",}, + {"name":"note_data","order":19,"path":"scripts/note_data/note_data.yy",}, {"name":"sh_fd_advect_material_rgba_8_glsl","order":5,"path":"shaders/sh_fd_advect_material_rgba_8_glsl/sh_fd_advect_material_rgba_8_glsl.yy",}, {"name":"addon_function","order":3,"path":"scripts/addon_function/addon_function.yy",}, {"name":"node_armature_bind","order":1,"path":"scripts/node_armature_bind/node_armature_bind.yy",}, @@ -578,6 +579,7 @@ {"name":"surface_valid","order":6,"path":"scripts/surface_valid/surface_valid.yy",}, {"name":"sh_blur_zoom","order":5,"path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",}, {"name":"node_isosurf","order":4,"path":"scripts/node_isosurf/node_isosurf.yy",}, + {"name":"__add_node_item","order":13,"path":"scripts/__add_node_item/__add_node_item.yy",}, {"name":"node_VFX_renderer","order":3,"path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",}, {"name":"s_node_pb_fx_stack","order":2,"path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",}, {"name":"fd_draw_sprite_to_collision_mask_surface","order":1,"path":"scripts/fd_draw_sprite_to_collision_mask_surface/fd_draw_sprite_to_collision_mask_surface.yy",}, @@ -620,6 +622,7 @@ {"name":"pack_bottom_left","order":2,"path":"scripts/pack_bottom_left/pack_bottom_left.yy",}, {"name":"o_dialog_lua_reference","order":5,"path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",}, {"name":"__node_custom","order":14,"path":"scripts/__node_custom/__node_custom.yy",}, + {"name":"s_node_note","order":35,"path":"sprites/s_node_note/s_node_note.yy",}, {"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",}, {"name":"load_palette","order":3,"path":"scripts/load_palette/load_palette.yy",}, {"name":"luaHighlight","order":1,"path":"scripts/luaHighlight/luaHighlight.yy",}, @@ -1202,6 +1205,7 @@ {"name":"sh_dilate","order":4,"path":"shaders/sh_dilate/sh_dilate.yy",}, {"name":"node_image_sequence","order":1,"path":"scripts/node_image_sequence/node_image_sequence.yy",}, {"name":"node_text_file_read","order":7,"path":"scripts/node_text_file_read/node_text_file_read.yy",}, + {"name":"node_note","order":17,"path":"scripts/node_note/node_note.yy",}, {"name":"node_pb_box_divide_grid","order":7,"path":"scripts/node_pb_box_divide_grid/node_pb_box_divide_grid.yy",}, {"name":"panel_preview_onion_setting","order":7,"path":"scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy",}, {"name":"d3d_cylinder","order":2,"path":"scripts/d3d_cylinder/d3d_cylinder.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 895d8a710..b34944f82 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -99,7 +99,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"vector","folderPath":"folders/functions/vector.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"window","folderPath":"folders/functions/window.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"main","folderPath":"folders/main.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"startup scripts","folderPath":"folders/main/startup scripts.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"components","folderPath":"folders/main/components.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"nodes","folderPath":"folders/nodes.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"data","folderPath":"folders/nodes/data.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"__base__","folderPath":"folders/nodes/data/__base__.yy",}, @@ -319,6 +319,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animate_clock_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animate_node_go.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animate_onion_skin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animate_prop_go.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animation_setting.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animation_stretch.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_animation_timing.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, @@ -531,9 +532,17 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junction_name_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_outline_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_outline.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_new_badge.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_note_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_note_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_note_resize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_note_selecting.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_note_title.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_state.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, @@ -938,6 +947,7 @@ {"id":{"name":"s_node_vfx","path":"sprites/s_node_vfx/s_node_vfx.yy",},}, {"id":{"name":"fd_rectangle_get_velocity_maccormack_weight","path":"scripts/fd_rectangle_get_velocity_maccormack_weight/fd_rectangle_get_velocity_maccormack_weight.yy",},}, {"id":{"name":"s_node_mesh_path","path":"sprites/s_node_mesh_path/s_node_mesh_path.yy",},}, + {"id":{"name":"note_data","path":"scripts/note_data/note_data.yy",},}, {"id":{"name":"sh_fd_advect_material_rgba_8_glsl","path":"shaders/sh_fd_advect_material_rgba_8_glsl/sh_fd_advect_material_rgba_8_glsl.yy",},}, {"id":{"name":"addon_function","path":"scripts/addon_function/addon_function.yy",},}, {"id":{"name":"node_armature_bind","path":"scripts/node_armature_bind/node_armature_bind.yy",},}, @@ -1164,6 +1174,7 @@ {"id":{"name":"steam_ugc_collection","path":"scripts/steam_ugc_collection/steam_ugc_collection.yy",},}, {"id":{"name":"sh_blur_zoom","path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",},}, {"id":{"name":"node_isosurf","path":"scripts/node_isosurf/node_isosurf.yy",},}, + {"id":{"name":"__add_node_item","path":"scripts/__add_node_item/__add_node_item.yy",},}, {"id":{"name":"node_VFX_renderer","path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},}, {"id":{"name":"s_node_pb_fx_stack","path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",},}, {"id":{"name":"fd_draw_sprite_to_collision_mask_surface","path":"scripts/fd_draw_sprite_to_collision_mask_surface/fd_draw_sprite_to_collision_mask_surface.yy",},}, @@ -1215,6 +1226,7 @@ {"id":{"name":"o_dialog_lua_reference","path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",},}, {"id":{"name":"__node_custom","path":"scripts/__node_custom/__node_custom.yy",},}, {"id":{"name":"node_surface_data","path":"scripts/node_surface_data/node_surface_data.yy",},}, + {"id":{"name":"s_node_note","path":"sprites/s_node_note/s_node_note.yy",},}, {"id":{"name":"node_strand_gravity","path":"scripts/node_strand_gravity/node_strand_gravity.yy",},}, {"id":{"name":"load_palette","path":"scripts/load_palette/load_palette.yy",},}, {"id":{"name":"sh_alpha_cutoff","path":"shaders/sh_alpha_cutoff/sh_alpha_cutoff.yy",},}, @@ -1870,6 +1882,7 @@ {"id":{"name":"sh_dilate","path":"shaders/sh_dilate/sh_dilate.yy",},}, {"id":{"name":"node_image_sequence","path":"scripts/node_image_sequence/node_image_sequence.yy",},}, {"id":{"name":"node_text_file_read","path":"scripts/node_text_file_read/node_text_file_read.yy",},}, + {"id":{"name":"node_note","path":"scripts/node_note/node_note.yy",},}, {"id":{"name":"s_menu_transparent","path":"sprites/s_menu_transparent/s_menu_transparent.yy",},}, {"id":{"name":"node_pb_box_divide_grid","path":"scripts/node_pb_box_divide_grid/node_pb_box_divide_grid.yy",},}, {"id":{"name":"draw_tooltip","path":"scripts/draw_tooltip/draw_tooltip.yy",},}, diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index 1e62a9915..275534e97 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index aa6a06285..261f6eedf 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -54,6 +54,8 @@ event_inherited(); #endregion function rightClick(node) { #region + if(!is_instanceof(node, NodeObject)) return; + node_menu_selecting = node; var fav = array_exists(global.FAV_NODES, node.node); @@ -133,10 +135,20 @@ event_inherited(); return; } + if(is_instanceof(_node, AddNodeItem)) { + _node.onClick({ + node_called, + junction_hovering + }); + instance_destroy(o_dialog_menubox); + instance_destroy(); + return; + } + var _new_node = noone; var _inputs = 0, _outputs = 0; - if(instanceof(_node) == "NodeObject") { + if(is_instanceof(_node, NodeObject)) { _new_node = _node.build(node_target_x, node_target_y,, _param); if(!_new_node) { instance_destroy(); @@ -153,7 +165,7 @@ event_inherited(); _inputs = _new_node.inputs; _outputs = _new_node.outputs; - } else if(instanceof(_node) == "NodeAction") { + } else if(is_instanceof(_node, NodeAction)) { var res = _node.build(node_target_x, node_target_y,, _param); if(_node.inputNode != noone) @@ -413,10 +425,12 @@ event_inherited(); var _boxx = _nx + (grid_width - grid_size) / 2; BLEND_OVERRIDE; - if(instanceof(_node) == "NodeObject") + if(is_instanceof(_node, NodeObject)) draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size); - else if(instanceof(_node) == "NodeAction") - draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS._main_value_positive, 1); + else if(is_instanceof(_node, NodeAction)) + draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_action, 1); + else if(is_instanceof(_node, AddNodeItem)) + draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_generic, 1); else draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.dialog_add_node_collection, 1); BLEND_NORMAL; @@ -436,8 +450,8 @@ event_inherited(); if(sprite_exists(_node.spr)) draw_sprite_ui_uniform(_node.spr, 0, spr_x, spr_y, 0.5); - if(instanceof(_node) == "NodeAction") - draw_sprite_ui_uniform(THEME.play_action, 0, _boxx + grid_size - 16, yy + grid_size - 16, 1, COLORS._main_value_positive); + if(is_instanceof(_node, NodeAction)) + draw_sprite_ui_uniform(THEME.play_action, 0, _boxx + grid_size - 16, yy + grid_size - 16, 1, COLORS.add_node_blend_action); if(_node.getTooltip() != "") { if(point_in_rectangle(_m[0], _m[1], _boxx, yy, _boxx + ui(16), yy + ui(16))) { @@ -459,10 +473,11 @@ event_inherited(); draw_sprite_ui_uniform(THEME.node_deprecated_badge, 1, _boxx + grid_size - ui(12), yy + ui(6)); } - var fav = array_exists(global.FAV_NODES, _node.node); - if(fav) - draw_sprite_ui_uniform(THEME.star, 0, _boxx + grid_size - ui(10), yy + grid_size - ui(10), 0.7, COLORS._main_accent, 1.); - + if(is_instanceof(_node, NodeObject)) { + var fav = array_exists(global.FAV_NODES, _node.node); + if(fav) draw_sprite_ui_uniform(THEME.star, 0, _boxx + grid_size - ui(10), yy + grid_size - ui(10), 0.7, COLORS._main_accent, 1.); + } + draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text); draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.getName(), -1, grid_width); @@ -549,8 +564,10 @@ event_inherited(); rightClick(_node); } - var fav = array_exists(global.FAV_NODES, _node.node); - if(fav) draw_sprite_ui_uniform(THEME.star, 0, ui(20), yy + list_height / 2, 0.7, COLORS._main_accent, 1.); + if(is_instanceof(_node, NodeObject)) { + var fav = array_exists(global.FAV_NODES, _node.node); + if(fav) draw_sprite_ui_uniform(THEME.star, 0, ui(20), yy + list_height / 2, 0.7, COLORS._main_accent, 1.); + } var spr_x = list_height / 2 + ui(32); var spr_y = yy + list_height / 2; @@ -561,8 +578,8 @@ event_inherited(); draw_sprite_ext(_node.spr, 0, spr_x, spr_y, ss, ss, 0, c_white, 1); } - if(instanceof(_node) == "NodeAction") - draw_sprite_ui_uniform(THEME.play_action, 0, spr_x + list_height / 2 - 8, spr_y + list_height / 2 - 8, 0.5, COLORS._main_value_positive); + if(is_instanceof(_node, NodeAction)) + draw_sprite_ui_uniform(THEME.play_action, 0, spr_x + list_height / 2 - 8, spr_y + list_height / 2 - 8, 0.5, COLORS.add_node_blend_action); var tx = list_height + ui(40); @@ -667,7 +684,7 @@ event_inherited(); var _node = _content[| j]; if(is_string(_node)) continue; - if(ds_map_exists(search_map, _node.node)) continue; + if(ds_map_exists(search_map, _node)) continue; if(struct_try_get(_node, "deprecated")) continue; var match = string_partial_match(string_lower(_node.getName()), search_lower); @@ -683,7 +700,7 @@ event_inherited(); if(match == -9999) continue; ds_priority_add(pr_list, [_node, param], match); - search_map[? _node.node] = 1; + search_map[? _node] = 1; } } @@ -747,10 +764,12 @@ event_inherited(); var _boxx = _nx + (grid_width - grid_size) / 2; BLEND_OVERRIDE; - if(instanceof(_node) == "NodeObject") + if(is_instanceof(_node, NodeObject)) draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size); - else if(instanceof(_node) == "NodeAction") - draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS._main_value_positive, 1); + else if(is_instanceof(_node, NodeAction)) + draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_action, 1); + else if(is_instanceof(_node, AddNodeItem)) + draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_generic, 1); else draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.dialog_add_node_collection, 1); BLEND_NORMAL; @@ -773,8 +792,8 @@ event_inherited(); draw_sprite_ext(_node.spr, _si, _sx, _sy, _ss, _ss, 0, c_white, 1); } - if(instanceof(_node) == "NodeAction") - draw_sprite_ui_uniform(THEME.play_action, 0, _boxx + grid_size - 16, yy + grid_size - 16, 1, COLORS._main_value_positive); + if(is_instanceof(_node, NodeAction)) + draw_sprite_ui_uniform(THEME.play_action, 0, _boxx + grid_size - 16, yy + grid_size - 16, 1, COLORS.add_node_blend_action); draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text); var txt = _node.getName(); @@ -804,10 +823,11 @@ event_inherited(); } else draw_sprite_ui_uniform(THEME.info, 0, _boxx + ui(8), yy + ui(8), 0.7, COLORS._main_icon, 0.5); } - var fav = struct_has(_node, "node") && array_exists(global.FAV_NODES, _node.node); - if(fav) - draw_sprite_ui_uniform(THEME.star, 0, _boxx + grid_size - ui(10), yy + grid_size - ui(10), 0.7, COLORS._main_accent, 1.); - + if(is_instanceof(_node, NodeObject)) { + var fav = struct_has(_node, "node") && array_exists(global.FAV_NODES, _node.node); + if(fav) draw_sprite_ui_uniform(THEME.star, 0, _boxx + grid_size - ui(10), yy + grid_size - ui(10), 0.7, COLORS._main_accent, 1.); + } + if(node_focusing == i) search_pane.scroll_y_to = -max(0, hh - search_pane.h); @@ -857,12 +877,14 @@ event_inherited(); draw_sprite_ext(_node.spr, _si, _sx, _sy, _ss, _ss, 0, c_white, 1); - if(instanceof(_node) == "NodeAction") - draw_sprite_ui_uniform(THEME.play_action, 0, _sx + list_height / 2 - 8, _sy + list_height / 2 - 8, 0.5, COLORS._main_value_positive); + if(is_instanceof(_node, NodeAction)) + draw_sprite_ui_uniform(THEME.play_action, 0, _sx + list_height / 2 - 8, _sy + list_height / 2 - 8, 0.5, COLORS.add_node_blend_action); } - var fav = struct_has(_node, "node") && array_exists(global.FAV_NODES, _node.node); - if(fav) draw_sprite_ui_uniform(THEME.star, 0, ui(20), yy + list_height / 2, 0.7, COLORS._main_accent, 1.); + if(is_instanceof(_node, NodeObject)) { + var fav = struct_has(_node, "node") && array_exists(global.FAV_NODES, _node.node); + if(fav) draw_sprite_ui_uniform(THEME.star, 0, ui(20), yy + list_height / 2, 0.7, COLORS._main_accent, 1.); + } draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); draw_text_add(list_height + ui(40), yy + list_height / 2, _node.getName()); diff --git a/objects/o_main/Draw_64.gml b/objects/o_main/Draw_64.gml index e3e5c459a..4ab4bc59a 100644 --- a/objects/o_main/Draw_64.gml +++ b/objects/o_main/Draw_64.gml @@ -1,12 +1,14 @@ /// @description init draw_clear(COLORS.bg); -if(OS == os_windows && gameframe_is_minimized()) { - //gameframe_update(); - exit; -} else if(OS == os_macosx) { - mac_window_step(); -} +#region gameframe + if(OS == os_windows && gameframe_is_minimized()) { + //gameframe_update(); + exit; + } else if(OS == os_macosx) { + mac_window_step(); + } +#endregion #region widget scroll if(!WIDGET_TAB_BLOCK) { @@ -47,6 +49,11 @@ if(OS == os_windows && gameframe_is_minimized()) { gameframe_update(); #endregion +#region notes + for( var i = 0, n = array_length(PROJECT.notes); i < n; i++ ) + PROJECT.notes[i].draw(); +#endregion + #region window var pd = gameframe_resize_padding; diff --git a/scripts/__add_node_item/__add_node_item.gml b/scripts/__add_node_item/__add_node_item.gml new file mode 100644 index 000000000..bd56df76a --- /dev/null +++ b/scripts/__add_node_item/__add_node_item.gml @@ -0,0 +1,24 @@ +function AddNodeItem() constructor { + name = ""; + spr = noone; + tags = []; + + tooltip = ""; + tooltip_spr = noone; + new_node = false; + + onClick = -1; + + static getName = function() { return name; } + static getTooltip = function() { return tooltip; } +} + +function addNodeItem(list, name, spr, onClick) { + var item = new AddNodeItem(); + item.name = name; + item.spr = spr; + item.onClick = onClick; + + ds_list_add(list, item); + return item; +} \ No newline at end of file diff --git a/scripts/__add_node_item/__add_node_item.yy b/scripts/__add_node_item/__add_node_item.yy new file mode 100644 index 000000000..21c11df6f --- /dev/null +++ b/scripts/__add_node_item/__add_node_item.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__add_node_item", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "__base__", + "path": "folders/nodes/data/__base__.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node/__node.gml b/scripts/__node/__node.gml index 1c4ccff53..e76bd0cda 100644 --- a/scripts/__node/__node.gml +++ b/scripts/__node/__node.gml @@ -5,6 +5,7 @@ function __Node_Base(x, y) constructor { display_name = ""; inputs = ds_list_create(); outputs = ds_list_create(); + input_value_map = {}; active_index = -1; preview_index = 0; diff --git a/scripts/action_loader/action_loader.yy b/scripts/action_loader/action_loader.yy index 79acfbcbe..f17782b7f 100644 --- a/scripts/action_loader/action_loader.yy +++ b/scripts/action_loader/action_loader.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/assets_data/assets_data.yy b/scripts/assets_data/assets_data.yy index bd503435f..070ed0786 100644 --- a/scripts/assets_data/assets_data.yy +++ b/scripts/assets_data/assets_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/collection_data/collection_data.yy b/scripts/collection_data/collection_data.yy index da4974e53..99a6d90ee 100644 --- a/scripts/collection_data/collection_data.yy +++ b/scripts/collection_data/collection_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/color_loader/color_loader.yy b/scripts/color_loader/color_loader.yy index 1c069d3f3..3c15324fc 100644 --- a/scripts/color_loader/color_loader.yy +++ b/scripts/color_loader/color_loader.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/event_recorder/event_recorder.yy b/scripts/event_recorder/event_recorder.yy index 741e5796e..a0c91a8f3 100644 --- a/scripts/event_recorder/event_recorder.yy +++ b/scripts/event_recorder/event_recorder.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/font_data/font_data.yy b/scripts/font_data/font_data.yy index 4b004e1b8..f17c455c9 100644 --- a/scripts/font_data/font_data.yy +++ b/scripts/font_data/font_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/globals/globals.yy b/scripts/globals/globals.yy index c162413d8..aa49f7847 100644 --- a/scripts/globals/globals.yy +++ b/scripts/globals/globals.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/hotkey_data/hotkey_data.yy b/scripts/hotkey_data/hotkey_data.yy index 8c9a20a33..a1e19c929 100644 --- a/scripts/hotkey_data/hotkey_data.yy +++ b/scripts/hotkey_data/hotkey_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/load_function/load_function.gml b/scripts/load_function/load_function.gml index eb6447de1..bbe873983 100644 --- a/scripts/load_function/load_function.gml +++ b/scripts/load_function/load_function.gml @@ -135,6 +135,12 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false, override = false if(struct_has(_load_content, "attributes")) struct_override(PROJECT.attributes, _load_content.attributes); + if(struct_has(_load_content, "notes")) { + PROJECT.notes = array_create(array_length(_load_content.notes)); + for( var i = 0, n = array_length(_load_content.notes); i < n; i++ ) + PROJECT.notes[i] = new Note.deserialize(_load_content.notes[i]); + } + try { if(struct_has(_load_content, "metadata")) METADATA.deserialize(_load_content.metadata); diff --git a/scripts/locale_data/locale_data.yy b/scripts/locale_data/locale_data.yy index 24c00e483..c87a8bf59 100644 --- a/scripts/locale_data/locale_data.yy +++ b/scripts/locale_data/locale_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/meta_data/meta_data.yy b/scripts/meta_data/meta_data.yy index 810b9e739..5f2ac9fd5 100644 --- a/scripts/meta_data/meta_data.yy +++ b/scripts/meta_data/meta_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 3f45b3766..8b4dd405a 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -74,12 +74,19 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc cc = expValid? COLORS._main_value_positive : COLORS._main_value_negative; } - if(global_var) - if(string_pos(" ", _name)) cc = COLORS._main_value_negative; + if(global_var) if(string_pos(" ", _name)) cc = COLORS._main_value_negative; - draw_set_text(breakLine? f_p0 : f_p1, fa_left, fa_center, cc); - draw_text_add(xx + ui(40), lb_y - ui(2), _name); + draw_set_text(f_p0, fa_left, fa_center, cc); var lb_w = string_width(_name) + ui(48); + var lb_x = xx + ui(40); + + if(jun.color != -1) { #region + draw_sprite_ext(THEME.timeline_color, 1, lb_x + ui(8), lb_y, 1, 1, 0, jun.color, 1); + lb_x += ui(24); + lb_w += ui(24); + } #endregion + + draw_text_add(lb_x, lb_y - ui(2), _name); #region tooltip if(jun.tooltip != "") { diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 11dc6f210..37076c7c3 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -352,7 +352,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x return array_exists(global.loop_nodes, instanceof(group)); } #endregion - static move = function(_x, _y) { #region + static move = function(_x, _y, _s) { #region if(x == _x && y == _y) return; x = _x; @@ -730,8 +730,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var aa = 0.25 + 0.5 * renderActive; if(!isHighlightingInGraph()) aa *= 0.25; + var cc = timeline_item.color == -1? color : timeline_item.color; - draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, color, aa); + draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, cc, aa); } #endregion static drawGetBbox = function(xx, yy, _s) { #region @@ -769,8 +770,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var aa = 0.25 + 0.5 * renderActive; if(!isHighlightingInGraph()) aa *= 0.25; + var cc = timeline_item.color == -1? color : timeline_item.color; - draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), color, aa); + draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), cc, aa); var cc = COLORS._main_text; if(PREF_MAP[? "node_show_render_status"] && !rendered) @@ -838,14 +840,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static drawJunctionNames = function(_x, _y, _mx, _my, _s) { #region if(draw_graph_culled) return; if(!active) return; + var amo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); var jun; var xx = x * _s + _x; var yy = y * _s + _y; - show_input_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s); - show_output_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s); + var _hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == self); + show_input_name = _hov && point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s); + show_output_name = _hov && point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s); if(show_input_name) { for(var i = 0; i < amo; i++) { diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index a0a74ace4..ba132ecb6 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -144,7 +144,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _dtype = getInputData(0); var _range = getInputData(1); var _type = getInputData(2); - var _val_type = data_type_map[_type]; + var _val_type = array_safe_get(data_type_map, _type, VALUE_TYPE.any); var _enum_label = getInputData(3); var _vec_size = getInputData(4); var _step = getInputData(7); @@ -296,7 +296,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru if(is_undefined(inParent)) return; var _type = getInputData(2); - var _val_type = data_type_map[_type]; + var _val_type = array_safe_get(data_type_map, _type, VALUE_TYPE.any); inputs[| 0].display_data.data = array_safe_get(display_list, _val_type); inputs[| 0].editWidget.data_list = array_safe_get(display_list, _val_type); @@ -330,7 +330,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _data = getInputData(2); _dstype = array_safe_get(array_safe_get(display_list, _data, []), _dstype); - var _datype = data_type_map[_data]; + var _datype = array_safe_get(data_type_map, _data, VALUE_TYPE.any); inputs[| 1].setVisible(false); inputs[| 3].setVisible(false); diff --git a/scripts/node_note/node_checkerboard.yy b/scripts/node_note/node_checkerboard.yy new file mode 100644 index 000000000..f65eb196c --- /dev/null +++ b/scripts/node_note/node_checkerboard.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "generator", + "path": "folders/nodes/data/generator.yy", + }, + "resourceVersion": "1.0", + "name": "node_checkerboard", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_note/node_note.gml b/scripts/node_note/node_note.gml new file mode 100644 index 000000000..6688a2142 --- /dev/null +++ b/scripts/node_note/node_note.gml @@ -0,0 +1,187 @@ +function Node_Note(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "New Note"; + w = 240; + h = 160; + alpha = 1; + bg_spr = THEME.node_note_bg; + bg_sel_spr = THEME.node_note_selecting; + + size_dragging = false; + size_dragging_w = w; + size_dragging_h = h; + size_dragging_mx = w; + size_dragging_my = h; + + auto_height = false; + name_hover = false; + hover_progress = 0; + + color = c_white; + text_color = c_black; + alpha = 1; + content = ""; + attributes.expand = true; + + inputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 240, 160 ] ) + .setDisplay(VALUE_DISPLAY.vector) + .rejectArray(); + + inputs[| 1] = nodeValue("BG Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, CDEF.yellow ) + .rejectArray(); + + inputs[| 2] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 ) + .setDisplay(VALUE_DISPLAY.slider) + .rejectArray(); + + inputs[| 3] = nodeValue("Content", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" ) + .rejectArray(); + + inputs[| 4] = nodeValue("Text Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black ) + .rejectArray(); + + input_display_list = [ 3, 0, 4, 1, 2 ]; + + static move = function(_x, _y, _s) { #region + if(x == _x && y == _y) return; + + var dx = x - _x; + var dy = y - _y; + + x += dx / _s; + y += dy / _s; + + if(!LOADING) PROJECT.modified = true; + } #endregion + + static step = function() { + var si = getInputData(0); + w = si[0]; + h = si[1]; + + color = getInputData(1); + alpha = getInputData(2); + content = getInputData(3); + } + + static drawNodeBase = function(xx, yy) { + if(!attributes.expand) return false; + + draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w, h, color, alpha); + hover_progress = lerp_float(hover_progress, name_hover, 2); + + draw_set_text(f_p0, fa_left, fa_top, text_color); + draw_text_ext_add(round(xx + 8), round(yy + 18), content, -1, w - 16); + + draw_sprite_ext(THEME.node_note_pin, attributes.expand, xx + 10, yy + 10, 1, 1, 0, color, 1); + } + + static drawNode = function(_x, _y, _mx, _my, _s) { + if(size_dragging) { + w = max(32, size_dragging_w + (mouse_mx - size_dragging_mx)); + h = max(32, size_dragging_h + (mouse_my - size_dragging_my)); + if(!key_mod_press(CTRL)) { + w = max(32, round(w / 32) * 32); + h = max(32, round(h / 32) * 32); + } + + if(mouse_release(mb_left)) { + size_dragging = false; + inputs[| 0].setValue([ w, h ]); + } + } + + var xx = x; + var yy = y; + + var x0 = xx; + var y0 = yy; + var x1 = x0 + 16; + var y1 = y0 + 16; + + if(point_in_rectangle(_mx, _my, x0, y0, x1, y1)) { + if(!attributes.expand) TOOLTIP = content; + + if(mouse_press(mb_left)) + attributes.expand = !attributes.expand; + } + + if(!attributes.expand) { + draw_sprite_ext(THEME.node_note_pin, attributes.expand, xx + 10, yy + 10, 1, 1, 0, color, 1); + return false; + } + + drawNodeBase(xx, yy, _s); + + if(active_draw_index > -1) { + draw_sprite_stretched_ext(bg_sel_spr, 0, xx, yy, w, h, COLORS._main_accent, 1); + active_draw_index = -1; + } + + var x1 = xx + w; + var y1 = yy + h; + var x0 = x1 - 16; + var y0 = y1 - 16; + var cc = merge_color(color, c_black, 0.25); + + if(point_in_rectangle(_mx, _my, x0, y0, x1, y1)) { + draw_sprite_ext(THEME.node_note_resize, 1, x1, y1, 1, 1, 0, cc, 1); + PANEL_GRAPH.drag_locking = true; + + if(mouse_press(mb_left)) { + size_dragging = true; + size_dragging_w = w; + size_dragging_h = h; + size_dragging_mx = mouse_mx; + size_dragging_my = mouse_my; + } + } else draw_sprite_ext(THEME.node_note_resize, 0, x1, y1, 1, 1, 0, cc, 1); + + return noone; + } + + static pointIn = function(_x, _y, _mx, _my, _s) { + if(!attributes.expand) return false; + + var xx = x; + var yy = y; + + var x1 = xx + w; + var y1 = yy + h; + var x0 = x1 - 16; + var y0 = y1 - 16; + + var hover = point_in_rectangle(_mx, _my, xx, yy, xx + w, yy + h) && !point_in_rectangle(_mx, _my, x0, y0, x1, y1); + name_hover = hover; + + return hover; + } + + static drawBadge = function(_x, _y, _s) { #region + if(!active) return; + if(!attributes.expand) return false; + + var xx = x + w; + var yy = y; + + badgePreview = lerp_float(badgePreview, !!previewing, 2); + badgeInspect = lerp_float(badgeInspect, inspecting, 2); + + if(badgePreview > 0) { + draw_sprite_ext(THEME.node_state, 0, xx, yy, badgePreview, badgePreview, 0, c_white, 1); + xx -= 28 * badgePreview; + } + + if(badgeInspect > 0) { + draw_sprite_ext(THEME.node_state, 1, xx, yy, badgeInspect, badgeInspect, 0, c_white, 1); + xx -= 28 * badgeInspect; + } + + if(isTool) { + draw_sprite_ext(THEME.node_state, 2, xx, yy, 1, 1, 0, c_white, 1); + xx -= 28 * 2; + } + + inspecting = false; + previewing = 0; + } #endregion +} \ No newline at end of file diff --git a/scripts/node_note/node_note.yy b/scripts/node_note/node_note.yy new file mode 100644 index 000000000..def25ccc2 --- /dev/null +++ b/scripts/node_note/node_note.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_note", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "misc", + "path": "folders/nodes/data/misc.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_note/node_stripe.yy b/scripts/node_note/node_stripe.yy new file mode 100644 index 000000000..3c179d416 --- /dev/null +++ b/scripts/node_note/node_stripe.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "generator", + "path": "folders/nodes/data/generator.yy", + }, + "resourceVersion": "1.0", + "name": "node_stripe", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index 8b2aa2b9c..ca94e3378 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -262,9 +262,12 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var vec = getSingleValue(0,, true); var bbox = drawGetBbox(xx, yy, _s); + var v0 = array_safe_get(vec, 0); + var v1 = array_safe_get(vec, 1); + if(disp == 0 || inputs[| 0].value_from != noone || inputs[| 1].value_from != noone) { draw_set_text(f_h1, fa_center, fa_center, COLORS._main_text); - var str = string(vec[0]) + "\n" + string(vec[1]); + var str = $"{v0}\n{v1}"; var ss = string_scale(str, bbox.w, bbox.h); draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0); return; @@ -300,9 +303,9 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 1); draw_set_alpha(1); - var pin_x = (vec[0] - wd_minx) / (wd_maxx - wd_minx); - var pin_y = (vec[1] - wd_miny) / (wd_maxy - wd_miny); - if(point_in_rectangle(vec[0], vec[1], wd_minx, wd_miny, wd_maxx, wd_maxy)) { + var pin_x = (v0 - wd_minx) / (wd_maxx - wd_minx); + var pin_y = (v1 - wd_miny) / (wd_maxy - wd_miny); + if(point_in_rectangle(v0, v1, wd_minx, wd_miny, wd_maxx, wd_maxy)) { var pin_dx = bbox.x0 + bbox.w * pin_x; var pin_dy = bbox.y1 - bbox.h * pin_y; draw_sprite_ext(THEME.node_coor_pin, 0, pin_dx, pin_dy, 1, 1, 0, c_white, 1); @@ -384,7 +387,7 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c } draw_set_text(f_p2, fa_center, fa_bottom, COLORS._main_text); - var str = "[" + string(vec[0]) + ", " + string(vec[1]) + "]"; + var str = $"[{v0}, {v1}]"; draw_text(bbox.xc, bbox.y1 - 4, str); } } @@ -433,7 +436,11 @@ function Node_Vector3(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { draw_set_text(f_h1, fa_center, fa_center, COLORS._main_text); var vec = getSingleValue(0,, true); - var str = string(vec[0]) + "\n" + string(vec[1]) + "\n" + string(vec[2]); + var v0 = array_safe_get(vec, 0); + var v1 = array_safe_get(vec, 1); + var v2 = array_safe_get(vec, 2); + + var str = $"{v0}\n{v1}\n{v2}"; var bbox = drawGetBbox(xx, yy, _s); var ss = string_scale(str, bbox.w, bbox.h); @@ -488,7 +495,12 @@ function Node_Vector4(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { draw_set_text(f_h1, fa_center, fa_center, COLORS._main_text); var vec = getSingleValue(0,, true); - var str = string(vec[0]) + "\n" + string(vec[1]) + "\n" + string(vec[2]) + "\n" + string(vec[3]); + var v0 = array_safe_get(vec, 0); + var v1 = array_safe_get(vec, 1); + var v2 = array_safe_get(vec, 2); + var v3 = array_safe_get(vec, 3); + + var str = $"{v0}\n{v1}\n{v2}\n{v3}"; var bbox = drawGetBbox(xx, yy, _s); var ss = string_scale(str, bbox.w, bbox.h); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index b77f84091..296f4c167 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -701,7 +701,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio addNodeObject(node, "Widget Test", s_node_print, "Node_Widget_Test", [1, Node_Widget_Test]); ds_list_add(node, "System"); - addNodeObject(node, "Execute Shell", s_node_shell_excecute, "Node_Shell", [1, Node_Shell], ["terminal", "execute", "run"], "Execute shell script.").setVersion(11530); + addNodeObject(node, "Execute Shell", s_node_shell_excecute, "Node_Shell", [1, Node_Shell], ["terminal", "execute", "run"], "Execute shell script.").setVersion(11530); + //addNodeObject(node, "Note", s_node_note, "Node_Note", [1, Node_Note]).setVersion(11530); #endregion var actions = ds_list_create(); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index a36c4f48e..089c717d5 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -139,40 +139,86 @@ enum VALUE_TAG { function value_color(i) { #region static JUNCTION_COLORS = [ - $6691ff, //int - $78e4ff, //float - $5d3f8c, //bool - $5dde8f, //color - $976bff, //surface - $4b00eb, //path - $d1c2c2, //curve - $e3ff66, //text - $b5b5ff, //object - $ffa64d, //node + #ff9166, //int + #ffe478, //float + #8c3f5d, //bool + #8fde5d, //color + #ff6b97, //surface + #eb004b, //path + #c2c2d1, //curve + #66ffe3, //text + #ffb5b5, //object + #4da6ff, //node #c1007c, //3D - $808080, //any - $b5b5ff, //path - $5dde8f, //particle - $e3ff66, //rigid + #808080, //any + #ffb5b5, //path + #8fde5d, //particle + #88ffe9, //rigid #4da6ff, //fdomain - $5d3f8c, //struct - $6691ff, //strand - $d1c2c2, //mesh - $5dde8f, //trigger - $976bff, //atlas + #8c3f5d, //struct + #ff9166, //strand + #c2c2d1, //mesh + #8fde5d, //trigger + #ff6b97, //atlas #c1007c, //d3vertex - $5dde8f, //gradient - $6691ff, //armature - $808080, //buffer - $976bff, //pbBox - $ffa64d, //d3Mesh - $ffa64d, //d3Light - $ffa64d, //d3Camera - $ffa64d, //d3Scene - $976bff, //d3Material - $976bff, //dynaSurf + #8fde5d, //gradient + #ff9166, //armature + #808080, //buffer + #ff6b97, //pbBox + #4da6ff, //d3Mesh + #4da6ff, //d3Light + #4da6ff, //d3Camera + #4da6ff, //d3Scene + #ff6b97, //d3Material + #ff6b97, //dynaSurf #c2c2d1, //PCX - $5dde8f, //audiobit + #8fde5d, //audiobit + ]; + + if(i == 99) return $5dde8f; + return JUNCTION_COLORS[safe_mod(max(0, i), array_length(JUNCTION_COLORS))]; +} #endregion + +function value_color_bg(i) { #region + return #3b3b4e; +} #endregion + +function value_color_bg_array(i) { #region + static JUNCTION_COLORS = [ + #e36956, //int + #ff9166, //float + #5e315b, //bool + #3ca370, //color + #bd4882, //surface + #bb003c, //path + #83839b, //curve + #4da6ff, //text + #e28989, //object + #4b5bab, //node + #64003f, //3D + #4d4d4d, //any + #e28989, //path + #3ca370, //particle + #4da6ff, //rigid + #4b5bab, //fdomain + #5e315b, //struct + #e36956, //strand + #83839b, //mesh + #3ca370, //trigger + #9e2a69, //atlas + #64003f, //d3vertex + #3ca370, //gradient + #e36956, //armature + #4d4d4d, //buffer + #bd4882, //pbBox + #4b5bab, //d3Mesh + #4b5bab, //d3Light + #4b5bab, //d3Camera + #4b5bab, //d3Scene + #bd4882, //d3Material + #bd4882, //dynaSurf + #83839b, //PCX + #3ca370, //audiobit ]; if(i == 99) return $5dde8f; @@ -561,6 +607,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru drag_my = 0; drag_sx = 0; drag_sy = 0; + + color = -1; + color_display = 0; #endregion #region ---- timeline ---- @@ -1891,28 +1940,30 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(!isVisible()) return false; var ss = max(0.25, _s / 2); - var is_hover = false; + var hov = PANEL_GRAPH.pHOVER && (PANEL_GRAPH.node_hovering == noone || PANEL_GRAPH.node_hovering == node); + var is_hover = hov && point_in_circle(_mx, _my, x, y, 10 * _s * sca); - if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s * sca)) { - //var _to = getJunctionTo(); - //var _ss = ""; - //for( var i = 0, n = array_length(_to); i < n; i++ ) - // _ss += (i? ", " : "") + _to[i].internalName; - //TOOLTIP = _ss; - - is_hover = true; - if(type == VALUE_TYPE.action) - junction_drawing = [THEME.node_junction_inspector, 1]; - else - junction_drawing = [isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, draw_junction_index]; + var _bgS = THEME.node_junctions_bg; + var _fgS = is_hover? THEME.node_junctions_outline_hover : THEME.node_junctions_outline; + + var _bgC, _fgC; + + if(color == -1) { + _bgC = isArray()? value_color_bg_array(draw_junction_index) : value_color_bg(draw_junction_index); + _fgC = value_color(draw_junction_index); } else { - if(type == VALUE_TYPE.action) - junction_drawing = [THEME.node_junction_inspector, 0]; - else - junction_drawing = [isArray()? THEME.node_junctions_array : THEME.node_junctions_single, draw_junction_index]; + _bgC = isArray()? merge_color(color, CDEF.main_dkgrey, 0.35) : value_color_bg(draw_junction_index); + _fgC = color; } - draw_sprite_ext(junction_drawing[0], junction_drawing[1], x, y, ss, ss, 0, c_white, 1); + if(type == VALUE_TYPE.action) { + draw_sprite_ext(THEME.node_junction_inspector, is_hover, x, y, ss, ss, 0, c_white, 1); + color_display = #8fde5d; + } else { + draw_sprite_ext(_bgS, draw_junction_index, x, y, ss, ss, 0, _bgC, 1); + draw_sprite_ext(_fgS, draw_junction_index, x, y, ss, ss, 0, _fgC, 1); + color_display = _fgC; + } return is_hover; } #endregion @@ -2065,11 +2116,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _fade = PREF_MAP[? "connection_line_highlight_fade"]; var _colr = _selc? 1 : _fade; - c0 = merge_color(bg, value_color(value_from.type), _colr); - c1 = merge_color(bg, value_color(type), _colr); + c0 = merge_color(bg, value_from.color_display, _colr); + c1 = merge_color(bg, color_display, _colr); } else { - c0 = value_color(value_from.type); - c1 = value_color(type); + c0 = value_from.color_display; + c1 = color_display; } var ss = _s * aa; @@ -2126,7 +2177,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var corner = PREF_MAP[? "connection_line_corner"] * ss; var th = PREF_MAP[? "connection_line_width"] * ss; - var col = value_color(type); + var col = color_display; draw_set_color(col); switch(PREF_MAP[? "curve_connection_line"]) { @@ -2313,6 +2364,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru _map.attributes = attributes; _map.name_custom = name_custom; + _map.color = color; return _map; } #endregion @@ -2341,7 +2393,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru draw_line_shift_y = struct_try_get(_map, "shift_y"); name_custom = struct_try_get(_map, "name_custom", false); - if(name_custom) name = struct_try_get(_map, "name", name); + if(name_custom) name = struct_try_get(_map, "name", name); + color = struct_try_get(_map, "color", -1); animator.deserialize(struct_try_get(_map, "raw_value"), scale); diff --git a/scripts/note_data/note_data.gml b/scripts/note_data/note_data.gml new file mode 100644 index 000000000..31359d9a7 --- /dev/null +++ b/scripts/note_data/note_data.gml @@ -0,0 +1,20 @@ +function Note() constructor { + content = []; + w = 256; + h = 256; + + static draw = function() { + + } + + static serialize = function() { + var _dat = {}; + _dat.content = []; + return _dat; + } + + static deserialize = function(_dat) { + content = _dat.content; + return self; + } +} \ No newline at end of file diff --git a/scripts/note_data/note_data.yy b/scripts/note_data/note_data.yy new file mode 100644 index 000000000..34e927b1d --- /dev/null +++ b/scripts/note_data/note_data.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "note_data", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "components", + "path": "folders/main/components.yy", + }, +} \ No newline at end of file diff --git a/scripts/notification_system/notification_system.yy b/scripts/notification_system/notification_system.yy index 80d6e20f7..4464abd56 100644 --- a/scripts/notification_system/notification_system.yy +++ b/scripts/notification_system/notification_system.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 6cd845b26..72e13356b 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -27,8 +27,8 @@ function Panel_Animation() : PanelContent() constructor { dope_sheet_surface = surface_create_valid(dope_sheet_w, 1); dope_sheet_mask = surface_create_valid(dope_sheet_w, 1); - dope_sheet_name_mask = surface_create_valid(tool_width - ui(16), 1); - dope_sheet_name_surface = surface_create_valid(tool_width - ui(16), 1); + dope_sheet_name_mask = surface_create_valid(tool_width, 1); + dope_sheet_name_surface = surface_create_valid(tool_width, 1); } #endregion initSize(); @@ -92,6 +92,9 @@ function Panel_Animation() : PanelContent() constructor { #region ---- display ---- show_node_outside_context = true; + + tooltip_loop_prop = noone; + tooltip_loop_type = new tooltipSelector(__txtx("panel_animation_looping_mode", "Looping mode"), global.junctionEndName); #endregion #region ---- item hover ---- @@ -285,27 +288,41 @@ function Panel_Animation() : PanelContent() constructor { var _clrs = COLORS.timeline_blend; var _item = array_create(array_length(_clrs)); - + + function setSelectingItemColor(color) { if(context_selecting_item == noone) return; context_selecting_item.item.color = color; } + for( var i = 0, n = array_length(_clrs); i < n; i++ ) { _item[i] = [ [ THEME.timeline_color, i > 0, _clrs[i] ], function(_data) { - context_selecting_item.item.color = _data.color; + setSelectingItemColor(_data.color); }, "", { color: i == 0? -1 : _clrs[i] } ]; } + array_push(_item, [ + [ THEME.timeline_color, 2 ], + function(_data) { + var dialog = dialogCall(o_dialog_color_selector); + dialog.selector.onApply = setSelectingItemColor; + dialog.onApply = setSelectingItemColor; + } + ]); + var clr = menuItemGroup(__txt("Color"), _item); clr.spacing = ui(24); name_menu_item = [ clr, + -1, name_menu_empty[0] ]; name_menu_group = [ clr, menuItem(__txt("Rename"), function() { context_selecting_item.item.rename(); }), + menuItem(__txt("Delete"), function() { context_selecting_item.item.destroy(); }, THEME.cross), + -1, name_menu_empty[0] ]; #endregion @@ -364,19 +381,10 @@ function Panel_Animation() : PanelContent() constructor { function onFocusBegin() { PANEL_ANIMATION = self; } - function onResize() { #region - initSize(); - + function surfaceVerify() { #region if(w - tool_width > 1) { - if(is_surface(timeline_mask) && surface_exists(timeline_mask)) - surface_size_to(timeline_mask, timeline_w, timeline_h); - else - timeline_mask = surface_create_valid(timeline_w, timeline_h); - - if(is_surface(timeline_surface) && surface_exists(timeline_surface)) - surface_size_to(timeline_surface, timeline_w, timeline_h); - else - timeline_surface = surface_create_valid(timeline_w, timeline_h); + timeline_mask = surface_verify(timeline_mask, timeline_w, timeline_h); + timeline_surface = surface_verify(timeline_surface, timeline_w, timeline_h); } dope_sheet_w = timeline_w; @@ -385,15 +393,20 @@ function Panel_Animation() : PanelContent() constructor { dope_sheet_mask = surface_verify(dope_sheet_mask, dope_sheet_w, dope_sheet_h); dope_sheet_surface = surface_verify(dope_sheet_surface, dope_sheet_w, dope_sheet_h); - dope_sheet_name_mask = surface_verify(dope_sheet_name_mask, tool_width, dope_sheet_h); + dope_sheet_name_mask = surface_verify(dope_sheet_name_mask, tool_width, dope_sheet_h); dope_sheet_name_surface = surface_verify(dope_sheet_name_surface, tool_width, dope_sheet_h); } + } #endregion + + function onResize() { #region + initSize(); + + surfaceVerify(); resetTimelineMask(); } #endregion function resetTimelineMask() { #region - if(!surface_exists(timeline_mask)) - timeline_mask = surface_create_valid(timeline_w, timeline_h); + timeline_mask = surface_verify(timeline_mask, timeline_w, timeline_h); surface_set_target(timeline_mask); draw_clear(c_black); @@ -1004,13 +1017,20 @@ function Panel_Animation() : PanelContent() constructor { var tx = tool_width; var ty = animator.y - 1; - var cc = colorMultiply(_item.item.color_cur, COLORS.panel_animation_dope_key_bg); - draw_set_color(cc); + if(prop.show_graph) { + var _y1 = ty + ui(10) + prop.graph_h + ui(8); + var c1 = colorMultiply(_item.item.color_cur, COLORS.panel_animation_dope_key_bg_hover); + draw_set_color(c1); + draw_rectangle(0, ty + ui(10), tx, _y1, false); + } + + var c0 = colorMultiply(_item.item.color_cur, COLORS.panel_animation_dope_key_bg); + draw_set_color(c0); draw_rectangle(0, ty - ui(10), tx, ty + ui(10), false); #region keyframe control tx = tool_width - ui(20 + 16 * 3); - if(buttonInstant(noone, tx - ui(6), ty - ui(6), ui(12), ui(12), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 0, [COLORS._main_icon, COLORS._main_icon_on_inner]) == 2) { + if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 0, [COLORS._main_icon, COLORS._main_icon_on_inner]) == 2) { var _t = -1; for(var k = 0; k < ds_list_size(animator.values); k++) { var _key = animator.values[| k]; @@ -1021,7 +1041,7 @@ function Panel_Animation() : PanelContent() constructor { } tx = tool_width - ui(20 + 16 * 1); - if(buttonInstant(noone, tx - ui(6), ty - ui(6), ui(12), ui(12), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 2, [COLORS._main_icon, COLORS._main_icon_on_inner]) == 2) { + if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 2, [COLORS._main_icon, COLORS._main_icon_on_inner]) == 2) { for(var k = 0; k < ds_list_size(animator.values); k++) { var _key = animator.values[| k]; if(_key.time > CURRENT_FRAME) { @@ -1034,7 +1054,7 @@ function Panel_Animation() : PanelContent() constructor { #region add keyframe tx = tool_width - ui(20 + 16 * 2); - if(buttonInstant(noone, tx - ui(6), ty - ui(6), ui(12), ui(12), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 1, [COLORS._main_accent, COLORS._main_icon_on_inner]) == 2) { + if(buttonInstant(noone, tx - ui(10), ty - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.prop_keyframe, 1, [COLORS._main_accent, COLORS._main_icon_on_inner]) == 2) { var _add = false; for(var k = 0; k < ds_list_size(animator.values); k++) { var _key = animator.values[| k]; @@ -1055,7 +1075,7 @@ function Panel_Animation() : PanelContent() constructor { if(isGraphable(prop)) { tx = tool_width - ui(16); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) { + if(pHOVER && point_in_rectangle(msx, msy, tx - ui(9), ty - ui(10), tx + ui(10), ty + ui(8))) { draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, COLORS._main_icon_on_inner, 1); TOOLTIP = __txtx("panel_animation_show_graph", "Show graph"); @@ -1066,9 +1086,14 @@ function Panel_Animation() : PanelContent() constructor { } tx = tool_width - ui(20 + 16 * 4.5); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { + if(pHOVER && point_in_rectangle(msx, msy, tx - ui(10), ty - ui(9), tx + ui(10), ty + ui(8))) { draw_sprite_ui_uniform(THEME.prop_on_end, prop.on_end, tx, ty, 1, COLORS._main_icon_on_inner, 1); - TOOLTIP = __txtx("panel_animation_looping_mode", "Looping mode") + ": " + global.junctionEndName[prop.on_end]; + + if(tooltip_loop_prop != prop) + tooltip_loop_type.arrow_pos = noone; + tooltip_loop_prop = prop; + tooltip_loop_type.index = prop.on_end; + TOOLTIP = tooltip_loop_type; if(mouse_release(mb_left, pFOCUS)) prop.on_end = safe_mod(prop.on_end + 1, sprite_get_number(THEME.prop_on_end)); @@ -1084,6 +1109,14 @@ function Panel_Animation() : PanelContent() constructor { value_focusing = prop; } + var _gx = ui(20); + var _gy = ty; + if(hov) + if(buttonInstant(noone, _gx - ui(10), _gy - ui(9), ui(20), ui(17), [msx, msy], pFOCUS, pHOVER, "", THEME.animate_prop_go, 0, [COLORS._main_icon, COLORS._main_icon_on_inner], 0.75) == 2) { + graphFocusNode(_node); + PANEL_INSPECTOR.highlightProp(prop); + } + var cc = prop.sep_axis? COLORS.axis[animator.index] : COLORS._main_text_inner; if(hov) cc = COLORS._main_text_accent; @@ -1236,9 +1269,8 @@ function Panel_Animation() : PanelContent() constructor { var bar_h = timeline_h; var bar_total_w = TOTAL_FRAMES * ui(timeline_scale); - dope_sheet_surface = surface_verify(dope_sheet_surface, dope_sheet_w, dope_sheet_h); - dope_sheet_name_surface = surface_verify(dope_sheet_name_surface, dope_sheet_w, dope_sheet_h); - + surfaceVerify(); + #region scroll dope_sheet_y = lerp_float(dope_sheet_y, dope_sheet_y_to, 4); @@ -1308,11 +1340,14 @@ function Panel_Animation() : PanelContent() constructor { _cont.h += dope_sheet_node_padding; var _ks = key_y; - if(_cont.item.color_cur > -1) { + if(_cont.item.color_dsp > -1) { draw_set_color(_cont.item.color_dsp); draw_rectangle(0, _ks - 1, bar_show_w, _ks + ui(20), false); - - cc = colorMultiply(_cont.item.color_cur, COLORS.panel_animation_dope_key_bg); + } + + if(_cont.item.color_cur > -1) { + var c0 = colorMultiply(_cont.item.color_cur, COLORS.panel_animation_dope_key_bg); + var c1 = colorMultiply(_cont.item.color_cur, COLORS.panel_animation_dope_key_bg_hover); } key_y += ui(20) + _expand * ui(10); @@ -1324,30 +1359,32 @@ function Panel_Animation() : PanelContent() constructor { var prop = _cont.props[j]; var _prop = prop.prop; prop.y = key_y; - + for( var k = 0; k < array_length(prop.animators); k++ ) { prop.animators[k].y = key_y; - draw_set_color(c_red); - - if(_prop == value_focusing) draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(8), bar_show_w, ui(16), COLORS.panel_animation_graph_select, 1); - else if(_prop == value_hovering) draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(6), bar_show_w, ui(12), COLORS.panel_animation_graph_bg, 1); + if(_cont.item.color_cur > -1) { + draw_set_color(c0); + draw_rectangle(0, key_y - ui(10), bar_show_w, key_y + ui(10), false); + + if(_prop == value_focusing) draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(8), bar_show_w, ui(16), c1, 1); + //else if(_prop == value_hovering) draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(2), bar_show_w, ui( 4), c1, 1); + } key_y += ui(18); _cont.h += ui(18); } if(_prop.show_graph) { - draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(4), bar_show_w, _prop.graph_h, COLORS.panel_animation_graph_bg, 1); + if(_cont.item.color_cur > -1) { + draw_set_color(c1); + draw_rectangle(0, key_y - ui(10), bar_show_w, key_y + _prop.graph_h - ui(2), false); + } + //draw_sprite_stretched_ext(THEME.menu_button_mask, 0, 0, key_y - ui(4), bar_show_w, _prop.graph_h, COLORS.panel_animation_graph_bg, 1); key_y += _prop.graph_h + ui(8); _cont.h += _prop.graph_h + ui(8); } } - - if(_cont.item.color_cur > -1) { - draw_set_color(cc); - draw_rectangle(0, _ks, bar_show_w, key_y - ui(10), false); - } } key_y -= _expand * ui(10); @@ -1897,10 +1934,10 @@ function Panel_Animation() : PanelContent() constructor { PROJECT.timelines.addItem(_dir); } - by += ui(28); - var txt = show_node_outside_context? __txtx("panel_animation_hide_node", "Hide node outside context") : __txtx("panel_animation_show_node", "Show node outside context"); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.junc_visible, show_node_outside_context) == 2) - show_node_outside_context = !show_node_outside_context; + //by += ui(28); + //var txt = show_node_outside_context? __txtx("panel_animation_hide_node", "Hide node outside context") : __txtx("panel_animation_show_node", "Show node outside context"); + //if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.junc_visible, show_node_outside_context) == 2) + // show_node_outside_context = !show_node_outside_context; by += ui(28); var txt = ""; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 7e10b6163..9d89b14a8 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -374,6 +374,154 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } #endregion #endregion + #region ++++ context menu ++++ + menu_sent_to_preview = menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { setCurrentPreview(node_hover); }); + menu_send_to_window = menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() { create_preview_window(node_hover); }, noone, ["Graph", "Preview window"]); + menu_sent_to_inspector = menuItem(__txtx("panel_graph_inspector_panel", "Send to new inspector"), function() { + var pan = panelAdd("Panel_Inspector", true); + pan.destroy_on_click_out = false; + pan.content.setInspecting(node_hover); + pan.content.locked = true; + }); + menu_send_export = menuItem(__txtx("panel_graph_send_to_export", "Send to export"), function() { setCurrentExport(node_hover); }, noone, ["Graph", "Export"]); + menu_toggle_preview = menuItem(__txtx("panel_graph_toggle_preview", "Toggle node preview"), function() { setTriggerPreview(); }, noone, ["Graph", "Toggle preview"]); + menu_toggle_render = menuItem(__txtx("panel_graph_toggle_render", "Toggle node render"), function() { setTriggerRender(); }, noone, ["Graph", "Toggle render"]); + menu_open_group = menuItem(__txtx("panel_graph_enter_group", "Open group"), function() { PANEL_GRAPH.addContext(node_hover); }, THEME.group); + menu_open_group_tab = menuItem(__txtx("panel_graph_enter_group_new_tab", "Open group in new tab"), function() { + var graph = new Panel_Graph(project); + panel.setContent(graph, true); + + for( var i = 0; i < ds_list_size(node_context); i++ ) + graph.addContext(node_context[| i]); + graph.addContext(node_hover); + + setFocus(panel); + }, THEME.group); + menu_group_ungroup = menuItem(__txt("Ungroup"), function() { doUngroup(); }, THEME.group, ["Graph", "Ungroup"]); + menu_group_tool = menuItem(__txt("Set as group tool"), function() { node_hover.setTool(!node_hover.isTool); }); + + menu_node_delete_merge = menuItem(__txtx("panel_graph_delete_and_merge_connection", "Delete and merge connection"), function() { doDelete(true); }, THEME.cross, ["Graph", "Delete (merge)"]); + menu_node_delete_cut = menuItem(__txtx("panel_graph_delete_and_cut_connection", "Delete and cut connection"), function() { doDelete(false); }, THEME.cross, ["Graph", "Delete (break)"]); + menu_node_duplicate = menuItem(__txt("Duplicate"), function() { doDuplicate(); }, THEME.duplicate, ["Graph", "Duplicate"]); + menu_node_copy = menuItem(__txt("Copy"), function() { doCopy(); }, THEME.copy, ["Graph", "Copy"]); + + menu_node_transform = menuItem(__txtx("panel_graph_add_transform", "Add transform"), function() { doTransform(); }, noone, ["Graph", "Transform node"]); + menu_node_canvas = menuItem(__txtx("panel_graph_canvas", "Canvas"), + function(_dat) { + return submenuCall(_dat, [ + menuItem(__txtx("panel_graph_copy_to_canvas", "Copy to canvas"), function() { setCurrentCanvas(node_hover); }, noone, ["Graph", "Canvas"]), + menuItem(__txtx("panel_graph_overlay_canvas", "Overlay canvas"), function() { setCurrentCanvasBlend(node_hover); }, noone, ["Graph", "Canvas blend"]) + ]); + }).setIsShelf(); + + menu_nodes_align = menuItem(__txtx("panel_graph_align_nodes", "Align nodes"), function(_dat) { + return submenuCall(_dat, [ + menuItemGroup(__txtx("horizontal", "Horizontal"), [ + [ [THEME.inspector_surface_halign, 0], function() { node_halign(nodes_select_list, fa_left); } ], + [ [THEME.inspector_surface_halign, 1], function() { node_halign(nodes_select_list, fa_center); } ], + [ [THEME.inspector_surface_halign, 2], function() { node_halign(nodes_select_list, fa_right); } ], + ]), + menuItemGroup(__txtx("vertical", "Vertical"), [ + [ [THEME.inspector_surface_valign, 0], function() { node_valign(nodes_select_list, fa_top); } ], + [ [THEME.inspector_surface_valign, 1], function() { node_valign(nodes_select_list, fa_middle); } ], + [ [THEME.inspector_surface_valign, 2], function() { node_valign(nodes_select_list, fa_bottom); } ], + ]), + menuItemGroup(__txtx("distribute", "Distribute"), [ + [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ], + [ [THEME.obj_distribute_v, 0], function() { node_vdistribute(nodes_select_list); } ], + ]), + ]); + }).setIsShelf(); + menu_nodes_blend = menuItem(__txtx("panel_graph_blend_nodes", "Blend nodes"), function() { doBlend(); }, noone, ["Graph", "Blend"]); + menu_nodes_compose = menuItem(__txtx("panel_graph_compose_nodes", "Compose nodes"), function() { doCompose(); }, noone, ["Graph", "Compose"]); + menu_nodes_array = menuItem(__txtx("panel_graph_array_from_nodes", "Array from nodes"), function() { doArray(); }, noone, ["Graph", "Array"]); + menu_nodes_group = menuItem(__txtx("panel_graph_group_nodes", "Group nodes"), function() { doGroup(); }, THEME.group, ["Graph", "Group"]); + menu_nodes_frame = menuItem(__txtx("panel_graph_frame_nodes", "Frame nodes"), function() { doFrame(); }, noone, ["Graph", "Frame"]); + + #region node color + function setSelectingNodeColor(color) { + if(node_hover == noone) return; + node_hover.timeline_item.color = color; + + for(var i = 0; i < ds_list_size(nodes_select_list); i++) + nodes_select_list[| i].timeline_item.color = color; + } + + var _clrs = COLORS.timeline_blend; + var _item = array_create(array_length(_clrs)); + + for( var i = 0, n = array_length(_clrs); i < n; i++ ) { + _item[i] = [ + [ THEME.timeline_color, i > 0, _clrs[i] ], + function(_data) { + setSelectingNodeColor(_data.color); + }, "", { color: i == 0? -1 : _clrs[i] } + ]; + } + + array_push(_item, [ + [ THEME.timeline_color, 2 ], + function(_data) { + var dialog = dialogCall(o_dialog_color_selector); + dialog.selector.onApply = setSelectingNodeColor; + dialog.onApply = setSelectingNodeColor; + } + ]); + + menu_node_color = menuItemGroup(__txt("Node Color"), _item); + menu_node_color.spacing = ui(24); + #endregion + + #region junction color + __junction_hovering = noone; + + function setSelectingJuncColor(color) { + if(__junction_hovering == noone) return; + __junction_hovering.color = color; + + if(__junction_hovering.value_from != noone) + __junction_hovering.value_from.color = color; + + for(var i = 0; i < ds_list_size(nodes_select_list); i++) { + var _node = nodes_select_list[| i]; + + for( var j = 0, m = ds_list_size(_node.inputs); j < m; j++ ) { + var _input = _node.inputs[| j]; + if(_input.value_from == noone) continue; + if(!ds_exists(_input.value_from.node, nodes_select_list)) continue; + + _input.color = color; + _input.value_from.color = color; + } + } + } + + var _clrs = COLORS.timeline_blend; + var _item = array_create(array_length(_clrs)); + + for( var i = 0, n = array_length(_clrs); i < n; i++ ) { + _item[i] = [ + [ THEME.timeline_color, i > 0, _clrs[i] ], + function(_data) { + setSelectingJuncColor(_data.color); + }, "", { color: i == 0? -1 : _clrs[i] } + ]; + } + + array_push(_item, [ + [ THEME.timeline_color, 2 ], + function(_data) { + var dialog = dialogCall(o_dialog_color_selector); + dialog.selector.onApply = setSelectingJuncColor; + dialog.onApply = setSelectingJuncColor; + } + ]); + + menu_junc_color = menuItemGroup(__txt("Connection Color"), _item); + menu_junc_color.spacing = ui(24); + #endregion + #endregion + function getCurrentContext() { #region if(ds_list_empty(node_context)) return noone; return node_context[| ds_list_size(node_context) - 1]; @@ -624,232 +772,105 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { #region selection if(mouse_on_graph && pHOVER) { - if(NODE_DROPPER_TARGET != noone && node_hovering) { - node_hovering.draw_droppable = true; - if(mouse_press(mb_left, NODE_DROPPER_TARGET_CAN)) { - NODE_DROPPER_TARGET.expression += node_hovering.internalName; - NODE_DROPPER_TARGET.expressionUpdate(); - } - } else if(mouse_press(mb_left, pFOCUS)) { - if(key_mod_press(SHIFT)) { - if(ds_list_empty(nodes_select_list) && node_focus) - ds_list_add(nodes_select_list, node_focus); - if(node_focus != node_hovering) - ds_list_add(nodes_select_list, node_hovering); - } else { - var _prevFocus = node_focus; - if(node_hovering != noone || value_focus == noone) - node_focus = node_hovering; - - if(node_focus) { - if(instanceof(node_focus) == "Node_Frame") { - var fx0 = (node_focus.x + graph_x) * graph_s; - var fy0 = (node_focus.y + graph_y) * graph_s; - var fx1 = fx0 + node_focus.w * graph_s; - var fy1 = fy0 + node_focus.h * graph_s; - - ds_list_clear(nodes_select_list); - - if(!key_mod_press(CTRL)) - for(var i = 0; i < ds_list_size(nodes_list); i++) { //select content - var _node = nodes_list[| i]; - if(instanceof(_node) == "Node_Frame") continue; - var _x = (_node.x + graph_x) * graph_s; - var _y = (_node.y + graph_y) * graph_s; - var _w = _node.w * graph_s; - var _h = _node.h * graph_s; - - if(rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h)) - ds_list_add(nodes_select_list, _node); - } - ds_list_add(nodes_select_list, node_focus); - } else if(DOUBLE_CLICK) { - PANEL_PREVIEW.setNodePreview(node_focus); - } else { - if(_prevFocus != node_focus) - bringNodeToFront(node_focus); - - var hover_selected = false; - for( var i = 0; i < ds_list_size(nodes_select_list); i++ ) { - if(nodes_select_list[| i] == node_focus) { - hover_selected = true; - break; - } - } - if(!hover_selected) - ds_list_clear(nodes_select_list); - } + #region select + if(NODE_DROPPER_TARGET != noone && node_hovering) { + node_hovering.draw_droppable = true; + if(mouse_press(mb_left, NODE_DROPPER_TARGET_CAN)) { + NODE_DROPPER_TARGET.expression += node_hovering.internalName; + NODE_DROPPER_TARGET.expressionUpdate(); + } + } else if(mouse_press(mb_left, pFOCUS)) { + if(key_mod_press(SHIFT)) { + if(ds_list_empty(nodes_select_list) && node_focus) + ds_list_add(nodes_select_list, node_focus); + if(node_focus != node_hovering) + ds_list_add(nodes_select_list, node_hovering); } else { - if(value_focus == noone) - ds_list_clear(nodes_select_list); + var _prevFocus = node_focus; + if(node_hovering != noone || value_focus == noone) + node_focus = node_hovering; + + if(node_focus) { + if(instanceof(node_focus) == "Node_Frame") { + var fx0 = (node_focus.x + graph_x) * graph_s; + var fy0 = (node_focus.y + graph_y) * graph_s; + var fx1 = fx0 + node_focus.w * graph_s; + var fy1 = fy0 + node_focus.h * graph_s; + + ds_list_clear(nodes_select_list); + + if(!key_mod_press(CTRL)) + for(var i = 0; i < ds_list_size(nodes_list); i++) { //select content + var _node = nodes_list[| i]; + if(instanceof(_node) == "Node_Frame") continue; + var _x = (_node.x + graph_x) * graph_s; + var _y = (_node.y + graph_y) * graph_s; + var _w = _node.w * graph_s; + var _h = _node.h * graph_s; + + if(rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h)) + ds_list_add(nodes_select_list, _node); + } + ds_list_add(nodes_select_list, node_focus); + } else if(DOUBLE_CLICK) { + PANEL_PREVIEW.setNodePreview(node_focus); + } else { + if(_prevFocus != node_focus) + bringNodeToFront(node_focus); + + var hover_selected = false; + for( var i = 0; i < ds_list_size(nodes_select_list); i++ ) { + if(nodes_select_list[| i] == node_focus) { + hover_selected = true; + break; + } + } + if(!hover_selected) + ds_list_clear(nodes_select_list); + } + } else { + if(value_focus == noone) + ds_list_clear(nodes_select_list); - if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked) - PANEL_INSPECTOR.inspecting = noone; + if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked) + PANEL_INSPECTOR.inspecting = noone; + } } } - } + #endregion if(mouse_press(mb_right, pFOCUS)) { #region node_hover = node_hovering; + if(node_hover) { var menu = []; - array_push(menu, - menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { - setCurrentPreview(node_hover); - })); - array_push(menu, - menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() { - create_preview_window(node_hover); - }, noone, ["Graph", "Preview window"])); - array_push(menu, - menuItem(__txtx("panel_graph_inspector_panel", "Send to new inspector"), function() { - var pan = panelAdd("Panel_Inspector", true); - pan.destroy_on_click_out = false; - pan.content.setInspecting(node_hover); - pan.content.locked = true; - })); + array_push(menu, menu_node_color, -1, menu_sent_to_preview, menu_send_to_window, menu_sent_to_inspector); + if(!DEMO) + array_push(menu, menu_send_export); + array_push(menu, -1, menu_toggle_preview, menu_toggle_render); + + if(is_instanceof(node_hover, Node_Collection)) + array_push(menu, -1, menu_open_group, menu_open_group_tab, menu_group_ungroup); - if(DEMO) { - array_push(menu, - menuItem(__txtx("panel_graph_send_to_export", "Send to export"), function() { - setCurrentExport(node_hover); - }, noone, ["Graph", "Export"])); - } + if(node_hover.group != noone) + array_push(menu, menu_group_tool); - array_push(menu, - menuItem(__txtx("panel_graph_toggle_preview", "Toggle node preview"), function() { - setTriggerPreview(); - }, noone, ["Graph", "Toggle preview"])); - array_push(menu, - menuItem(__txtx("panel_graph_toggle_render", "Toggle node render"), function() { - setTriggerRender(); - }, noone, ["Graph", "Toggle render"])); - - if(struct_has(node_hover, "nodes")) { - array_push(menu, -1); + array_push(menu, -1, menu_node_delete_merge, menu_node_delete_cut, menu_node_duplicate, menu_node_copy); + array_push(menu, -1, menu_node_transform, menu_node_canvas); - array_push(menu, - menuItem(__txtx("panel_graph_enter_group", "Open group"), function() { - PANEL_GRAPH.addContext(node_hover); - }, THEME.group)); - array_push(menu, - menuItem(__txtx("panel_graph_enter_group_new_tab", "Open group in new tab"), function() { - var graph = new Panel_Graph(project); - panel.setContent(graph, true); - - for( var i = 0; i < ds_list_size(node_context); i++ ) - graph.addContext(node_context[| i]); - graph.addContext(node_hover); - - setFocus(panel); - }, THEME.group)); - array_push(menu, - menuItem(__txt("Ungroup"), function() { - doUngroup(); - }, THEME.group, ["Graph", "Ungroup"])); - } - - if(node_hover.group != noone) { - array_push(menu, - menuItem(__txt("Set as group tool"), function() { - node_hover.setTool(!node_hover.isTool); - })); - } - - array_push(menu, -1); - - array_push(menu, - menuItem(__txtx("panel_graph_delete_and_merge_connection", "Delete and merge connection"), function() { - doDelete(true); - }, THEME.cross, ["Graph", "Delete (merge)"])); - array_push(menu, - menuItem(__txtx("panel_graph_delete_and_cut_connection", "Delete and cut connection"), function() { - doDelete(false); - }, THEME.cross, ["Graph", "Delete (break)"])); - array_push(menu, - menuItem(__txt("Duplicate"), function() { - doDuplicate(); - }, THEME.duplicate, ["Graph", "Duplicate"])); - array_push(menu, - menuItem(__txt("Copy"), function() { - doCopy(); - }, THEME.copy, ["Graph", "Copy"])); - - array_push(menu, -1); - array_push(menu, menuItem(__txtx("panel_graph_add_transform", "Add transform"), doTransform, noone, ["Graph", "Transform node"])); - array_push(menu, menuItem(__txtx("panel_graph_canvas", "Canvas"), - function(_dat) { - return submenuCall(_dat, [ - menuItem(__txtx("panel_graph_copy_to_canvas", "Copy to canvas"), function() { - setCurrentCanvas(node_hover); - }, noone, ["Graph", "Canvas"]), - menuItem(__txtx("panel_graph_overlay_canvas", "Overlay canvas"), function() { - setCurrentCanvasBlend(node_hover); - }, noone, ["Graph", "Canvas blend"]) - ]); - }).setIsShelf() - ); - - if(ds_list_size(nodes_select_list) >= 2) { - array_push(menu, -1); - array_push(menu, - menuItem(__txtx("panel_graph_align_nodes", "Align nodes"), function(_dat) { - return submenuCall(_dat, [ - menuItemGroup(__txtx("horizontal", "Horizontal"), [ - [ [THEME.inspector_surface_halign, 0], function() { node_halign(nodes_select_list, fa_left); } ], - [ [THEME.inspector_surface_halign, 1], function() { node_halign(nodes_select_list, fa_center); } ], - [ [THEME.inspector_surface_halign, 2], function() { node_halign(nodes_select_list, fa_right); } ], - ]), - menuItemGroup(__txtx("vertical", "Vertical"), [ - [ [THEME.inspector_surface_valign, 0], function() { node_valign(nodes_select_list, fa_top); } ], - [ [THEME.inspector_surface_valign, 1], function() { node_valign(nodes_select_list, fa_middle); } ], - [ [THEME.inspector_surface_valign, 2], function() { node_valign(nodes_select_list, fa_bottom); } ], - ]), - menuItemGroup(__txtx("distribute", "Distribute"), [ - [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ], - [ [THEME.obj_distribute_v, 0], function() { node_vdistribute(nodes_select_list); } ], - ]), - ]); - }).setIsShelf()); - array_push(menu, - menuItem(__txtx("panel_graph_blend_nodes", "Blend nodes"), function() { - doBlend(); - }, noone, ["Graph", "Blend"])); - array_push(menu, - menuItem(__txtx("panel_graph_compose_nodes", "Compose nodes"), function() { - doCompose(); - }, noone, ["Graph", "Compose"])); - array_push(menu, - menuItem(__txtx("panel_graph_array_from_nodes", "Array from nodes"), function() { - doArray(); - }, noone, ["Graph", "Array"])); - - array_push(menu, - menuItem(__txtx("panel_graph_group_nodes", "Group nodes"), function() { - doGroup(); - }, THEME.group, ["Graph", "Group"])); - - array_push(menu, - menuItem(__txtx("panel_graph_frame_nodes", "Frame nodes"), function() { - doFrame(); - }, noone, ["Graph", "Frame"])); - } + if(ds_list_size(nodes_select_list) >= 2) + array_push(menu, -1, menu_nodes_align, menu_nodes_blend, menu_nodes_compose, menu_nodes_array, menu_nodes_group, menu_nodes_frame); menuCall("graph_node_selected_multiple_menu",,, menu ); } else { var menu = []; - - array_push(menu, - menuItem(__txt("Copy"), function() { - doCopy(); - }, THEME.copy, ["Graph", "Copy"]).setActive(node_focus != noone || ds_list_size(nodes_select_list)) - ); - - array_push(menu, - menuItem(__txt("Paste"), function() { - doPaste(); - }, THEME.paste, ["Graph", "Paste"]).setActive(clipboard_get_text() != "") - ); + + __junction_hovering = junction_hovering; + if(junction_hovering != noone) + array_push(menu, menu_junc_color, -1); + + array_push(menu, menuItem(__txt("Copy"), function() { doCopy(); }, THEME.copy, ["Graph", "Copy"]).setActive(node_focus != noone || ds_list_size(nodes_select_list))); + array_push(menu, menuItem(__txt("Paste"), function() { doPaste(); }, THEME.paste, ["Graph", "Paste"]).setActive(clipboard_get_text() != "")); callAddDialog(); menuCall("graph_node_selected_menu", o_dialog_add_node.dialog_x - ui(8), o_dialog_add_node.dialog_y + ui(4), menu, fa_right ); @@ -959,7 +980,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { ny = round(ny / project.graphGrid.size) * project.graphGrid.size; } - node_dragging.move(nx, ny); + node_dragging.move(nx, ny, graph_s); if(mouse_release(mb_left) && (nx != node_drag_sx || ny != node_drag_sy)) { recordAction(ACTION_TYPE.var_modify, node_dragging, [ node_drag_sx, "x", "node x position" ]); @@ -991,7 +1012,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { _ny = round(_ny / project.graphGrid.size) * project.graphGrid.size; } - _node.move(_nx, _ny); + _node.move(_nx, _ny, graph_s); } node_drag_ox = nx; diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 19fbe1d5d..9da50d89c 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -29,6 +29,9 @@ function Panel_Inspector() : PanelContent() constructor { #region ---- properties ---- prop_hover = noone; prop_selecting = noone; + + prop_highlight = noone; + prop_highlight_time = 0; prop_dragging = noone; prop_sel_drag_x = 0; @@ -120,6 +123,55 @@ function Panel_Inspector() : PanelContent() constructor { } }), ] + + __dialog_junction = noone; + menu_junc_reset_value = menuItem(__txtx("panel_inspector_reset", "Reset value"), function() { __dialog_junction.resetValue(); }); + menu_junc_add_anim = menuItem(__txtx("panel_inspector_add", "Add animation"), function() { __dialog_junction.setAnim(true); }); + menu_junc_rem_anim = menuItem(__txtx("panel_inspector_remove", "Remove animation"), function() { __dialog_junction.setAnim(false); }); + menu_junc_combine_axis = menuItem(__txtx("panel_inspector_axis_combine", "Combine axis"), function() { __dialog_junction.sep_axis = false; }); + menu_junc_separate_axis = menuItem(__txtx("panel_inspector_axis_separate", "Separate axis"), function() { __dialog_junction.sep_axis = true; }); + menu_junc_expression_ena = menuItem(__txtx("panel_inspector_use_expression", "Use expression"), function() { __dialog_junction.expUse = true; }); + menu_junc_expression_dis = menuItem(__txtx("panel_inspector_disable_expression", "Disable expression"), function() { __dialog_junction.expUse = false; }); + menu_junc_extract = menuItem(__txtx("panel_inspector_extract_single", "Extract to node"), function() { __dialog_junction.extractNode(); }); + + menu_junc_copy = menuItem(__txt("Copy"), function() { clipboard_set_text(__dialog_junction.getShowString()); }, THEME.copy, ["Inspector", "Copy property"]); + menu_junc_paste = menuItem(__txt("Paste"), function() { __dialog_junction.setString(clipboard_get_text()); }, THEME.paste, ["Inspector", "Paste property"]); + + function setSelectingItemColor(color) { + if(__dialog_junction == noone) return; + + __dialog_junction.color = color; + + if(__dialog_junction.value_from != noone) + __dialog_junction.value_from.color = color; + var _val_to = __dialog_junction.getJunctionTo(); + for( var i = 0, n = array_length(_val_to); i < n; i++ ) + _val_to[i].color = color; + } + + var _clrs = COLORS.timeline_blend; + var _item = array_create(array_length(_clrs)); + + for( var i = 0, n = array_length(_clrs); i < n; i++ ) { + _item[i] = [ + [ THEME.timeline_color, i > 0, _clrs[i] ], + function(_data) { + setSelectingItemColor(_data.color); + }, "", { color: i == 0? -1 : _clrs[i] } + ]; + } + + array_push(_item, [ + [ THEME.timeline_color, 2 ], + function(_data) { + var dialog = dialogCall(o_dialog_color_selector); + dialog.selector.onApply = setSelectingItemColor; + dialog.onApply = setSelectingItemColor; + } + ]); + + menu_junc_color = menuItemGroup(__txt("Color"), _item); + menu_junc_color.spacing = ui(24); #endregion function setInspecting(inspecting) { #region @@ -333,6 +385,11 @@ function Panel_Inspector() : PanelContent() constructor { return hh; } #endregion + static highlightProp = function(prop) { #region + prop_highlight = prop; + prop_highlight_time = 60; + } #endregion + static drawNodeProperties = function(_y, _m, _inspecting = inspecting) { #region var con_w = contentPane.surface_w - ui(4); var _hover = pHOVER && contentPane.hover; @@ -494,28 +551,35 @@ function Panel_Inspector() : PanelContent() constructor { } #region ++++ draw widget ++++ - var lb_h = line_get_height(f_p0) + ui(8); - var lb_w = line_get_width(jun.getName(), f_p0) + ui(16); - var padd = ui(8); + var lb_h = line_get_height(f_p0) + ui(8); + var lb_w = line_get_width(jun.getName(), f_p0) + ui(16); + var lb_x = ui(48) + (ui(24) * (jun.color != -1)); + var padd = ui(8); - var _selY = yy - ui(0); - var lbHov = point_in_rectangle(_m[0], _m[1], ui(48), _selY, ui(48) + lb_w, _selY + lb_h); - if(lbHov) - draw_sprite_stretched_ext(THEME.group_label, 0, ui(48), _selY + ui(2), lb_w, lb_h - ui(4), COLORS._main_icon_dark, 0.85); + var _selY = yy; + var lbHov = point_in_rectangle(_m[0], _m[1], lb_x, _selY, lb_x + lb_w, _selY + lb_h); + if(lbHov) draw_sprite_stretched_ext(THEME.group_label, 0, lb_x, _selY + ui(2), lb_w, lb_h - ui(4), COLORS._main_icon_dark, 0.85); var widg = drawWidget(ui(16), yy, contentPane.surface_w - ui(24), _m, jun, false, pHOVER && contentPane.hover, pFOCUS, contentPane, ui(16) + x, top_bar_h + y); var widH = widg[0]; var mbRight = widg[1]; - + hh += lb_h + widH + padd; var _selY1 = yy + lb_h + widH + ui(2); - var _selH = _selY1 - _selY; - + var _selH = _selY1 - _selY + ui(4); + + if(jun == prop_highlight && prop_highlight_time) { + if(prop_highlight_time == 60) + contentPane.setScroll(_y - yy); + var aa = min(1, prop_highlight_time / 30); + draw_sprite_stretched_ext(THEME.ui_panel_active, 0, ui(4), yy, contentPane.surface_w - ui(4), _selH, COLORS._main_accent, aa); + } + if(_hover && lbHov) { if(prop_dragging == noone && mouse_press(mb_left, pFOCUS)) { prop_dragging = jun; - + prop_sel_drag_x = mouse_mx; prop_sel_drag_y = mouse_my; } @@ -543,7 +607,7 @@ function Panel_Inspector() : PanelContent() constructor { NODE_DROPPER_TARGET.expressionUpdate(); } } else - draw_sprite_stretched_ext(THEME.prop_selecting, 0, 4, _selY, contentPane.surface_w - ui(8), _selH, COLORS._main_accent, 1); + draw_sprite_stretched_ext(THEME.prop_selecting, 0, ui(4), _selY, contentPane.surface_w - ui(8), _selH, COLORS._main_accent, 1); if(anim_toggling) { jun.setAnim(!jun.is_anim); @@ -556,41 +620,15 @@ function Panel_Inspector() : PanelContent() constructor { prop_selecting = jun; if(mouse_press(mb_right, pFOCUS && mbRight)) { #region right click menu - var _menuItem = []; + var _menuItem = [ menu_junc_color, -1 ]; if(i < amoIn) { - array_push(_menuItem, - menuItem(__txtx("panel_inspector_reset", "Reset value"), function() { - __dialog_junction.resetValue(); - }), - menuItem(jun.is_anim? __txtx("panel_inspector_remove", "Remove animation") : __txtx("panel_inspector_add", "Add animation"), function() { - __dialog_junction.setAnim(!__dialog_junction.is_anim); - }), - ); - - if(jun.sepable) { - array_push(_menuItem, - menuItem(jun.sep_axis? __txtx("panel_inspector_axis_combine", "Combine axis") : __txtx("panel_inspector_axis_separate", "Separate axis"), function() { - __dialog_junction.sep_axis = !__dialog_junction.sep_axis; - }), - ); - } - + array_push(_menuItem, menu_junc_reset_value, jun.is_anim? menu_junc_rem_anim : menu_junc_add_anim); + if(jun.sepable) array_push(_menuItem, jun.sep_axis? menu_junc_combine_axis : menu_junc_separate_axis); array_push(_menuItem, -1); } - array_push(_menuItem, - menuItem(__txtx("panel_inspector_use_expression", "Use expression"), function() { - __dialog_junction.expUse = !__dialog_junction.expUse; - }), - -1, - menuItem(__txt("Copy"), function() { - clipboard_set_text(__dialog_junction.getShowString()); - }, THEME.copy, ["Inspector", "Copy property"]), - menuItem(__txt("Paste"), function() { - __dialog_junction.setString(clipboard_get_text()); - }, THEME.paste, ["Inspector", "Paste property"]), - ); + array_push(_menuItem, jun.expUse? menu_junc_expression_dis : menu_junc_expression_ena, -1, menu_junc_copy, menu_junc_paste); if(jun.extract_node != "") { if(is_array(jun.extract_node)) { @@ -603,12 +641,9 @@ function Panel_Inspector() : PanelContent() constructor { return submenuCall(_dat, arr); }).setIsShelf(); - array_insert(_menuItem, 2, ext); - } else { - array_insert(_menuItem, 2, menuItem(__txtx("panel_inspector_extract_single", "Extract to node"), function() { - __dialog_junction.extractNode(); - })); - } + array_push(_menuItem, ext); + } else + array_push(_menuItem, menu_junc_extract); } var dia = menuCall("inspector_value_menu",,, _menuItem,, jun); @@ -656,6 +691,12 @@ function Panel_Inspector() : PanelContent() constructor { } #endregion + if(prop_highlight_time) { + prop_highlight_time--; + if(prop_highlight_time == 0) + prop_highlight = noone; + } + return hh; } #endregion diff --git a/scripts/preferences/preferences.yy b/scripts/preferences/preferences.yy index dcc59f159..b5307b1f8 100644 --- a/scripts/preferences/preferences.yy +++ b/scripts/preferences/preferences.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/preset_data/preset_data.yy b/scripts/preset_data/preset_data.yy index 094b54edc..196680533 100644 --- a/scripts/preset_data/preset_data.yy +++ b/scripts/preset_data/preset_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/project_data/project_data.gml b/scripts/project_data/project_data.gml index 8acbb1806..c7fa4446a 100644 --- a/scripts/project_data/project_data.gml +++ b/scripts/project_data/project_data.gml @@ -61,6 +61,8 @@ timelines = new timelineItemGroup(); + notes = []; + static cleanup = function() { #region if(!ds_map_empty(nodeMap)) array_map(ds_map_keys_to_array(nodeMap), function(_key, _ind) { diff --git a/scripts/project_data/project_data.yy b/scripts/project_data/project_data.yy index 19df4abdb..7dccb9d80 100644 --- a/scripts/project_data/project_data.yy +++ b/scripts/project_data/project_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/render_data/render_data.yy b/scripts/render_data/render_data.yy index a9f68f146..99100d7ca 100644 --- a/scripts/render_data/render_data.yy +++ b/scripts/render_data/render_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/sample_projects/sample_projects.yy b/scripts/sample_projects/sample_projects.yy index dfc13af5b..f6e0541ec 100644 --- a/scripts/sample_projects/sample_projects.yy +++ b/scripts/sample_projects/sample_projects.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/save_function/save_function.gml b/scripts/save_function/save_function.gml index 4254116e8..1d7f92192 100644 --- a/scripts/save_function/save_function.gml +++ b/scripts/save_function/save_function.gml @@ -41,6 +41,7 @@ function save_serialize(project = PROJECT, _outMap = false) { _map.attributes = project.attributes; _map.timelines = project.timelines.serialize(); + _map.notes = array_map(project.notes, function(note) { return node.serialize(); } ); var prev = PANEL_PREVIEW.getNodePreviewSurface(); if(!is_surface(prev)) _map.preview = ""; diff --git a/scripts/scrollPane/scrollPane.gml b/scripts/scrollPane/scrollPane.gml index 8debcf327..e2a03bc22 100644 --- a/scripts/scrollPane/scrollPane.gml +++ b/scripts/scrollPane/scrollPane.gml @@ -31,6 +31,12 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { surface_h = _h; } + static setScroll = function(_scroll_y) { #region + gml_pragma("forceinline"); + + scroll_y_to = clamp(_scroll_y, -content_h, 0); + } #endregion + static draw = function(x, y, _mx = mouse_mx - x, _my = mouse_my - y) { self.x = x; self.y = y; diff --git a/scripts/sprite_loader/sprite_loader.yy b/scripts/sprite_loader/sprite_loader.yy index 606d671a3..dd166b7bf 100644 --- a/scripts/sprite_loader/sprite_loader.yy +++ b/scripts/sprite_loader/sprite_loader.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/theme_definition/theme_definition.yy b/scripts/theme_definition/theme_definition.yy index 9f6636f6c..26cbec69f 100644 --- a/scripts/theme_definition/theme_definition.yy +++ b/scripts/theme_definition/theme_definition.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/timeline_data/timeline_data.gml b/scripts/timeline_data/timeline_data.gml index b2f35e8db..bd6b2a65b 100644 --- a/scripts/timeline_data/timeline_data.gml +++ b/scripts/timeline_data/timeline_data.gml @@ -2,7 +2,7 @@ function timelineItem() constructor { show = true; color = -1; - color_cur = -1; + color_cur = CDEF.main_grey; color_dsp = -1; parent = noone; @@ -49,8 +49,8 @@ function timelineItemNode(node) : timelineItem() constructor { col = _context.item.color; break; } - color_cur = col; if(col == -1) col = CDEF.main_grey; + color_cur = col; var cc = colorMultiply(col, COLORS.panel_animation_dope_bg); @@ -131,7 +131,10 @@ function timelineItemGroup() : timelineItem() constructor { static rename = function() { renaming = true; tb_name.setFocusHover(true, true); - run_in(1, function() { tb_name.activate(); }); + run_in(1, function() { + tb_name._current_text = name; + tb_name.activate(); + }); } static drawLabel = function(_item, _x, _y, _w, _msx, _msy, hover, focus, itHover, fdHover, nameType, alpha = 1) { #region @@ -151,8 +154,8 @@ function timelineItemGroup() : timelineItem() constructor { hig = false; break; } - color_cur = col; if(col == -1) col = CDEF.main_grey; + color_cur = col; var bnd = hig? merge_color(c_white, COLORS.panel_animation_dope_bg, 0.8) : COLORS.panel_animation_dope_bg; var cc = colorMultiply(col, bnd); @@ -201,6 +204,16 @@ function timelineItemGroup() : timelineItem() constructor { return self; } #endregion + static destroy = function() { #region + var ind = array_find(parent.contents, self); + array_delete(parent.contents, ind, 1); + + for( var i = 0, n = array_length(contents); i < n; i++ ) { + array_insert(parent.contents, ind++, contents[i]); + contents[i].parent = parent; + } + } #endregion + static serialize = function() { #region var _map = {}; diff --git a/scripts/timeline_data/timeline_data.yy b/scripts/timeline_data/timeline_data.yy index 75d77e978..0c8dfddc3 100644 --- a/scripts/timeline_data/timeline_data.yy +++ b/scripts/timeline_data/timeline_data.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "startup scripts", - "path": "folders/main/startup scripts.yy", + "name": "components", + "path": "folders/main/components.yy", }, } \ No newline at end of file diff --git a/scripts/tooltip_selector_object/tooltip_selector_object.gml b/scripts/tooltip_selector_object/tooltip_selector_object.gml index 933b62bfb..a8610193f 100644 --- a/scripts/tooltip_selector_object/tooltip_selector_object.gml +++ b/scripts/tooltip_selector_object/tooltip_selector_object.gml @@ -14,7 +14,7 @@ function tooltipSelector(title, data, index = 0) constructor { var lh = line_get_height(); var _h = (th + ui(6)) + (lh + ui(4)) * array_length(data); - var _w = string_width(title); + var _w = ui(16) + string_width(title); for( var i = 0, n = array_length(data); i < n; i++ ) _w = max(_w, ui(8 + 16) + string_width(data[i])); @@ -27,7 +27,7 @@ function tooltipSelector(title, data, index = 0) constructor { var yy = my + ui(8); draw_set_font(f_p0); - draw_text(mx + ui(8), yy, title); + draw_text(mx + ui(12), yy, title); yy += th + ui(6); draw_set_font(f_p1); diff --git a/sprites/s_node_note/88bca569-08cd-47c2-abb5-3184c1d6dd9a.png b/sprites/s_node_note/88bca569-08cd-47c2-abb5-3184c1d6dd9a.png new file mode 100644 index 000000000..ba581d1e2 Binary files /dev/null and b/sprites/s_node_note/88bca569-08cd-47c2-abb5-3184c1d6dd9a.png differ diff --git a/sprites/s_node_note/layers/88bca569-08cd-47c2-abb5-3184c1d6dd9a/36776b37-c569-40e4-bf4f-a43f3367a7fa.png b/sprites/s_node_note/layers/88bca569-08cd-47c2-abb5-3184c1d6dd9a/36776b37-c569-40e4-bf4f-a43f3367a7fa.png new file mode 100644 index 000000000..ba581d1e2 Binary files /dev/null and b/sprites/s_node_note/layers/88bca569-08cd-47c2-abb5-3184c1d6dd9a/36776b37-c569-40e4-bf4f-a43f3367a7fa.png differ diff --git a/sprites/s_node_note/s_node_note.yy b/sprites/s_node_note/s_node_note.yy new file mode 100644 index 000000000..bb5b049ea --- /dev/null +++ b/sprites/s_node_note/s_node_note.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "s_node_note", + "bbox_bottom": 55, + "bbox_left": 4, + "bbox_right": 59, + "bbox_top": 8, + "bboxMode": 0, + "collisionKind": 1, + "collisionTolerance": 0, + "DynamicTexturePage": false, + "edgeFiltering": false, + "For3D": false, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"88bca569-08cd-47c2-abb5-3184c1d6dd9a",}, + ], + "gridX": 0, + "gridY": 0, + "height": 64, + "HTile": false, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"36776b37-c569-40e4-bf4f-a43f3367a7fa","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,}, + ], + "nineSlice": null, + "origin": 4, + "parent": { + "name": "misc", + "path": "folders/nodes/icons/misc.yy", + }, + "preMultiplyAlpha": false, + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "s_node_note", + "autoRecord": true, + "backdropHeight": 768, + "backdropImageOpacity": 0.5, + "backdropImagePath": "", + "backdropWidth": 1366, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "events": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "eventStubScript": null, + "eventToFunction": {}, + "length": 1.0, + "lockOrigin": false, + "moments": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "showBackdrop": true, + "showBackdropImage": false, + "timeUnits": 1, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[ + {"resourceType":"Keyframe","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"88bca569-08cd-47c2-abb5-3184c1d6dd9a","path":"sprites/s_node_note/s_node_note.yy",},},},"Disabled":false,"id":"7fe05c22-f647-4a5e-9f2b-6715f62f78a7","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,}, + ],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange": null, + "volume": 1.0, + "xorigin": 32, + "yorigin": 32, + }, + "swatchColours": null, + "swfPrecision": 2.525, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "type": 0, + "VTile": false, + "width": 64, +} \ No newline at end of file