diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index d305811b2..11db8f151 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -123,8 +123,8 @@ {"name":"pattern","order":14,"path":"folders/nodes/data/generator/pattern.yy",}, {"name":"regions","order":21,"path":"folders/nodes/data/generator/regions.yy",}, {"name":"group","order":7,"path":"folders/nodes/data/group.yy",}, - {"name":"IO","order":1,"path":"folders/nodes/data/IO.yy",}, - {"name":"network","order":15,"path":"folders/nodes/data/IO/network.yy",}, + {"name":"io","order":1,"path":"folders/nodes/data/io.yy",}, + {"name":"network","order":15,"path":"folders/nodes/data/io/network.yy",}, {"name":"iterate","order":9,"path":"folders/nodes/data/iterate.yy",}, {"name":"_legacy","order":12,"path":"folders/nodes/data/iterate/_legacy.yy",}, {"name":"for filter","order":1,"path":"folders/nodes/data/iterate/_legacy/for filter.yy",}, @@ -270,10 +270,10 @@ {"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",}, {"name":"widget","order":3,"path":"folders/VCT/widget.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, - {"name":"button","order":34,"path":"folders/widgets/button.yy",}, - {"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",}, - {"name":"sliders","order":39,"path":"folders/widgets/sliders.yy",}, - {"name":"text","order":36,"path":"folders/widgets/text.yy",}, + {"name":"button","order":8,"path":"folders/widgets/button.yy",}, + {"name":"rotator","order":9,"path":"folders/widgets/rotator.yy",}, + {"name":"sliders","order":12,"path":"folders/widgets/sliders.yy",}, + {"name":"text","order":10,"path":"folders/widgets/text.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":13,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -455,7 +455,7 @@ {"name":"panel_preview_snap_setting","order":5,"path":"scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy",}, {"name":"sh_edge_shade_convert","order":1,"path":"shaders/sh_edge_shade_convert/sh_edge_shade_convert.yy",}, {"name":"sh_d3d_extrude_extends","order":26,"path":"shaders/sh_d3d_extrude_extends/sh_d3d_extrude_extends.yy",}, - {"name":"scrollBox","order":13,"path":"scripts/scrollBox/scrollBox.yy",}, + {"name":"scrollBox","order":2,"path":"scripts/scrollBox/scrollBox.yy",}, {"name":"o_dialog_exit","order":2,"path":"objects/o_dialog_exit/o_dialog_exit.yy",}, {"name":"s_node_vfx_triangulate","order":15,"path":"sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy",}, {"name":"node_shape_polygon","order":6,"path":"scripts/node_shape_polygon/node_shape_polygon.yy",}, @@ -553,7 +553,7 @@ {"name":"Obj_FirebaseFirestore_allCallbacks","order":4,"path":"objects/Obj_FirebaseFirestore_allCallbacks/Obj_FirebaseFirestore_allCallbacks.yy",}, {"name":"sh_level_selector","order":15,"path":"shaders/sh_level_selector/sh_level_selector.yy",}, {"name":"byte_writer","order":8,"path":"scripts/byte_writer/byte_writer.yy",}, - {"name":"checkboxGroup","order":28,"path":"scripts/checkboxGroup/checkboxGroup.yy",}, + {"name":"checkboxGroup","order":6,"path":"scripts/checkboxGroup/checkboxGroup.yy",}, {"name":"node_FXAA","order":8,"path":"scripts/node_FXAA/node_FXAA.yy",}, {"name":"__node_3d_object","order":4,"path":"scripts/__node_3d_object/__node_3d_object.yy",}, {"name":"s_node_pixel_find","order":13,"path":"sprites/s_node_pixel_find/s_node_pixel_find.yy",}, @@ -666,7 +666,7 @@ {"name":"node_color_rgb","order":7,"path":"scripts/node_color_rgb/node_color_rgb.yy",}, {"name":"node_struct_get","order":1,"path":"scripts/node_struct_get/node_struct_get.yy",}, {"name":"d3d_plane","order":2,"path":"scripts/d3d_plane/d3d_plane.yy",}, - {"name":"curveBox","order":8,"path":"scripts/curveBox/curveBox.yy",}, + {"name":"curveBox","order":1,"path":"scripts/curveBox/curveBox.yy",}, {"name":"s_node_iterator_length","order":24,"path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",}, {"name":"preview_overlay_vector","order":2,"path":"scripts/preview_overlay_vector/preview_overlay_vector.yy",}, {"name":"sh_gradient_display","order":7,"path":"shaders/sh_gradient_display/sh_gradient_display.yy",}, @@ -794,7 +794,6 @@ {"name":"node_voronoi_extra","order":16,"path":"scripts/node_voronoi_extra/node_voronoi_extra.yy",}, {"name":"node_combine_rgb","order":1,"path":"scripts/node_combine_rgb/node_combine_rgb.yy",}, {"name":"fd_rectangle_draw_part","order":10,"path":"scripts/fd_rectangle_draw_part/fd_rectangle_draw_part.yy",}, - {"name":"checkbox","order":7,"path":"scripts/checkbox/checkbox.yy",}, {"name":"s_node_to_number","order":16,"path":"sprites/s_node_to_number/s_node_to_number.yy",}, {"name":"node_string_regex_replace","order":9,"path":"scripts/node_string_regex_replace/node_string_regex_replace.yy",}, {"name":"s_node_particle","order":12,"path":"sprites/s_node_particle/s_node_particle.yy",}, @@ -860,6 +859,7 @@ {"name":"libxprocess","order":2,"path":"extensions/libxprocess/libxprocess.yy",}, {"name":"fd_rectangle_get_pressure_height","order":16,"path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",}, {"name":"hyperbolic_function","order":16,"path":"scripts/hyperbolic_function/hyperbolic_function.yy",}, + {"name":"sh_widget_rotator","order":4,"path":"shaders/sh_widget_rotator/sh_widget_rotator.yy",}, {"name":"node_tile","order":4,"path":"scripts/node_tile/node_tile.yy",}, {"name":"s_node_2d_light_shape","order":14,"path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",}, {"name":"sh_rsh_rotate","order":1,"path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",}, @@ -931,6 +931,7 @@ {"name":"s_node_pb_fx_radial","order":4,"path":"sprites/s_node_pb_fx_radial/s_node_pb_fx_radial.yy",}, {"name":"node_kuwahara","order":21,"path":"scripts/node_kuwahara/node_kuwahara.yy",}, {"name":"__background_get_internal","order":2,"path":"scripts/__background_get_internal/__background_get_internal.yy",}, + {"name":"sh_widget_rotator_range","order":5,"path":"shaders/sh_widget_rotator_range/sh_widget_rotator_range.yy",}, {"name":"s_node_array_sample","order":18,"path":"sprites/s_node_array_sample/s_node_array_sample.yy",}, {"name":"o_pie_menu","order":14,"path":"objects/o_pie_menu/o_pie_menu.yy",}, {"name":"s_biterator_b_labels","order":9,"path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",}, @@ -1096,7 +1097,7 @@ {"name":"FirebaseFirestoreUserFunctions","order":2,"path":"scripts/FirebaseFirestoreUserFunctions/FirebaseFirestoreUserFunctions.yy",}, {"name":"node_smoke_add_collider","order":6,"path":"scripts/node_smoke_add_collider/node_smoke_add_collider.yy",}, {"name":"node_atlas_get","order":1,"path":"scripts/node_atlas_get/node_atlas_get.yy",}, - {"name":"fontScrollBox","order":14,"path":"scripts/fontScrollBox/fontScrollBox.yy",}, + {"name":"fontScrollBox","order":13,"path":"scripts/fontScrollBox/fontScrollBox.yy",}, {"name":"node_grid_hex","order":2,"path":"scripts/node_grid_hex/node_grid_hex.yy",}, {"name":"sh_lovify","order":1,"path":"shaders/sh_lovify/sh_lovify.yy",}, {"name":"FirebaseREST_Firestore_collection_compare","order":5,"path":"scripts/FirebaseREST_Firestore_collection_compare/FirebaseREST_Firestore_collection_compare.yy",}, @@ -1260,7 +1261,7 @@ {"name":"json_compare","order":21,"path":"scripts/json_compare/json_compare.yy",}, {"name":"s_node_text_file_write","order":34,"path":"sprites/s_node_text_file_write/s_node_text_file_write.yy",}, {"name":"node_rigid_force_apply","order":4,"path":"scripts/node_rigid_force_apply/node_rigid_force_apply.yy",}, - {"name":"checkboxActive","order":38,"path":"scripts/checkboxActive/checkboxActive.yy",}, + {"name":"checkboxActive","order":11,"path":"scripts/checkboxActive/checkboxActive.yy",}, {"name":"__node_shader","order":21,"path":"scripts/__node_shader/__node_shader.yy",}, {"name":"node_FLIP_vortex","order":13,"path":"scripts/node_FLIP_vortex/node_FLIP_vortex.yy",}, {"name":"__node_iterator","order":6,"path":"scripts/__node_iterator/__node_iterator.yy",}, @@ -1333,7 +1334,7 @@ {"name":"_node_strand_affector","order":10,"path":"scripts/_node_strand_affector/_node_strand_affector.yy",}, {"name":"Steamworks","order":2,"path":"extensions/Steamworks/Steamworks.yy",}, {"name":"sh_vertex_pnt_light","order":4,"path":"shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy",}, - {"name":"surfaceBox","order":22,"path":"scripts/surfaceBox/surfaceBox.yy",}, + {"name":"surfaceBox","order":4,"path":"scripts/surfaceBox/surfaceBox.yy",}, {"name":"s_node_array_composite","order":17,"path":"sprites/s_node_array_composite/s_node_array_composite.yy",}, {"name":"node_gradient_palette","order":11,"path":"scripts/node_gradient_palette/node_gradient_palette.yy",}, {"name":"node_smoke_domain","order":1,"path":"scripts/node_smoke_domain/node_smoke_domain.yy",}, @@ -1366,7 +1367,7 @@ {"name":"s_node_cache_array","order":25,"path":"sprites/s_node_cache_array/s_node_cache_array.yy",}, {"name":"sh_blend_alpha_addition","order":13,"path":"shaders/sh_blend_alpha_addition/sh_blend_alpha_addition.yy",}, {"name":"s_node_path_from_mask","order":14,"path":"sprites/s_node_path_from_mask/s_node_path_from_mask.yy",}, - {"name":"widget","order":25,"path":"scripts/widget/widget.yy",}, + {"name":"widget","order":5,"path":"scripts/widget/widget.yy",}, {"name":"node_VFX_vortex","order":6,"path":"scripts/node_VFX_vortex/node_VFX_vortex.yy",}, {"name":"s_node_skew","order":11,"path":"sprites/s_node_skew/s_node_skew.yy",}, {"name":"version_checker","order":11,"path":"scripts/version_checker/version_checker.yy",}, @@ -1632,7 +1633,7 @@ {"name":"node_alpha_hash","order":11,"path":"scripts/node_alpha_hash/node_alpha_hash.yy",}, {"name":"sh_region_fill_border","order":5,"path":"shaders/sh_region_fill_border/sh_region_fill_border.yy",}, {"name":"sh_mask_modify","order":2,"path":"shaders/sh_mask_modify/sh_mask_modify.yy",}, - {"name":"toggleGroup","order":31,"path":"scripts/toggleGroup/toggleGroup.yy",}, + {"name":"toggleGroup","order":7,"path":"scripts/toggleGroup/toggleGroup.yy",}, {"name":"mouse_input","order":1,"path":"scripts/mouse_input/mouse_input.yy",}, {"name":"string_cut","order":2,"path":"scripts/string_cut/string_cut.yy",}, {"name":"__node_3d_prim_cylinder","order":2,"path":"scripts/__node_3d_prim_cylinder/__node_3d_prim_cylinder.yy",}, @@ -1720,7 +1721,7 @@ {"name":"s_node_3d_light_point","order":18,"path":"sprites/s_node_3d_light_point/s_node_3d_light_point.yy",}, {"name":"libdlgmodule","order":13,"path":"extensions/libdlgmodule/libdlgmodule.yy",}, {"name":"node_csv_file_read","order":8,"path":"scripts/node_csv_file_read/node_csv_file_read.yy",}, - {"name":"scrollPane","order":14,"path":"scripts/scrollPane/scrollPane.yy",}, + {"name":"scrollPane","order":3,"path":"scripts/scrollPane/scrollPane.yy",}, {"name":"node_gradient_extract","order":13,"path":"scripts/node_gradient_extract/node_gradient_extract.yy",}, {"name":"node_base_convert","order":7,"path":"scripts/node_base_convert/node_base_convert.yy",}, {"name":"node_3d_mesh_plane","order":7,"path":"scripts/node_3d_mesh_plane/node_3d_mesh_plane.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 56e48511a..9d078cac2 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -149,8 +149,8 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"pattern","folderPath":"folders/nodes/data/generator/pattern.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"regions","folderPath":"folders/nodes/data/generator/regions.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"group","folderPath":"folders/nodes/data/group.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"IO","folderPath":"folders/nodes/data/IO.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"network","folderPath":"folders/nodes/data/IO/network.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"io","folderPath":"folders/nodes/data/io.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"network","folderPath":"folders/nodes/data/io/network.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"iterate","folderPath":"folders/nodes/data/iterate.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"_legacy","folderPath":"folders/nodes/data/iterate/_legacy.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for each","folderPath":"folders/nodes/data/iterate/_legacy/for each.yy",}, @@ -1131,6 +1131,7 @@ {"id":{"name":"fd_rectangle_get_pressure_height","path":"scripts/fd_rectangle_get_pressure_height/fd_rectangle_get_pressure_height.yy",},}, {"id":{"name":"hyperbolic_function","path":"scripts/hyperbolic_function/hyperbolic_function.yy",},}, {"id":{"name":"s_node_fluidSim_repulse","path":"sprites/s_node_fluidSim_repulse/s_node_fluidSim_repulse.yy",},}, + {"id":{"name":"sh_widget_rotator","path":"shaders/sh_widget_rotator/sh_widget_rotator.yy",},}, {"id":{"name":"node_tile","path":"scripts/node_tile/node_tile.yy",},}, {"id":{"name":"s_node_2d_light_shape","path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",},}, {"id":{"name":"sh_rsh_rotate","path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},}, @@ -1210,6 +1211,7 @@ {"id":{"name":"s_node_pb_fx_radial","path":"sprites/s_node_pb_fx_radial/s_node_pb_fx_radial.yy",},}, {"id":{"name":"node_kuwahara","path":"scripts/node_kuwahara/node_kuwahara.yy",},}, {"id":{"name":"__background_get_internal","path":"scripts/__background_get_internal/__background_get_internal.yy",},}, + {"id":{"name":"sh_widget_rotator_range","path":"shaders/sh_widget_rotator_range/sh_widget_rotator_range.yy",},}, {"id":{"name":"s_node_array_sample","path":"sprites/s_node_array_sample/s_node_array_sample.yy",},}, {"id":{"name":"o_pie_menu","path":"objects/o_pie_menu/o_pie_menu.yy",},}, {"id":{"name":"s_biterator_b_labels","path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},}, diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 6d9bb9a5a..f833f6a50 100644 Binary files a/datafiles/data/Theme.zip and b/datafiles/data/Theme.zip differ diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index ea62b56ae..5d078c5c8 100644 Binary files a/fonts/_f_sdf/_f_sdf.old.png and b/fonts/_f_sdf/_f_sdf.old.png differ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index 473e0d5f4..4ccd3cfad 100644 Binary files a/fonts/_f_sdf/_f_sdf.png and b/fonts/_f_sdf/_f_sdf.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index 89ca6a387..928778469 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.old.png and b/fonts/_f_sdf_medium/_f_sdf_medium.old.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 1672eb2cb..4e1f8866b 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.png and b/fonts/_f_sdf_medium/_f_sdf_medium.png differ diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index e09179dba..dae061e0e 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -28,6 +28,7 @@ UPDATE = RENDER_TYPE.none; CURSOR = cr_default; CURSOR_LOCK = false; + CURSOR_IS_LOCK = false; CURSOR_LOCK_X = 0; CURSOR_LOCK_Y = 0; TOOLTIP = ""; diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index f69adaa22..d6a722cbc 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -31,14 +31,14 @@ _HOVERING_ELEMENT = noone; } CURSOR = cr_default; - if(_cursor_lock != CURSOR_LOCK) { window_mouse_set_locked(CURSOR_LOCK); if(!CURSOR_LOCK) window_mouse_set(CURSOR_LOCK_X, CURSOR_LOCK_Y); } - _cursor_lock = CURSOR_LOCK; - CURSOR_LOCK = false; + _cursor_lock = CURSOR_LOCK; + CURSOR_IS_LOCK = CURSOR_LOCK; + CURSOR_LOCK = false; if(!is_surface(watcher_surface)) { RENDER_ALL diff --git a/objects/textBox_slider/Draw_64.gml b/objects/textBox_slider/Draw_64.gml index 24c3bcc62..2aafa60c0 100644 --- a/objects/textBox_slider/Draw_64.gml +++ b/objects/textBox_slider/Draw_64.gml @@ -15,8 +15,10 @@ if(mouse_check_button_pressed(mb_right)) { exit; } -var _s = tb.slide_speed; -var _dx = window_mouse_get_delta_x(); +var _s = tb.slide_speed; +var _mdx = window_mouse_get_delta_x(); +var _mdy = window_mouse_get_delta_y(); +var _dx = abs(_mdx) > abs(_mdy)? _mdx : -_mdy; if(key_mod_press(CTRL)) _s *= 10; if(key_mod_press(ALT)) _s /= 10; @@ -34,5 +36,4 @@ if(abs(_val) < _s * 4) _val = 0; tb._input_text = string_real(_val); if(tb.apply()) UNDO_HOLDING = true; -tb = noone; -CURSOR = cr_none; \ No newline at end of file +tb = noone; \ No newline at end of file diff --git a/scripts/areaBox/areaBox.gml b/scripts/areaBox/areaBox.gml index d3941a6a3..09eb45dfd 100644 --- a/scripts/areaBox/areaBox.gml +++ b/scripts/areaBox/areaBox.gml @@ -36,56 +36,64 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { onModifySingle[0] = function(val) { #region var v = toNumber(val); + var m = onModify(0, v); - if(mode == AREA_MODE.area) { - return onModify(0, v); - } else if(mode == AREA_MODE.padding) { - if(link_value) return onModify(0, v) || onModify(1, v) || onModify(2, v) || onModify(3, v); - else return onModify(0, v); - } else if(mode == AREA_MODE.two_point) { - return onModify(0, v); - } + if(mode == AREA_MODE.area || mode == AREA_MODE.two_point || !link_value) + return m; + + m |= onModify(1, v); + m |= onModify(2, v); + m |= onModify(3, v); + + return m; } #endregion + onModifySingle[1] = function(val) { #region var v = toNumber(val); + var m = onModify(1, v); - if(mode == AREA_MODE.area) { - return onModify(1, v); - } else if(mode == AREA_MODE.padding) { - if(link_value) return onModify(0, v) || onModify(1, v) || onModify(2, v) || onModify(3, v); - else return onModify(1, v); - } else if(mode == AREA_MODE.two_point) { - return onModify(1, v); - } + if(mode == AREA_MODE.area || mode == AREA_MODE.two_point || !link_value) + return m; + + m |= onModify(0, v); + m |= onModify(2, v); + m |= onModify(3, v); + + return m; } #endregion + onModifySingle[2] = function(val) { #region var v = toNumber(val); + var m = onModify(2, v); - if(mode == AREA_MODE.area) { - return onModify(2, v); - } else if(mode == AREA_MODE.padding) { - if(link_value) return onModify(0, v) || onModify(1, v) || onModify(2, v) || onModify(3, v); - else return onModify(2, v); - } else if(mode == AREA_MODE.two_point) { - return onModify(2, v); - } + if(mode == AREA_MODE.area || mode == AREA_MODE.two_point || !link_value) + return m; + + m |= onModify(0, v); + m |= onModify(1, v); + m |= onModify(3, v); + + return m; } #endregion + onModifySingle[3] = function(val) { #region var v = toNumber(val); + var m = onModify(3, v); - if(mode == AREA_MODE.area) { - return onModify(3, v); - } else if(mode == AREA_MODE.padding) { - if(link_value) return onModify(0, v) || onModify(1, v) || onModify(2, v) || onModify(3, v); - else return onModify(3, v); - } else if(mode == AREA_MODE.two_point) { - return onModify(3, v); - } + if(mode == AREA_MODE.area || mode == AREA_MODE.two_point || !link_value) + return m; + + m |= onModify(0, v); + m |= onModify(1, v); + m |= onModify(2, v); + + return m; } #endregion for(var i = 0; i < 4; i++) { #region tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); tb[i].slidable = true; + tb[i].hide = true; } #endregion static setSlideSpeed = function(speed) { #region @@ -119,68 +127,40 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { } #endregion static drawParam = function(params) { #region - return draw(params.x + params.w / 2, params.y + ui(40), params.data, params.display_data, params.m); + font = params.font; + for(var i = 0; i < 4; i++) tb[i].font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.display_data, params.m); } #endregion - static draw = function(_x, _y, _data, _display_data, _m) { + static draw = function(_x, _y, _w, _h, _data, _display_data, _m) { x = _x; y = _y; - w = 0; - h = ui(204); + w = _w; + h = _h * 2 + ui(4); mode = array_safe_get(_data, 5); - var _bx = _x - ui(48); - var _by = _y + ui(64 - 48); - var _bs = ui(96); + var _bs = min(_h, ui(32)); + var _bx = _x; + var _by = _y + _h / 2 - _bs / 2; var _bact = adjust_shape && active; var _bhov = adjust_shape && hover; var _bind = array_safe_get(_data, 4); - if(!is_array(_bind)) - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bact, _bhov,, THEME.inspector_area, _bind, c_white) == 2) { + if(!is_array(_bind) && buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bact, _bhov,, THEME.inspector_area, _bind) == 2) { var val = (array_safe_get(_data, 4) + 1) % 2; onModify(4, val); } + var _tx =_x + _bs + ui(4); + if(onSurfaceSize != -1) { - var _bx = _x - ui(76); - var _by = _y + ui(28 - 12); - var _bs = ui(24); - var _btxt = __txtx("widget_area_fill_surface", "Full surface"); - - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.fill, 0, c_white) == 2) { #region - switch(mode) { - case AREA_MODE.area : - var ss = onSurfaceSize(); - onModify(0, ss[0] / 2); - onModify(1, ss[1] / 2); - onModify(2, ss[0] / 2); - onModify(3, ss[1] / 2); - break; - case AREA_MODE.padding : - var ss = onSurfaceSize(); - onModify(0, 0); - onModify(1, 0); - onModify(2, 0); - onModify(3, 0); - break; - case AREA_MODE.two_point : - var ss = onSurfaceSize(); - onModify(0, 0); - onModify(1, 0); - onModify(2, ss[0]); - onModify(3, ss[1]); - break; - } - } #endregion - tooltip.index = mode; - var _bx = _x + ui(76 - 24); - var _by = _y + ui(28 - 12); - var _bs = ui(24); + var _bx = _x + _w - _bs; + var _by = _y + _h / 2 - _bs / 2; - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, tooltip, THEME.inspector_area_type, mode, c_white) == 2) { #region + if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, tooltip, THEME.inspector_area_type, mode) == 2) { #region switch(mode) { case AREA_MODE.area : //area to padding var cx = array_safe_get(_data, 0); @@ -223,53 +203,78 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { onModify(5, (mode + 1) % 3); } #endregion + + var _bx = _x + _w - _bs; + var _by = _y + _h + ui(4) + _h / 2 - _bs / 2; + var _btxt = __txtx("widget_area_fill_surface", "Full surface"); + + if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.fill, 0) == 2) { #region + switch(mode) { + case AREA_MODE.area : + var ss = onSurfaceSize(); + onModify(0, ss[0] / 2); + onModify(1, ss[1] / 2); + onModify(2, ss[0] / 2); + onModify(3, ss[1] / 2); + break; + case AREA_MODE.padding : + var ss = onSurfaceSize(); + onModify(0, 0); + onModify(1, 0); + onModify(2, 0); + onModify(3, 0); + break; + case AREA_MODE.two_point : + var ss = onSurfaceSize(); + onModify(0, 0); + onModify(1, 0); + onModify(2, ss[0]); + onModify(3, ss[1]); + break; + } + } #endregion + + _w -= _bs + ui(4); } + _w -= _bs + ui(4); + if(mode == AREA_MODE.padding) { #region var cc = link_value? COLORS._main_accent : COLORS._main_icon; - var _bx = _x - ui(76); - var _by = _y + ui(88); - var _bs = ui(24); + var _bx = _x; + var _by = _y + _h + ui(4) + _h / 2 - _bs / 2; var _btxt = __txt("Link values"); if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.value_link, link_value, cc) == 2) link_value = !link_value; } #endregion - for(var i = 0; i < 4; i++) { + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); + + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y + _h + ui(4), _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y + _h + ui(4), _w, _h, c_white, 0.5 + 0.5 * interactable); + + for(var i = 0; i < 4; i++) tb[i].setFocusHover(active, hover); - tb[i].align = fa_center; - tb[i].hide = mode == AREA_MODE.area || mode == AREA_MODE.two_point; - } current_data = _data; + var tb_w = _w / 2; + var tb_h = _h; + if(mode == AREA_MODE.area) { #region - var tb_w = ui(96); - var tb_h = TEXTBOX_HEIGHT; + var tb_x0 = _tx; + var tb_y0 = _y; - var tb_x0 = _x - tb_w; - var tb_x1 = _x; - var tb_y0 = _y - ui(28); - var tb_y1 = _y + ui(64 + 48 + 8); + var tb_x1 = _tx + tb_w; + var tb_y1 = _y + _h + ui(4); - draw_sprite_stretched_ext(THEME.textbox, 3, tb_x0, tb_y0, tb_w * 2, tb_h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, tb_x0, tb_y0, tb_w * 2, tb_h, c_white, 0.5 + 0.5 * interactable); - - draw_sprite_stretched_ext(THEME.textbox, 3, tb_x0, tb_y1, tb_w * 2, tb_h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, tb_x0, tb_y1, tb_w * 2, tb_h, c_white, 0.5 + 0.5 * interactable); - - - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - - draw_text(tb_x0 + ui(8), tb_y0 + tb_h / 2, "x"); - draw_text(tb_x1 + ui(8), tb_y0 + tb_h / 2, "y"); - - draw_text(tb_x0 + ui(8), tb_y1 + tb_h / 2, "w"); - draw_text(tb_x1 + ui(8), tb_y1 + tb_h / 2, "h"); - - draw_set_alpha(1); + tb[0].label = "x"; + tb[1].label = "y"; + + tb[2].label = "w"; + tb[3].label = "h"; tb[0].draw(tb_x0, tb_y0, tb_w, tb_h, array_safe_get(_data, 0), _m); tb[1].draw(tb_x1, tb_y0, tb_w, tb_h, array_safe_get(_data, 1), _m); @@ -277,51 +282,45 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { tb[2].draw(tb_x0, tb_y1, tb_w, tb_h, array_safe_get(_data, 2), _m); tb[3].draw(tb_x1, tb_y1, tb_w, tb_h, array_safe_get(_data, 3), _m); #endregion + } else if(mode == AREA_MODE.padding) { #region - var tb_rx = _x + ui(56); - var tb_ry = _y + ui(48); + var tb_lx = _tx; + var tb_ly = _y; - var tb_tx = _x - ui(48); - var tb_ty = _y - ui(28); + var tb_rx = _tx + tb_w; + var tb_ry = _y; - var tb_lx = _x - ui(56 + 96); - var tb_ly = _y + ui(48); + var tb_tx = _tx; + var tb_ty = _y + _h + ui(4); - var tb_bx = _x - ui(48); - var tb_by = _y + ui(64 + 48 + 8); + var tb_bx = _tx + tb_w; + var tb_by = _y + _h + ui(4); - tb[0].draw(tb_rx, tb_ry, ui(96), TEXTBOX_HEIGHT, array_safe_get(_data, 0), _m); - tb[1].draw(tb_tx, tb_ty, ui(96), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); - - tb[2].draw(tb_lx, tb_ly, ui(96), TEXTBOX_HEIGHT, array_safe_get(_data, 2), _m); - tb[3].draw(tb_bx, tb_by, ui(96), TEXTBOX_HEIGHT, array_safe_get(_data, 3), _m); + tb[2].label = "l"; + tb[0].label = "r"; + + tb[1].label = "t"; + tb[3].label = "b"; + + tb[2].draw(tb_lx, tb_ly, tb_w, tb_h, array_safe_get(_data, 2), _m); + tb[0].draw(tb_rx, tb_ry, tb_w, tb_h, array_safe_get(_data, 0), _m); + + tb[1].draw(tb_tx, tb_ty, tb_w, tb_h, array_safe_get(_data, 1), _m); + tb[3].draw(tb_bx, tb_by, tb_w, tb_h, array_safe_get(_data, 3), _m); #endregion + } else if(mode == AREA_MODE.two_point) { #region - var tb_w = ui(96); - var tb_h = TEXTBOX_HEIGHT; + var tb_x0 = _tx; + var tb_y0 = _y; - var tb_x0 = _x - tb_w; - var tb_x1 = _x; - var tb_y0 = _y - ui(28); - var tb_y1 = _y + ui(64 + 48 + 8); + var tb_x1 = _tx + tb_w; + var tb_y1 = _y + _h + ui(4); - draw_sprite_stretched_ext(THEME.textbox, 3, tb_x0, tb_y0, tb_w * 2, tb_h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, tb_x0, tb_y0, tb_w * 2, tb_h, c_white, 0.5 + 0.5 * interactable); - - draw_sprite_stretched_ext(THEME.textbox, 3, tb_x0, tb_y1, tb_w * 2, tb_h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, tb_x0, tb_y1, tb_w * 2, tb_h, c_white, 0.5 + 0.5 * interactable); - - - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - - draw_text(tb_x0 + ui(8), tb_y0 + tb_h / 2, "x0"); - draw_text(tb_x1 + ui(8), tb_y0 + tb_h / 2, "y0"); - - draw_text(tb_x0 + ui(8), tb_y1 + tb_h / 2, "x1"); - draw_text(tb_x1 + ui(8), tb_y1 + tb_h / 2, "y1"); - - draw_set_alpha(1); + tb[0].label = "x0"; + tb[1].label = "y0"; + + tb[2].label = "x1"; + tb[3].label = "y1"; tb[0].draw(tb_x0, tb_y0, tb_w, tb_h, array_safe_get(_data, 0), _m); tb[1].draw(tb_x1, tb_y0, tb_w, tb_h, array_safe_get(_data, 1), _m); @@ -331,10 +330,10 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { #endregion } - if(unit != noone && unit.reference != noone) { - unit.triggerButton.setFocusHover(active, hover); - unit.draw(_x + ui(56 + 48 + 8), _y - ui(28), ui(32), ui(32), _m); - } + //if(unit != noone && unit.reference != noone) { + // unit.triggerButton.setFocusHover(active, hover); + // unit.draw(_x + ui(56 + 48 + 8), _y - ui(28), ui(32), ui(32), _m); + //} resetFocus(); diff --git a/scripts/button/button.gml b/scripts/button/button.gml index 793be62e4..a2eee0257 100644 --- a/scripts/button/button.gml +++ b/scripts/button/button.gml @@ -57,6 +57,8 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor { } #endregion static drawParam = function(params) { #region + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.m); } #endregion @@ -98,8 +100,8 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor { if(text != "") { draw_set_alpha(aa); - draw_set_text(f_p0, fa_center, fa_center, COLORS._main_text); - draw_text(_x + _w / 2, _y + _h / 2, text); + draw_set_text(font, fa_center, fa_center, COLORS._main_text); + draw_text_add(_x + _w / 2, _y + _h / 2, text); draw_set_alpha(1); } diff --git a/scripts/buttonGroup/buttonGroup.gml b/scripts/buttonGroup/buttonGroup.gml index 3a634a080..62a98304a 100644 --- a/scripts/buttonGroup/buttonGroup.gml +++ b/scripts/buttonGroup/buttonGroup.gml @@ -1,10 +1,10 @@ function buttonGroup(_data, _onClick) : widget() constructor { data = _data; onClick = _onClick; + display_button = false; - buttonSpr = [ THEME.button_left, THEME.button_middle, THEME.button_right ]; - font = f_p0; - fColor = COLORS._main_text; + buttonSpr = [ THEME.button_left, THEME.button_middle, THEME.button_right ]; + fColor = COLORS._main_text; current_selecting = 0; @@ -41,6 +41,8 @@ function buttonGroup(_data, _onClick) : widget() constructor { } static drawParam = function(params) { + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.rx, params.ry); } @@ -57,7 +59,7 @@ function buttonGroup(_data, _onClick) : widget() constructor { var ww = _w / amo; var total_width = 0; - draw_set_font(f_p0); + draw_set_font(font); for(var i = 0; i < amo; i++) { if(is_string(data[i])) total_width += string_width(data[i]) + ui(32); diff --git a/scripts/checkboxGroup/checkboxGroup.gml b/scripts/checkboxGroup/checkboxGroup.gml index 82afa8d73..eb3ad6b01 100644 --- a/scripts/checkboxGroup/checkboxGroup.gml +++ b/scripts/checkboxGroup/checkboxGroup.gml @@ -10,6 +10,8 @@ function checkBoxGroup(sprs, _onClick) : widget() constructor { } static drawParam = function(params) { + font = params.font; + return draw(params.x, params.y, params.data, params.m, params.s); } diff --git a/scripts/controlPointBox/controlPointBox.gml b/scripts/controlPointBox/controlPointBox.gml index 85f81003b..f3f931164 100644 --- a/scripts/controlPointBox/controlPointBox.gml +++ b/scripts/controlPointBox/controlPointBox.gml @@ -29,6 +29,9 @@ function controlPointBox(_onModify) : widget() constructor { sW = new textBox(TEXTBOX_INPUT.number, function(val) { onModify(PUPPET_CONTROL.width, toNumber(val)); }) .setSlidable(0.01, false, [ 1, 32 ]); + tbCx.label = "cx"; + tbCy.label = "cy"; + sMode = [ __txtx("widget_control_point_move", "Move"), __txtx("widget_control_point_wind", "Wind"), @@ -53,11 +56,22 @@ function controlPointBox(_onModify) : widget() constructor { widgets[i].register(parent); } - static drawParam = function(params) { - return draw(params.x, params.y, params.w, params.data, params.m, params.rx, params.ry); - } + static drawParam = function(params) { #region + font = params.font; + tbCx.font = params.font; + tbCy.font = params.font; + tbFx.font = params.font; + tbFy.font = params.font; + tbW.font = params.font; + tbH.font = params.font; + rot.font = params.font; + sW.font = params.font; + scMode.font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.rx, params.ry); + } #endregion - static draw = function(_x, _y, _w, _data, _m, _rx, _ry) { + static draw = function(_x, _y, _w, _h, _data, _m, _rx, _ry) { x = _x; y = _y; @@ -76,24 +90,18 @@ function controlPointBox(_onModify) : widget() constructor { var yy = _y; - scMode.draw(_x, yy, _w, TEXTBOX_HEIGHT, sMode[_mode], _m, _rx, _ry); - yy += TEXTBOX_HEIGHT + ui(8); + scMode.draw(_x, yy, _w, _h, sMode[_mode], _m, _rx, _ry); + yy += _h + ui(4); var _ww = _w / 2; - var _wh = TEXTBOX_HEIGHT; + var _wh = _h; draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text(_x + ui(8), yy + _wh / 2, "cx"); - draw_text(_x + _ww + ui(8), yy + _wh / 2, "cy"); - draw_set_alpha(1); - tbCx.draw(_x, yy, _ww, _wh, _cx, _m); tbCy.draw(_x + _ww, yy, _ww, _wh, _cy, _m); - yy += _wh + ui(8); + yy += _wh + ui(4); switch(_mode) { case PUPPET_FORCE_MODE.move: @@ -102,25 +110,18 @@ function controlPointBox(_onModify) : widget() constructor { draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text(_x + ui(8), yy + _wh / 2, "fx"); - draw_text(_x + _ww + ui(8), yy + _wh / 2, "fy"); - draw_set_alpha(1); + tbFx.label = "fx"; + tbFy.label = "fy"; tbFx.draw(_x, yy, _ww, _wh, _fx, _m); tbFy.draw(_x + _ww, yy, _ww, _wh, _fy, _m); - yy += _wh + ui(8); + yy += _wh + ui(4); if(_mode == PUPPET_FORCE_MODE.move) { + sW.label = __txt("radius"); sW.draw(_x, yy, _w, _wh, _wid, _m); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_set_alpha(0.5); - draw_text(_x + ui(8), yy + _wh / 2, __txt("radius")); - draw_set_alpha(1); - - yy += _wh + ui(8); + yy += _wh + ui(4); } break; @@ -129,18 +130,15 @@ function controlPointBox(_onModify) : widget() constructor { draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text(_x + ui(8), yy + _wh / 2, __txt("strength")); - draw_text(_x + _ww + ui(8), yy + _wh / 2, __txt("width")); - draw_set_alpha(1); + tbFx.label = __txt("strength"); + tbW.label = __txt("width"); tbFx.draw(_x, yy, _ww, _wh, _fx, _m); tbW.draw( _x + _ww, yy, _ww, _wh, _wid, _m); - yy += _wh + ui(8); + yy += _wh + ui(4); - var _rh = rot.draw(_x, yy, _w, _fy, _m); - yy += _rh + ui(8); + var _rh = rot.draw(_x, yy, _w, _wh, _fy, _m); + yy += _rh + ui(4); break; } diff --git a/scripts/cornerBox/cornerBox.gml b/scripts/cornerBox/cornerBox.gml index 94591c24a..04fbcf653 100644 --- a/scripts/cornerBox/cornerBox.gml +++ b/scripts/cornerBox/cornerBox.gml @@ -20,9 +20,13 @@ function cornerBox(_onModify, _unit = noone) : widget() constructor { onModifySingle[2] = function(val) { onModifyIndex(2, val); } onModifySingle[3] = function(val) { onModifyIndex(3, val); } + labels = [ "r", "t", "l", "b" ]; + for(var i = 0; i < 4; i++) { tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); + tb[i].label = labels[i]; tb[i].slidable = true; + tb[i].hide = true; } static setSlideSpeed = function(speed) { @@ -47,38 +51,61 @@ function cornerBox(_onModify, _unit = noone) : widget() constructor { tb[3].register(parent); } - static drawParam = function(params) { - return draw(params.x + params.w / 2, params.y + ui(32), params.data, params.m); + static drawParam = function(params) { + font = params.font; + for(var i = 0; i < 4; i++) tb[i].font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } - static draw = function(_x, _y, _data, _m) { + static draw = function(_x, _y, _w, _h, _data, _m) { x = _x; y = _y; - w = 0; - h = ui(192); + w = _w; + h = _h + ui(4) + _h; - var yy = _y + ui(64); - draw_sprite_ui_uniform(THEME.inspector_corner, 0, _x, yy); - - for(var i = 0; i < 4; i++) { - tb[i].setFocusHover(active, hover); - tb[i].align = fa_center; - } - - tb[0].draw(_x - ui(120), yy + ui(-48 - 34), ui(64), TEXTBOX_HEIGHT, _data[0], _m); - tb[1].draw(_x + ui(56), yy + ui(-48 - 34), ui(64), TEXTBOX_HEIGHT, _data[1], _m); - tb[2].draw(_x - ui(120), yy + ui( 48), ui(64), TEXTBOX_HEIGHT, _data[2], _m); - tb[3].draw(_x + ui(56), yy + ui( 48), ui(64), TEXTBOX_HEIGHT, _data[3], _m); + for(var i = 0; i < 4; i++) tb[i].setFocusHover(active, hover); b_link.setFocusHover(active, hover); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); - var bx = _x - ui(12); - var by = yy - ui(12); - b_link.draw(bx, by, ui(24), ui(24), _m, THEME.button_hide); + var _bs = min(_h, ui(32)); + var _bx = _x; + var _by = _y + _h / 2 - _bs / 2; + b_link.draw(_bx, _by, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(4); + _x += _bs + ui(4); + + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); + + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y + _h + ui(4), _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y + _h + ui(4), _w, _h, c_white, 0.5 + 0.5 * interactable); + + var tb_w = _w / 2; + var tb_h = _h; + + var tb_lx = _x; + var tb_ly = _y; + + var tb_rx = _x + tb_w; + var tb_ry = _y; + + var tb_tx = _x; + var tb_ty = _y + _h + ui(4); + + var tb_bx = _x + tb_w; + var tb_by = _y + _h + ui(4); + + tb[2].draw(tb_lx, tb_ly, tb_w, tb_h, array_safe_get(_data, 2), _m); + tb[0].draw(tb_rx, tb_ry, tb_w, tb_h, array_safe_get(_data, 0), _m); + + tb[1].draw(tb_tx, tb_ty, tb_w, tb_h, array_safe_get(_data, 1), _m); + tb[3].draw(tb_bx, tb_by, tb_w, tb_h, array_safe_get(_data, 3), _m); + resetFocus(); return h; diff --git a/scripts/fontScrollBox/fontScrollBox.gml b/scripts/fontScrollBox/fontScrollBox.gml index 4f01b172f..8ccd2e804 100644 --- a/scripts/fontScrollBox/fontScrollBox.gml +++ b/scripts/fontScrollBox/fontScrollBox.gml @@ -25,6 +25,8 @@ function fontScrollBox(_onModify) : widget() constructor { } static drawParam = function(params) { + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.rx, params.ry); } @@ -68,7 +70,7 @@ function fontScrollBox(_onModify) : widget() constructor { _txt = $"[{_txt}]"; _text = is_array(_text)? _txt : filename_name_only(_text); - draw_set_text(f_p0, align, fa_center, COLORS._main_text); + draw_set_text(font, align, fa_center, COLORS._main_text); draw_set_alpha(0.5 + 0.5 * interactable); if(align == fa_center) draw_text(_x + w / 2, _y + _h / 2 - ui(2), _text); diff --git a/scripts/fontScrollBox/fontScrollBox.yy b/scripts/fontScrollBox/fontScrollBox.yy index 0cc7186a1..add525bdb 100644 --- a/scripts/fontScrollBox/fontScrollBox.yy +++ b/scripts/fontScrollBox/fontScrollBox.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "text", - "path": "folders/widgets/text.yy", + "name": "widgets", + "path": "folders/widgets.yy", }, } \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 7d44921c3..f9c1afa2c 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -41,7 +41,6 @@ HOTKEY_CONTEXT = ds_list_create(); HOTKEY_CONTEXT[| 0] = ""; - globalvar CURSOR, CURSOR_LOCK, CURSOR_LOCK_X, CURSOR_LOCK_Y; globalvar TOOLTIP, DRAGGING, DIALOG_DEPTH_HOVER; #endregion @@ -88,7 +87,7 @@ #macro mouse_ui [device_mouse_x_to_gui(0), device_mouse_y_to_gui(0)] #macro sFOCUS FOCUS == self.id - #macro sHOVER HOVER == self.id + #macro sHOVER (!CURSOR_IS_LOCK && HOVER == self.id) #macro DELTA_TIME delta_time / 1_000_000 diff --git a/scripts/matrixGrid/matrixGrid.gml b/scripts/matrixGrid/matrixGrid.gml index 856113e27..edd73b701 100644 --- a/scripts/matrixGrid/matrixGrid.gml +++ b/scripts/matrixGrid/matrixGrid.gml @@ -77,6 +77,10 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct } static drawParam = function(params) { + font = params.font; + for(var i = 0; i < inputs; i++) + tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } @@ -84,9 +88,7 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct x = _x; y = _y; w = _w; - - var hh = TEXTBOX_HEIGHT; - h = hh * size; + h = _h * size; if(extras && instanceof(extras) == "buttonClass") { extras.setFocusHover(active, hover); @@ -107,7 +109,7 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); - var th = hh * size - ui(8); + var th = _h * size - ui(8); var bx = _x; var by = _y + th / 2 - ui(24 / 2); @@ -118,8 +120,8 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct var ww = _w / size; - draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, ww * size, hh * size, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, ww * size, hh * size, c_white, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, ww * size, _h * size, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, ww * size, _h * size, c_white, 0.5 + 0.5 * interactable); for(var i = 0; i < size; i++) for(var j = 0; j < size; j++) { @@ -128,10 +130,10 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct tb[ind].hide = true; var bx = _x + ww * j; - var by = _y + hh * i; + var by = _y + _h * i; var _dat = array_safe_get(_data, ind); - tb[ind].draw(bx, by, ww, hh, _dat, _m); + tb[ind].draw(bx, by, ww, _h, _dat, _m); } resetFocus(); diff --git a/scripts/mouse_input/mouse_input.gml b/scripts/mouse_input/mouse_input.gml index b60238824..f7bbf206d 100644 --- a/scripts/mouse_input/mouse_input.gml +++ b/scripts/mouse_input/mouse_input.gml @@ -1,4 +1,5 @@ #region mouse global + globalvar CURSOR, CURSOR_LOCK, CURSOR_IS_LOCK, CURSOR_LOCK_X, CURSOR_LOCK_Y; globalvar MOUSE_WRAP, MOUSE_WRAPPING, MOUSE_BLOCK, _MOUSE_BLOCK; MOUSE_WRAP = false; @@ -95,4 +96,14 @@ function mouse_rrelease(focus = true) { #region if(PEN_RIGHT_RELEASE) return true; return mouse_check_button_released(mb_right); +} #endregion + +function mouse_lock(mx = CURSOR_LOCK_X, my = CURSOR_LOCK_Y) { #region + INLINE + + CURSOR_LOCK = true; + CURSOR_LOCK_X = mx; + CURSOR_LOCK_Y = my; + + window_mouse_set(CURSOR_LOCK_X, CURSOR_LOCK_Y); } #endregion \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index d530f6652..d261d1ff4 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -19,8 +19,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var xc = xx + ww / 2; var _font = viewMode == INSP_VIEW_MODE.spacious? f_p0 : f_p2; - var breakLine = viewMode || jun.expUse; - var lb_h = line_get_height(_font) + ui(8); + var breakLine = viewMode == INSP_VIEW_MODE.spacious || jun.expUse; + var lb_h = line_get_height(_font) + ui(6); var lb_y = yy + lb_h / 2; var _name = jun.getName(); @@ -28,13 +28,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc switch(instanceof(wid)) { #region case "textArea" : - case "paddingBox" : - case "areaBox" : case "controlPointBox" : - case "cornerBox" : - case "rotator" : - case "rotatorRandom" : - case "rotatorRange" : case "transformBox" : breakLine = true; } #endregion @@ -309,18 +303,19 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var _show = jun.showValue(); var param = new widgetParam(editBoxX, editBoxY, editBoxW, editBoxH, _show, jun.display_data, _m, rx, ry); + param.font = viewMode == INSP_VIEW_MODE.spacious? f_p0 : f_p2; switch(jun.type) { - case VALUE_TYPE.integer : - case VALUE_TYPE.float : + case VALUE_TYPE.float : + case VALUE_TYPE.integer : switch(jun.display_type) { - case VALUE_DISPLAY.padding : param.h = ui(192); break; - case VALUE_DISPLAY.corner : param.h = ui(192); break; - case VALUE_DISPLAY.area : param.h = ui(204); break; - case VALUE_DISPLAY.rotation : param.halign = fa_center; break; + case VALUE_DISPLAY.puppet_control : + case VALUE_DISPLAY.transform : + param.h = viewMode == INSP_VIEW_MODE.spacious? param.h : lb_h; + break; } break; - + case VALUE_TYPE.boolean : if(is_instanceof(wid, checkBoxActive)) break; param.halign = breakLine? fa_left : fa_center; diff --git a/scripts/node_ase_file_read/node_ase_file_read.yy b/scripts/node_ase_file_read/node_ase_file_read.yy index b6bf20f89..e122dd398 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.yy +++ b/scripts/node_ase_file_read/node_ase_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_ase_layer/node_ase_layer.yy b/scripts/node_ase_layer/node_ase_layer.yy index b4bf6fb4e..c1ca86668 100644 --- a/scripts/node_ase_layer/node_ase_layer.yy +++ b/scripts/node_ase_layer/node_ase_layer.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_byte_file_read/node_byte_file_read.yy b/scripts/node_byte_file_read/node_byte_file_read.yy index 41c2deedf..ce2c8915e 100644 --- a/scripts/node_byte_file_read/node_byte_file_read.yy +++ b/scripts/node_byte_file_read/node_byte_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_byte_file_write/node_byte_file_write.yy b/scripts/node_byte_file_write/node_byte_file_write.yy index a7e0bb614..8a46d6f9a 100644 --- a/scripts/node_byte_file_write/node_byte_file_write.yy +++ b/scripts/node_byte_file_write/node_byte_file_write.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_canvas/node_canvas.yy b/scripts/node_canvas/node_canvas.yy index c7ce6b717..87374e85c 100644 --- a/scripts/node_canvas/node_canvas.yy +++ b/scripts/node_canvas/node_canvas.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_color_adjust/node_color_adjust.gml b/scripts/node_color_adjust/node_color_adjust.gml index 7cd2e7d20..b164162be 100644 --- a/scripts/node_color_adjust/node_color_adjust.gml +++ b/scripts/node_color_adjust/node_color_adjust.gml @@ -228,7 +228,8 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro #region surface adjust _m = mask_modify(_m, _mskInv, _mskFea); - surface_set_shader(_baseSurf, sh_color_adjust); + + surface_set_shader(_baseSurf, sh_color_adjust, true, BLEND.over); shader_set_surface("param0", temp_surface[0]); shader_set_surface("param1", temp_surface[1]); @@ -246,10 +247,6 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro shader_set_f_map_s("alpha", _alp, _data[24], inputs[| 9]); shader_set_i("use_mask", is_surface(_m)); shader_set_surface("mask", _m); - - gpu_set_colorwriteenable(1, 1, 1, 0); - draw_surface_safe(_surf, 0, 0); //replace clear color with surface color - gpu_set_colorwriteenable(1, 1, 1, 1); draw_surface_ext_safe(_surf, 0, 0, 1, 1, 0, c_white, 1); surface_reset_shader(); diff --git a/scripts/node_csv_file_read/node_csv_file_read.yy b/scripts/node_csv_file_read/node_csv_file_read.yy index 4eb048eaf..82e6263aa 100644 --- a/scripts/node_csv_file_read/node_csv_file_read.yy +++ b/scripts/node_csv_file_read/node_csv_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_csv_file_write/node_csv_file_write.yy b/scripts/node_csv_file_write/node_csv_file_write.yy index 12815e88e..965feb742 100644 --- a/scripts/node_csv_file_write/node_csv_file_write.yy +++ b/scripts/node_csv_file_write/node_csv_file_write.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 4748939bb..da19a5ce0 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -1335,11 +1335,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { if(previewable) { if(preview_draw) drawPreview(xx, yy, _s); - try { - onDrawNode(xx, yy, _mx, _my, _s, PANEL_GRAPH.node_hovering == self, PANEL_GRAPH.getFocusingNode() == self); - } catch(e) { - log_warning("NODE onDRAW", exception_print(e)); - } + + try { onDrawNode(xx, yy, _mx, _my, _s, PANEL_GRAPH.node_hovering == self, PANEL_GRAPH.getFocusingNode() == self); } + catch(e) { log_warning("NODE onDrawNode", exception_print(e)); } + } else { var bbox = drawGetBbox(xx, yy, _s); draw_sprite_ext(THEME.preview_hide, 0, bbox.xc, bbox.yc, _s, _s, 0, c_white, 0.25); diff --git a/scripts/node_export/node_export.yy b/scripts/node_export/node_export.yy index de37941ec..c347d8c8e 100644 --- a/scripts/node_export/node_export.yy +++ b/scripts/node_export/node_export.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_image/node_image.yy b/scripts/node_image/node_image.yy index 93c56c5de..0addfda68 100644 --- a/scripts/node_image/node_image.yy +++ b/scripts/node_image/node_image.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_image_animated/node_image_animated.yy b/scripts/node_image_animated/node_image_animated.yy index 7c93f78df..79f88c56b 100644 --- a/scripts/node_image_animated/node_image_animated.yy +++ b/scripts/node_image_animated/node_image_animated.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_image_gif/node_image_gif.yy b/scripts/node_image_gif/node_image_gif.yy index 61babfa14..a20488796 100644 --- a/scripts/node_image_gif/node_image_gif.yy +++ b/scripts/node_image_gif/node_image_gif.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_image_sequence/node_image_sequence.yy b/scripts/node_image_sequence/node_image_sequence.yy index b7886f7c5..54b9f7594 100644 --- a/scripts/node_image_sequence/node_image_sequence.yy +++ b/scripts/node_image_sequence/node_image_sequence.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_image_sheet/node_image_sheet.yy b/scripts/node_image_sheet/node_image_sheet.yy index 8911246f3..8c3ad5aa8 100644 --- a/scripts/node_image_sheet/node_image_sheet.yy +++ b/scripts/node_image_sheet/node_image_sheet.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_json_file_read/node_json_file_read.yy b/scripts/node_json_file_read/node_json_file_read.yy index 9311fd9df..98b8f99d2 100644 --- a/scripts/node_json_file_read/node_json_file_read.yy +++ b/scripts/node_json_file_read/node_json_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_json_file_write/node_json_file_write.yy b/scripts/node_json_file_write/node_json_file_write.yy index 1c3ab3a0c..84390cea6 100644 --- a/scripts/node_json_file_write/node_json_file_write.yy +++ b/scripts/node_json_file_write/node_json_file_write.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_midi_in/node_midi_in.yy b/scripts/node_midi_in/node_midi_in.yy index 45f44cf6f..d4bdc43b6 100644 --- a/scripts/node_midi_in/node_midi_in.yy +++ b/scripts/node_midi_in/node_midi_in.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index c36467dfc..84047d3c6 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -114,11 +114,11 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co var cmp = getInputData(5); var _col = getColor(); - if(inputs[| 0].value_from != noone || disp == 0) { #region + if(disp == 0 || inputs[| 0].value_from != noone || bbox.h < line_get_height(f_p2)) { draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text); draw_text_bbox(bbox, string(val)); return; - } #endregion + } switch(disp) { case 1 : #region diff --git a/scripts/node_polar/node_polar.gml b/scripts/node_polar/node_polar.gml index 8716031c3..bec3798d3 100644 --- a/scripts/node_polar/node_polar.gml +++ b/scripts/node_polar/node_polar.gml @@ -35,10 +35,13 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con ////////////////////////////////////////////////////////////////////////////////////////////////// + inputs[| 12] = nodeValue("Tile", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ] ) + .setDisplay(VALUE_DISPLAY.vector); + outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); input_display_list = [ 3, 4, - ["Surfaces", false], 0, 1, 2, 7, 8, + ["Surfaces", false], 0, 1, 2, 7, 8, 12, ["Effect", false], 5, 6, 11, 9, 10, ] @@ -59,6 +62,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con shader_set_i("distMode", _data[9]); shader_set_f_map("blend", _data[6], _data[11], inputs[| 6]); shader_set_i("swap", _data[10]); + shader_set_f("tile", _data[12]); draw_surface_safe(_data[0], 0, 0); surface_reset_shader(); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index ddbafd385..b0264e931 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -477,7 +477,7 @@ function __initNodes() { addNodeObject(strandSim, "Strand Collision", s_node_strandSim_collide, "Node_Strand_Collision", [1, Node_Strand_Collision],, "Create solid object for strands to collides to.").hideRecent().setVersion(1140); #endregion - ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ + //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ var input = ds_list_create(); #region addNodeCatagory("IO", input); diff --git a/scripts/node_sequence_anim/node_sequence_anim.yy b/scripts/node_sequence_anim/node_sequence_anim.yy index 6cbd64e12..9346423e2 100644 --- a/scripts/node_sequence_anim/node_sequence_anim.yy +++ b/scripts/node_sequence_anim/node_sequence_anim.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_shape/node_shape.gml b/scripts/node_shape/node_shape.gml index e140f04c3..5af296a61 100644 --- a/scripts/node_shape/node_shape.gml +++ b/scripts/node_shape/node_shape.gml @@ -30,6 +30,8 @@ enum NODE_SHAPE_TYPE { rectangle, elipse, regular, star, arc, teardrop, cross, l function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Shape"; + onSurfaceSize = function() { return getInputData(0, DEF_SURF); }; + inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) .setDisplay(VALUE_DISPLAY.vector); @@ -42,8 +44,8 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con inputs[| 2] = nodeValue("Shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, _types); - onSurfaceSize = function() { return getInputData(0, DEF_SURF); }; inputs[| 3] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, DEF_AREA) + .setUnitRef(onSurfaceSize) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); inputs[| 4] = nodeValue("Sides", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 3) @@ -82,11 +84,11 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con inputs[| 16] = nodeValue("Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2 ] ) .setDisplay(VALUE_DISPLAY.vector) - .setUnitRef(function(index) { return getInputData(0, DEF_SURF); }); + .setUnitRef(onSurfaceSize); inputs[| 17] = nodeValue("Half Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2 ] ) .setDisplay(VALUE_DISPLAY.vector) - .setUnitRef(function(index) { return getInputData(0, DEF_SURF); }); + .setUnitRef(onSurfaceSize); inputs[| 18] = nodeValue("Tile", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); diff --git a/scripts/node_spout_send/node_spout_send.yy b/scripts/node_spout_send/node_spout_send.yy index ced500653..b63e73f49 100644 --- a/scripts/node_spout_send/node_spout_send.yy +++ b/scripts/node_spout_send/node_spout_send.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_text_file_read/node_text_file_read.yy b/scripts/node_text_file_read/node_text_file_read.yy index d1d170cd8..f1c584dce 100644 --- a/scripts/node_text_file_read/node_text_file_read.yy +++ b/scripts/node_text_file_read/node_text_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_text_file_write/node_text_file_write.yy b/scripts/node_text_file_write/node_text_file_write.yy index 929176634..fffe019d5 100644 --- a/scripts/node_text_file_write/node_text_file_write.yy +++ b/scripts/node_text_file_write/node_text_file_write.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 71f0257d0..7b8cbdd20 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -555,6 +555,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru tooltip = _tooltip; editWidget = noone; editWidgetRaw = noone; + graphWidget = noone; mapWidget = noone; active_tooltip = ""; @@ -1100,9 +1101,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extract_node = ""; break; #endregion case VALUE_DISPLAY.transform : #region - editWidget = new transformBox(function(index, val) { - return setValueInspector(_val, index); - }); + editWidget = new transformBox(function(index, val) { return setValueInspector(val, index); }); extract_node = "Node_Transform_Array"; break; #endregion @@ -1284,6 +1283,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } editWidgetRaw = editWidget; + //graphWidget = variable_clone(editWidget); for( var i = 0, n = ds_list_size(animator.values); i < n; i++ ) { animator.values[| i].ease_in_type = key_inter; diff --git a/scripts/node_wav_file_read/node_wav_file_read.yy b/scripts/node_wav_file_read/node_wav_file_read.yy index 16185e780..65c55a2f8 100644 --- a/scripts/node_wav_file_read/node_wav_file_read.yy +++ b/scripts/node_wav_file_read/node_wav_file_read.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_wav_file_write/node_wav_file_write.yy b/scripts/node_wav_file_write/node_wav_file_write.yy index 3e9be2042..3450ec815 100644 --- a/scripts/node_wav_file_write/node_wav_file_write.yy +++ b/scripts/node_wav_file_write/node_wav_file_write.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "IO", - "path": "folders/nodes/data/IO.yy", + "name": "io", + "path": "folders/nodes/data/io.yy", }, } \ No newline at end of file diff --git a/scripts/node_websocket_receiver/node_websocket_receiver.yy b/scripts/node_websocket_receiver/node_websocket_receiver.yy index ca8951b29..e223683af 100644 --- a/scripts/node_websocket_receiver/node_websocket_receiver.yy +++ b/scripts/node_websocket_receiver/node_websocket_receiver.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "network", - "path": "folders/nodes/data/IO/network.yy", + "path": "folders/nodes/data/io/network.yy", }, } \ No newline at end of file diff --git a/scripts/node_websocket_sender/node_websocket_sender.yy b/scripts/node_websocket_sender/node_websocket_sender.yy index 9568615c4..e77a3a9fd 100644 --- a/scripts/node_websocket_sender/node_websocket_sender.yy +++ b/scripts/node_websocket_sender/node_websocket_sender.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "network", - "path": "folders/nodes/data/IO/network.yy", + "path": "folders/nodes/data/io/network.yy", }, } \ No newline at end of file diff --git a/scripts/paddingBox/paddingBox.gml b/scripts/paddingBox/paddingBox.gml index e1f0198b8..eef99b357 100644 --- a/scripts/paddingBox/paddingBox.gml +++ b/scripts/paddingBox/paddingBox.gml @@ -31,70 +31,97 @@ function paddingBox(_onModify, _unit = noone) : widget() constructor { for(var i = 0; i < 4; i++) { tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); tb[i].slidable = true; + tb[i].hide = true; } - static setSlideSpeed = function(speed) { - for(var i = 0; i < 4; i++) - tb[i].setSlidable(speed); - } + tb[2].label = "l"; + tb[0].label = "r"; + + tb[1].label = "t"; + tb[3].label = "b"; + + static setSlideSpeed = function(speed) { for(var i = 0; i < 4; i++) tb[i].setSlidable(speed); } - static setInteract = function(interactable = noone) { - self.interactable = interactable; + static setInteract = function(interactable = noone) { #region + self.interactable = interactable; b_link.interactable = interactable; for( var i = 0; i < 4; i++ ) tb[i].interactable = interactable; - } + } #endregion - static register = function(parent = noone) { + static register = function(parent = noone) { #region b_link.register(); - tb[1].register(parent); - if(unit != noone && unit.reference != noone) unit.triggerButton.register(parent); tb[2].register(parent); tb[0].register(parent); + tb[1].register(parent); tb[3].register(parent); + } #endregion + + static drawParam = function(params) { + font = params.font; + for(var i = 0; i < 4; i++) tb[i].font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } - static drawParam = function(params) { - return draw(params.x + params.w / 2, params.y + ui(32), params.data, params.m); - } - - static draw = function(_x, _y, _data, _m) { + static draw = function(_x, _y, _w, _h, _data, _m) { x = _x; y = _y; - w = 0; - h = ui(192); + w = _w; + h = _h + ui(4) + _h; - draw_sprite_ui_uniform(THEME.inspector_padding, 0, _x, _y + ui(64)); - - for(var i = 0; i < 4; i++) { - tb[i].setFocusHover(active, hover); - tb[i].align = fa_center; - } - - tb[0].draw(_x + ui(64), _y + ui(64 - 17), ui(64), TEXTBOX_HEIGHT, _data[0], _m); - tb[1].draw(_x - ui(32), _y + ui(64 - 48 - 8 - 34), ui(64), TEXTBOX_HEIGHT, _data[1], _m); - tb[2].draw(_x - ui(64) - ui(64), _y + ui(64 - 17), ui(64), TEXTBOX_HEIGHT, _data[2], _m); - tb[3].draw(_x - ui(32), _y + ui(64 + 48 + 8), ui(64), TEXTBOX_HEIGHT, _data[3], _m); + for(var i = 0; i < 4; i++) tb[i].setFocusHover(active, hover); b_link.setFocusHover(active, hover); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); - var bx = _x - ui(80); - var by = _y - ui(24); - b_link.draw(bx + ui(4), by + ui(4), ui(24), ui(24), _m, THEME.button_hide); + var _bs = min(_h, ui(32)); + var _bx = _x; + var _by = _y + _h / 2 - _bs / 2; + b_link.draw(_bx, _by, _bs, _bs, _m, THEME.button_hide); + + _w -= _bs + ui(4); + _x += _bs + ui(4); if(unit != noone && unit.reference != noone) { unit.triggerButton.setFocusHover(iactive, ihover); - unit.draw(_x + ui(48), _y - ui(25), ui(32), ui(32), _m); + unit.draw(_bx, _by + ui(4) + _h, _bs, _bs, _m); } + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); + + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y + _h + ui(4), _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y + _h + ui(4), _w, _h, c_white, 0.5 + 0.5 * interactable); + + var tb_w = _w / 2; + var tb_h = _h; + + var tb_lx = _x; + var tb_ly = _y; + + var tb_rx = _x + tb_w; + var tb_ry = _y; + + var tb_tx = _x; + var tb_ty = _y + _h + ui(4); + + var tb_bx = _x + tb_w; + var tb_by = _y + _h + ui(4); + + tb[2].draw(tb_lx, tb_ly, tb_w, tb_h, array_safe_get(_data, 2), _m); + tb[0].draw(tb_rx, tb_ry, tb_w, tb_h, array_safe_get(_data, 0), _m); + + tb[1].draw(tb_tx, tb_ty, tb_w, tb_h, array_safe_get(_data, 1), _m); + tb[3].draw(tb_bx, tb_by, tb_w, tb_h, array_safe_get(_data, 3), _m); + resetFocus(); return h; diff --git a/scripts/panel_data/panel_data.gml b/scripts/panel_data/panel_data.gml index b53ca5ac4..328c38fe4 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -927,7 +927,7 @@ function PanelContent() constructor { #region self.panel = panel; if(o_main.panel_dragging == noone) { pFOCUS = FOCUS == panel/* && panel.mouse_active*/; - pHOVER = HOVER == panel && panel.mouse_active; + pHOVER = !CURSOR_IS_LOCK && HOVER == panel && panel.mouse_active; } drawContent(panel); diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 28fc784c3..8f1410225 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -646,13 +646,14 @@ function Panel_Inspector() : PanelContent() constructor { var padd = ui(8); var _selY = yy; - var lbHov = point_in_rectangle(_m[0], _m[1], lb_x, _selY, lb_x + lb_w, _selY + lb_h); - if(lbHov) draw_sprite_stretched_ext(THEME.group_label, 0, lb_x, _selY + ui(2), lb_w, lb_h - ui(4), COLORS._main_icon_dark, 0.85); var widg = drawWidget(ui(16), yy, contentPane.surface_w - ui(24), _m, jun, false, pHOVER && contentPane.hover, pFOCUS, contentPane, ui(16) + x, top_bar_h + y); var widH = widg[0]; var mbRight = widg[1]; + var lbHov = point_in_rectangle(_m[0], _m[1], lb_x, _selY + ui(2), lb_x + lb_w, _selY + lb_h - ui(4)); + if(lbHov) draw_sprite_stretched_ext(THEME.button_hide, 1, lb_x, _selY + ui(2), lb_w, lb_h - ui(6), COLORS._main_icon, 1); + hh += lb_h + widH + padd; var _selY1 = yy + lb_h + widH + ui(2); diff --git a/scripts/pathAnchorBox/pathAnchorBox.gml b/scripts/pathAnchorBox/pathAnchorBox.gml index f1c5d39a5..339b88143 100644 --- a/scripts/pathAnchorBox/pathAnchorBox.gml +++ b/scripts/pathAnchorBox/pathAnchorBox.gml @@ -39,6 +39,9 @@ function pathAnchorBox(_onModify) : widget() constructor { } static drawParam = function(params) { + font = params.font; + for(var i = 0; i < 6; i++) tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } diff --git a/scripts/pathArrayBox/pathArrayBox.gml b/scripts/pathArrayBox/pathArrayBox.gml index 70c7bf9b8..6397a1e28 100644 --- a/scripts/pathArrayBox/pathArrayBox.gml +++ b/scripts/pathArrayBox/pathArrayBox.gml @@ -18,6 +18,8 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { } static drawParam = function(params) { + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } @@ -51,15 +53,17 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { } var aa = interactable * 0.25 + 0.75; + if(!is_array(_files)) _files = [ _files ]; var len = array_length(_files); - var txt = "(" + string(len) + ") " + "["; - for( var i = 0, n = array_length(_files); i < n; i++ ) + + var txt = $"({len}) ["; + for( var i = 0; i < len; i++ ) txt += (i? ", " : "") + filename_name_only(_files[i]); txt += "]"; draw_set_alpha(aa); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); + draw_set_text(font, fa_left, fa_center, COLORS._main_text); draw_text_cut(_x + ui(8), _y + _h / 2, txt, _w - ui(16)); draw_set_alpha(1); diff --git a/scripts/quarternionBox/quarternionBox.gml b/scripts/quarternionBox/quarternionBox.gml index eb1821791..610c69e7d 100644 --- a/scripts/quarternionBox/quarternionBox.gml +++ b/scripts/quarternionBox/quarternionBox.gml @@ -30,6 +30,7 @@ function quarternionBox(_onModify) : widget() constructor { for(var i = 0; i < 4; i++) { tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); tb[i].slidable = true; + tb[i].label = axis[i]; } static setSlideSpeed = function(speed) { @@ -50,6 +51,9 @@ function quarternionBox(_onModify) : widget() constructor { } static drawParam = function(params) { + font = params.font; + for(var i = 0; i < 4; i++) tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.display_data, params.m); } @@ -90,11 +94,6 @@ function quarternionBox(_onModify) : widget() constructor { for(var i = 0; i < size; i++) { var _a = _dispDat[i]; - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text(bx + ui(8), _y + _h / 2, axis[i]); - draw_set_alpha(1); - tb[i].hide = true; tb[i].setFocusHover(clickable && active, hover); tb[i].draw(bx, _y, disp_w, _h, _a, _m); diff --git a/scripts/rangeBox/rangeBox.gml b/scripts/rangeBox/rangeBox.gml index fda1bfbaa..698a3f2f8 100644 --- a/scripts/rangeBox/rangeBox.gml +++ b/scripts/rangeBox/rangeBox.gml @@ -53,6 +53,9 @@ function rangeBox(_type, _onModify) : widget() constructor { } static drawParam = function(params) { + font = params.font; + for(var i = 0; i < 2; i++) tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.display_data, params.m); } diff --git a/scripts/rotator/rotator.gml b/scripts/rotator/rotator.gml index efc581630..3749b275e 100644 --- a/scripts/rotator/rotator.gml +++ b/scripts/rotator/rotator.gml @@ -1,6 +1,6 @@ function rotator(_onModify, _step = -1) : widget() constructor { onModify = _onModify; - step = _step; + valStep = _step; scale = 1; dragging = noone; @@ -12,7 +12,8 @@ function rotator(_onModify, _step = -1) : widget() constructor { spr_bg = THEME.rotator_bg; spr_knob = THEME.rotator_knob; - tb_value = new textBox(TEXTBOX_INPUT.number, onModify).setSlidable(); + tb_value = new textBox(TEXTBOX_INPUT.number, onModify).setSlidable(0.1, true); + tb_value.hide = true; halign = fa_center; @@ -26,52 +27,50 @@ function rotator(_onModify, _step = -1) : widget() constructor { } #endregion static drawParam = function(params) { #region - halign = params.halign; - return draw(params.x, params.y, params.w, params.data, params.m); + font = params.font; + tb_value.font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion - static draw = function(_x, _y, _w, _data, _m, draw_tb = true) { #region + static draw = function(_x, _y, _w, _h, _data, _m, draw_tb = true) { #region x = _x; y = _y; w = _w; - h = ui(64); + h = _h; - var _r = ui(28); + if(!is_real(_data)) return; + + var _bs = min(_h, ui(32)); if(side_button) { side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - ui(32), _y + h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(4); } - switch(halign) { - case fa_left : _x += _r; break; - case fa_center : _x += _w / 2; break; - } + var _r = _h; + var _tx = _x + _r + ui(4); + var _tw = _w - _r - ui(4); - if(!is_real(_data)) return; - var knob_y = _y + h / 2; + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, _h, c_white, 0.5 + 0.5 * interactable); - if(draw_tb) { - tb_value.setFocusHover(active, hover); - tb_value.draw(_x + ui(64), knob_y - ui(17), ui(64), TEXTBOX_HEIGHT, _data, _m); - } + tb_value.setFocusHover(active, hover); + tb_value.draw(_tx, _y, _tw, _h, _data, _m); - draw_sprite(spr_bg, 0, round(_x), round(knob_y)); - - draw_set_color(COLORS.widget_rotator_guide); - draw_line(_x, knob_y, _x + lengthdir_x(ui(20), _data) - 1, knob_y + lengthdir_y(ui(20), _data) - 1); - - var px = _x + lengthdir_x(_r, _data); - var py = knob_y + lengthdir_y(_r, _data); + var _kx = _x + _r / 2; + var _ky = _y + _r / 2; + var _kr = (_r - ui(12)) / 2; + var _kc = COLORS._main_icon; if(dragging) { + _kc = COLORS._main_icon_light; + var real_val = round(dragging.delta_acc + drag_sv); var val = key_mod_press(CTRL)? round(real_val / 15) * 15 : real_val; - if(step != -1) val = round(real_val / step) * step; - - draw_sprite(spr_knob, 1, px, py); + if(valStep != -1) val = round(real_val / valStep) * valStep; if(onModify(val)) UNDO_HOLDING = true; @@ -83,32 +82,38 @@ function rotator(_onModify, _step = -1) : widget() constructor { instance_destroy(dragging); dragging = noone; UNDO_HOLDING = false; + } else if(mouse_release(mb_left)) { instance_destroy(dragging); dragging = noone; UNDO_HOLDING = false; } - } else if(hover && point_in_circle(_m[0], _m[1], _x, knob_y, _r + ui(16))) { - draw_sprite(spr_knob, 1, px, py); - + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc = COLORS._main_icon_light; + if(mouse_press(mb_left, active)) { - dragging = instance_create(0, 0, rotator_Rotator).init(_m, _x, knob_y); + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky); drag_sv = _data; } - var amo = 1; - if(key_mod_press(CTRL)) amo *= 10; - if(key_mod_press(ALT)) amo /= 10; - if(key_mod_press(SHIFT)) { + var amo = 1; + if(key_mod_press(CTRL)) amo *= 10; + if(key_mod_press(ALT)) amo /= 10; + if(mouse_wheel_down()) onModify(_data + amo * SCROLL_SPEED); if(mouse_wheel_up()) onModify(_data - amo * SCROLL_SPEED); } - } else { - draw_sprite(spr_knob, 0, px, py); } + shader_set(sh_widget_rotator); + shader_set_color("color", _kc); + shader_set_f("angle", degtorad(_data)); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + shader_reset(); + resetFocus(); return h; diff --git a/scripts/rotatorRandom/rotatorRandom.gml b/scripts/rotatorRandom/rotatorRandom.gml index ac174c4b7..eb3c989d9 100644 --- a/scripts/rotatorRandom/rotatorRandom.gml +++ b/scripts/rotatorRandom/rotatorRandom.gml @@ -9,10 +9,10 @@ function rotatorRandom(_onModify) : widget() constructor { knob_hovering = noone; mode = 0; - tb_min_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, val); } ).setSlidable(true, 1); - tb_max_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(2, val); } ).setSlidable(true, 1); - tb_min_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(3, val); } ).setSlidable(true, 1); - tb_max_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(4, val); } ).setSlidable(true, 1); + tb_min_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, val); } ).setSlidable(0.1, true); tb_min_0.hide = true; + tb_max_0 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(2, val); } ).setSlidable(0.1, true); tb_max_0.hide = true; + tb_min_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(3, val); } ).setSlidable(0.1, true); tb_min_1.hide = true; + tb_max_1 = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(4, val); } ).setSlidable(0.1, true); tb_max_1.hide = true; tooltip = new tooltipSelector("Mode", [ __txtx("widget_rotator_random_range", "Range"), @@ -39,29 +39,47 @@ function rotatorRandom(_onModify) : widget() constructor { } #endregion static drawParam = function(params) { #region - return draw(params.x, params.y, params.w, params.data, params.m); + font = params.font; + tb_min_0.font = params.font; + tb_max_0.font = params.font; + tb_min_1.font = params.font; + tb_max_1.font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion - static draw = function(_x, _y, _w, _data, _m) { #region + static draw = function(_x, _y, _w, _h, _data, _m) { #region x = _x; y = _y; w = _w; - h = ui(80); - - var _kHover = dragging_index; - - _x += _w / 2; mode = _data[0]; + var _hh = mode > 1? _h * 2 + ui(4) : _h; + h = h == 0? _hh : lerp_float(h, _hh, 5); - var knx = _x; - var kny = _y + h / 2; - var px, py, _r = ui(28); + var _kHover = dragging_index; + var _r = _h; + var _bs = min(_h, ui(32)); + var _tx = _x + _r + ui(4); + var _tw = _w - _r - ui(8) - _bs; - draw_sprite(THEME.rotator_bg, 0, round(_x), round(kny)); + switch(mode) { + case 2 : + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y + _h + ui(4), _tw, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y + _h + ui(4), _tw, _h, c_white, 0.5 + 0.5 * interactable); + case 0 : + case 1 : + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, _h, c_white, 0.5 + 0.5 * interactable); + break; + + case 3 : + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, h, c_white, 0.5 + 0.5 * interactable); + } tooltip.index = mode; - if(buttonInstant(THEME.button_hide_circle_28, knx - ui(28 / 2), kny - ui(28 / 2), ui(28), ui(28), _m, active, hover, tooltip, THEME.rotator_random_mode, mode) == 2) { #region + if(buttonInstant(noone, _x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, active, hover, tooltip, THEME.rotator_random_mode, mode, [ COLORS._main_icon, c_white ]) == 2) { #region mode = (mode + 1) % 4; onModify(0, mode); @@ -81,80 +99,45 @@ function rotatorRandom(_onModify) : widget() constructor { onModify(2, 225); onModify(3, 45); } + } #endregion + _w -= _bs + ui(4); + + var _kx = _x + _r / 2; + var _ky = _y + _r / 2; + var _kr = (_r - ui(12)) / 2; + var _kc = COLORS._main_icon; + + var _tw = (_w - _r - ui(4)) / 2; + var _tx = _x + _r + ui(4); + var _ty = _y; + switch(mode) { - case 0 : + case 0 : #region tb_min_0.setFocusHover(active, hover); tb_max_0.setFocusHover(active, hover); - tb_min_0.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); - tb_max_0.draw(knx + ui(40 + 16), kny - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 2), _m); + tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get(_data, 1), _m); + tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get(_data, 2), _m); - var _a0 = _data[1]; - var _a1 = _data[2]; - - px[0] = knx + lengthdir_x(_r, _a0); - px[1] = knx + lengthdir_x(_r, _a1); - - py[0] = kny + lengthdir_y(_r, _a0); - py[1] = kny + lengthdir_y(_r, _a1); - - #region draw arc - var hover_arc = false; - var diss = point_distance(_m[0], _m[1], knx, kny); - if(abs(diss - _r) < 6 || dragging_index == 2) - hover_arc = true; - - for(var i = 0; i < 2; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) - hover_arc = false; - } - - draw_set_color(hover_arc? COLORS.widget_rotator_range_hover : COLORS.widget_rotator_range); - draw_arc_width(knx, kny, _r, 3, _a0, _a1); - - for(var i = 0; i < 2; i++) - draw_sprite(THEME.rotator_knob, i == knob_hovering, px[i], py[i]); - #endregion - - if(dragging_index > -1) { #region - var val = point_direction(knx, kny, _m[0], _m[1]); - if(key_mod_press(CTRL)) val = round(val / 15) * 15; - + if(dragging_index > -1) { + _kc = COLORS._main_icon_light; + var val; - - if(dragging_index == 2) { - var curr_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ]; - var modi = false; + var curr_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ]; + var modi = false; - curr_val[1] = round(dragging.delta_acc + drag_sv[1]); - curr_val[2] = round(dragging.delta_acc + drag_sv[2]); + curr_val[1] = round(dragging.delta_acc + drag_sv[1]); + curr_val[2] = round(dragging.delta_acc + drag_sv[2]); - val = key_mod_press(CTRL)? round(curr_val[1] / 15) * 15 : curr_val[1]; - modi |= onModify(1, val); + val = key_mod_press(CTRL)? round(curr_val[1] / 15) * 15 : curr_val[1]; + modi |= onModify(1, val); - val = key_mod_press(CTRL)? round(curr_val[2] / 15) * 15 : curr_val[2]; - modi |= onModify(2, val); + val = key_mod_press(CTRL)? round(curr_val[2] / 15) * 15 : curr_val[2]; + modi |= onModify(2, val); - if(modi) UNDO_HOLDING = true; - } else { - var _o = _data[dragging_index]; - var curr_val = round(dragging.delta_acc + drag_sv); - val = key_mod_press(CTRL)? round(curr_val / 15) * 15 : curr_val; - - if(_data[dragging_index] != val) { - var modi = false; - modi |= onModify(1 + dragging_index, val); - - if(key_mod_press(ALT)) { - var dt = val - _o; - modi |= onModify(1 + !dragging_index, _data[!dragging_index] - dt); - } - - if(modi) UNDO_HOLDING = true; - } - } + if(modi) UNDO_HOLDING = true; MOUSE_BLOCK = true; @@ -172,78 +155,56 @@ function rotatorRandom(_onModify) : widget() constructor { dragging_index = -1; UNDO_HOLDING = false; } - #endregion - } else if(hover) { #region - for(var i = 0; i < 2; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) { - _kHover = i; - - if(mouse_press(mb_left, active)) { - dragging_index = i; - - drag_sv = _data[1 + i]; - drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny); - } - } - } - - if(dragging_index == -1 && hover_arc && mouse_press(mb_left, active)) { + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { dragging_index = 2; drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny); + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky); } - #endregion + } + + draw_set_color(CDEF.main_dkgrey); + draw_circle_angle(_kx, _ky, _kr, _data[1], _data[2], 32); + + shader_set(sh_widget_rotator_range); + shader_set_color("color", _kc); + shader_set_f("angle", degtorad(_data[1]), degtorad(_data[2])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + shader_reset(); + break; - case 1 : + #endregion + + case 1 : #region tb_min_0.setFocusHover(active, hover); tb_max_0.setFocusHover(active, hover); - - tb_min_0.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); - tb_max_0.draw(knx + ui(40 + 16), kny - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 2), _m); + + tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get(_data, 1), _m); + tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get(_data, 2), _m); var _a0 = _data[1] - _data[2]; var _a1 = _data[1] + _data[2]; - px[0] = knx + lengthdir_x(_r, _a0); - py[0] = kny + lengthdir_y(_r, _a0); - - px[1] = knx + lengthdir_x(_r, _a1); - py[1] = kny + lengthdir_y(_r, _a1); - - px[2] = knx + lengthdir_x(_r, (_a0 + _a1) / 2); - py[2] = kny + lengthdir_y(_r, (_a0 + _a1) / 2); - - #region draw arc - draw_set_color(COLORS.widget_rotator_range); - draw_arc_width(knx, kny, _r, 3, _a0, _a1); - - for( var i = 0; i < 3; i++ ) - draw_sprite(THEME.rotator_knob, i == knob_hovering, px[i], py[i]); - #endregion - - if(dragging_index > -1) { #region - var val = point_direction(knx, kny, _m[0], _m[1]); + if(dragging_index > -1) { + _kc = COLORS._main_icon_light; + + var val = point_direction(_kx, _ky, _m[0], _m[1]); if(key_mod_press(CTRL)) val = round(val / 15) * 15; var val; var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ]; - if(dragging_index == 2) { - real_val[1] = round(dragging.delta_acc + drag_sv[1]); - val = key_mod_press(CTRL)? round(real_val[1] / 15) * 15 : real_val[1]; + real_val[1] = round(dragging.delta_acc + drag_sv[1]); + val = key_mod_press(CTRL)? round(real_val[1] / 15) * 15 : real_val[1]; - if(onModify(1, val)) UNDO_HOLDING = true; - } else { - real_val[2] = round(drag_sv[2] + (dragging.delta_acc * (dragging_index? 1 : -1))); - val = key_mod_press(CTRL)? round(real_val[2] / 15) * 15 : real_val[2]; - - if(onModify(2, val)) UNDO_HOLDING = true; - } + if(onModify(1, val)) UNDO_HOLDING = true; MOUSE_BLOCK = true; @@ -261,74 +222,72 @@ function rotatorRandom(_onModify) : widget() constructor { dragging_index = -1; UNDO_HOLDING = false; } - #endregion - } else if(hover) { #region - for(var i = 0; i < 3; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) { - _kHover = i; - - if(mouse_press(mb_left, active)) { - dragging_index = i; - drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny); - } - } + + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { + dragging_index = 2; + drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky); } - #endregion } + + draw_set_color(CDEF.main_dkgrey); + draw_circle_angle(_kx, _ky, _kr, _a0, _a1, 32); + + shader_set(sh_widget_rotator); + shader_set_color("color", _kc); + shader_set_f("angle", degtorad(_data[1])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + shader_reset(); + break; - case 2 : + #endregion + + case 2 : #region + var _ky0 = _y + _r / 2; + var _ky1 = _y + _h + ui(4) + _r / 2; + + var _kc0 = _kc; + var _kc1 = _kc; + tb_min_0.setFocusHover(active, hover); tb_max_0.setFocusHover(active, hover); tb_min_1.setFocusHover(active, hover); tb_max_1.setFocusHover(active, hover); - tb_min_0.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2 - ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); - tb_max_0.draw(knx + ui(40 + 16), kny - TEXTBOX_HEIGHT / 2 - ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 2), _m); - tb_min_1.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2 + ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 3), _m); - tb_max_1.draw(knx + ui(40 + 16), kny - TEXTBOX_HEIGHT / 2 + ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 4), _m); + tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get(_data, 1), _m); + tb_max_0.draw(_tx + _tw, _ty, _tw, _h, array_safe_get(_data, 2), _m); + tb_min_1.draw(_tx, _ty + _h + ui(4), _tw, _h, array_safe_get(_data, 3), _m); + tb_max_1.draw(_tx + _tw, _ty + _h + ui(4), _tw, _h, array_safe_get(_data, 4), _m); - var _a0 = _data[1]; - var _a1 = _data[2]; - var _a2 = _data[3]; - var _a3 = _data[4]; - - px[0] = knx + lengthdir_x(_r, _a0); - py[0] = kny + lengthdir_y(_r, _a0); - - px[1] = knx + lengthdir_x(_r, _a1); - py[1] = kny + lengthdir_y(_r, _a1); - - px[2] = knx + lengthdir_x(_r, _a2); - py[2] = kny + lengthdir_y(_r, _a2); - - px[3] = knx + lengthdir_x(_r, _a3); - py[3] = kny + lengthdir_y(_r, _a3); - - #region draw arc - draw_set_color(COLORS.widget_rotator_range); - draw_arc_width(knx, kny, _r, 3, _a0, _a1); - draw_arc_width(knx, kny, _r, 3, _a2, _a3); + if(dragging_index > -1) { + if(dragging_index == 1) _kc0 = COLORS._main_icon_light; + else _kc1 = COLORS._main_icon_light; - for( var i = 0; i < 4; i++ ) - draw_sprite(THEME.rotator_knob, i == knob_hovering, px[i], py[i]); - #endregion - - if(dragging_index > -1) { #region - var val = point_direction(knx, kny, _m[0], _m[1]); + var val = point_direction(_kx, dragging_index == 1? _ky0 : _ky1, _m[0], _m[1]); if(key_mod_press(CTRL)) val = round(val / 15) * 15; var val; var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ]; - var ind = dragging_index + 1; + var modi = false; - real_val[ind] = round(drag_sv[ind] + (dragging.delta_acc * (ind? 1 : -1))); - val = key_mod_press(CTRL)? round(real_val[ind] / 15) * 15 : real_val[ind]; + for( var i = 1; i <= 2; i++ ) { + var ind = (dragging_index - 1) * 2 + i; - if(onModify(ind, val)) UNDO_HOLDING = true; + real_val[ind] = round(drag_sv[ind] + dragging.delta_acc); + val = key_mod_press(CTRL)? round(real_val[ind] / 15) * 15 : real_val[ind]; + + if(onModify(ind, val)) modi = true; + } - MOUSE_BLOCK = true; + if(modi) { + UNDO_HOLDING = true; + MOUSE_BLOCK = true; + } if(mouse_check_button_pressed(mb_right)) { for( var i = 0; i < 5; i++ ) onModify(i, drag_dat[i]); @@ -344,76 +303,75 @@ function rotatorRandom(_onModify) : widget() constructor { dragging_index = -1; UNDO_HOLDING = false; } - #endregion - } else if(hover) { #region - for(var i = 0; i < 4; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) { - _kHover = i; - - if(mouse_press(mb_left, active)) { - dragging_index = i; - drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny); - } - } + + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc0 = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { + dragging_index = 1; + drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky0); + } + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y + _h + ui(4), _x + _r, _y + _h + ui(4) + _r)) { + _kc1 = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { + dragging_index = 2; + drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky1); } - #endregion } + + draw_set_color(CDEF.main_dkgrey); + draw_circle_angle(_kx, _ky0, _kr, _data[1], _data[2], 32); + draw_circle_angle(_kx, _ky1, _kr, _data[3], _data[4], 32); + + shader_set(sh_widget_rotator_range); + shader_set_color("color", _kc0); + shader_set_f("angle", degtorad(_data[1]), degtorad(_data[2])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + + shader_set_color("color", _kc1); + shader_set_f("angle", degtorad(_data[3]), degtorad(_data[4])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y + _h + ui(4), _r, _r); + shader_reset(); + break; - case 3 : + #endregion + + case 3 : #region + var _ky0 = _y + _r / 2; + var _ky1 = _y + _h + ui(4) + _r / 2; + + var _kc0 = _kc; + var _kc1 = _kc; + tb_min_0.setFocusHover(active, hover); tb_max_0.setFocusHover(active, hover); tb_min_1.setFocusHover(active, hover); - tb_min_0.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2 - ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); - tb_max_0.draw(knx - ui(40 + 16 + 80), kny - TEXTBOX_HEIGHT / 2 + ui(20), ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 2), _m); - tb_min_1.draw(knx + ui(40 + 16), kny - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 3), _m); + tb_min_0.draw(_tx, _ty, _tw, _h, array_safe_get(_data, 1), _m); + tb_max_0.draw(_tx, _ty + _h + ui(4), _tw, _h, array_safe_get(_data, 2), _m); + tb_min_1.draw(_tx + _tw, _ty, _tw, h, array_safe_get(_data, 3), _m); - var _a0 = _data[1]; - var _a1 = _data[2]; + var _a0 = _data[1] - _data[3]; + var _a1 = _data[1] + _data[3]; + var _a2 = _data[2] - _data[3]; + var _a3 = _data[2] + _data[3]; - var _a2 = _data[1] - _data[3]; - var _a3 = _data[1] + _data[3]; - var _a4 = _data[2] - _data[3]; - var _a5 = _data[2] + _data[3]; - - px[0] = knx + lengthdir_x(_r, _a0); - py[0] = kny + lengthdir_y(_r, _a0); - - px[1] = knx + lengthdir_x(_r, _a1); - py[1] = kny + lengthdir_y(_r, _a1); - - px[2] = knx + lengthdir_x(_r, _a2); - py[2] = kny + lengthdir_y(_r, _a2); - - px[3] = knx + lengthdir_x(_r, _a3); - py[3] = kny + lengthdir_y(_r, _a3); - - px[4] = knx + lengthdir_x(_r, _a4); - py[4] = kny + lengthdir_y(_r, _a4); - - px[5] = knx + lengthdir_x(_r, _a5); - py[5] = kny + lengthdir_y(_r, _a5); - - #region draw arc - draw_set_color(COLORS.widget_rotator_range); - draw_arc_width(knx, kny, _r, 3, _a2, _a3); - draw_arc_width(knx, kny, _r, 3, _a4, _a5); - - for( var i = 0; i < 2; i++ ) - draw_sprite(THEME.rotator_knob, i == knob_hovering, px[i], py[i]); - #endregion - - if(dragging_index > -1) { #region - var val = point_direction(knx, kny, _m[0], _m[1]); + if(dragging_index > -1) { + var val = point_direction(_kx, _ky, _m[0], _m[1]); if(key_mod_press(CTRL)) val = round(val / 15) * 15; var real_val = [ drag_sv[0], drag_sv[1], drag_sv[2], drag_sv[3], drag_sv[4] ]; var val; - var ind = dragging_index + 1; + var ind = dragging_index; - real_val[ind] = round(drag_sv[ind] + (dragging.delta_acc * (ind? 1 : -1))); + real_val[ind] = round(drag_sv[ind] + dragging.delta_acc); val = key_mod_press(CTRL)? round(real_val[ind] / 15) * 15 : real_val[ind]; if(onModify(ind, val)) UNDO_HOLDING = true; @@ -434,23 +392,45 @@ function rotatorRandom(_onModify) : widget() constructor { dragging_index = -1; UNDO_HOLDING = false; } - #endregion - } else if(hover) { #region - for(var i = 0; i < 2; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) { - _kHover = i; + + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc0 = COLORS._main_icon_light; - if(mouse_press(mb_left, active)) { - dragging_index = i; - drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, knx, kny); - } - } + if(mouse_press(mb_left, active)) { + dragging_index = 1; + drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky0); + } + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y + _h + ui(4), _x + _r, _y + _h + ui(4) + _r)) { + _kc1 = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { + dragging_index = 2; + drag_sv = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + drag_dat = [ _data[0], _data[1], _data[2], _data[3], _data[4] ]; + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky1); } - #endregion } + + draw_set_color(CDEF.main_dkgrey); + draw_circle_angle(_kx, _ky0, _kr, _a0, _a1, 32); + draw_circle_angle(_kx, _ky1, _kr, _a2, _a3, 32); + + shader_set(sh_widget_rotator); + shader_set_color("color", _kc0); + shader_set_f("angle", degtorad(_data[1])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + + shader_set_color("color", _kc1); + shader_set_f("angle", degtorad(_data[2])); + + draw_sprite_stretched(s_fx_pixel, 0, _x, _y + _h + ui(4), _r, _r); + shader_reset(); + break; + #endregion } knob_hovering = _kHover; diff --git a/scripts/rotatorRange/rotatorRange.gml b/scripts/rotatorRange/rotatorRange.gml index 560af3db8..4e12acf8d 100644 --- a/scripts/rotatorRange/rotatorRange.gml +++ b/scripts/rotatorRange/rotatorRange.gml @@ -8,9 +8,8 @@ function rotatorRange(_onModify) : widget() constructor { knob_hovering = noone; - tb_min = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(0, val); } ).setSlidable(); - - tb_max = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, val); } ).setSlidable(); + tb_min = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(0, val); } ).setSlidable(0.1, true); tb_min.hide = true; + tb_max = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(1, val); } ).setSlidable(0.1, true); tb_max.hide = true; static setInteract = function(interactable = noone) { #region self.interactable = interactable; @@ -24,95 +23,61 @@ function rotatorRange(_onModify) : widget() constructor { } #endregion static drawParam = function(params) { #region - return draw(params.x, params.y, params.w, params.data, params.m); + font = params.font; + tb_min.font = params.font; + tb_max.font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion - static draw = function(_x, _y, _w, _data, _m) { #region + static draw = function(_x, _y, _w, _h, _data, _m) { #region x = _x; y = _y; w = _w; - h = ui(64); - - knob_hovering = dragging_index; - _x += _w / 2; + h = _h; if(!is_real(_data[0])) return; if(!is_real(_data[1])) return; - var knob_y = _y + h / 2; - var _r = ui(28); + var _r = _h; + var _tx = _x + _r + ui(4); + var _tw = _w - _r - ui(4); + + draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _tw, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _tw, _h, c_white, 0.5 + 0.5 * interactable); + + var _tw = (_w - _r - ui(4)) / 2; tb_min.setFocusHover(active, hover); + tb_min.draw(_x + _r + ui(4), _y, _tw, _h, _data[0], _m); + tb_max.setFocusHover(active, hover); + tb_max.draw(_x + _r + ui(4) + _tw, _y, _tw, _h, _data[1], _m); - tb_min.draw(_x - ui(40 + 16 + 80), knob_y - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 0), _m); - tb_max.draw(_x + ui(40 + 16), knob_y - TEXTBOX_HEIGHT / 2, ui(80), TEXTBOX_HEIGHT, array_safe_get(_data, 1), _m); + var _kx = _x + _r / 2; + var _ky = _y + _r / 2; + var _kr = (_r - ui(12)) / 2; + var _kc = COLORS._main_icon; - var px, py; - for(var i = 0; i < 2; i++) { - px[i] = _x + lengthdir_x(_r, _data[i]); - py[i] = knob_y + lengthdir_y(_r, _data[i]); - } - - draw_sprite(THEME.rotator_bg, 0, round(_x), round(knob_y)); - - draw_set_color(COLORS.widget_rotator_guide); - draw_line(_x, knob_y, _x + lengthdir_x(ui(20), _data[0]) - 1, knob_y + lengthdir_y(ui(20), _data[0]) - 1); - draw_line(_x, knob_y, _x + lengthdir_x(ui(20), _data[1]) - 1, knob_y + lengthdir_y(ui(20), _data[1]) - 1); - - #region draw arc - var hover_arc = false; - var diss = point_distance(_m[0], _m[1], _x, knob_y); + if(dragging_index) { + _kc = COLORS._main_icon_light; - if(abs(diss - _r) < 6 || dragging_index == 2) - hover_arc = true; - - for(var i = 0; i < 2; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) - hover_arc = false; - } - - draw_set_color(hover_arc? COLORS.widget_rotator_range_hover : COLORS.widget_rotator_range); - draw_arc_forward(_x, knob_y, _r, 3, _data[0], _data[1]); - #endregion - - if(dragging_index > -1) { #region - var val = point_direction(_x, knob_y, _m[0], _m[1]); + var val = point_direction(_kx, _ky, _m[0], _m[1]); if(key_mod_press(CTRL)) val = round(val / 15) * 15; var val, real_val; - - if(dragging_index == 2) { - var modi = false; + var modi = false; - real_val[0] = round(dragging.delta_acc + drag_sv[0]); - real_val[1] = round(dragging.delta_acc + drag_sv[1]); + real_val[0] = round(dragging.delta_acc + drag_sv[0]); + real_val[1] = round(dragging.delta_acc + drag_sv[1]); - val = key_mod_press(CTRL)? round(real_val[0] / 15) * 15 : real_val[0]; - modi |= onModify(0, val); + val = key_mod_press(CTRL)? round(real_val[0] / 15) * 15 : real_val[0]; + modi |= onModify(0, val); - val = key_mod_press(CTRL)? round(real_val[1] / 15) * 15 : real_val[1]; - modi |= onModify(1, val); + val = key_mod_press(CTRL)? round(real_val[1] / 15) * 15 : real_val[1]; + modi |= onModify(1, val); - if(modi) UNDO_HOLDING = true; - } else { - var _o = _data[dragging_index]; - real_val = round(dragging.delta_acc + drag_sv); - val = key_mod_press(CTRL)? round(real_val / 15) * 15 : real_val; - - if(_data[dragging_index] != val) { - var modi = false; - modi |= onModify(dragging_index, val); - - if(key_mod_press(ALT)) { - var dt = val - _o; - modi |= onModify(!dragging_index, _data[!dragging_index] - dt); - } - - if(modi) UNDO_HOLDING = true; - } - } - + if(modi) UNDO_HOLDING = true; MOUSE_BLOCK = true; if(mouse_check_button_pressed(mb_right)) { @@ -129,32 +94,28 @@ function rotatorRange(_onModify) : widget() constructor { dragging_index = -1; UNDO_HOLDING = false; } - #endregion - } else if(hover) { #region - for(var i = 0; i < 2; i++) { - if(point_in_circle(_m[0], _m[1], px[i], py[i], ui(20))) { - knob_hovering = i; - - if(mouse_press(mb_left, active)) { - dragging_index = i; - drag_sv = _data[i]; - drag_dat = [ _data[0], _data[1] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, _x, knob_y); - } - } - } - if(dragging_index == -1 && hover_arc && mouse_press(mb_left, active)) { - dragging_index = 2; + } else if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _r, _y + _r)) { + _kc = COLORS._main_icon_light; + + if(mouse_press(mb_left, active)) { + dragging_index = 1; drag_sv = [ _data[0], _data[1] ]; drag_dat = [ _data[0], _data[1] ]; - dragging = instance_create(0, 0, rotator_Rotator).init(_m, _x, knob_y); + dragging = instance_create(0, 0, rotator_Rotator).init(_m, _kx, _ky); } - } #endregion + } - for(var i = 0; i < 2; i++) - draw_sprite(THEME.rotator_knob, knob_hovering == i, px[i], py[i]); + draw_set_color(CDEF.main_dkgrey); + draw_circle_angle(_kx, _ky, _kr, _data[0], _data[1], 32); + + shader_set(sh_widget_rotator_range); + shader_set_color("color", _kc); + shader_set_f("angle", degtorad(_data[0]), degtorad(_data[1])); + draw_sprite_stretched(s_fx_pixel, 0, _x, _y, _r, _r); + shader_reset(); + resetFocus(); return h; diff --git a/scripts/scrollBox/scrollBox.gml b/scripts/scrollBox/scrollBox.gml index 406dcb4de..660d08b0a 100644 --- a/scripts/scrollBox/scrollBox.gml +++ b/scripts/scrollBox/scrollBox.gml @@ -17,7 +17,6 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor data = _data; curr_text = 0; - font = f_p0; arrow_spr = THEME.scroll_box_arrow; arrow_ind = 0; @@ -44,6 +43,8 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor } #endregion static drawParam = function(params) { #region + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.rx, params.ry); } #endregion diff --git a/scripts/slider/slider.gml b/scripts/slider/slider.gml index e19869eb5..efae4ab6d 100644 --- a/scripts/slider/slider.gml +++ b/scripts/slider/slider.gml @@ -50,6 +50,8 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg } #endregion static drawParam = function(params) { #region + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion diff --git a/scripts/sliderRange/sliderRange.gml b/scripts/sliderRange/sliderRange.gml index f53804916..7789a130b 100644 --- a/scripts/sliderRange/sliderRange.gml +++ b/scripts/sliderRange/sliderRange.gml @@ -29,6 +29,10 @@ function sliderRange(_step, _int, _range, _onModify) : widget() constructor { } #endregion static drawParam = function(params) { #region + font = params.font; + tb_value_min.font = params.font; + tb_value_max.font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index db251cec7..bba0d6013 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -737,6 +737,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor static drawParam = function(params) { #region rx = params.rx; ry = params.ry; + font = params.font; return draw(params.x, params.y, params.w, params.h, params.data, params.m); } #endregion diff --git a/scripts/textArrayBox/textArrayBox.gml b/scripts/textArrayBox/textArrayBox.gml index eda420b4d..df9eb33a1 100644 --- a/scripts/textArrayBox/textArrayBox.gml +++ b/scripts/textArrayBox/textArrayBox.gml @@ -9,6 +9,8 @@ function textArrayBox(arraySet, data, onModify = noone) : widget() constructor { open = false; static drawParam = function(params) { + font = params.font; + return draw(params.x, params.y, params.w, params.h, params.m, params.rx, params.ry); } @@ -21,10 +23,10 @@ function textArrayBox(arraySet, data, onModify = noone) : widget() constructor { var tx = _x + ui(4); var ty = _y + ui(4); - var hh = line_get_height(f_p0, ui(4)); + var hh = line_get_height(font, ui(4)); var th = hh + ui(8); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); + draw_set_text(font, fa_left, fa_center, COLORS._main_text); for( var i = 0, n = array_length(arraySet); i < n; i++ ) { var ww = string_width(arraySet[i]) + ui(16); if(tx + ww + ui(2) > _x + _w - ui(8)) { @@ -56,9 +58,9 @@ function textArrayBox(arraySet, data, onModify = noone) : widget() constructor { var tx = _x + ui(4); var ty = _y + ui(4); - var hh = line_get_height(f_p0, ui(4)); + var hh = line_get_height(font, ui(4)); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); + draw_set_text(font, fa_left, fa_center, COLORS._main_text); for( var i = 0, n = array_length(arraySet); i < n; i++ ) { var ww = string_width(arraySet[i]) + ui(16); if(tx + ww + ui(2) > _x + _w - ui(8)) { diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index e02972376..a43228d23 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -12,11 +12,14 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { format = TEXT_AREA_FORMAT._default; precision = 5; + suffix = ""; + no_empty = true; auto_update = false; slidable = false; sliding = false; + slide_delta = 0; slide_int = false; slide_speed = 1 / 10; slide_range = noone; @@ -314,8 +317,12 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { draw_set_alpha(0.5 + 0.5 * interactable); _y += ui(1); - draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, color); - draw_text_add(_x + disp_x, _y, _text); + var cc = color; + if(sliding == 2) + cc = COLORS._main_accent + + draw_set_text(font == noone? f_p0 : font, fa_left, fa_top, cc); + draw_text_add(_x + disp_x, _y, _text + suffix); draw_set_alpha(1); var _xx = _x + disp_x; @@ -354,6 +361,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } #endregion static drawParam = function(params) { #region + font = params.font; return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.halign, params.valign); } #endregion @@ -404,7 +412,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { if(!hide) { draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, _w, _h, boxColor, 1); - + if(slide_range != noone) { var _minn = slide_range[0]; var _maxx = slide_range[1]; @@ -421,6 +429,22 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } } + if(sliding == 2) { + var _ax0 = _x + ui(10); + var _ax1 = _x + _w - ui(10); + var _ay = _y + _h / 2; + + draw_sprite_ui_uniform(THEME.arrow, 2, _ax0, _ay, 1, COLORS._main_accent, 1); + draw_sprite_ui_uniform(THEME.arrow, 0, _ax1, _ay, 1, COLORS._main_accent, 1); + + } else if(label != "") { + draw_set_valign(fa_center) + draw_set_color(COLORS._main_text_sub); + draw_set_alpha(0.5); + draw_text_add(_x + ui(8), _y + _h / 2, label); + draw_set_alpha(1); + } + disp_x = lerp_float(disp_x, disp_x_to, 5); var hoverRect = point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); @@ -558,17 +582,13 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } else if(!hide) draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, boxColor, 0.5 + 0.5 * interactable); - if(slidable) { - //if(_w > ui(64) && _h >= TEXTBOX_HEIGHT && label == "") - // draw_sprite_ui_uniform(THEME.text_slider, 0, _x + ui(20), _y + _h / 2, 1, COLORS._main_icon, 0.5); - - if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h) && mouse_press(mb_left, active)) { - sliding = 1; + if(slidable && hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h) && mouse_press(mb_left, active)) { + sliding = 1; + slide_delta = 0; - slide_mx = _m[0]; - slide_my = _m[1]; - } - } + slide_mx = _m[0]; + slide_my = _m[1]; + } surface_set_shader(text_surface, noone, true, BLEND.add); display_text(tx - tb_surf_x, _h / 2 - th / 2, _display_text, _w - ui(4)); @@ -577,18 +597,13 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { BLEND_ALPHA draw_surface(text_surface, tb_surf_x, tb_surf_y); BLEND_NORMAL - - if(label != "") { - draw_set_text(f_p2, fa_left, fa_center, COLORS._main_icon); - draw_set_alpha(0.5); - draw_text_add(_x + ui(8), _y + _h / 2, label); - draw_set_alpha(1); - } } #endregion if(sliding > 0) { #region + slide_delta += window_mouse_get_delta_x(); + slide_delta += window_mouse_get_delta_y(); - if(sliding == 1 && window_mouse_get_delta_x() != 0) { + if(sliding == 1 && abs(slide_delta) > 8) { deactivate(); textBox_slider.activate(toNumber(_input_text)); sliding = 2; diff --git a/scripts/toggleGroup/toggleGroup.gml b/scripts/toggleGroup/toggleGroup.gml index 9726e0b7b..f920005da 100644 --- a/scripts/toggleGroup/toggleGroup.gml +++ b/scripts/toggleGroup/toggleGroup.gml @@ -23,6 +23,10 @@ function toggleGroup(_data, _onClick) : widget() constructor { } static drawParam = function(params) { + font = params.font; + for(var i = 0; i < array_length(data); i++) + buttons[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.m, params.rx, params.ry); } diff --git a/scripts/transformBox/transformBox.gml b/scripts/transformBox/transformBox.gml index 15d56a451..670a30139 100644 --- a/scripts/transformBox/transformBox.gml +++ b/scripts/transformBox/transformBox.gml @@ -15,11 +15,14 @@ function transformBox(_onModify) : widget() constructor { onModifySingle[TRANSFORM.sca_x] = function(val) { onModify(TRANSFORM.sca_x, val); } onModifySingle[TRANSFORM.sca_y] = function(val) { onModify(TRANSFORM.sca_y, val); } - rot = new rotator(function(val) { onModify(TRANSFORM.rot , val); }); + rot = new rotator(function(val) { onModify(TRANSFORM.rot, val); }); + + labels = [ "x", "y", "rot", "sx", "sy" ]; for(var i = 0; i < 5; i++) { tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); tb[i].slidable = true; + tb[i].label = labels[i]; } static setInteract = function(interactable = noone) { @@ -38,15 +41,19 @@ function transformBox(_onModify) : widget() constructor { tb[TRANSFORM.sca_y].register(parent); } - static drawParam = function(params) { - return draw(params.x, params.y, params.w, params.data, params.m); + static drawParam = function(params) { + font = params.font; + rot.font = params.font; + for(var i = 0; i < 5; i++) tb[i].font = params.font; + + return draw(params.x, params.y, params.w, params.h, params.data, params.m); } - static draw = function(_x, _y, _w, _data, _m) { + static draw = function(_x, _y, _w, _h, _data, _m) { x = _x; y = _y; w = _w; - h = ui(148); + h = _h * 3 + ui(4) * 2; if(!is_array(_data)) return 0; if(array_empty(_data)) return 0; @@ -58,32 +65,27 @@ function transformBox(_onModify) : widget() constructor { tb[i].hide = true; } - var lbw = ui(80); - var tbw = (_w - lbw) / 2; - var tbh = TEXTBOX_HEIGHT; + draw_set_text(font, fa_left, fa_center, CDEF.main_dkgrey); + + var lbw = string_width(__txt("Position")) + ui(8); + var tbw = (_w - lbw) / 2; + var tbh = _h; - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner); draw_text_add(_x, _y + tbh / 2, __txt("Position")); draw_sprite_stretched_ext(THEME.textbox, 3, _x + lbw, _y, _w - lbw, tbh, c_white, 1); draw_sprite_stretched_ext(THEME.textbox, 0, _x + lbw, _y, _w - lbw, tbh, c_white, 0.5 + 0.5 * interactable); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text_add(_x + lbw + ui(8), _y + tbh / 2, "x"); - draw_text_add(_x + lbw + tbw + ui(8), _y + tbh / 2, "y"); - draw_set_alpha(1); - tb[TRANSFORM.pos_x].draw(_x + lbw, _y, tbw, tbh, _data[TRANSFORM.pos_x], _m); tb[TRANSFORM.pos_y].draw(_x + lbw + tbw, _y, tbw, tbh, _data[TRANSFORM.pos_y], _m); - _y += ui(40); + _y += tbh + ui(4); - rot.draw(_x, _y, _w, _data[TRANSFORM.rot], _m); + rot.draw(_x, _y, _w, tbh, _data[TRANSFORM.rot], _m); - _y += ui(72); + _y += tbh + ui(4); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner); + draw_set_text(font, fa_left, fa_center, CDEF.main_dkgrey); draw_text_add(_x, _y + tbh / 2, __txt("Scale")); draw_sprite_stretched_ext(THEME.textbox, 3, _x + lbw, _y, _w - lbw, tbh, c_white, 1); @@ -91,14 +93,6 @@ function transformBox(_onModify) : widget() constructor { tbw = array_length(_data) > 4? (_w - lbw) / 2 : _w - lbw; - if(array_length(_data) > 4) { - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text_add(_x + lbw + ui(8), _y + tbh / 2, "x"); - draw_text_add(_x + lbw + tbw + ui(8), _y + tbh / 2, "y"); - draw_set_alpha(1); - } - tb[TRANSFORM.sca_x].draw(_x + lbw, _y, tbw, tbh, _data[TRANSFORM.sca_x], _m); if(array_length(_data) > 4) tb[TRANSFORM.sca_y].draw(_x + lbw + tbw, _y, tbw, tbh, _data[TRANSFORM.sca_y], _m); diff --git a/scripts/vectorBox/vectorBox.gml b/scripts/vectorBox/vectorBox.gml index a1883c720..28822866f 100644 --- a/scripts/vectorBox/vectorBox.gml +++ b/scripts/vectorBox/vectorBox.gml @@ -49,26 +49,27 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { for(var i = 0; i < 4; i++) { tb[i] = new textBox(TEXTBOX_INPUT.number, onModifySingle[i]); tb[i].slidable = true; + tb[i].label = axis[i]; } - static setMinMax = function() { + static setMinMax = function() { #region linkable = false; axis = [ "min", "max" ]; return self; - } + } #endregion - static setLinkInactiveColor = function(color) { + static setLinkInactiveColor = function(color) { #region link_inactive_color = color; return self; - } + } #endregion - static setSlideSpeed = function(speed) { + static setSlideSpeed = function(speed) { #region for(var i = 0; i < size; i++) tb[i].setSlidable(speed); return self; - } + } #endregion - static setInteract = function(interactable) { + static setInteract = function(interactable) { #region self.interactable = interactable; if(side_button != noone) @@ -76,9 +77,9 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { for( var i = 0; i < size; i++ ) tb[i].interactable = interactable; - } + } #endregion - static register = function(parent = noone) { + static register = function(parent = noone) { #region for( var i = 0; i < size; i++ ) tb[i].register(parent); @@ -87,11 +88,14 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { if(unit != noone && unit.reference != noone) unit.triggerButton.register(parent); - } + } #endregion - static drawParam = function(params) { + static drawParam = function(params) { #region + font = params.font; + for(var i = 0; i < 4; i++) tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.display_data, params.m); - } + } #endregion static draw = function(_x, _y, _w, _h, _data, _display_data, _m) { x = _x; @@ -149,16 +153,10 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); for(var i = 0; i < sz; i++) { - draw_set_font(f_p0); var bx = per_line? _x : _x + ww * i; var by = per_line? _y + (_h + ui(8)) * i : _y; - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text_add(bx + ui(8), by + _h / 2, axis[i]); - draw_set_alpha(1); - tb[i].setFocusHover(active, hover); tb[i].hide = true; tb[i].draw(bx, by, ww, _h, _data[i], _m); diff --git a/scripts/vectorRangeBox/vectorRangeBox.gml b/scripts/vectorRangeBox/vectorRangeBox.gml index 761270dee..30e3da730 100644 --- a/scripts/vectorRangeBox/vectorRangeBox.gml +++ b/scripts/vectorRangeBox/vectorRangeBox.gml @@ -33,7 +33,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const for(var i = 0; i < size; i++) { #region tb[i] = new textBox(_type, onModifySingle[i]); tb[i].slidable = true; - tb[i].hide = true; + tb[i].hide = true; } #endregion static setSlideSpeed = function(speed) { #region @@ -56,6 +56,9 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const } #endregion static drawParam = function(params) { #region + font = params.font; + for(var i = 0; i < size; i++) tb[i].font = params.font; + return draw(params.x, params.y, params.w, params.h, params.data, params.display_data, params.m); } #endregion @@ -100,11 +103,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const var bx = _x + ww * i; var by = _y; - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text_add(bx + ui(8), by + _h / 2, axis[i]); - draw_set_alpha(1); - + tb[i * 2].label = axis[i]; tb[i * 2].setFocusHover(active, hover); tb[i * 2].draw(bx, by, ww, _h, _data[i * 2], _m); } @@ -115,14 +114,10 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const draw_sprite_stretched_ext(THEME.textbox, 3, _x, by, _w, _h, c_white, 1); draw_sprite_stretched_ext(THEME.textbox, 0, _x, by, _w, _h, c_white, 0.5 + 0.5 * interactable); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.5); - draw_text_add(_x + ui(8), by + _h / 2, axis[j]); - draw_set_alpha(1); - for( var i = 0; i < 2; i++ ) { var bx = _x + ww * i; - + + if(i == 0) tb[j * 2 + i].label = axis[j]; tb[j * 2 + i].setFocusHover(active, hover); tb[j * 2 + i].draw(bx, by, ww, _h, _data[j * 2 + i], _m); } diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index fecb909a5..319c0da10 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -9,6 +9,8 @@ function widget() constructor { lua_thread = noone; lua_thread_key = ""; + font = f_p0; + x = 0; y = 0; w = 0; @@ -91,4 +93,6 @@ function widgetParam(x, y, w, h, data, display_data = {}, m = mouse_ui, rx = 0, self.valign = fa_top; self.display_data = display_data; + + self.font = f_p0; } \ No newline at end of file diff --git a/shaders/sh_color_adjust/sh_color_adjust.fsh b/shaders/sh_color_adjust/sh_color_adjust.fsh index b35d47dd2..39dde8d63 100644 --- a/shaders/sh_color_adjust/sh_color_adjust.fsh +++ b/shaders/sh_color_adjust/sh_color_adjust.fsh @@ -12,16 +12,22 @@ uniform sampler2D param1; uniform vec2 brightness; uniform int brightnessUseSurf; + uniform vec2 contrast; uniform int contrastUseSurf; + uniform vec2 exposure; uniform int exposureUseSurf; + uniform vec2 hue; uniform int hueUseSurf; + uniform vec2 sat; uniform int satUseSurf; + uniform vec2 val; uniform int valUseSurf; + uniform vec2 alpha; uniform int alphaUseSurf; diff --git a/shaders/sh_polar/sh_polar.fsh b/shaders/sh_polar/sh_polar.fsh index c89b9b236..10dbd50da 100644 --- a/shaders/sh_polar/sh_polar.fsh +++ b/shaders/sh_polar/sh_polar.fsh @@ -6,6 +6,7 @@ varying vec4 v_vColour; uniform int invert; uniform int distMode; uniform int swap; +uniform vec2 tile; uniform vec2 blend; uniform int blendUseSurf; @@ -62,6 +63,7 @@ vec4 texture2Dintp( sampler2D texture, vec2 uv ) { void main() { vec2 center = vec2(0.5, 0.5); vec2 coord; + vec2 _tile = swap == 1? tile.yx : tile; float bld = blend.x; if(blendUseSurf == 1) { @@ -77,7 +79,7 @@ void main() { vec2 cenPos = v_vTexcoord - center; float angle = (atan(cenPos.y, cenPos.x) / PI + 1.) / 2.; - coord = fract(vec2(dist, angle)); + coord = fract(vec2(dist, angle) * _tile); } else if(invert == 1) { float dist = v_vTexcoord.x * 0.5; if(distMode == 1) dist = sqrt(dist); @@ -85,9 +87,10 @@ void main() { float ang = v_vTexcoord.y * PI * 2.; - coord = fract(center + vec2(cos(ang), sin(ang)) * dist); + coord = fract(center + vec2(cos(ang), sin(ang)) * dist * _tile); } if(swap == 1) coord.xy = coord.yx; + gl_FragColor = texture2Dintp( gm_BaseTexture, mix(v_vTexcoord, coord, bld) ); } diff --git a/shaders/sh_widget_rotator/sh_widget_rotator.fsh b/shaders/sh_widget_rotator/sh_widget_rotator.fsh new file mode 100644 index 000000000..44d3fb722 --- /dev/null +++ b/shaders/sh_widget_rotator/sh_widget_rotator.fsh @@ -0,0 +1,30 @@ +#define PI 3.14159265359 + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec4 color; +uniform float angle; + +float line_segment(in float ang) { + vec2 a = vec2(.5); + vec2 b = vec2(.5) + vec2(cos(ang), -sin(ang)) * 0.3; + vec2 p = v_vTexcoord; + + vec2 ba = b - a; + vec2 pa = p - a; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0., 1.); + return length(pa - h * ba); +} + +void main() { + float dist = length(v_vTexcoord - .5) - 0.3; + float alp = 0.; + bool inside = dist < 0.; + + dist = abs(dist); + alp = max(alp, smoothstep(0.1, 0., dist)); + alp = max(alp, smoothstep(0.1, 0., line_segment(angle))); + + gl_FragColor = vec4(color.rgb, alp); +} diff --git a/shaders/sh_widget_rotator/sh_widget_rotator.vsh b/shaders/sh_widget_rotator/sh_widget_rotator.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_widget_rotator/sh_widget_rotator.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_widget_rotator/sh_widget_rotator.yy b/shaders/sh_widget_rotator/sh_widget_rotator.yy new file mode 100644 index 000000000..3730bac45 --- /dev/null +++ b/shaders/sh_widget_rotator/sh_widget_rotator.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_widget_rotator", + "parent": { + "name": "rotator", + "path": "folders/widgets/rotator.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_widget_rotator_range/sh_widget_rotator_range.fsh b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.fsh new file mode 100644 index 000000000..1a1085f8a --- /dev/null +++ b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.fsh @@ -0,0 +1,31 @@ +#define PI 3.14159265359 + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec4 color; +uniform vec2 angle; + +float line_segment(in float ang) { + vec2 a = vec2(.5); + vec2 b = vec2(.5) + vec2(cos(ang), -sin(ang)) * 0.3; + vec2 p = v_vTexcoord; + + vec2 ba = b - a; + vec2 pa = p - a; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0., 1.); + return length(pa - h * ba); +} + +void main() { + float dist = length(v_vTexcoord - .5) - 0.3; + float alp = 0.; + bool inside = dist < 0.; + + dist = abs(dist); + alp = max(alp, smoothstep(0.1, 0., dist)); + alp = max(alp, smoothstep(0.1, 0., line_segment(angle[0]))); + alp = max(alp, smoothstep(0.1, 0., line_segment(angle[1]))); + + gl_FragColor = vec4(color.rgb, alp); +} diff --git a/shaders/sh_widget_rotator_range/sh_widget_rotator_range.vsh b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_widget_rotator_range/sh_widget_rotator_range.yy b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.yy new file mode 100644 index 000000000..3d45c4859 --- /dev/null +++ b/shaders/sh_widget_rotator_range/sh_widget_rotator_range.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_widget_rotator_range", + "parent": { + "name": "rotator", + "path": "folders/widgets/rotator.yy", + }, + "type": 1, +} \ No newline at end of file