This commit is contained in:
Tanasart 2023-06-10 13:59:45 +02:00
parent 2c4ebb08e5
commit 59a6d6d16c
92 changed files with 759 additions and 320 deletions

View file

@ -130,7 +130,7 @@
{"name":"context menu","order":5,"path":"folders/panels/context menu.yy",},
{"name":"graph","order":1,"path":"folders/panels/graph.yy",},
{"name":"inspectors","order":2,"path":"folders/panels/inspectors.yy",},
{"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",},
{"name":"components","order":1,"path":"folders/panels/inspectors/components.yy",},
{"name":"preview","order":3,"path":"folders/panels/preview.yy",},
{"name":"overlay","order":2,"path":"folders/panels/preview/overlay.yy",},
{"name":"sprites","order":3,"path":"folders/panels/preview/sprites.yy",},
@ -346,7 +346,6 @@
{"name":"s_node_HSV_combine","order":44,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},
{"name":"o_dialog_release_note","order":8,"path":"objects/o_dialog_release_note/o_dialog_release_note.yy",},
{"name":"sh_fd_advect_material_rgba_16_glsl","order":4,"path":"shaders/sh_fd_advect_material_rgba_16_glsl/sh_fd_advect_material_rgba_16_glsl.yy",},
{"name":"panel_inspector","order":1,"path":"scripts/panel_inspector/panel_inspector.yy",},
{"name":"node_padding","order":9,"path":"scripts/node_padding/node_padding.yy",},
{"name":"node_VFX_group","order":4,"path":"scripts/node_VFX_group/node_VFX_group.yy",},
{"name":"s_node_vfx_attract","order":8,"path":"sprites/s_node_vfx_attract/s_node_vfx_attract.yy",},
@ -722,7 +721,7 @@
{"name":"sh_seperate_shape_counter","order":1,"path":"shaders/sh_seperate_shape_counter/sh_seperate_shape_counter.yy",},
{"name":"s_node_stack","order":37,"path":"sprites/s_node_stack/s_node_stack.yy",},
{"name":"s_fade_up","order":3,"path":"sprites/s_fade_up/s_fade_up.yy",},
{"name":"panel_globalvar","order":4,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
{"name":"panel_globalvar","order":2,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
{"name":"node_guide","order":18,"path":"scripts/node_guide/node_guide.yy",},
{"name":"fd_rectangle_get_velocity_surface","order":24,"path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",},
{"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",},
@ -1184,6 +1183,7 @@
{"name":"node_3d_extrude","order":9,"path":"scripts/node_3d_extrude/node_3d_extrude.yy",},
{"name":"node_path_array","order":11,"path":"scripts/node_path_array/node_path_array.yy",},
{"name":"node_scale","order":8,"path":"scripts/node_scale/node_scale.yy",},
{"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",},
{"name":"sh_displace","order":5,"path":"shaders/sh_displace/sh_displace.yy",},
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
{"name":"rangeBox","order":10,"path":"scripts/rangeBox/rangeBox.yy",},

View file

@ -225,6 +225,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Regular.ttf","CopyToMask":-1,"filePath":"datafiles/data/themes/default/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-SemiBold.ttf","CopyToMask":-1,"filePath":"datafiles/data/themes/default/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Thin.ttf","CopyToMask":-1,"filePath":"datafiles/data/themes/default/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"empty.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.json","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png.tmp$$","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
@ -483,14 +484,19 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_dialog_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_group_label.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_key_display.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_menu_box_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_menu_button.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_menu_separator.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_menu_white.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_shadow_drop_down_24.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_toolbar_shadow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_toolbar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_label_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_tab.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_scroll_bar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_selection.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_badge.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"workshop_frame.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
@ -1774,6 +1780,7 @@
{"id":{"name":"node_path_array","path":"scripts/node_path_array/node_path_array.yy",},},
{"id":{"name":"node_scale","path":"scripts/node_scale/node_scale.yy",},},
{"id":{"name":"node_array_insert","path":"scripts/node_array_insert/node_array_insert.yy",},},
{"id":{"name":"panel_array_sequence","path":"scripts/panel_array_sequence/panel_array_sequence.yy",},},
{"id":{"name":"sh_displace","path":"shaders/sh_displace/sh_displace.yy",},},
{"id":{"name":"node_group","path":"scripts/node_group/node_group.yy",},},
{"id":{"name":"fd_rectangle_get_material_height","path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},},

Binary file not shown.

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("add_images_title_images", "Import multiple images"));
#endregion

View file

@ -349,7 +349,7 @@ event_inherited();
curr_height = 0;
BLEND_OVERRIDE;
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(16), yy, content_pane.surface_w - ui(32), ui(24), COLORS._main_icon, 1);
draw_sprite_stretched(THEME.group_label, 0, ui(16), yy, content_pane.surface_w - ui(32), ui(24));
BLEND_NORMAL;
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
@ -403,7 +403,7 @@ event_inherited();
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_over(_boxx + grid_size / 2, yy + grid_size + 4, _node.getName(), -1, grid_width);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.getName(), -1, grid_width);
var name_height = string_height_ext(_node.getName(), -1, grid_width) + 8;
curr_height = max(curr_height, grid_size + grid_space + name_height);
@ -437,7 +437,7 @@ event_inherited();
yy += ui(8);
BLEND_OVERRIDE;
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(8), yy, content_pane.surface_w - ui(24), ui(24), COLORS._main_icon, 1);
draw_sprite_stretched(THEME.group_label, 0, ui(8), yy, content_pane.surface_w - ui(24), ui(24));
BLEND_NORMAL;
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
@ -664,7 +664,7 @@ event_inherited();
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
var txt = _node.getName();
name_height = max(name_height, string_height_ext(txt, -1, grid_width) + ui(8));
draw_text_ext_over(_boxx + grid_size / 2, yy + grid_size + 4, txt, -1, grid_width);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, txt, -1, grid_width);
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
node_selecting = i;

View file

@ -81,7 +81,7 @@ if !ready exit;
var y1 = node_tooltip_y - ui(8);
var y0 = y1 - hh;
draw_sprite_stretched_ext(THEME.textbox, 3, x0, y0, ww, hh, COLORS._main_icon, 1);
draw_sprite_stretched(THEME.textbox, 3, x0, y0, ww, hh);
draw_sprite_stretched(THEME.textbox, 0, x0, y0, ww, hh);
if(spr) draw_sprite(spr, 0, x0 + ui(4), y0 + ui(4));

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("anim_scale_title", "Animation scaler"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txt("Animation"));
#endregion

View file

@ -17,7 +17,7 @@
folderW_dragging = -1;
}
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), dialog_y + ui(16), __txt("Assets"));
draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(8), dialog_h - ui(64));

View file

@ -22,7 +22,7 @@ event_inherited();
onApply(previous_color);
DIALOG_CLICK = false;
instance_destroy();
}).setIcon(THEME.revert, 0, COLORS._main_icon)
}).setIcon(THEME.undo, 0, COLORS._main_icon)
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
b_apply = button(function() {

View file

@ -23,7 +23,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, content_x, dialog_y, content_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(presets_x + ui(24), dialog_y + ui(16), __txt("Palettes"));
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
if(!interactable)

View file

@ -13,7 +13,7 @@ draw_set_alpha(1);
#region text
var py = dialog_y + ui(16);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, __txtx("crashed_title", "Restore project"));
py += line_get_height(, 4);

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("add_images_title_direcory", "Import directory"));
#endregion

View file

@ -14,7 +14,7 @@ draw_set_alpha(1);
#region text
var py = dialog_y + ui(16);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, __txtx("dialog_exit_title", "Project modified"));
py += line_get_height(, 4);

View file

@ -5,7 +5,7 @@
#endregion
#region draw TB
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(dialog_x + ui(8), dialog_y + dialog_h / 2, __txt("Name"));
tb_name.setActiveFocus(sFOCUS, sHOVER);

View file

@ -6,7 +6,7 @@
#endregion
#region draw TB
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(dialog_x + ui(16), dialog_y + ui(32), __txtx("Name"));
//var is_author = !meta.steam || meta.author_steam_id == 0 || meta.author_steam_id == STEAM_USER_ID;
@ -97,7 +97,7 @@
if(meta_expand) {
var yy = dialog_y + ui(56);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), yy, __txt("Description"));
yy += line_get_height() + ui(4);
dialog_h += line_get_height() + ui(4);
@ -108,7 +108,7 @@
yy += ui(200) + ui(8);
dialog_h += ui(200) + ui(8);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), yy, __txt("Author"));
yy += line_get_height() + ui(4);
dialog_h += line_get_height() + ui(4);
@ -119,7 +119,7 @@
yy += TEXTBOX_HEIGHT + ui(8);
dialog_h += TEXTBOX_HEIGHT + ui(8);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), yy, __txt("Contact info"));
yy += line_get_height() + ui(4);
dialog_h += line_get_height() + ui(4);
@ -130,7 +130,7 @@
yy += TEXTBOX_HEIGHT + ui(8);
dialog_h += TEXTBOX_HEIGHT + ui(8);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), yy, __txt("Alias"));
yy += line_get_height() + ui(4);
dialog_h += line_get_height() + ui(4);
@ -141,7 +141,7 @@
yy += TEXTBOX_HEIGHT + ui(8);
dialog_h += TEXTBOX_HEIGHT + ui(8);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(16), yy, __txt("Tags"));
yy += line_get_height() + ui(4);
dialog_h += line_get_height() + ui(4);

View file

@ -51,7 +51,7 @@ event_inherited();
onApply(previous_gradient);
DIALOG_CLICK = false;
instance_destroy();
}).setIcon(THEME.revert, 0, COLORS._main_icon)
}).setIcon(THEME.undo, 0, COLORS._main_icon)
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
b_apply = button(function() {

View file

@ -27,7 +27,7 @@ if !ready exit;
draw_sprite_stretched(THEME.dialog_bg, 0, palette_x, dialog_y, presets_w, dialog_h);
if(sFOCUS) draw_sprite_stretched_ext(THEME.dialog_active, 0, palette_x, dialog_y, presets_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(presets_x + ui(24), dialog_y + ui(16), __txt("Presets"));
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
if(!interactable)

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("dialog_connection_title", "Connection settings"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("grid_title", "Grid settings"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("graph_visibility_title", "Visibility settings"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("dialog_group_order_title", "Input order"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("History"));
var bx = dialog_x + ui(24);

View file

@ -7,7 +7,7 @@ if !target exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(padding), dialog_y + ui(20), __txtx("array_edit_title", "Image array edit"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("anim_interpolation", "Interpolation curve"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(padding), dialog_y + ui(20), "Lindenmayer System reference");
#endregion

View file

@ -14,7 +14,7 @@ draw_set_alpha(1);
#region text
var py = dialog_y + ui(16);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, __txtx("dialog_exit_title", "Project modified"));
py += line_get_height(, 4);

View file

@ -30,7 +30,7 @@ event_inherited();
yy += ui(8);
var hh = line_get_height() + pad + ui(8);
draw_text_over(ui(24), yy, _f);
draw_text_add(ui(24), yy, _f);
ind = 0;
yy += hh;

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(padding), dialog_y + ui(20), "Lua reference");
#endregion

View file

@ -4,7 +4,7 @@ if(!ready) exit;
#region draw
var yy = dialog_y;
draw_sprite_stretched(THEME.textbox, 3, dialog_x, dialog_y, dialog_w, dialog_h);
draw_sprite_stretched(THEME.menu_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
//if(show_icon)
// draw_sprite_stretched(THEME.textbox_code, 0, dialog_x, dialog_y, ui(36), dialog_h);
@ -149,7 +149,7 @@ if(!ready) exit;
instance_destroy();
}
draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h);
draw_sprite_stretched(THEME.menu_bg, 1, dialog_x, dialog_y, dialog_w, dialog_h);
#endregion
#region debug

View file

@ -13,7 +13,7 @@ draw_set_alpha(1);
#region text
var py = dialog_y + ui(16);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), py, __txtx("dialog_migration_title", "Program directory changed in 1.13"));
py += line_get_height(, 4);

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("Notifications"));
var bx = dialog_x + ui(24);

View file

@ -41,7 +41,7 @@ event_inherited();
draw_sprite_ui(THEME.visible, output.visible, ui(16), _yy + hh / 2, 0.6, 0.6, 0, output.visible? COLORS._main_icon_light : COLORS._main_icon);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text_over(ui(36), _yy + hh / 2, output.name);
draw_text_add(ui(36), _yy + hh / 2, output.name);
}
return _h;

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("output_visibility_title", "Outputs visibility"));
#endregion

View file

@ -37,7 +37,7 @@ event_inherited();
onApply(previous_palette);
DIALOG_CLICK = false;
instance_destroy();
}).setIcon(THEME.revert, 0, COLORS._main_icon)
}).setIcon(THEME.undo, 0, COLORS._main_icon)
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
b_apply = button(function() {

View file

@ -23,7 +23,7 @@ if palette == 0 exit;
draw_sprite_stretched(THEME.dialog_bg, 0, content_x, dialog_y, content_w, dialog_h);
if(sFOCUS) draw_sprite_stretched_ext(THEME.dialog_active, 0, content_x, dialog_y, content_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(presets_x + ui(24), dialog_y + ui(16), __txt("Presets"));
draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name);
if(!interactable)

View file

@ -312,9 +312,9 @@ event_inherited();
PREF_MAP[? "theme"] = thm;
PREF_SAVE();
loadFonts();
loadGraphic(thm);
loadColor(thm);
loadFonts();
}, false);
sb_theme.align = fa_left;

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("Preferences"));
var bx = dialog_x + ui(24);

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txt("Presets"));
#endregion

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("grid_title", "Grid settings"));
#endregion

View file

@ -90,7 +90,7 @@ if(node_target == noone) {
draw_sprite_stretched_ext(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, title_height, c_white, title_show);
draw_set_alpha(0.5 + title_show * 0.5);
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text_title);
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
draw_text(dialog_x + ui(padding + 8), dialog_y + ui(title_height) / 2, node_target.getFullName());
draw_set_alpha(1);

View file

@ -38,7 +38,7 @@ event_inherited();
switch(md) {
case "#" :
draw_set_text(f_h3, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h3, fa_left, fa_top, COLORS._main_text_on_accent);
line = string_copy(line, sp + 1, string_length(line) - sp);
yy += ui(16);
draw_text_line(xx, _y + yy, line, -1, ww);
@ -46,7 +46,7 @@ event_inherited();
yy += ui(4);
break;
case "##" :
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_on_accent);
line = string_copy(line, sp + 1, string_length(line) - sp);
yy += ui(8);
draw_text_line(xx + ui(16), _y + yy, line, -1, ww);

View file

@ -8,7 +8,7 @@ if !ready exit;
#endregion
#region text
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(16), string(VERSION_STRING) + " Release note");
draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(24), dialog_y + ui(48), dialog_w - ui(48), dialog_h - ui(72));

View file

@ -94,10 +94,10 @@ event_inherited();
}
var ly = recent_thumbnail? _y + hg - (line_get_height(f_p0b) + line_get_height(f_p1)) - ui(8) : _y + ui(8);
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text);
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_inner);
draw_text(fx + ui(12), ly, filename_name(_rec));
ly += line_get_height();
ly += line_get_height(, ui(4));
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
draw_text_cut(fx + ui(12), ly, _rec, ww - ui(24));
}
@ -187,7 +187,7 @@ event_inherited();
draw_set_color(_project.tag == "Getting started"? COLORS._main_text_accent : COLORS._main_text_sub);
draw_text(tx, ty - ui(2), _project.tag);
ty += line_get_height();
ty += line_get_height(, ui(4));
}
draw_set_text(f_p1, fa_center, fa_top, COLORS._main_text);

View file

@ -101,10 +101,8 @@ if !ready exit;
if(txt == "Contests")
tw += ui(32);
if(project_page == i)
draw_sprite_stretched(THEME.ui_panel_bg, 0, bx, y0 - ui(32), tw, ui(40));
else if(point_in_rectangle(mouse_mx, mouse_my, bx, y0 - ui(32), bx + tw, y0)) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, bx, y0 - ui(32), tw, ui(40), c_white, 0.5);
if(project_page != i && point_in_rectangle(mouse_mx, mouse_my, bx, y0 - ui(32), bx + tw, y0)) {
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), tw, ui(40), COLORS.panel_tab_hover, 1);
if(mouse_click(mb_left, sFOCUS)) {
project_page = i;
@ -114,6 +112,10 @@ if !ready exit;
expandAction = true;
}
}
} else {
var foc = project_page == i;
draw_sprite_stretched_ext(THEME.ui_panel_tab, foc, bx, y0 - ui(32), tw, ui(40),
foc? COLORS.panel_tab_active : COLORS.panel_tab_inactive, 1);
}
var _btx = bx + ui(8);
@ -122,18 +124,22 @@ if !ready exit;
_btx += ui(32);
}
if(txt == "Contests") draw_set_color(project_page == i? CDEF.yellow : COLORS._main_text_sub );
var cc = COLORS._main_text;
if(txt == "Contests") cc = project_page == i? CDEF.yellow : COLORS._main_text_sub;
if(project_page == i) cc = COLORS._main_text_on_accent;
draw_set_color(cc);
draw_text(_btx, y0 - ui(4), dtxt);
_btx += ui(8) + string_width(dtxt);
if(amo) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _btx, y0 - ui(26), string_width(amo) + ui(8), ui(24), COLORS._main_icon, 0.5);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _btx, y0 - ui(26), string_width(amo) + ui(8), ui(24), COLORS._main_icon, 1);
_btx += ui(4);
if(txt == "Contests") draw_set_color(CDEF.yellow);
else draw_set_color(COLORS._main_text_sub);
else draw_set_color(COLORS._main_text);
draw_text(_btx, y0 - ui(4), amo);
}

View file

@ -6,7 +6,7 @@ if !ready exit;
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txt("Tunnels"));
#endregion

View file

@ -1,4 +1,6 @@
/// @description init
draw_clear(COLORS.bg);
if(OS == os_windows && gameframe_is_minimized()) {
//gameframe_update();
exit;

View file

@ -75,9 +75,9 @@
log_message("SESSION", "> init Addon"); __initAddon();
PREF_APPLY();
loadFonts();
loadGraphic(PREF_MAP[? "theme"]);
loadColor(PREF_MAP[? "theme"]);
loadFonts();
setPanel();
loadAddon();

View file

@ -8,12 +8,31 @@ function array_create_from_list(list) {
return arr;
}
function array_safe_set(arr, index, value) {
if(!is_array(arr)) return def;
if(index < 0) return;
if(index >= array_length(arr)) return;
function array_safe_set(arr, index, value, fill = 0) {
if(!is_array(arr)) return arr;
if(index < 0) return arr;
if(index >= array_length(arr)) {
var i = array_length(arr);
for(; i <= index; i++ )
arr[i] = fill;
arr[index] = value;
return arr;
}
array_set(arr, index, value);
return arr;
}
function array_resize_fill(arr, size, fill = 0) {
if(size < array_length(arr)) {
array_resize(arr, size);
return arr;
}
var i = array_length(arr);
for(; i < size; i++)
arr[i] = fill;
return arr;
}
enum ARRAY_OVERFLOW {

View file

@ -28,4 +28,9 @@ function buffer_from_file(path) {
if(!file_exists(path)) return;
var _b = buffer_load(path);
return _b;
}
function buffer_read_at(buffer, position, type) {
buffer_seek(buffer, buffer_seek_start, position);
return buffer_read(buffer, type);
}

View file

@ -70,7 +70,9 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor {
if(mouse_press(mb_left)) deactivate();
}
draw_sprite_stretched_ext(THEME.color_picker_sample, 0, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8), current_color, 1);
draw_sprite_stretched_ext(THEME.button_color_overlay, 0, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8), current_color, 1);
//draw_set_color(c_white);
//draw_rectangle( _x + ui(4), _y + ui(4), _x + _cw - ui(4), _y + _h - ui(4), 1);
if(WIDGET_CURRENT == self)
draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1);

View file

@ -156,16 +156,16 @@ function DirectoryObject(name, path) constructor {
var hh = 0;
if(path == parent.context.path)
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(28), hg, COLORS.collection_path_current_bg, 1);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(36), hg, COLORS.collection_path_current_bg, 1);
if(!ds_list_empty(subDir) && _hover && point_in_rectangle(_m[0], _m[1], _x, _y, ui(32), _y + hg - 1)) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x, _y, ui(32), hg, COLORS.collection_path_current_bg, 0.75);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x, _y, ui(32), hg, COLORS.collection_path_current_bg, 1);
if(mouse_press(mb_left, _focus))
open = !open;
}
if(_hover && point_in_rectangle(_m[0], _m[1], _x + ui(32), _y, _w, _y + hg - 1)) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(28), hg, COLORS.collection_path_current_bg, 0.75);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(36), hg, COLORS.collection_path_current_bg, 1);
if(mouse_press(mb_left, _focus)) {
if(!ds_list_empty(subDir))
open = !open;
@ -177,12 +177,13 @@ function DirectoryObject(name, path) constructor {
}
}
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
if(ds_list_empty(subDir)) {
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
if(ds_list_empty(subDir))
draw_sprite_ui_uniform(THEME.folder_content, parent.context == self, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_empty);
} else {
else
draw_sprite_ui_uniform(THEME.folder_content, open, _x + ui(16), _y + hg / 2 - 1, 1, COLORS.collection_folder_nonempty);
}
draw_text(_x + ui(32), _y + hg / 2, name);
hh += hg;
_y += hg;

View file

@ -19,12 +19,21 @@ function draw_sprite_stretched_override(spr, ind, _x, _y, w = 1, h = 1) {
__draw_sprite_stretched(spr, ind, round(_x), round(_y), round(w), round(h));
}
function draw_sprite_stretched_points(spr, ind, _x0, _y0, _x1, _y1) {
var _xs = round(min(_x0, _x1));
var _ys = round(min(_y0, _y1));
var _w = round(max(_x0, _x1) - _xs);
var _h = round(max(_y0, _y1) - _ys);
__draw_sprite_stretched(spr, ind, _xs, _ys, _w, _h);
}
function draw_sprite_uniform(spr, ind, _x, _y, scale, color = c_white) {
draw_sprite_ext(spr, ind, round(_x), round(_y), scale, scale, 0, color, 1);
}
function draw_sprite_ui(spr, ind, _x, _y, xscale = 1, yscale = 1, rot = 0, color = c_white, alpha = 1) {
static UI_SPRITE_SCALE = 2;
var UI_SPRITE_SCALE = 2;
var xscale_ui = ui(xscale) / UI_SPRITE_SCALE;
var yscale_ui = ui(yscale) / UI_SPRITE_SCALE;

View file

@ -2,18 +2,6 @@ function draw_text_line(_x, _y, _text, _sep, _w) {
__draw_text_ext_transformed(_x, _y, _text, _sep, _w, 1, 1, 0);
}
function draw_text_over(_x, _y, _text, scale = 1) {
BLEND_ALPHA_MULP;
draw_text_transformed(_x, _y, _text, scale, scale, 0);
BLEND_NORMAL;
}
function draw_text_ext_over(_x, _y, _text, _sep, _w, scale = 1) {
BLEND_ALPHA_MULP;
__draw_text_ext_transformed(_x, _y, _text, _sep, _w, scale, scale, 0);
BLEND_NORMAL;
}
function draw_text_add(_x, _y, _text, scale = 1) {
BLEND_ALPHA_MULP;
draw_text_transformed(_x, _y, _text, scale, scale, 0);

View file

@ -23,6 +23,7 @@ function _font_load_from_struct(str, def) {
return def;
}
font_add_enable_aa(THEME_VALUE.font_aa);
return font_add(path, str.size * UI_SCALE, false, false, 0, 0);
}

View file

@ -133,6 +133,8 @@
#macro RETURN_ON_REST if(!ANIMATOR.is_playing || !ANIMATOR.frame_progress) return;
#macro PANEL_PAD THEME_VALUE.panel_padding
function print(str) {
//show_debug_message(string(str));
noti_status(string(str));

View file

@ -68,15 +68,14 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
if(visi_hold != noone && mouse_release(mb_left))
visi_hold = noone;
var cc = COLORS._main_text;
var cc = COLORS._main_text_inner;
if(jun.expUse) {
var expValid = jun.expTree != noone && jun.expTree.validate();
cc = expValid? COLORS._main_value_positive : COLORS._main_value_negative;
}
if(global_var) {
if(global_var)
if(string_pos(" ", jun.name)) cc = COLORS._main_value_negative;
}
draw_set_text(f_p0, fa_left, fa_center, cc);
draw_text_add(xx + ui(40), lb_y - ui(2), jun.name);
@ -315,7 +314,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
}
} else if(jun.display_type == VALUE_DISPLAY.label) {
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);
draw_text_over(xx + ui(16), _hsy, jun.display_data);
draw_text_add(xx + ui(16), _hsy, jun.display_data);
widH = string_height(jun.display_data);
} else

View file

@ -26,7 +26,7 @@ function Node_Atlas_Draw(_x, _y, _group = noone) : Node(_x, _y, _group) construc
outSurf = surface_verify(outSurf, dim[0], dim[1]);
outputs[| 0].setValue(outSurf);
surface_set_shader(outSurf);
surface_set_shader(outSurf,,, BLEND.alpha);
for( var i = 0; i < array_length(atl); i++ ) {
shader_set_interpolation(atl[i].surface.get())
atl[i].draw();

View file

@ -27,6 +27,68 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
static findBoundary = function(surface) {
if(!is_surface(surface)) return [ 0, 0, 0, 0 ];
var _w = surface_get_width(surface);
var _h = surface_get_height(surface);
var s = surface_create(_w, _h, surface_r8unorm);
surface_set_target(s);
DRAW_CLEAR
draw_surface_safe(surface, 0, 0);
surface_reset_target();
var buff = buffer_create(_w * _h, buffer_fast, 1);
buffer_get_surface(buff, s, 0);
var top = 0;
for( var i = top; i < _h; i++ )
for( var j = 0; j < _w; j++ ) {
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
if(col > 0) {
top = i;
i = _h;
break;
}
}
var bottom = _h;
for( var i = bottom; i >= top; i-- )
for( var j = 0; j < _w; j++ ) {
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
if(col > 0) {
bottom = i;
i = 0;
break;
}
}
var left = 0;
for( var j = 0; j < _w; j++ )
for( var i = top; i < bottom; i++ ) {
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
if(col > 0) {
left = j;
j = _w;
break;
}
}
var right = 0;
for( var j = _w; j >= left; j-- )
for( var i = top; i < bottom; i++ ) {
var col = buffer_read_at(buff, i * _w + j, buffer_u8);
if(col > 0) {
right = j;
j = 0;
break;
}
}
return [ left, top, right + 1, bottom + 1 ];
}
static update = function() {
var _inSurf = inputs[| 0].getValue();
var _active = inputs[| 1].getValue();
@ -56,33 +118,48 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _surf = _inSurf[j];
var _dim = [ surface_get_width(_surf), surface_get_height(_surf) ];
var s = surface_create(_dim[0], _dim[1], surface_r8unorm);
surface_set_target(s);
DRAW_CLEAR
draw_surface_safe(_surf, 0, 0);
surface_reset_target();
var _minx, _miny, _maxx, _maxy;
for( var i = 0; i < array_length(temp_surface); i++ ) {
temp_surface[i] = surface_verify(temp_surface[i], 1, 1, cDep);
shader_set(sh_find_boundary);
shader_set_f("dimension", _dim);
shader_set_i("mode", i);
if(i) shader_set_f("minn", [ _minx, _miny ]);
shader_set_surface("texture", s);
surface_set_target(temp_surface[i]);
DRAW_CLEAR
BLEND_OVERRIDE;
draw_surface_safe(_surf, 0, 0);
draw_surface(s, 0, 0);
BLEND_NORMAL;
surface_reset_target();
shader_reset();
if(i == 0) {
var minBox = surface_get_pixel_ext(temp_surface[0] , 0, 0);
_minx = max(0, color_get_red(minBox) * 256 + color_get_green(minBox));
_miny = max(0, color_get_blue(minBox) * 256 + color_get_alpha(minBox));
}
}
var minBox = surface_get_pixel_ext(temp_surface[DIMENSION.width] , 0, 0);
var maxBox = surface_get_pixel_ext(temp_surface[DIMENSION.height], 0, 0);
surface_free(s);
var _minx = max(0, color_get_red(minBox) * 256 + color_get_green(minBox) - 1);
var _miny = max(0, color_get_blue(minBox) * 256 + color_get_alpha(minBox) - 1);
var _maxx = color_get_red(maxBox) * 256 + color_get_green(maxBox);
var _maxy = color_get_blue(maxBox) * 256 + color_get_alpha(maxBox);
var maxBox = surface_get_pixel_ext(temp_surface[1], 0, 0);
_maxx = color_get_red(maxBox) * 256 + color_get_green(maxBox) + 1;
_maxy = color_get_blue(maxBox) * 256 + color_get_alpha(maxBox) + 1;
if(_array == 0) {
minx = min(minx, _minx);
miny = min(miny, _miny);
maxx = max(maxx, _maxx);
maxy = max(maxy, _maxy);
} else if(_array == 1) {

View file

@ -75,10 +75,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_tw = string_width(_bch) * _s;
_th = string_height(_bch) * _s;
draw_set_color(COLORS.node_display_text_frame_outline);
draw_roundrect_ext(_tx - 4, _y - 4, _tx + _tw + 4, _y + _th + 4, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, 0);
draw_set_color(COLORS.node_display_text_frame_fill);
draw_roundrect_ext(_tx - 4, _y - 4, _tx + _tw + 4, _y + _th + 4, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, 1);
draw_sprite_stretched_points(THEME.ui_selection, 0, _tx - 4, _y - 4, _tx + _tw + 4, _y + _th + 4);
draw_set_color(_cc);
draw_text_transformed(_tx, _y, _bch, _s, _s, 0);

View file

@ -66,7 +66,7 @@ function Node_Equation(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
_jName.editWidget.draw(tx, ty, ui(128), _th, _jName.showValue(), _m, _jName.display_type);
draw_set_text(f_p1, fa_center, fa_top, COLORS._main_text_sub);
draw_text_over(tx + ui(128 + 12), ty + ui(6), "=");
draw_text_add(tx + ui(128 + 12), ty + ui(6), "=");
var _jValue = inputs[| i + 1];
_jValue.editWidget.setActiveFocus(_focus, _hover);

View file

@ -442,6 +442,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
}
}
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
var vk = new valueKey(_time, _val, self, ease_in, ease_out);
vk.ease_in_type = ease_in_type;
vk.ease_out_type = ease_out_type;

View file

@ -535,7 +535,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
addNodeObject(color, "Palette Replace", s_node_palette_replace, "Node_Palette_Replace", [1, Node_Palette_Replace]).setVersion(1120);
ds_list_add(color, "Gradient");
addNodeObject(color, "Gradient", s_node_gradient_out, "Node_Gradient_Out", [1, Node_Gradient_Out]);
addNodeObject(color, "Gradient", s_node_gradient_out, "Node_6radient_Out", [1, Node_Gradient_Out]);
addNodeObject(color, "Palette to Gradient", s_node_gradient_palette, "Node_Gradient_Palette", [1, Node_Gradient_Palette],, "Create gradient from palette.").setVersion(1135);
addNodeObject(color, "Gradient Shift", s_node_gradient_shift, "Node_Gradient_Shift", [1, Node_Gradient_Shift],, "Move gradients keys.");
addNodeObject(color, "Gradient Replace", s_node_gradient_replace, "Node_Gradient_Replace_Color", [1, Node_Gradient_Replace_Color]).setVersion(1135);

View file

@ -6,19 +6,106 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const
inputs[| 1] = nodeValue("Speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.rejectArray();
inputs[| 2] = nodeValue("Sequence", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [])
.setArrayDepth(1);
inputs[| 3] = nodeValue("Overflow", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Hold", "Loop", "Empty" ]);
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
static update = function(frame = ANIMATOR.current_frame) {
var seq = inputs[| 0].getValue();
var spd = inputs[| 1].getValue();
sequence_surface = noone;
sequence_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) {
var _seq = inputs[| 0].getValue();
var _ord = inputs[| 2].getValue();
var _h = ui(64);
if(!is_array(seq)) {
outputs[| 0].setValue(seq);
if(_hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) {
draw_sprite_stretched(THEME.button, mouse_click(mb_left, _focus)? 2 : 1, _x, _y, _w, _h);
if(mouse_press(mb_left, _focus))
dialogPanelCall(new Panel_Array_Sequence(self));
} else
draw_sprite_stretched(THEME.button, 0, _x, _y, _w, _h);
var x0 = _x + ui(4);
var y0 = _y + ui(4);
var x1 = _x + _w - ui(4 + 32);
var y1 = _y + _h - ui(4);
var sw = x1 - x0;
var sh = y1 - y0;
var nn = sh;
draw_sprite_stretched(THEME.ui_panel_bg, 1, x0, y0, sw, sh);
sequence_surface = surface_verify(sequence_surface, sw, sh - ui(8));
surface_set_target(sequence_surface);
DRAW_CLEAR
for( var i = 0; i < array_length(_ord); i++ ) {
var o = _ord[i];
if(o == noone) continue;
var s = array_safe_get(_seq, o);
if(!is_surface(s)) continue;
var xx = nn * i;
var _sw = surface_get_width(s);
var _sh = surface_get_height(s);
var _ss = (nn - ui(4)) / max(_sw, _sh);
var _sx = xx + nn / 2 - _sw * _ss / 2;
var _sy = nn / 2 - _sh * _ss / 2;
draw_surface_ext_safe(s, _sx, _sy, _ss, _ss);
//draw_set_color(COLORS.panel_toolbar_outline);
//draw_rectangle(xx, 0, xx + nn, nn, true);
}
surface_reset_target();
draw_surface(sequence_surface, x0, y0 + ui(4));
draw_sprite_ui(THEME.gear, 0, x1 + ui(16), _y + _h / 2,,,, COLORS._main_icon);
return _h;
});
input_display_list = [ 0,
["Frames", false], sequence_renderer, 3,
["Animation", false], 1,
];
static update = function(frame = ANIMATOR.current_frame) {
var _seq = inputs[| 0].getValue();
var _spd = inputs[| 1].getValue();
var _ord = inputs[| 2].getValue();
var _ovf = inputs[| 3].getValue();
if(!is_array(_seq)) {
outputs[| 0].setValue(_seq);
return;
}
var _frame = safe_mod(floor(ANIMATOR.current_frame / spd), array_length(seq));
outputs[| 0].setValue(array_safe_get(seq, _frame));
var frm = floor(ANIMATOR.current_frame / _spd);
var ind = frm;
if(array_length(_ord) > 0) {
if(_ovf == 0)
ind = clamp(ind, 0, array_length(_ord) - 1);
else if(_ovf == 2 && ind >= array_length(_ord)) {
outputs[| 0].setValue(noone);
return;
}
ind = array_safe_get(_ord, ind,, ARRAY_OVERFLOW.loop);
} else
ind = safe_mod(floor(ANIMATOR.current_frame / _spd), array_length(_seq));
if(ind == noone) {
outputs[| 0].setValue(noone);
return;
}
outputs[| 0].setValue(array_safe_get(_seq, ind));
}
}

View file

@ -160,6 +160,7 @@ function Panel_Addon() : PanelContent() constructor {
#endregion
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -13,17 +13,17 @@ function Panel_Animation() : PanelContent() constructor {
timeline_h = ui(28);
min_w = ui(40);
min_h = ui(48);
tool_width = ui(280);
tool_width = ui(224);
function initSize() {
timeline_w = w - tool_width - ui(12);
timeline_w = w - tool_width - ui(80);
timeline_surface = surface_create_valid(timeline_w, timeline_h);
timeline_mask = surface_create_valid(timeline_w, timeline_h);
timeline_mask = surface_create_valid(timeline_w, timeline_h);
dope_sheet_w = w - tool_width;
dope_sheet_h = h - timeline_h - ui(20);
dope_sheet_surface = surface_create_valid(dope_sheet_w, 1);
dope_sheet_mask = surface_create_valid(dope_sheet_w, 1);
dope_sheet_w = w - tool_width;
dope_sheet_h = h - timeline_h - ui(20);
dope_sheet_surface = surface_create_valid(dope_sheet_w, 1);
dope_sheet_mask = surface_create_valid(dope_sheet_w, 1);
}
initSize();
@ -330,20 +330,9 @@ function Panel_Animation() : PanelContent() constructor {
dope_sheet_w = timeline_w;
dope_sheet_h = h - timeline_h - ui(24);
if(dope_sheet_h > ui(8)) {
if(is_surface(dope_sheet_mask) && surface_exists(dope_sheet_mask))
surface_size_to(dope_sheet_mask, dope_sheet_w, dope_sheet_h);
else
dope_sheet_mask = surface_create_valid(dope_sheet_w, dope_sheet_h);
if(is_surface(dope_sheet_surface) && surface_exists(dope_sheet_surface))
surface_size_to(dope_sheet_surface, dope_sheet_w, dope_sheet_h);
else
dope_sheet_surface = surface_create_valid(dope_sheet_w, dope_sheet_h);
if(is_surface(ds_name_surface) && surface_exists(ds_name_surface))
surface_size_to(ds_name_surface, tool_width - ui(16), dope_sheet_h);
else
ds_name_surface = surface_create_valid(tool_width - ui(16), dope_sheet_h);
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);
ds_name_surface = surface_verify(ds_name_surface, tool_width - ui(0), dope_sheet_h);
}
resetTimelineMask();
}
@ -405,7 +394,7 @@ function Panel_Animation() : PanelContent() constructor {
}
function drawTimeline() { //draw summary
var bar_x = tool_width - ui(48);
var bar_x = tool_width + ui(16);
var bar_y = h - timeline_h - ui(10);
var bar_w = timeline_w;
var bar_h = timeline_h;
@ -413,15 +402,15 @@ function Panel_Animation() : PanelContent() constructor {
var inspecting = PANEL_INSPECTOR.inspecting;
resetTimelineMask();
if(!is_surface(timeline_surface) || !surface_exists(timeline_surface))
timeline_surface = surface_create_valid(timeline_w, timeline_h);
timeline_surface = surface_verify(timeline_surface, timeline_w, timeline_h);
surface_set_target(timeline_surface);
draw_clear_alpha(COLORS.panel_bg_clear, 0);
#region bg
draw_sprite_stretched(THEME.ui_panel_bg, 1, 0, 0, bar_w, bar_h);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, 0, 0, bar_total_w, bar_h, COLORS.panel_animation_timeline_blend, 1);
var __w = timeline_shift + ANIMATOR.frames_total * ui(timeline_scale) + PANEL_PAD;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 2, 0, 0, min(__w, timeline_w), bar_h, COLORS.panel_animation_timeline_blend, 1);
if(inspecting)
inspecting.drawAnimationTimeline(timeline_shift, bar_w, bar_h, timeline_scale);
@ -429,7 +418,7 @@ function Panel_Animation() : PanelContent() constructor {
for(var i = timeline_separate; i <= ANIMATOR.frames_total; i += timeline_separate) {
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
draw_set_color(COLORS.panel_animation_frame_divider);
draw_line(bar_line_x, ui(12), bar_line_x, bar_h);
draw_line(bar_line_x, ui(12), bar_line_x, bar_h - PANEL_PAD);
draw_set_text(f_p2, fa_center, fa_bottom, COLORS._main_text_sub);
draw_text(bar_line_x, ui(16), string(i));
@ -438,7 +427,7 @@ function Panel_Animation() : PanelContent() constructor {
var bar_line_x = (ANIMATOR.current_frame + 1) * ui(timeline_scale) + timeline_shift;
var cc = ANIMATOR.is_playing? COLORS._main_value_positive : COLORS._main_accent;
draw_set_color(cc);
draw_line(bar_line_x, ui(12), bar_line_x, bar_h);
draw_line(bar_line_x, ui(12), bar_line_x, bar_h - PANEL_PAD);
draw_set_text(f_p2, fa_center, fa_bottom, cc);
draw_text(bar_line_x, ui(16), string(ANIMATOR.current_frame + 1));
@ -788,12 +777,12 @@ function Panel_Animation() : PanelContent() constructor {
function drawDopesheetAnimator(_node, animator, msx, msy) {
var aa = _node.group == PANEL_GRAPH.getCurrentContext()? 1 : 0.9;
var tx = tool_width - ui(72 + 16 * 3);
var tx = tool_width - ui(16 + 16 * 3);
var ty = animator.dopesheet_y - 1;
#region keyframe control
if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 1);
draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon_on_inner, 1);
if(mouse_press(mb_left, pFOCUS)) {
var _t = -1;
@ -805,11 +794,11 @@ function Panel_Animation() : PanelContent() constructor {
if(_t > -1) ANIMATOR.setFrame(_t);
}
} else
draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 0.75);
draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon_on_inner, 1);
var tx = tool_width - ui(72 + 16 * 1);
tx = tool_width - ui(16 + 16 * 1);
if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 1);
draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon_on_inner, 1);
if(mouse_press(mb_left, pFOCUS)) {
for(var k = 0; k < ds_list_size(animator.values); k++) {
@ -821,11 +810,11 @@ function Panel_Animation() : PanelContent() constructor {
}
}
} else
draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 0.75);
draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon_on_inner);
#endregion
#region add keyframe
var tx = tool_width - ui(72 + 16 * 2);
tx = tool_width - ui(16 + 16 * 2);
if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 1);
@ -847,40 +836,40 @@ function Panel_Animation() : PanelContent() constructor {
if(!_add) ds_list_add(animator.values, new valueKey(ANIMATOR.current_frame, animator.getValue(, false), animator));
}
} else
draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 0.75);
draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent);
#endregion
if(isGraphable(animator.prop)) {
var tx = tool_width - ui(68 + 16 * 0);
tx = tool_width - ui(16);
if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) {
draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, COLORS._main_icon, animator.prop.show_graph? 1 : 0.75);
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");
if(mouse_press(mb_left, pFOCUS))
animator.prop.show_graph = !animator.prop.show_graph;
} else
draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, animator.prop.show_graph? COLORS._main_accent : COLORS._main_icon);
draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, animator.prop.show_graph? COLORS._main_accent : COLORS._main_icon_on_inner);
}
var tx = tool_width - ui(72 + 16 * 4.5);
tx = tool_width - ui(16 + 16 * 4.5);
if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) {
draw_sprite_ui_uniform(THEME.prop_on_end, animator.prop.on_end, tx, ty, 1, COLORS._main_icon, 1);
draw_sprite_ui_uniform(THEME.prop_on_end, animator.prop.on_end, tx, ty, 1, COLORS._main_icon_on_inner, 1);
TOOLTIP = __txtx("panel_animation_looping_mode", "Looping mode") + ": " + ON_END_NAME[animator.prop.on_end];
if(mouse_press(mb_left, pFOCUS))
animator.prop.on_end = safe_mod(animator.prop.on_end + 1, sprite_get_number(THEME.prop_on_end));
} else
draw_sprite_ui_uniform(THEME.prop_on_end, animator.prop.on_end, tx, ty, 1, COLORS._main_icon, 0.75);
draw_sprite_ui_uniform(THEME.prop_on_end, animator.prop.on_end, tx, ty, 1, COLORS._main_icon_on_inner);
if(pHOVER && point_in_circle(msx, msy, ui(22), ty - 1, ui(10))) {
draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), ty - 1, 1, COLORS._main_icon, 1);
draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), ty - 1, 1, COLORS._main_icon_on_inner, 1);
if(mouse_press(mb_left, pFOCUS)) {
animator.prop.setAnim(!animator.prop.is_anim);
updatePropertyList();
}
} else
draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), ty - 1, 1, COLORS._main_icon, 0.75);
draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), ty - 1, 1, COLORS._main_icon_on_inner);
var hov = pHOVER && point_in_rectangle(msx, msy, 0, ty - ui(8), w, ty + ui(8));
if(hov) {
@ -889,7 +878,7 @@ function Panel_Animation() : PanelContent() constructor {
value_focusing = animator.prop;
}
var cc = animator.prop.sep_axis? COLORS.axis[animator.index] : COLORS._main_text;
var cc = animator.prop.sep_axis? COLORS.axis[animator.index] : COLORS._main_text_inner;
if(hov) cc = COLORS._main_text_accent;
draw_set_color(cc);
@ -904,7 +893,7 @@ function Panel_Animation() : PanelContent() constructor {
var msx = mx - ui(8);
var msy = my - ui(8);
var lable_w = tool_width - ui(64);
var lable_w = tool_width;
var _node = noone;
var _node_y = 0;
draw_set_text(f_p2, fa_left, fa_center);
@ -928,16 +917,16 @@ function Panel_Animation() : PanelContent() constructor {
_node_y += dope_sheet_node_padding;
if(pHOVER && point_in_rectangle(msx, msy, ui(20), _node_y - ui(10), lable_w, _node_y + ui(10))) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _node_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg_hover, aa);
draw_sprite_stretched_ext(THEME.ui_label_bg, 0, 0, _node_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg_hover, aa);
if(mouse_press(mb_left, pFOCUS))
node_ordering = _node;
} else
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _node_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg, aa);
draw_sprite_stretched_ext(THEME.ui_label_bg, 0, 0, _node_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg, aa);
if(_node == PANEL_INSPECTOR.inspecting)
draw_sprite_stretched_ext(THEME.node_active, 0, 0, _node_y - ui(10), lable_w, ui(20), COLORS._main_accent, 1);
var tx = tool_width - ui(76 + 16 * 0);
var tx = tool_width - ui(16);
if(pHOVER && point_in_circle(msx, msy, tx, _node_y - 1, ui(10))) {
draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, _node_y - 1, 1, COLORS._main_icon_light, 1);
TOOLTIP = __txtx("panel_animation_goto", "Go to node");
@ -962,13 +951,13 @@ function Panel_Animation() : PanelContent() constructor {
if(node_name_type == 0 || node_name_type == 1 || _node.display_name == "") {
draw_set_alpha(0.4);
draw_text(txx, _node_y - ui(2), nodeName);
draw_text_add(txx, _node_y - ui(2), nodeName);
txx += tw;
}
if(node_name_type == 0 || node_name_type == 2) {
draw_set_alpha(0.9);
draw_text(txx, _node_y - ui(2), _node.display_name);
draw_text_add(txx, _node_y - ui(2), _node.display_name);
}
draw_set_alpha(1);
@ -1137,7 +1126,7 @@ function Panel_Animation() : PanelContent() constructor {
}
function drawDopesheet() {
var bar_x = tool_width - ui(48);
var bar_x = tool_width + ui(16);
var bar_y = h - timeline_h - ui(10);
var bar_w = timeline_w;
var bar_h = timeline_h;
@ -1195,8 +1184,9 @@ function Panel_Animation() : PanelContent() constructor {
#region bg \\\\ set X, Y for Node and Prop
var bar_show_w = timeline_shift + bar_total_w;
draw_sprite_stretched(THEME.ui_panel_bg, 1, 0, 0, bar_w, dope_sheet_h); //base BG
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, timeline_shift, 0, bar_total_w, dope_sheet_h, COLORS.panel_animation_timeline_blend, 1);
var _bg_w = min(bar_total_w + PANEL_PAD, bar_w);
draw_sprite_stretched_ext(THEME.ui_panel_bg, 2, 0, 0, _bg_w, dope_sheet_h, COLORS.panel_animation_timeline_blend, 1);
dope_sheet_y_max = 0;
var key_y = ui(24) + dope_sheet_y;
@ -1208,7 +1198,7 @@ function Panel_Animation() : PanelContent() constructor {
key_y += dope_sheet_node_padding;
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), bar_show_w, ui(20), COLORS.panel_animation_node_bg, 1);
draw_sprite_stretched_ext(THEME.ui_label_bg, 0, 0, key_y - ui(10), bar_show_w, ui(20), COLORS.panel_animation_node_bg, 1);
key_y += ui(22);
dope_sheet_y_max += ui(28);
@ -1222,9 +1212,9 @@ function Panel_Animation() : PanelContent() constructor {
for( var k = 0; k < array_length(prop.animators); k++ ) {
prop.animators[k].dopesheet_y = key_y;
if(prop == value_focusing)
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(8), bar_show_w, ui(16), merge_color(COLORS._main_icon, COLORS._main_icon_dark, 0.7), 1);
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.ui_panel_bg, 0, 0, key_y - ui(6), bar_show_w, ui(12), COLORS.panel_animation_graph_bg, 1);
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);
key_y += ui(18);
dope_sheet_y_max += ui(18);
@ -1232,16 +1222,16 @@ function Panel_Animation() : PanelContent() constructor {
} else {
prop.animator.dopesheet_y = key_y;
if(prop == value_focusing)
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(8), bar_show_w, ui(16), merge_color(COLORS._main_icon, COLORS._main_icon_dark, 0.7), 1);
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.ui_panel_bg, 0, 0, key_y - ui(6), bar_show_w, ui(12), COLORS.panel_animation_graph_bg, 1);
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);
key_y += ui(18);
dope_sheet_y_max += ui(18);
}
if(prop.show_graph) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(4), bar_show_w, prop.graph_h, COLORS.panel_animation_graph_bg, 1);
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);
dope_sheet_y_max += prop.graph_h + ui(8);
}
@ -1254,7 +1244,7 @@ function Panel_Animation() : PanelContent() constructor {
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
draw_set_color(COLORS.panel_animation_frame_divider);
draw_set_alpha(i % timeline_separate == 0? 1 : 0.1);
draw_line(bar_line_x, ui(16), bar_line_x, dope_sheet_h);
draw_line(bar_line_x, ui(16), bar_line_x, dope_sheet_h - PANEL_PAD);
}
draw_set_alpha(1);
#endregion
@ -1440,11 +1430,7 @@ function Panel_Animation() : PanelContent() constructor {
#endregion
if(keyframe_boxing) {
draw_set_color(COLORS._main_accent);
draw_roundrect_ext(keyframe_box_sx, keyframe_box_sy, msx, msy, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, true);
draw_set_alpha(0.05);
draw_roundrect_ext(keyframe_box_sx, keyframe_box_sy, msx, msy, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, false);
draw_set_alpha(1);
draw_sprite_stretched_points(THEME.ui_selection, 0, keyframe_box_sx, keyframe_box_sy, msx, msy);
if(mouse_release(mb_left))
keyframe_boxing = false;
@ -1527,13 +1513,16 @@ function Panel_Animation() : PanelContent() constructor {
}
#region overlay
var ww = min(bar_show_w, bar_w - PANEL_PAD);
var hh = ui(20);
draw_set_color(COLORS.panel_animation_timeline_top);
draw_rectangle(0, 0, bar_show_w, ui(16), false);
draw_rectangle(PANEL_PAD, PANEL_PAD, ww - 1, hh, false);
for(var i = timeline_separate; i <= ANIMATOR.frames_total; i += timeline_separate) {
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_sub);
draw_text(bar_line_x - ui(2), 0, string(i));
draw_text(bar_line_x - ui(2), PANEL_PAD, string(i));
}
var bar_line_x = (ANIMATOR.current_frame + 1) * ui(timeline_scale) + timeline_shift;
@ -1541,15 +1530,14 @@ function Panel_Animation() : PanelContent() constructor {
draw_set_color(cc);
draw_set_font(f_p2);
draw_line(bar_line_x, 0, bar_line_x, dope_sheet_h);
draw_line(bar_line_x, PANEL_PAD, bar_line_x, dope_sheet_h);
var cf = string(ANIMATOR.current_frame + 1);
var tx = string_width(cf) + ui(4);
draw_rectangle(bar_line_x - tx, 0, bar_line_x, ui(16), false);
draw_roundrect_ext(bar_line_x - tx - ui(2), 0, bar_line_x, ui(16), ui(2), ui(2), false);
draw_rectangle(bar_line_x - tx, PANEL_PAD, bar_line_x, hh, false);
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_icon_dark);
draw_text(bar_line_x - ui(2), 0, cf);
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_on_accent);
draw_text(bar_line_x - ui(2), PANEL_PAD, cf);
#endregion
gpu_set_blendmode(bm_subtract);
@ -1561,7 +1549,11 @@ function Panel_Animation() : PanelContent() constructor {
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(8), ui(8), tool_width, dope_sheet_h);
draw_surface_safe(ds_name_surface, ui(8), ui(8));
draw_sprite_stretched(THEME.ui_panel_bg, 1, bar_x, ui(8), bar_w, dope_sheet_h); //base BG
draw_surface_safe(dope_sheet_surface, bar_x, ui(8));
draw_sprite_stretched(THEME.ui_panel_bg_cover, 1, bar_x, ui(8), bar_w, dope_sheet_h);
}
function drawAnimationControl() {

View file

@ -0,0 +1,192 @@
function Panel_Array_Sequence(node) : PanelContent() constructor {
self.node = node;
title = __txt("Array Sequence");
w = ui(640);
h = ui(168);
padding = ui(16);
content_h = ui(64);
content_surface = noone;
content_x = 0;
content_x_to = 0;
content_x_max = 0;
content_drag = noone;
sequence_surface = noone;
sequence_x = 0;
sequence_x_to = 0;
sequence_x_max = 0;
sequence_drag = noone;
len_stretching = false;
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
var _seq = node.inputs[| 0].getValue();
var _ord = node.inputs[| 2].getValue();
var draw_drag = true;
var content_w = w - (padding + padding);
var _ns = content_h;
var msx = mx - padding;
var msy = my - padding;
content_surface = surface_verify(content_surface, content_w, content_h);
surface_set_target(content_surface);
DRAW_CLEAR
for( var i = 0; i < array_length(_seq); i++ ) {
var _s = _seq[i];
if(!is_surface(_s)) continue;
var _sx = content_x + i * (_ns + ui(8));
var _sy = 0;
var _sw = surface_get_width(_s);
var _sh = surface_get_height(_s);
var _ss = (_ns - ui(8)) / max(_sw, _sh);
var _ssx = _sx + (_ns - _sw * _ss) / 2;
var _ssy = _sy + (_ns - _sh * _ss) / 2;
if(pHOVER && point_in_rectangle(msx, msy, _sx, _sy, _sx + _ns, _sy + _ns)) {
draw_sprite_stretched(THEME.group_label, 1, _sx, _sy, _ns, _ns);
if(mouse_press(mb_left, pFOCUS))
content_drag = i;
} else
draw_sprite_stretched(THEME.group_label, 0, _sx, _sy, _ns, _ns);
draw_surface_ext_safe(_s, _ssx, _ssy, _ss, _ss);
}
surface_reset_target();
content_x = lerp_float(content_x, content_x_to, 5);
content_x_max = max(0, array_length(_seq) * (_ns + ui(8)) - content_w + ui(96));
if(pHOVER && point_in_rectangle(mx, my, padding, padding, w - padding, h + content_h)) {
if(mouse_wheel_down()) content_x_to = clamp(content_x_to - (_ns + ui(8)), -content_x_max, 0);
if(mouse_wheel_up()) content_x_to = clamp(content_x_to + (_ns + ui(8)), -content_x_max, 0);
}
draw_surface(content_surface, padding, padding);
var px = padding;
var py = padding + content_h + ui(16);
var pw = w - (padding + padding);
var ph = h - (padding + padding) - content_h - ui(16);
var _ns = ui(32);
var len = array_length(_ord);
var msx = mx - px;
var msy = my - py;
draw_sprite_stretched(THEME.ui_panel_bg, !in_dialog, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16));
sequence_surface = surface_verify(sequence_surface, pw, ph);
surface_set_target(sequence_surface);
DRAW_CLEAR
draw_sprite_stretched(THEME.ui_panel_bg, 1, sequence_x, 0, len * _ns, ph);
var ax = sequence_x + len * _ns + ui(12);
var ay = ui(24) + _ns / 2;
if(pHOVER && point_in_circle(msx, msy, ax, ay, ui(8))) {
draw_sprite_ui(THEME.animation_stretch, 0, ax, ay,,,,, 1);
if(mouse_press(mb_left, pFOCUS))
len_stretching = true;
} else
draw_sprite_ui(THEME.animation_stretch, 0, ax, ay,,,,, 0.75);
for( var i = 0; i < ANIMATOR.frames_total; i++ ) {
var _sx = sequence_x + i * _ns;
draw_set_color(COLORS._main_text_sub);
draw_set_alpha(0.5);
draw_line(_sx, ui(24), _sx, ph);
draw_set_alpha(1);
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub);
draw_text_add(_sx + _ns / 2, ui(0), i);
}
for( var i = 0; i < array_length(_ord); i++ ) {
var _i = _ord[i];
if(_i == noone) continue;
var _s = _seq[_i];
if(!is_surface(_s)) continue;
var _sx = sequence_x + i * _ns;
var _sy = ui(24);
var _sw = surface_get_width(_s);
var _sh = surface_get_height(_s);
var _ss = min(_ns / _sw, _ns / _sh);
var _ssx = _sx + (_ns - _sw * _ss) / 2;
var _ssy = _sy + (_ns - _sh * _ss) / 2;
draw_surface_ext_safe(_s, _ssx, _ssy, _ss, _ss);
if(pHOVER && point_in_rectangle(msx, msy, _sx, _sy, _sx + _ns, _sy + _ns)) {
if(mouse_press(mb_left, pFOCUS)) {
_ord[i] = noone;
node.inputs[| 2].setValue(_ord);
content_drag = _i;
}
}
}
if(content_drag != noone && pHOVER && point_in_rectangle(mx, my, px, py, px + pw, py + ph)) {
var _s = _seq[content_drag];
var frm = round((msx - sequence_x - _ns / 2) / _ns);
var _sx = sequence_x + frm * _ns;
var _sy = ui(24);
var _sw = surface_get_width(_s);
var _sh = surface_get_height(_s);
var _ss = min(_ns / _sw, _ns / _sh);
var _ssx = _sx + (_ns - _sw * _ss) / 2;
var _ssy = _sy + (_ns - _sh * _ss) / 2;
draw_surface_ext_safe(_s, _ssx, _ssy, _ss, _ss,,, 0.75);
draw_drag = false;
if(mouse_release(mb_left, pFOCUS)) {
_ord = array_safe_set(_ord, frm, content_drag, noone);
node.inputs[| 2].setValue(_ord);
content_drag = noone;
}
}
surface_reset_target();
sequence_x = lerp_float(sequence_x, sequence_x_to, 5);
sequence_x_max = max(0, array_length(_ord) * _ns - pw + ui(320));
if(pHOVER && point_in_rectangle(mx, my, px, py, px + pw, py + ph)) {
if(mouse_wheel_down()) sequence_x_to = clamp(sequence_x_to - (_ns + ui(8)), -sequence_x_max, 0);
if(mouse_wheel_up()) sequence_x_to = clamp(sequence_x_to + (_ns + ui(8)), -sequence_x_max, 0);
}
draw_surface(sequence_surface, px, py);
if(len_stretching) {
var frm = round((msx - sequence_x - _ns / 2) / _ns);
_ord = array_resize_fill(_ord, frm, noone);
node.inputs[| 2].setValue(_ord);
if(mouse_release(mb_left))
len_stretching = false;
}
if(content_drag != noone) {
if(draw_drag) {
var _s = _seq[content_drag];
var _ns = content_h;
var _sw = surface_get_width(_s);
var _sh = surface_get_height(_s);
var _ss = (_ns - ui(8)) / max(_sw, _sh);
draw_surface_ext_safe(_s, mx, my, _ss, _ss,,, 0.5);
}
if(mouse_release(mb_left))
content_drag = noone;
}
}
}

View file

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

View file

@ -126,7 +126,7 @@ function Panel_Collection() : PanelContent() constructor {
contentView = 0;
contentPane = new scrollPane(content_w - ui(6), content_h, function(_y, _m) {
draw_clear_alpha(c_white, 0);
draw_clear_alpha(COLORS._main_text_inner, 0);
var nodes = search_string == ""? context.content : search_list;
if(mode == 0 && context == root) nodes = STEAM_COLLECTION;
@ -233,9 +233,9 @@ function Panel_Collection() : PanelContent() constructor {
}
}
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_inner);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
draw_text_ext_over(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width);
}
var hght = grid_size + name_height + ui(8);
@ -288,8 +288,8 @@ function Panel_Collection() : PanelContent() constructor {
} else
draw_sprite_ui_uniform(THEME.group, 0, spr_x, spr_y, 0.75, c_white);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
draw_text_over(list_height + ui(20), yy + list_height / 2, _node.name);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_inner);
draw_text_add(list_height + ui(20), yy + list_height / 2, _node.name);
yy += list_height;
hh += list_height;
@ -301,7 +301,7 @@ function Panel_Collection() : PanelContent() constructor {
folderPane = new scrollPane(group_w - ui(8), content_h, function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
draw_sprite_stretched(THEME.ui_panel_bg, 0, ui(8), 0, folderPane.surface_w - ui(8), folderPane.surface_h);
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(8), 0, folderPane.surface_w - ui(8), folderPane.surface_h);
var hh = ui(8);
_y += ui(8);
@ -372,7 +372,7 @@ function Panel_Collection() : PanelContent() constructor {
}
#endregion
var _x = ui(16);
var _x = ui(20);
var _y = ui(24);
var bh = line_get_height(f_p0b, 8);
var rootx = 0;
@ -386,32 +386,32 @@ function Panel_Collection() : PanelContent() constructor {
context = root;
}
draw_set_text(f_p0b, fa_left, fa_center, i == mode? COLORS._main_text
: COLORS._main_text_sub);
draw_set_text(f_p0b, fa_left, fa_center, i == mode? COLORS._main_text : COLORS._main_text_sub);
draw_text(_x, _y, __txt(r[0]));
_x += string_width(r[0]) + ui(20);
_x += string_width(r[0]) + ui(24);
}
rootx = _x;
var bx = w - ui(40);
var bx = w - ui(44);
var by = ui(12);
var bs = ui(32);
if(search_string == "") {
if(bx > rootx) {
var txt = contentView? __txtx("view_grid", "Grid view") : __txtx("view_list", "List view");
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.view_mode, contentView) == 2) {
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.view_mode, contentView) == 2) {
contentView = !contentView;
}
}
bx -= ui(32);
bx -= ui(36);
if(mode == 0 && !DEMO) {
if(bx > rootx) {
if(context != root) {
var txt = __txtx("panel_collection_add_node", "Add selecting node as collection");
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.add, 0, COLORS._main_value_positive) == 2) {
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.add, 0, COLORS._main_value_positive) == 2) {
if(PANEL_INSPECTOR.inspecting != noone) {
data_path = context.path;
var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(8));
@ -422,15 +422,14 @@ function Panel_Collection() : PanelContent() constructor {
}
}
}
} else {
draw_sprite_ui_uniform(THEME.add, 0, bx + ui(12), by + ui(12), 1, COLORS._main_icon_dark);
}
} else
draw_sprite_ui_uniform(THEME.add, 0, bx + bs / 2, by + bs / 2, 1, COLORS._main_icon_dark);
}
bx -= ui(32);
bx -= ui(36);
if(bx > rootx) {
var txt = __txtx("panel_collection_add_folder", "Add folder");
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt) == 2) {
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt) == 2) {
var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8);
dia.onModify = function (txt) {
directory_create(txt);
@ -438,25 +437,25 @@ function Panel_Collection() : PanelContent() constructor {
};
dia.path = context.path + "/";
}
draw_sprite_ui_uniform(THEME.folder_add, 0, bx + ui(12), by + ui(12), 1, COLORS._main_icon);
draw_sprite_ui_uniform(THEME.folder_add, 1, bx + ui(12), by + ui(12), 1, COLORS._main_value_positive);
draw_sprite_ui_uniform(THEME.folder_add, 0, bx + bs / 2, by + bs / 2, 1, COLORS._main_icon);
draw_sprite_ui_uniform(THEME.folder_add, 1, bx + bs / 2, by + bs / 2, 1, COLORS._main_value_positive);
}
bx -= ui(32);
bx -= ui(36);
}
if(bx > rootx) {
var txt = __txtx("panel_collection_open_file", "Open in file explorer");
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.folder) == 2)
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.folder) == 2)
shellOpenExplorer(context.path);
}
bx -= ui(32);
bx -= ui(36);
if(bx > rootx) {
var txt = __txt("Refresh");
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.refresh) == 2)
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.refresh) == 2)
refreshContext();
}
bx -= ui(32);
bx -= ui(36);
} else {
var tb_w = ui(200);
var tb_x = w - ui(10) - tb_w;

View file

@ -41,6 +41,7 @@ function Panel_Color() : PanelContent() constructor {
setHSV();
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE
@ -48,7 +49,7 @@ function Panel_Color() : PanelContent() constructor {
var py = ui(title_height);
var pw = w - ui(padding + padding);
var ph = h - ui(title_height + padding);
draw_sprite_stretched(THEME.ui_panel_bg, !in_dialog, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16));
var cont_x = ui(padding);

View file

@ -10,7 +10,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
parent = _parent;
if(parent) ds_list_add(parent.childs, self);
padding = ui(2);
padding = THEME_VALUE.panel_margin;
content = [];
content_index = 0;
childs = ds_list_create();
@ -461,8 +461,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
surface_set_target(tab_surface);
DRAW_CLEAR
var tbx = tab_x;
var tbx = tab_x + ui(1);
var tby = 0;
var tbh = tab_height + ui(2);
var tabHov = msx < 0 ? 0 : array_length(content) - 1;
tab_x = lerp_float(tab_x, tab_x_to, 5);
@ -492,16 +493,13 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(i == content_index) {
foc = FOCUS == self;
draw_set_color(FOCUS == self? COLORS._main_accent : COLORS.panel_bg_clear);
draw_roundrect_ext(_tbx, tby, _tbx + tbw, tby + ui(32), THEME_VALUE.panel_corner_radius, THEME_VALUE.panel_corner_radius, false);
var cc = FOCUS == self? COLORS.panel_tab_active : COLORS.panel_tab;
draw_sprite_stretched_ext(THEME.ui_panel_tab, FOCUS == self, _tbx, tby, tbw, tbh, cc, 1);
} else {
draw_set_color(COLORS.panel_bg_clear_inner);
draw_roundrect_ext(_tbx, tby, _tbx + tbw, tby + ui(32), THEME_VALUE.panel_corner_radius, THEME_VALUE.panel_corner_radius, false);
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, _tbx, tby, tbw, tbh, COLORS.panel_tab_inactive, 1);
if(HOVER == self && _hov) {
draw_set_color(COLORS.panel_bg_clear);
draw_roundrect_ext(_tbx, tby, _tbx + tbw, tby + ui(32), THEME_VALUE.panel_corner_radius, THEME_VALUE.panel_corner_radius, false);
}
if(HOVER == self && _hov)
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, _tbx, tby, tbw, tbh, COLORS.panel_tab_hover, 1);
}
if(HOVER == self && _hov) {
@ -535,7 +533,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
}
draw_set_text(f_p3, fa_left, fa_bottom, cc);
draw_text(_tbx + ui(8), tab_height - ui(2), txt);
draw_text_add(_tbx + ui(8), tab_height - ui(2), txt);
tbx += tbw + ui(2);
}
@ -555,8 +553,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
var tbw = string_width(txt) + ui(16);
if(icn != noone) tbw += ui(16 + 4);
draw_set_color(COLORS._main_accent);
draw_roundrect_ext(_tbx, tby, _tbx + tbw, tby + ui(32), THEME_VALUE.panel_corner_radius, THEME_VALUE.panel_corner_radius, false);
draw_sprite_stretched_ext(THEME.ui_panel_tab, FOCUS == self, _tbx, tby, tbw, tbh, COLORS.panel_tab_active, 1);
var cc = COLORS.panel_bg_clear_inner;
if(icn != noone) {
@ -602,6 +599,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
tw = w; th = h - tab * ui(tab_height);
if(th < ui(16)) return;
var con = getContent();
if(tab) drawTab();
var p = ui(6);
@ -609,19 +607,19 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
var m_ot = point_in_rectangle(mouse_mx, mouse_my, tx, ty, tx + tw, ty + th);
mouse_active = m_in;
draw_sprite_stretched(THEME.ui_panel_bg, 0, tx + padding, ty + padding, tw - padding * 2, th - padding * 2);
var _tw = tw - padding * 2;
var _th = th - padding * 2;
draw_sprite_stretched(THEME.ui_panel_bg, 0, tx + padding, ty + padding, _tw, _th);
if(!is_surface(mask_surface)) {
mask_surface = surface_create_valid(tw, th);
refresh();
}
if(!is_surface(content_surface))
content_surface = surface_create_valid(tw, th);
content_surface = surface_verify(content_surface, tw, th);
surface_set_target(content_surface);
draw_clear(COLORS.panel_bg_clear);
var con = getContent();
if(con) {
min_w = con.min_w;
min_h = con.min_h;
@ -635,6 +633,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
surface_reset_target();
draw_surface_safe(content_surface, tx, ty);
draw_sprite_stretched(THEME.ui_panel_bg, 3, tx + padding, ty + padding, _tw, _th);
if(FOCUS == self && parent != noone) {
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, tx + padding, ty + padding, tw - padding * 2, th - padding * 2, COLORS._main_accent, 1);

View file

@ -22,8 +22,8 @@
#macro PANEL_PADDING padding = in_dialog? ui(24) : ui(16); \
title_height = in_dialog? ui(64) : ui(56);
#macro PANEL_TITLE draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title); \
draw_text_over(in_dialog? ui(56) : ui(24), title_height / 2 - (!in_dialog) * ui(4), title);
#macro PANEL_TITLE draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); \
draw_text_add(in_dialog? ui(56) : ui(24), title_height / 2 - (!in_dialog) * ui(4), title);
#endregion
#region functions

View file

@ -34,6 +34,7 @@ function Panel_Globalvar() : PanelContent() constructor {
});
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -79,6 +79,7 @@ function Panel_Gradient() : PanelContent() constructor {
});
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -842,11 +842,7 @@ function Panel_Graph() : PanelContent() constructor {
#region draw selection frame
if(nodes_select_drag) {
if(point_distance(nodes_select_mx, nodes_select_my, mx, my) > 16) {
draw_set_color(COLORS._main_accent);
draw_roundrect_ext(nodes_select_mx, nodes_select_my, mx, my, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, true);
draw_set_alpha(0.05);
draw_roundrect_ext(nodes_select_mx, nodes_select_my, mx, my, THEME_VALUE.selection_corner_radius, THEME_VALUE.selection_corner_radius, false);
draw_set_alpha(1);
draw_sprite_stretched_points(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my);
//ds_list_clear(nodes_select_list);
@ -1528,13 +1524,8 @@ function Panel_Graph() : PanelContent() constructor {
if(pHOVER && point_in_rectangle(mx, my, 0, ty, w, h))
mouse_on_graph = false;
draw_set_color(COLORS.panel_toolbar_fill);
draw_rectangle(0, ty, w, h, false);
draw_set_color(COLORS.panel_toolbar_outline);
draw_line(0, ty, w, ty);
draw_sprite_stretched(THEME.toolbar, 0, 0, ty, w, h);
drawContext();
var tbx = w - toolbar_height / 2;

View file

@ -73,7 +73,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor {
for( var i = 0; i < array_length(widgets); i++ ) {
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
draw_text_over(0, ty + wh * i, __txt(widgets[i][0], "graph_export_"));
draw_text_add(0, ty + wh * i, __txt(widgets[i][0], "graph_export_"));
var _wid = widgets[i][1];
var _dat = widgets[i][2]();

View file

@ -155,10 +155,11 @@ function Panel_History() : PanelContent() constructor {
})
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title);
draw_text_over(in_dialog? ui(56) : ui(24), title_height / 2, title);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text_add(in_dialog? ui(56) : ui(24), title_height / 2, title);
var px = ui(padding);
var py = ui(title_height);

View file

@ -138,7 +138,7 @@ function Panel_Inspector() : PanelContent() constructor {
draw_sprite_ui(THEME.arrow, meta_display[i][1]? 0 : 3, ui(16), yy + ui(32) / 2, 1, 1, 0, COLORS.panel_inspector_group_bg, 1);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
draw_text(ui(32), yy + ui(32) / 2, _txt);
yy += ui(32 + 8);
@ -299,7 +299,7 @@ function Panel_Inspector() : PanelContent() constructor {
var lby = yy + ui(12);
draw_set_alpha(0.5);
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub);
draw_text_over(xc, lby, edt);
draw_text_add(xc, lby, edt);
var lbw = string_width(edt) / 2;
draw_set_color(COLORS._main_text_sub);
@ -325,7 +325,7 @@ function Panel_Inspector() : PanelContent() constructor {
}
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text_over(ui(8), yy + hg / 2, edt[0]);
draw_text_add(ui(8), yy + hg / 2, edt[0]);
switch(instanceof(edt[2])) {
case "textBox" : edt[2].draw(wx0, yy, ww, hg, val, _m); break;
@ -398,7 +398,7 @@ function Panel_Inspector() : PanelContent() constructor {
} else if(i == amoIn) {
hh += ui(8 + 32 + 8);
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(8), con_w, ui(32), COLORS._main_icon_dark, 0.85);
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(8), con_w, ui(32), COLORS.panel_inspector_output_label, 0.85);
draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub);
draw_text(xc, yy + ui(8 + 16), __txt("Outputs"));
continue;

View file

@ -445,7 +445,8 @@ function Panel_Menu() : PanelContent() constructor {
if(noti_icon_show > 0)
draw_sprite_ui(noti_icon, 0, nx0 + nw - ui(16), ny0,,,,, noti_icon_show);
draw_set_color(COLORS._main_text_inner);
var wr_x = hori? nx0 + ui(8) : w / 2 - (wr_w + er_w + ui(16)) / 2;
draw_sprite_ui_uniform(THEME.noti_icon_warning, warning_amo? 1 : 0, wr_x + ui(10), ny0);
draw_text(wr_x + ui(28), ny0, warning_amo);

View file

@ -101,6 +101,7 @@ function Panel_Nodes() : PanelContent() constructor {
#endregion
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -42,10 +42,11 @@ function Panel_Notification() : PanelContent() constructor {
sp_noti = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding), function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
var hh = 32;
var yy = _y;
var hh = 32;
var yy = _y;
var txw = sp_noti.surface_w - ui(48 + 48 + 20);
var amo = ds_list_size(STATUSES);
var pad = THEME_VALUE.panel_notification_padding;
draw_set_font(f_p3);
var timeW = string_width("00:00:00");
@ -57,13 +58,14 @@ function Panel_Notification() : PanelContent() constructor {
draw_set_font(f_p2);
var _w = sp_noti.surface_w;
var _h = ui(8) + string_height_ext(noti.txt, -1, txw) + ui(8);
var _h = ui(12) + string_height_ext(noti.txt, -1, txw);
_h += pad * 2;
if(yy >= -_h && yy <= sp_noti.h) {
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), _w, _h - ui(4), COLORS.dialog_notification_bg, 1);
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, _w, _h, COLORS.dialog_notification_bg, 1);
if(pHOVER && pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) {
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), _w, _h - ui(4), COLORS.dialog_notification_bg_hover, 1);
if(pHOVER && pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h)) {
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, _w, _h, COLORS.dialog_notification_bg_hover, 1);
if(noti.tooltip != "")
TOOLTIP = noti.tooltip;
@ -88,10 +90,10 @@ function Panel_Notification() : PanelContent() constructor {
var _nwx = sp_noti.w - ui(12) - ui(40);
var _nw = _nwx * noti.life / noti.life_max;
draw_sprite_stretched_ext(THEME.group_label, 0, ui(40), yy + ui(2), _nw, _h - ui(4), COLORS.dialog_notification_icon_bg, 1);
draw_sprite_stretched_ext(THEME.group_label, 0, ui(40), yy, _nw, _h, COLORS.dialog_notification_icon_bg, 1);
}
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), ui(48), _h - ui(4), noti.color, 1);
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, ui(48), _h, noti.color, 1);
if(noti.icon_end != noone)
draw_sprite_ui(noti.icon_end, 1, _w - ui(24), yy + _h / 2,,,, COLORS._main_icon);
@ -109,10 +111,10 @@ function Panel_Notification() : PanelContent() constructor {
var tx = ui(48) + timeW + ui(12);
draw_set_text(f_p3, fa_right, fa_center, COLORS._main_text_sub);
draw_set_text(f_p3, fa_right, fa_center, COLORS._main_text_sub_inner);
draw_text_line(tx - ui(4), yy + _h / 2, noti.time, -1, txw);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_inner);
draw_text_line(tx + ui(4), yy + _h / 2, noti.txt, -1, txw);
if(noti.amount > 1) {
@ -130,14 +132,15 @@ function Panel_Notification() : PanelContent() constructor {
}
}
yy += _h;
hh += _h;
yy += _h + ui(4);
hh += _h + ui(4);
}
return hh;
});
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -95,6 +95,7 @@ function Panel_Palette() : PanelContent() constructor {
});
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -665,11 +665,7 @@ function Panel_Preview() : PanelContent() constructor {
var scHeight = ui(32);
draw_set_color(COLORS.panel_toolbar_fill);
draw_rectangle(0, 0, w, scHeight, false);
draw_set_color(COLORS.panel_toolbar_outline);
draw_line(0, scHeight, w, scHeight);
draw_sprite_stretched(THEME.toolbar, 1, 0, 0, w, scHeight);
if(tool_current != noone) { //tool settings
var settings = PANEL_GRAPH.node_focus.tool_settings;
@ -746,11 +742,7 @@ function Panel_Preview() : PanelContent() constructor {
}
}
draw_set_color(COLORS.panel_toolbar_fill);
draw_rectangle(0, ty, w, h, false);
draw_set_color(COLORS.panel_toolbar_outline);
draw_line(0, ty, w, ty);
draw_sprite_stretched(THEME.toolbar, 0, 0, ty, w, h);
var tbx = toolbar_height / 2;
var tby = ty + toolbar_height / 2;
@ -851,7 +843,7 @@ function Panel_Preview() : PanelContent() constructor {
draw_clear(COLORS.panel_bg_clear);
if(canvas_bg == -1 && canvas_s >= 0.1)
draw_sprite_tiled_ext(s_transparent, 0, canvas_x, canvas_y, canvas_s, canvas_s, c_white, 0.5);
draw_sprite_tiled_ext(s_transparent, 0, canvas_x, canvas_y, canvas_s, canvas_s, COLORS.panel_preview_transparent, 1);
else
draw_clear(canvas_bg);

View file

@ -149,6 +149,7 @@ function Panel_Tunnels() : PanelContent() constructor {
#endregion
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
PANEL_PADDING
PANEL_TITLE

View file

@ -68,13 +68,21 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
tb_value.draw(_x + sw + ui(16), _y, tb_w, _h, _data, _m);
}
draw_sprite_stretched_ext(spr, 0, _x, _y + _h / 2 - ui(4), sw, ui(8), blend, 1);
if(THEME_VALUE.slider_type == "full_height")
draw_sprite_stretched_ext(spr, 0, _x, _y, sw, _h, blend, 1);
else if(THEME_VALUE.slider_type == "stem")
draw_sprite_stretched_ext(spr, 0, _x, _y + _h / 2 - ui(4), sw, ui(8), blend, 1);
var _kx = _x + clamp((_data - curr_minn) / (curr_maxx - curr_minn), 0, 1) * sw;
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
var _pg = clamp((_data - curr_minn) / (curr_maxx - curr_minn), 0, 1) * sw;
var _kx = _x + _pg;
if(THEME_VALUE.slider_type == "full_height")
draw_sprite_stretched_ext(spr, 1, _x, _y, _pg, _h, blend, 1);
else if(THEME_VALUE.slider_type == "stem")
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
if(dragging) {
draw_sprite_stretched_ext(spr, 3, _kx - handle_w / 2, _y, handle_w, _h, COLORS._main_accent, 1);
if(THEME_VALUE.slider_type == "stem")
draw_sprite_stretched_ext(spr, 3, _kx - handle_w / 2, _y, handle_w, _h, COLORS._main_accent, 1);
var val = (_m[0] - _x) / sw * (curr_maxx - curr_minn) + curr_minn;
val = round(val / step) * step;
@ -96,7 +104,8 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
}
} else {
if(hover && (point_in_rectangle(_m[0], _m[1], _x, _y, _x + sw, _y + _h) || point_in_rectangle(_m[0], _m[1], _kx - handle_w / 2, _y, _kx + handle_w / 2, _y + _h))) {
draw_sprite_stretched_ext(spr, 2, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
if(THEME_VALUE.slider_type == "stem")
draw_sprite_stretched_ext(spr, 2, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
if(mouse_press(mb_left, active)) {
dragging = true;

View file

@ -29,6 +29,9 @@ function _sprite_load_from_struct(str, theme, key) {
slice.top = str.slice.top;
slice.bottom = str.slice.bottom;
if(struct_has(str.slice, "tilemode"))
slice.tilemode = str.slice.tilemode;
sprite_set_nineslice(s, slice);
}
return s;

View file

@ -255,26 +255,7 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
break;
case VALUE_DISPLAY.node_title :
draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color);
var _x0 = _x + disp_x, ch = "", len = string_length(_text), i = 1;
var cc = draw_get_color();
var str = "", title = 0;
while(i <= len) {
ch = string_char_at(_text, i);
if(ch == "[")
draw_set_color(COLORS._main_text_sub);
draw_text(_x0, 0, ch);
_x0 += string_width(ch);
if(ch == "]")
draw_set_color(cc);
i++;
}
draw_text(_x0, _y, str);
draw_text(_x + disp_x, _y, _text);
break;
}
@ -568,7 +549,10 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
}
surface_set_target(text_surface);
DRAW_CLEAR
DRAW_CLEAR
//draw_set_color(c_black);
//draw_line(0, _h / 2 - th / 2, 9999, _h / 2 - th / 2);
display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4), _format);
surface_reset_target();
draw_surface(text_surface, tb_surf_x, tb_surf_y);

View file

@ -117,7 +117,7 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
var bx = _x + ww * i;
tb[i].draw(bx + ui(24), _y, ww - ui(24), _h, _data[i], _m);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
draw_text(bx + ui(8), _y + _h / 2, axis[i]);
}

View file

@ -89,7 +89,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const
var by = _y + i % 2 * (_h + ui(4));
tb[i].draw(bx + ui(56), by, ww - ui(56), _h, _data[i], _m);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner);
draw_text(bx + ui(8), by + _h / 2, label[i]);
}

View file

@ -5,32 +5,84 @@ varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
uniform vec2 minn;
uniform int mode;
uniform sampler2D texture;
void main() {
float minx = dimension.x;
float miny = dimension.y;
float maxx = 0.;
float maxy = 0.;
//float minx = dimension.x;
//float miny = dimension.y;
//float maxx = 0.;
//float maxy = 0.;
for(float i = 0.; i <= dimension.x; i++)
for(float j = 0.; j <= dimension.y; j++) {
vec4 col = texture2D( gm_BaseTexture, vec2(i, j) / (dimension + 1.) );
if(col.a == 0.) continue;
//for(float i = 0.; i <= dimension.x; i++)
//for(float j = 0.; j <= dimension.y; j++) {
// vec4 col = texture2D( gm_BaseTexture, vec2(i, j) / (dimension + 1.) );
// if(col.r == 0.) continue;
minx = min(minx, i);
miny = min(miny, j);
maxx = max(maxx, i);
maxy = max(maxy, j);
}
// minx = min(minx, i);
// miny = min(miny, j);
// maxx = max(maxx, i);
// maxy = max(maxy, j);
//}
float _w = dimension.x;
float _h = dimension.y;
vec4 col;
float i, j;
if(mode == 0) {
float miny = 0.;
for( i = miny; i < _h; i++ )
for( j = 0.; j < _w; j++ ) {
col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) {
miny = i;
i = _h;
break;
}
}
float minx = 0.;
for( j = 0.; j < _w; j++ )
for( i = miny; i < _h; i++ ) {
col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) {
minx = j;
j = _w;
break;
}
}
float minx_h = floor(minx / 256.) / 255.;
float minx_l = mod(minx, 256.) / 255.;
float miny_h = floor(miny / 256.) / 255.;
float miny_l = mod(miny, 256.) / 255.;
gl_FragColor = vec4(minx_h, minx_l, miny_h, miny_l);
} else {
float maxy = _h;
for( i = maxy; i >= minn.y; i-- )
for( j = 0.; j < _w; j++ ) {
col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) {
maxy = i;
i = 0.;
break;
}
}
float maxx = 0.;
for( j = _w; j >= minn.x; j-- )
for( i = minn.y; i < maxy; i++ ) {
col = texture2D( texture, vec2(j, i) / dimension);
if(col.r > 0.) {
maxx = j;
j = 0.;
break;
}
}
float maxx_h = floor(maxx / 256.) / 255.;
float maxx_l = mod(maxx, 256.) / 255.;
float maxy_h = floor(maxy / 256.) / 255.;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 314 B