From f996707b95c49d46305697c8a0c4b049d5511507 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Thu, 13 Feb 2025 16:54:56 +0700 Subject: [PATCH] New dynamic drawer system. --- PixelComposer.resource_order | 26 +-- PixelComposer.yyp | 10 +- datafiles/data/Nodes/Internal.zip | Bin 9102148 -> 9102148 bytes objects/o_dialog_add_node/Create_0.gml | 3 +- objects/o_dialog_assetbox/Create_0.gml | 83 +++++---- scripts/__VFX/__VFX.gml | 27 +-- scripts/__init_dynaDraw/__init_dynaDraw.gml | 20 +++ scripts/__init_dynaDraw/__init_dynaDraw.yy | 14 ++ .../_node_VFX_spawner/_node_VFX_spawner.gml | 9 +- scripts/assets_data/assets_data.gml | 3 + scripts/dynaSurf/dynaSurf.gml | 28 +-- scripts/dynaSurf/dynaSurf.yy | 4 +- scripts/dynaSurf_3d/dynaSurf_3d.yy | 4 +- .../dynaSurf_circle_fill.gml | 70 +++++--- .../dynaSurf_circle_fill.yy | 4 +- .../dynaSurf_circle_outline.gml | 67 ++++--- .../dynaSurf_circle_outline.yy | 4 +- scripts/dynaSurf_iso/dynaSurf_iso.yy | 4 +- .../dynaSurf_square_fill.gml | 32 ++-- .../dynaSurf_square_fill.yy | 4 +- .../dynaSurf_square_outline.gml | 32 ++-- .../dynaSurf_square_outline.yy | 4 +- scripts/globals/globals.gml | 4 +- scripts/node_mk_brownian/node_mk_brownian.gml | 6 +- scripts/panel_collection/panel_collection.gml | 3 +- scripts/surfaceBox/surfaceBox.gml | 165 +++++++++--------- .../surface_functions/surface_functions.gml | 2 +- 27 files changed, 372 insertions(+), 260 deletions(-) create mode 100644 scripts/__init_dynaDraw/__init_dynaDraw.gml create mode 100644 scripts/__init_dynaDraw/__init_dynaDraw.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index e9bf0ceb2..94e5f80fe 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -33,7 +33,7 @@ {"name":"debug","order":10,"path":"folders/functions/debug.yy",}, {"name":"delaunay","order":11,"path":"folders/functions/delaunay.yy",}, {"name":"draw","order":12,"path":"folders/functions/draw.yy",}, - {"name":"dynaSurf","order":20,"path":"folders/functions/draw/dynaSurf.yy",}, + {"name":"dynaDraw","order":2,"path":"folders/functions/surface/dynaDraw.yy",}, {"name":"ds","order":13,"path":"folders/functions/ds.yy",}, {"name":"files","order":14,"path":"folders/functions/files.yy",}, {"name":"geometry","order":15,"path":"folders/functions/geometry.yy",}, @@ -53,7 +53,7 @@ {"name":"sprite","order":29,"path":"folders/functions/sprite.yy",}, {"name":"string","order":30,"path":"folders/functions/string.yy",}, {"name":"surface","order":31,"path":"folders/functions/surface.yy",}, - {"name":"dynamic_surface","order":1,"path":"folders/functions/surface/dynamic_surface.yy",}, + {"name":"dynaSurf","order":1,"path":"folders/functions/surface/dynaSurf.yy",}, {"name":"svg","order":39,"path":"folders/functions/svg.yy",}, {"name":"test","order":32,"path":"folders/functions/test.yy",}, {"name":"tooltip","order":33,"path":"folders/functions/tooltip.yy",}, @@ -218,7 +218,6 @@ {"name":"bool","order":2,"path":"folders/nodes/icons/value/bool.yy",}, {"name":"color","order":10,"path":"folders/nodes/icons/value/color.yy",}, {"name":"gradient","order":12,"path":"folders/nodes/icons/value/gradient.yy",}, - {"name":null,"order":9,"path":"folders/panels/runner.yy",}, {"name":"matrix","order":4,"path":"folders/nodes/icons/value/matrix.yy",}, {"name":"mesh","order":9,"path":"folders/nodes/icons/value/mesh.yy",}, {"name":"number","order":1,"path":"folders/nodes/icons/value/number.yy",}, @@ -271,7 +270,6 @@ {"name":"rotator","order":2,"path":"folders/widgets/rotator.yy",}, {"name":"sliders","order":3,"path":"folders/widgets/sliders.yy",}, {"name":"text","order":4,"path":"folders/widgets/text.yy",}, - {"name":"runner","order":12,"path":"folders/panels/_others/runner.yy",}, ], "ResourceOrderSettings":[ {"name":"ac_disappear","order":2,"path":"animcurves/ac_disappear/ac_disappear.yy",}, @@ -489,7 +487,7 @@ {"name":"binder_gamemaker_tile","order":7,"path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",}, {"name":"binder_gamemaker","order":6,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",}, {"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",}, - {"name":"blurSurface","order":2,"path":"scripts/blurSurface/blurSurface.yy",}, + {"name":"blurSurface","order":3,"path":"scripts/blurSurface/blurSurface.yy",}, {"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",}, {"name":"buttonAnchor","order":5,"path":"scripts/buttonAnchor/buttonAnchor.yy",}, {"name":"buttonColor","order":1,"path":"scripts/buttonColor/buttonColor.yy",}, @@ -590,8 +588,8 @@ {"name":"draw_setter","order":1,"path":"scripts/draw_setter/draw_setter.yy",}, {"name":"draw_shapes","order":9,"path":"scripts/draw_shapes/draw_shapes.yy",}, {"name":"draw_sprite_ext_override","order":8,"path":"scripts/draw_sprite_ext_override/draw_sprite_ext_override.yy",}, - {"name":"draw_surface_blend","order":3,"path":"scripts/draw_surface_blend/draw_surface_blend.yy",}, - {"name":"draw_surface_functions","order":5,"path":"scripts/draw_surface_functions/draw_surface_functions.yy",}, + {"name":"draw_surface_blend","order":4,"path":"scripts/draw_surface_blend/draw_surface_blend.yy",}, + {"name":"draw_surface_functions","order":6,"path":"scripts/draw_surface_functions/draw_surface_functions.yy",}, {"name":"draw_text_delimiter","order":12,"path":"scripts/draw_text_delimiter/draw_text_delimiter.yy",}, {"name":"draw_text_function","order":10,"path":"scripts/draw_text_function/draw_text_function.yy",}, {"name":"draw_text_path","order":19,"path":"scripts/draw_text_path/draw_text_path.yy",}, @@ -600,10 +598,10 @@ {"name":"ds_list","order":1,"path":"scripts/ds_list/ds_list.yy",}, {"name":"ds_priority","order":3,"path":"scripts/ds_priority/ds_priority.yy",}, {"name":"dynaSurf_3d","order":2,"path":"scripts/dynaSurf_3d/dynaSurf_3d.yy",}, - {"name":"dynaSurf_circle_outline","order":1,"path":"scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy",}, + {"name":"dynaSurf_circle_outline","order":2,"path":"scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy",}, {"name":"dynaSurf_iso","order":1,"path":"scripts/dynaSurf_iso/dynaSurf_iso.yy",}, - {"name":"dynaSurf_square_fill","order":2,"path":"scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy",}, - {"name":"dynaSurf_square_outline","order":3,"path":"scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy",}, + {"name":"dynaSurf_square_fill","order":3,"path":"scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy",}, + {"name":"dynaSurf_square_outline","order":4,"path":"scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy",}, {"name":"event_recorder","order":4,"path":"scripts/event_recorder/event_recorder.yy",}, {"name":"export_portable","order":3,"path":"scripts/export_portable/export_portable.yy",}, {"name":"fft_functions","order":1,"path":"scripts/fft_functions/fft_functions.yy",}, @@ -1186,6 +1184,7 @@ {"name":"node_string_split","order":3,"path":"scripts/node_string_split/node_string_split.yy",}, {"name":"node_string_trim","order":4,"path":"scripts/node_string_trim/node_string_trim.yy",}, {"name":"node_string","order":2,"path":"scripts/node_string/node_string.yy",}, + {"name":"dynaSurf_circle_fill","order":1,"path":"scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy",}, {"name":"node_stripe","order":8,"path":"scripts/node_stripe/node_stripe.yy",}, {"name":"node_struct_get","order":1,"path":"scripts/node_struct_get/node_struct_get.yy",}, {"name":"node_struct_json_parse","order":2,"path":"scripts/node_struct_json_parse/node_struct_json_parse.yy",}, @@ -1432,10 +1431,10 @@ {"name":"string_scale","order":4,"path":"scripts/string_scale/string_scale.yy",}, {"name":"string_splice","order":3,"path":"scripts/string_splice/string_splice.yy",}, {"name":"struct_functions","order":4,"path":"scripts/struct_functions/struct_functions.yy",}, - {"name":"surface_draw_functions","order":8,"path":"scripts/surface_draw_functions/surface_draw_functions.yy",}, + {"name":"surface_draw_functions","order":9,"path":"scripts/surface_draw_functions/surface_draw_functions.yy",}, {"name":"surface_exr_encode","order":8,"path":"scripts/surface_exr_encode/surface_exr_encode.yy",}, - {"name":"surface_functions","order":6,"path":"scripts/surface_functions/surface_functions.yy",}, - {"name":"surface_get_palette","order":4,"path":"scripts/surface_get_palette/surface_get_palette.yy",}, + {"name":"surface_functions","order":7,"path":"scripts/surface_functions/surface_functions.yy",}, + {"name":"surface_get_palette","order":5,"path":"scripts/surface_get_palette/surface_get_palette.yy",}, {"name":"surfaceBox","order":9,"path":"scripts/surfaceBox/surfaceBox.yy",}, {"name":"surfaceDynaBox","order":17,"path":"scripts/surfaceDynaBox/surfaceDynaBox.yy",}, {"name":"svg_objects","order":1,"path":"scripts/svg_objects/svg_objects.yy",}, @@ -1629,6 +1628,7 @@ {"name":"sh_draw_tile_apply","order":2,"path":"shaders/sh_draw_tile_apply/sh_draw_tile_apply.yy",}, {"name":"sh_draw_tile_brush","order":3,"path":"shaders/sh_draw_tile_brush/sh_draw_tile_brush.yy",}, {"name":"sh_draw_tile_clear","order":4,"path":"shaders/sh_draw_tile_clear/sh_draw_tile_clear.yy",}, + {"name":"__init_dynaDraw","order":0,"path":"scripts/__init_dynaDraw/__init_dynaDraw.yy",}, {"name":"sh_draw_tile_map","order":5,"path":"shaders/sh_draw_tile_map/sh_draw_tile_map.yy",}, {"name":"sh_draw_tile","order":1,"path":"shaders/sh_draw_tile/sh_draw_tile.yy",}, {"name":"sh_edge_detect","order":18,"path":"shaders/sh_edge_detect/sh_edge_detect.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ab1746d81..6f18afee4 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -71,7 +71,7 @@ {"$GMFolder":"","%Name":"debug","folderPath":"folders/functions/debug.yy","name":"debug","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"delaunay","folderPath":"folders/functions/delaunay.yy","name":"delaunay","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"draw","folderPath":"folders/functions/draw.yy","name":"draw","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"dynaSurf","folderPath":"folders/functions/draw/dynaSurf.yy","name":"dynaSurf","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"dynaDraw","folderPath":"folders/functions/surface/dynaDraw.yy","name":"dynaDraw","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"ds","folderPath":"folders/functions/ds.yy","name":"ds","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"files","folderPath":"folders/functions/files.yy","name":"files","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"geometry","folderPath":"folders/functions/geometry.yy","name":"geometry","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -91,7 +91,7 @@ {"$GMFolder":"","%Name":"sprite","folderPath":"folders/functions/sprite.yy","name":"sprite","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"string","folderPath":"folders/functions/string.yy","name":"string","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"surface","folderPath":"folders/functions/surface.yy","name":"surface","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"dynamic_surface","folderPath":"folders/functions/surface/dynamic_surface.yy","name":"dynamic_surface","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"dynaSurf","folderPath":"folders/functions/surface/dynaSurf.yy","name":"dynaSurf","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"svg","folderPath":"folders/functions/svg.yy","name":"svg","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"test","folderPath":"folders/functions/test.yy","name":"test","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"tooltip","folderPath":"folders/functions/tooltip.yy","name":"tooltip","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -319,6 +319,7 @@ {"$GMFolder":"","%Name":"preview","folderPath":"folders/panels/preview.yy","name":"preview","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"overlay","folderPath":"folders/panels/preview/overlay.yy","name":"overlay","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"sprites","folderPath":"folders/panels/preview/sprites.yy","name":"sprites","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"runner","folderPath":"folders/panels/runner.yy","name":"runner","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"shader","folderPath":"folders/shader.yy","name":"shader","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"_helper","folderPath":"folders/shader/_helper.yy","name":"_helper","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"draw","folderPath":"folders/shader/draw.yy","name":"draw","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -347,7 +348,6 @@ {"$GMFolder":"","%Name":"rotator","folderPath":"folders/widgets/rotator.yy","name":"rotator","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"sliders","folderPath":"folders/widgets/sliders.yy","name":"sliders","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"text","folderPath":"folders/widgets/text.yy","name":"text","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"runner","folderPath":"folders/panels/runner.yy","name":"runner","resourceType":"GMFolder","resourceVersion":"2.0",}, ], "IncludedFiles":[ {"$GMIncludedFile":"","%Name":"Addons.zip","CopyToMask":-1,"filePath":"datafiles/data","name":"Addons.zip","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -1115,6 +1115,7 @@ {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Copy","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_CSV_Parse","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Find","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, + {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Flattern","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Get","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Insert","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, {"$GMIncludedFile":"","%Name":"info.json","CopyToMask":-1,"filePath":"datafiles/data/Nodes/Internal/Values/Array/Node_Array_Length","name":"info.json","resourceType":"GMIncludedFile","resourceVersion":"2.0",}, @@ -2559,6 +2560,7 @@ {"id":{"name":"panel_animation","path":"scripts/panel_animation/panel_animation.yy",},}, {"id":{"name":"panel_array_sequence","path":"scripts/panel_array_sequence/panel_array_sequence.yy",},}, {"id":{"name":"panel_collection_manager","path":"scripts/panel_collection_manager/panel_collection_manager.yy",},}, + {"id":{"name":"panel_collection_runner","path":"scripts/panel_collection_runner/panel_collection_runner.yy",},}, {"id":{"name":"panel_collection","path":"scripts/panel_collection/panel_collection.yy",},}, {"id":{"name":"panel_collections_settings","path":"scripts/panel_collections_settings/panel_collections_settings.yy",},}, {"id":{"name":"panel_color","path":"scripts/panel_color/panel_color.yy",},}, @@ -2836,7 +2838,6 @@ {"id":{"name":"sh_color_picker_hue","path":"shaders/sh_color_picker_hue/sh_color_picker_hue.yy",},}, {"id":{"name":"sh_color_picker_side_hue","path":"shaders/sh_color_picker_side_hue/sh_color_picker_side_hue.yy",},}, {"id":{"name":"sh_color_picker_side_value","path":"shaders/sh_color_picker_side_value/sh_color_picker_side_value.yy",},}, - {"id":{"name":"panel_collection_runner","path":"scripts/panel_collection_runner/panel_collection_runner.yy",},}, {"id":{"name":"sh_color_picker_value","path":"shaders/sh_color_picker_value/sh_color_picker_value.yy",},}, {"id":{"name":"sh_color_remove","path":"shaders/sh_color_remove/sh_color_remove.yy",},}, {"id":{"name":"sh_color_replace","path":"shaders/sh_color_replace/sh_color_replace.yy",},}, @@ -3047,6 +3048,7 @@ {"id":{"name":"sh_path_sdf","path":"shaders/sh_path_sdf/sh_path_sdf.yy",},}, {"id":{"name":"sh_pb_blob","path":"shaders/sh_pb_blob/sh_pb_blob.yy",},}, {"id":{"name":"sh_pb_brick","path":"shaders/sh_pb_brick/sh_pb_brick.yy",},}, + {"id":{"name":"__init_dynaDraw","path":"scripts/__init_dynaDraw/__init_dynaDraw.yy",},}, {"id":{"name":"sh_pb_draw_mask","path":"shaders/sh_pb_draw_mask/sh_pb_draw_mask.yy",},}, {"id":{"name":"sh_pb_hash","path":"shaders/sh_pb_hash/sh_pb_hash.yy",},}, {"id":{"name":"sh_pb_highlight","path":"shaders/sh_pb_highlight/sh_pb_highlight.yy",},}, diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index 43b4f92adef641da05ba1f89a9a5a56be7a5a706..e45bca32769ec341ae174d181ed817ca0be6a99c 100644 GIT binary patch delta 1321 zcmZ9~TTE0}6b4|$L1083s#WY9E{<9d5y4A^0lCO&MWGbyWiBYv+IqKA!5g&>>dzU^ ziKeMB?gta2gKx&f2h&O0L|;f@L_&N}Cuxg3X?!py?Tazi^k2-8pp$(0v)0~woqcAe z_mAt2Uh2X`Bw-R9NXBHOAQfqFVhYkR71J;sE@a>X%)m^1h*_A8Ow7SYa6>~DvXO&a z%!LQ@Fdqx>G4ha)g($!x6k;)oumr^@!BQ;4a;(57Scy`U!HaTKU==D+g=*AbHEM6^ zwZ5cMLp}5BZq@43r%G|ar!SGb;?oyN4*K-PlCOPwk>t4`H*fv3K1DV9b*FTKe!W=o ztUs}XC*A6iUw289v-2gZ0&Erq^yzj{Ah|c7FO+mWHry&Jj%n&nATg6qbE`}LAWgj( z-}&ziJ2}C`9^TZgwA5~=Y8u}eEbDfrH`Pya%$y(}j^~vN*-6{KpSZjZ6+W2DL_GLrY*FUT4)=!(pU5~ZKrSO zTiQW8X&3FLJ+znh(SG`l4p19?PY0=;I_MA`rXzHej!`H5K*#AvIzb`oqLXxrPDh>1 zXy{1t8p=NeujGXxtYk(9hwy8PG(vF{s#}lXvUh1JI}Vp>J!v_{eaYOI6i2!2sfweL z8RkLij)vmKzsa)DF>EZAyG& zj?TNe;{A5!2+y~8!>KBLBypadqb_D@s<_Y8q-g9jt0aHw zGs`9K^_i!mmMthx5uOH*R1=M F{{!AQ>GS{q delta 1321 zcmZ9~Sxi({7zc122Z0fFa7E{`I95SK1a}r$uN4ImwRIMhqPFe}cBrDCHU2;5YS2l3`RDu2Io~}qcdp;~ z$9|nUF&Z|EfgMR0i)5rA6%LF;8pdM+Cc=qyOu}SL!BkAcbYx%#X2JyxnaDymaxe>S z%*Gd(gSp5>9_Aq*^HG2WD8xb(p%{y>7)!7e%di|PP=ZpFp&Tnwfl5@N8a1fBpx1hA zH39X^tGiUIM;|Z6A&{WM_N<;82gk_^5J-1xj-Is#h-ZG@bCvM;nc9BS*KO> zC9S49T0?88o*HN!HPU)&q7Af>Hqlq~HEkvjdC5n9YNjo;m0IWjxyO(8Ak;( z%!AY&4aP&Sl4PO%QD~7QU$$FS{U1vH^!&p|p<-)!u_SA^%F)6}YX9Sq;`)oZMj9M@-5NFML!=3RY8jub|pQ6<@LE%K12a$`oeG&y#K2g}E5n7yDtMoAXX!z`4duESg{Z}|5Pv)nE}$KXk`L6W=HO701o^^zBZW}~&PMctidY?f5d z|2AtRdF5KkcXIVJ5p#~!)YP4bnQN_7OIG(Jb`F2ZNKaxh{XCC7?J@IY2Mhhf@o3<@ HdAs60P~_(@ diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 6c51fb6c8..ce5482169 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -248,8 +248,7 @@ event_inherited(); if(PANEL_INSPECTOR) PANEL_INSPECTOR.setInspecting(_new_node); if(PANEL_GRAPH) { - if(PREFERENCES.node_add_select) - PANEL_GRAPH.selectDragNode(_new_node, true); + if(PREFERENCES.node_add_select) PANEL_GRAPH.selectDragNode(_new_node, junction_called == noone); var _ins = instanceof(_new_node); if(struct_has(HOTKEYS, _ins)) FOCUS_STR = _ins; } diff --git a/objects/o_dialog_assetbox/Create_0.gml b/objects/o_dialog_assetbox/Create_0.gml index ce6cec34e..b5d260d3a 100644 --- a/objects/o_dialog_assetbox/Create_0.gml +++ b/objects/o_dialog_assetbox/Create_0.gml @@ -14,10 +14,10 @@ event_inherited(); anchor = ANCHOR.top | ANCHOR.left; dialog_resizable = true; - dialog_w_min = ui(200); - dialog_h_min = ui(120); - dialog_w_max = ui(1080); - dialog_h_max = ui(640); + dialog_w_min = ui(200); + dialog_h_min = ui(120); + dialog_w_max = ui(1080); + dialog_h_max = ui(640); #endregion #region context @@ -59,19 +59,21 @@ event_inherited(); folderPane = new scrollPane(folderW - ui(12), content_h - ui(32), function(_y, _m) { draw_clear_alpha(COLORS.panel_bg_clear, 1); - var hh = 8; + var hh = ui(8); + var ww = folderPane.surface_w - ui(16); + var hg; + + hg = DYNADRAW_FOLDER.draw(self, ui(8), _y + ui(8), _m, ww, sHOVER, sFOCUS, global.ASSETS); + hh += hg; + _y += hg; for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) { - var _w = folderPane.surface_w - ui(16); - var _hover = sHOVER; - - var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, _w, _hover, sFOCUS, global.ASSETS); + hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + ui(8), _m, ww, sHOVER, sFOCUS, global.ASSETS); hh += hg; _y += hg; } folderPane.hover_content = true; - return hh + 8; }); folderPane.scroll_color_bg = CDEF.main_mdblack; @@ -114,40 +116,53 @@ event_inherited(); draw_sprite_stretched(THEME.node_bg, 0, xx, yy, grid_size, grid_size); BLEND_NORMAL - var spr = content.getSpr(); + var spr = -1; - if(sprite_exists(spr)) { - var sw = sprite_get_width(spr); - var sh = sprite_get_height(spr); - var ss = img_size / max(sw, sh); - var sx = xx + (grid_size - sw * ss) / 2; - var sy = yy + (grid_size - sh * ss) / 2; - var sn = sprite_get_number(spr); + if(is(content, dynaSurf)) { + var _sw = grid_size - ui(16); + var _sh = grid_size - ui(16); - draw_sprite_ext(spr, frame, sx, sy, ss, ss, 0, c_white, 1); + var sx = xx + grid_size / 2; + var sy = yy + grid_size / 2; + content.draw(sx, sy, _sw, _sh); - var _txt = $"{sw}x{sh}"; - if(sn) _txt = $"[{sn}] " + _txt; + } else { + spr = content.getSpr(); - draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner); - var _tw = string_width(_txt) + ui(6); - var _th = 14; - var _nx = xx + grid_size - 1 - _tw; - var _ny = yy + grid_size - _th; - - draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th - 1, COLORS.panel_bg_clear_inner, 0.85); - draw_text_add(xx + grid_size - ui(3), yy + grid_size - ui(2), _txt); - - } else if(spr == -1) { - var _rr = lerp(.075, .2, abs(dsin(current_time / 2))); - draw_circle_ui(xx + grid_size / 2, yy + grid_size / 2, grid_size * .25, _rr, COLORS._main_icon, 1); + if(sprite_exists(spr)) { + var sw = sprite_get_width(spr); + var sh = sprite_get_height(spr); + var ss = img_size / max(sw, sh); + var sx = xx + (grid_size - sw * ss) / 2; + var sy = yy + (grid_size - sh * ss) / 2; + var sn = sprite_get_number(spr); + + draw_sprite_ext(spr, frame, sx, sy, ss, ss, 0, c_white, 1); + + var _txt = $"{sw}x{sh}"; + if(sn) _txt = $"[{sn}] " + _txt; + + draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner); + var _tw = string_width(_txt) + ui(6); + var _th = 14; + var _nx = xx + grid_size - 1 - _tw; + var _ny = yy + grid_size - _th; + + draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th - 1, COLORS.panel_bg_clear_inner, 0.85); + draw_text_add(xx + grid_size - ui(3), yy + grid_size - ui(2), _txt); + + } else if(spr == -1) { + var _rr = lerp(.075, .2, abs(dsin(current_time / 2))); + draw_circle_ui(xx + grid_size / 2, yy + grid_size / 2, grid_size * .25, _rr, COLORS._main_icon, 1); + } } - + if(sHOVER && contentPane.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + grid_size, yy + grid_size)) { contentPane.hover_content = true; TOOLTIP = [ spr, "sprite" ]; draw_sprite_stretched_ext(THEME.node_bg, 1, xx, yy, grid_size, grid_size, COLORS._main_accent, 1); + if(mouse_press(mb_left, sFOCUS)) { target.onModify(content.path); instance_destroy(); diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index a47a3710f..e56937288 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -380,8 +380,8 @@ function __part(_node) : __particleObject() constructor { ss = array_safe_get_fast(surf, clamp(_sca, 0, array_length(surf) - 1)); } - var surface = node.surface_cache[$ ss]; - var _useS = is_surface(surface); + var _surf = node.surface_cache[$ ss]; + var _useS = is_surface(_surf); if(arr_type == 3) { scx = 1; @@ -401,8 +401,8 @@ function __part(_node) : __particleObject() constructor { _yy = round(_yy); } - var s_w = (_useS? surface_get_width_safe(surface) : 1) * scx; - var s_h = (_useS? surface_get_height_safe(surface) : 1) * scy; + var s_w = (_useS? surface_get_width_safe(_surf) : 1) * scx; + var s_h = (_useS? surface_get_height_safe(_surf) : 1) * scy; var _pp = point_rotate(-s_w / 2, -s_h / 2, 0, 0, rot); _xx += _pp[0]; _yy += _pp[1]; @@ -428,18 +428,25 @@ function __part(_node) : __particleObject() constructor { switch(render_type) { case PARTICLE_RENDER_TYPE.surface : - if(_useS) draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw); + if(surface_exists(_surf)) + draw_surface_ext_safe(_surf, _xx, _yy, scx, scy, drawrot, cc, alp_draw); else { var ss = round(min(scx, scy)); if(round(ss) == 0) return; + _xx = drawx + _yy = drawy; + + if(exact) { + _xx = round(_xx); + _yy = round(_yy); + ss = round( ss); + } + var _s = shader_current(); shader_reset(); - - draw_set_color_alpha(cc, alp_draw); - dynaSurf_circle_fill(round(_xx), round(_yy), exact? round(ss) : ss); - draw_set_alpha(1); - + if(is(_surf, dynaSurf)) _surf.draw(_xx, _yy, ss, ss, 0, cc, alp_draw); + else DYNADRAW_SHAPES[0].draw(_xx, _yy, ss, ss, 0, cc, alp_draw); shader_set(_s); } break; diff --git a/scripts/__init_dynaDraw/__init_dynaDraw.gml b/scripts/__init_dynaDraw/__init_dynaDraw.gml new file mode 100644 index 000000000..7bab26281 --- /dev/null +++ b/scripts/__init_dynaDraw/__init_dynaDraw.gml @@ -0,0 +1,20 @@ +globalvar DYNADRAW_SHAPE_MAP, DYNADRAW_SHAPES, DYNADRAW_FOLDER; + +function __init_dynaDraw() { + DYNADRAW_SHAPE_MAP = {}; + DYNADRAW_SHAPES = [ + new dynaDraw_circle_fill(), + new dynaDraw_circle_outline(), + new dynaDraw_square_fill(), + new dynaDraw_square_outline(), + ]; + + DYNADRAW_FOLDER = new DirectoryObject("DynaDraw"); + + for( var i = 0, n = array_length(DYNADRAW_SHAPES); i < n; i++ ) { + var _sh = DYNADRAW_SHAPES[i]; + + ds_list_add(DYNADRAW_FOLDER.content, _sh); + DYNADRAW_SHAPE_MAP[$ _sh.path] = _sh; + } +} \ No newline at end of file diff --git a/scripts/__init_dynaDraw/__init_dynaDraw.yy b/scripts/__init_dynaDraw/__init_dynaDraw.yy new file mode 100644 index 000000000..add46fc8d --- /dev/null +++ b/scripts/__init_dynaDraw/__init_dynaDraw.yy @@ -0,0 +1,14 @@ +{ + "$GMScript":"v1", + "%Name":"__init_dynaDraw", + "isCompatibility":false, + "isDnD":false, + "name":"__init_dynaDraw", + "parent":{ + "name":"dynaDraw", + "path":"folders/functions/surface/dynaDraw.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", + "tags":[], +} \ No newline at end of file diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index cebfa82d9..aa21e4236 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -329,13 +329,18 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co for( var i = 0, n = array_length(surfs); i < n; i++ ) { var _s = surfs[i]; + if(is(_s, dynaSurf)) { + surface_cache[$ surfs[i]] = _s; + continue; + } + if(surface_exists(surface_cache[$ _s])) continue; - if(is_instanceof(_s, SurfaceAtlas)) + if(is(_s, SurfaceAtlas)) _s = _s.surface.get(); - if(!is_surface(_s)) + if(!is_surface(_s)) continue; surface_cache[$ surfs[i]] = surface_clone(_s); diff --git a/scripts/assets_data/assets_data.gml b/scripts/assets_data/assets_data.gml index 09ec99795..d84e50fe9 100644 --- a/scripts/assets_data/assets_data.gml +++ b/scripts/assets_data/assets_data.gml @@ -22,6 +22,8 @@ for( var i = 0, n = array_length(PREFERENCES.path_assets); i < n; i++ ) ds_list_add(global.ASSETS.subDir, __initAssetsFolder(PREFERENCES.path_assets[i])); } + + __init_dynaDraw(); } function __initAssetsFolder(_dir) { @@ -52,6 +54,7 @@ } function get_asset(key) { + if(struct_has(DYNADRAW_SHAPE_MAP, key)) return DYNADRAW_SHAPE_MAP[$ key]; if(!ds_map_exists(global.ASSET_MAP, key)) return noone; if(ds_map_exists(global.ASSET_CACHE, key)) { diff --git a/scripts/dynaSurf/dynaSurf.gml b/scripts/dynaSurf/dynaSurf.gml index 5f8dafa71..a4158672d 100644 --- a/scripts/dynaSurf/dynaSurf.gml +++ b/scripts/dynaSurf/dynaSurf.gml @@ -2,16 +2,16 @@ function dynaSurf() constructor { surfaces = []; static getAbsolutePos = function(_x, _y, _xs = 1, _ys = 1, _rot = 0) { - var _w = getWidth() * _xs; - var _h = getHeight() * _ys; - var _px = point_rotate(0, 0, _w / 2, _h / 2, _rot); + var _w = getWidth() * _xs; + var _h = getHeight() * _ys; + var _p = point_rotate(0, 0, _w / 2, _h / 2, _rot); - return [ _x - _px[0], _y - _px[1] ]; + return [ _x - _p[0], _y - _p[1] ]; } - static getWidth = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_width(surfaces[0]) : 1; } - static getHeight = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_height(surfaces[0]) : 1; } - static getFormat = function() { return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_format(surfaces[0]) : surface_rgba8unorm; } + static getWidth = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_width(surfaces[0]) : 1}; + static getHeight = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_height(surfaces[0]) : 1}; + static getFormat = function() /*=>*/ {return is_surface(array_safe_get_fast(surfaces, 0))? surface_get_format(surfaces[0]) : surface_rgba8unorm}; static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) {} static drawStretch = function(_x = 0, _y = 0, _w = 1, _h = 1, _ang = 0, _col = c_white, _alp = 1) { @@ -24,17 +24,17 @@ function dynaSurf() constructor { static drawTile = function(_x = 0, _y = 0, _xs = 1, _ys = 1, _col = c_white, _alp = 1) {} static drawPart = function(_l, _t, _w, _h, _x, _y, _xs = 1, _ys = 1, _rot = 0, _col = c_white, _alp = 1) {} - static onFree = function() {} - static free = function() { + static onFree = function() /*=>*/ {} + static free = function() /*=>*/ { for( var i = 0, n = array_length(surfaces); i < n; i++ ) surface_free_safe(surfaces[i]); onFree(); } - static getSurfacePreview = function() { return array_safe_get_fast(surfaces, 0); } + static getSurfacePreview = function() /*=>*/ {return array_safe_get_fast(surfaces, 0)}; - static clone = function() { return noone; } - static destroy = function() {} + static clone = function() /*=>*/ {return noone}; + static destroy = function() /*=>*/ {} } function compute_dynaSurf() : dynaSurf() constructor { @@ -73,4 +73,8 @@ function compute_dynaSurf() : dynaSurf() constructor { return _surf; } +} + +function dynaDraw() : dynaSurf() constructor { + path = ""; } \ No newline at end of file diff --git a/scripts/dynaSurf/dynaSurf.yy b/scripts/dynaSurf/dynaSurf.yy index 9b7bce6fd..45aa4d22b 100644 --- a/scripts/dynaSurf/dynaSurf.yy +++ b/scripts/dynaSurf/dynaSurf.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf", "parent":{ - "name":"dynamic_surface", - "path":"folders/functions/surface/dynamic_surface.yy", + "name":"dynaSurf", + "path":"folders/functions/surface/dynaSurf.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_3d/dynaSurf_3d.yy b/scripts/dynaSurf_3d/dynaSurf_3d.yy index af3059e81..a82b08da9 100644 --- a/scripts/dynaSurf_3d/dynaSurf_3d.yy +++ b/scripts/dynaSurf_3d/dynaSurf_3d.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_3d", "parent":{ - "name":"dynamic_surface", - "path":"folders/functions/surface/dynamic_surface.yy", + "name":"dynaSurf", + "path":"folders/functions/surface/dynaSurf.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.gml b/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.gml index cb99d4054..da6f5e847 100644 --- a/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.gml +++ b/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.gml @@ -1,27 +1,47 @@ -function dynaSurf_circle_fill(_x, _y, ss) { - switch(round(ss)) { - case 0 : - case 1 : - draw_point( _x, _y ); - break; - - case 2 : - draw_point( _x + 0, _y + 0 ); - draw_point( _x + 1, _y + 0 ); - draw_point( _x + 0, _y + 1 ); - draw_point( _x + 1, _y + 1 ); - break; - - case 3 : - draw_point( _x, _y ); - draw_point( _x - 1, _y ); - draw_point( _x + 1, _y ); - draw_point( _x, _y + 1 ); - draw_point( _x, _y - 1 ); - break; - - default : - draw_circle(_x, _y, ss - 2, false); - break; +function dynaDraw_circle_fill() : dynaDraw() constructor { + path = "dynaDraw_circle_fill"; + + static getWidth = function() /*=>*/ {return 1}; + static getHeight = function() /*=>*/ {return 1}; + static getFormat = function() /*=>*/ {return surface_rgba8unorm}; + + static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) { + draw_set_color(_col); + draw_set_alpha(_alp); + draw_set_circle_precision(32); + + if(_sx != _sy) { + draw_ellipse(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, false); + draw_set_alpha(1); + return; + } + + switch(round(_sx)) { + case 0 : + case 1 : + draw_point( _x, _y ); + break; + + case 2 : + draw_point( _x + 0, _y + 0 ); + draw_point( _x + 1, _y + 0 ); + draw_point( _x + 0, _y + 1 ); + draw_point( _x + 1, _y + 1 ); + break; + + case 3 : + draw_point( _x, _y ); + draw_point( _x - 1, _y ); + draw_point( _x + 1, _y ); + draw_point( _x, _y + 1 ); + draw_point( _x, _y - 1 ); + break; + + default : + draw_circle(_x, _y, _sx / 2 - 1, false); + break; + } + + draw_set_alpha(1); } } \ No newline at end of file diff --git a/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy b/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy index 72d61b524..f42c303fd 100644 --- a/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy +++ b/scripts/dynaSurf_circle_fill/dynaSurf_circle_fill.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_circle_fill", "parent":{ - "name":"dynaSurf", - "path":"folders/functions/draw/dynaSurf.yy", + "name":"dynaDraw", + "path":"folders/functions/surface/dynaDraw.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.gml b/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.gml index 46223a225..b52c59bee 100644 --- a/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.gml +++ b/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.gml @@ -1,23 +1,46 @@ -function dynaSurf_circle_outline(_x, _y, ss) { - switch(round(ss)) { - case 0 : - case 1 : - draw_point(_x, _y); - break; - case 2 : - draw_point(_x + 0, _y + 0); - draw_point(_x + 1, _y + 0); - draw_point(_x + 0, _y + 1); - draw_point(_x + 1, _y + 1); - break; - case 3 : - draw_point(_x - 1, _y); - draw_point(_x + 1, _y); - draw_point(_x, _y + 1); - draw_point(_x, _y - 1); - break; - default : - draw_circle(_x, _y, ss - 2, true); - break; +function dynaDraw_circle_outline() : dynaDraw() constructor { + path = "dynaDraw_circle_outline"; + + static getWidth = function() /*=>*/ {return 1}; + static getHeight = function() /*=>*/ {return 1}; + static getFormat = function() /*=>*/ {return surface_rgba8unorm}; + + static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) { + draw_set_color(_col); + draw_set_alpha(_alp); + draw_set_circle_precision(32); + + if(_sx != _sy) { + draw_ellipse(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, true); + draw_set_alpha(1); + return; + } + + switch(round(_sx)) { + case 0 : + case 1 : + draw_point( _x, _y ); + break; + + case 2 : + draw_point( _x + 0, _y + 0 ); + draw_point( _x + 1, _y + 0 ); + draw_point( _x + 0, _y + 1 ); + draw_point( _x + 1, _y + 1 ); + break; + + case 3 : + draw_point( _x - 1, _y ); + draw_point( _x + 1, _y ); + draw_point( _x, _y + 1 ); + draw_point( _x, _y - 1 ); + break; + + default : + draw_circle(_x, _y, _sx / 2 - 1, true); + break; + } + + draw_set_alpha(1); } -} \ No newline at end of file +} diff --git a/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy b/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy index 0ba33c30b..c5f473449 100644 --- a/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy +++ b/scripts/dynaSurf_circle_outline/dynaSurf_circle_outline.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_circle_outline", "parent":{ - "name":"dynaSurf", - "path":"folders/functions/draw/dynaSurf.yy", + "name":"dynaDraw", + "path":"folders/functions/surface/dynaDraw.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_iso/dynaSurf_iso.yy b/scripts/dynaSurf_iso/dynaSurf_iso.yy index d3d4493e6..f384d4ff2 100644 --- a/scripts/dynaSurf_iso/dynaSurf_iso.yy +++ b/scripts/dynaSurf_iso/dynaSurf_iso.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_iso", "parent":{ - "name":"dynamic_surface", - "path":"folders/functions/surface/dynamic_surface.yy", + "name":"dynaSurf", + "path":"folders/functions/surface/dynaSurf.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_square_fill/dynaSurf_square_fill.gml b/scripts/dynaSurf_square_fill/dynaSurf_square_fill.gml index 646753f52..bd51fc7f1 100644 --- a/scripts/dynaSurf_square_fill/dynaSurf_square_fill.gml +++ b/scripts/dynaSurf_square_fill/dynaSurf_square_fill.gml @@ -1,17 +1,21 @@ -function dynaSurf_square_fill(_x, _y, ss) { - switch(round(ss)) { - case 0 : - case 1 : +function dynaDraw_square_fill() : dynaDraw() constructor { + path = "dynaDraw_square_fill"; + + static getWidth = function() /*=>*/ {return 1}; + static getHeight = function() /*=>*/ {return 1}; + static getFormat = function() /*=>*/ {return surface_rgba8unorm}; + + static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) { + draw_set_color(_col); + draw_set_alpha(_alp); + + if(round(_sx) <= 1 && round(_sy) <= 0) { draw_point(_x, _y); - break; - case 2 : - draw_point(_x + 0, _y + 0); - draw_point(_x + 1, _y + 0); - draw_point(_x + 0, _y + 1); - draw_point(_x + 1, _y + 1); - break; - default : - draw_rectangle(_x - ss / 2, _y - ss / 2, _x + ss / 2, _y + ss / 2, false); - break; + draw_set_alpha(1); + return; + } + + draw_rectangle(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, false); + draw_set_alpha(1); } } \ No newline at end of file diff --git a/scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy b/scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy index 6b7c9be23..6e84861e3 100644 --- a/scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy +++ b/scripts/dynaSurf_square_fill/dynaSurf_square_fill.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_square_fill", "parent":{ - "name":"dynaSurf", - "path":"folders/functions/draw/dynaSurf.yy", + "name":"dynaDraw", + "path":"folders/functions/surface/dynaDraw.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/dynaSurf_square_outline/dynaSurf_square_outline.gml b/scripts/dynaSurf_square_outline/dynaSurf_square_outline.gml index 4734c4876..54ec7fadc 100644 --- a/scripts/dynaSurf_square_outline/dynaSurf_square_outline.gml +++ b/scripts/dynaSurf_square_outline/dynaSurf_square_outline.gml @@ -1,17 +1,21 @@ -function dynaSurf_square_outline(_x, _y, ss) { - switch(round(ss)) { - case 0 : - case 1 : +function dynaDraw_square_outline() : dynaDraw() constructor { + path = "dynaDraw_square_outline"; + + static getWidth = function() /*=>*/ {return 1}; + static getHeight = function() /*=>*/ {return 1}; + static getFormat = function() /*=>*/ {return surface_rgba8unorm}; + + static draw = function(_x = 0, _y = 0, _sx = 1, _sy = 1, _ang = 0, _col = c_white, _alp = 1) { + draw_set_color(_col); + draw_set_alpha(_alp); + + if(round(_sx) <= 1 && round(_sy) <= 0) { draw_point(_x, _y); - break; - case 2 : - draw_point(_x + 0, _y + 0); - draw_point(_x + 1, _y + 0); - draw_point(_x + 0, _y + 1); - draw_point(_x + 1, _y + 1); - break; - default : - draw_rectangle(_x - ss / 2, _y - ss / 2, _x + ss / 2, _y + ss / 2, true); - break; + draw_set_alpha(1); + return; + } + + draw_rectangle(_x - _sx / 2, _y - _sy / 2, _x + _sx / 2, _y + _sy / 2, true); + draw_set_alpha(1); } } \ No newline at end of file diff --git a/scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy b/scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy index 5383cafb1..d7d007271 100644 --- a/scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy +++ b/scripts/dynaSurf_square_outline/dynaSurf_square_outline.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"dynaSurf_square_outline", "parent":{ - "name":"dynaSurf", - "path":"folders/functions/draw/dynaSurf.yy", + "name":"dynaDraw", + "path":"folders/functions/surface/dynaDraw.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 68b6f6e4c..6f0e3c264 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -43,8 +43,8 @@ LATEST_VERSION = 1_18_00_0; VERSION = 1_18_08_0; SAVE_VERSION = 1_18_09_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.9.002"; - BUILD_NUMBER = 118080.002; + VERSION_STRING = MAC? "1.18.003m" : "1.18.9.003"; + BUILD_NUMBER = 118080.003; PREF_VERSION = 1_17_1; var _vsp = string_split(VERSION_STRING, "."); diff --git a/scripts/node_mk_brownian/node_mk_brownian.gml b/scripts/node_mk_brownian/node_mk_brownian.gml index 0cdab35d4..2843aa28e 100644 --- a/scripts/node_mk_brownian/node_mk_brownian.gml +++ b/scripts/node_mk_brownian/node_mk_brownian.gml @@ -122,12 +122,8 @@ function Node_MK_Brownian(_x, _y, _group = noone) : Node(_x, _y, _group) constru var _ss = random_range(_size[0], _size[1]); if(_sprt == noone) { - draw_set_color(_cc); - draw_set_alpha(_aa); + global.DynaDraw_circle_fill.draw(_pos[0], _pos[1], round(_ss), round(_ss), 0, _cc, _aa); - dynaSurf_circle_fill(_pos[0], _pos[1], round(_ss)); - - draw_set_alpha(1); } else { var _p = _sprt; if(is_array(_p)) _p = array_safe_get_fast(_p, irandom(array_length(_p) - 1)); diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 065b3d0e6..162d67961 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -422,8 +422,9 @@ function Panel_Collection() : PanelContent() constructor { if(PREFERENCES.collection_label) { draw_set_text(f_p3, fa_center, fa_top, COLORS._main_text_inner); - var _txtH = draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width, 1, true); + var _txtH = draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width + ui(16), 1, true); name_height = max(name_height, _txtH + 8); + } else name_height = 0; } diff --git a/scripts/surfaceBox/surfaceBox.gml b/scripts/surfaceBox/surfaceBox.gml index 552c657fe..427f2b4d3 100644 --- a/scripts/surfaceBox/surfaceBox.gml +++ b/scripts/surfaceBox/surfaceBox.gml @@ -1,6 +1,6 @@ -function surfaceBox(_onModify, def_path = "") : widget() constructor { - onModify = _onModify; - self.def_path = def_path; +function surfaceBox(_onModify, _def_path = "") : widget() constructor { + onModify = _onModify; + def_path = _def_path; open = false; open_rx = 0; @@ -9,20 +9,19 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor { align = fa_center; display_data = {}; - cb_atlas_crop = new checkBox(function() { - display_data.atlas_crop = !display_data.atlas_crop; - }); + cb_atlas_crop = new checkBox(function() /*=>*/ { display_data.atlas_crop = !display_data.atlas_crop; }); static trigger = function() { open = true; + with(dialogCall(o_dialog_assetbox, x + open_rx, y + open_ry)) { target = other; gotoDir(other.def_path); } } - static setInteract = function(interactable) { - self.interactable = interactable; + static setInteract = function(_interactable) { + interactable = _interactable; cb_atlas_crop.interactable = true; } @@ -50,81 +49,81 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor { else if(is_instanceof(_surf_single, SurfaceAtlas)) _type = VALUE_TYPE.atlas; else if(is_instanceof(_surf_single, __d3dMaterial)) _type = VALUE_TYPE.d3Material; - if(!open) { - draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); - - if(_type == VALUE_TYPE.surface && hover && hoverRect) { - draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h); - if(mouse_press(mb_left, active)) - trigger(); - - if(mouse_click(mb_left, active)) - draw_sprite_stretched_ext(THEME.textbox, 2, _x, _y, _w, _h, COLORS._main_accent, 1); - } else { - draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); - if(mouse_press(mb_left)) deactivate(); + draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); + + if(hover && hoverRect) { + draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h); + if(!open) { + if(mouse_press(mb_left, active)) trigger(); + if(mouse_click(mb_left, active)) draw_sprite_stretched_ext(THEME.textbox, 2, _x, _y, _w, _h, COLORS._main_accent, 1); } - var pad = ui(12); - var sw = min(_w - pad, _h - pad); - var sh = sw; - - var sx0 = _x + _w / 2 - sw / 2; - var sx1 = sx0 + sw; - var sy0 = _y + _h / 2 - sh / 2; - var sy1 = sy0 + sh; - - var _arrLen = 0; - var _arrInd = 0; - - if(is_array(_surface)) { - if(array_length(_surface)) { - _arrLen = array_length(_surface); - _arrInd = safe_mod(round(current_time / 250), _arrLen); - _surface = _surface[_arrInd]; - } else - _surface = noone; - } - - if(!is_surface(_surface)) _surface = noone; - - if(is_instanceof(_surface, __d3dMaterial)) _surface = _surface.surface; - else if(is_instanceof(_surface, dynaSurf)) _surface = array_safe_get_fast(_surface.surfaces, 0, noone); - else if(is_instanceof(_surface, Atlas)) _surface = _surface.getSurface(); - - ui_rect(sx0, sy0, sx1, sy1, COLORS.widget_surface_frame); - - if(surface_exists(_surface)) { - var sfw = surface_get_width(_surface); - var sfh = surface_get_height(_surface); - var ss = min(sw / sfw, sh / sfh); - var _sx = sx0 + sw / 2 - ss * sfw / 2; - var _sy = sy0 + sh / 2 - ss * sfh / 2; - - draw_surface_ext_safe(_surface, _sx, _sy, ss, ss, 0, c_white, 1); - - if(_arrLen) { - var bxw = sx1 - sx0; - - draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw, 4, COLORS.panel_bg_clear_inner, 1); - draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw * (_arrInd + 1) / _arrLen, 4, COLORS._main_accent, 1); - } - - var _txt = $"[{max(1, _arrLen)}] {sfw}x{sfh}"; - - draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner); - var _tw = string_width(_txt) + ui(6); - var _th = 14; - var _nx = sx1 - _tw; - var _ny = sy1 - _th; - - draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th, COLORS.panel_bg_clear_inner, 0.85); - draw_text_add(sx1 - ui(3), sy1 + ui(1), _txt); - } - - if(_type == VALUE_TYPE.surface) - draw_sprite_ui_uniform(THEME.scroll_box_arrow, 0, _x + _w - min(_h / 2, ui(20)), _y + _h / 2, min(1, _h / 64), COLORS._main_icon, 0.5 + 0.5 * interactable); + } else { + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); + if(!open && mouse_press(mb_left)) deactivate(); } + + var pad = ui(12); + var sw = min(_w - pad, _h - pad); + var sh = sw; + + var sx0 = _x + _w / 2 - sw / 2; + var sx1 = sx0 + sw; + var sy0 = _y + _h / 2 - sh / 2; + var sy1 = sy0 + sh; + + var _arrLen = 0; + var _arrInd = 0; + + if(is_array(_surface)) { + if(array_length(_surface)) { + _arrLen = array_length(_surface); + _arrInd = safe_mod(round(current_time / 250), _arrLen); + _surface = _surface[_arrInd]; + } else + _surface = noone; + } + + if(!is_surface(_surface)) _surface = noone; + + if(is(_surface, __d3dMaterial)) _surface = _surface.surface; + else if(is(_surface, dynaDraw)) _surface = _surface; + else if(is(_surface, dynaSurf)) _surface = array_safe_get_fast(_surface.surfaces, 0, noone); + else if(is(_surface, Atlas)) _surface = _surface.getSurface(); + + ui_rect(sx0, sy0, sx1, sy1, COLORS.widget_surface_frame); + + if(is(_surface, dynaDraw)) { + _surface.draw(sx0 + sw / 2, sy0 + sh / 2, sw - 2, sh - 2); + + } else if(surface_exists(_surface)) { + var sfw = surface_get_width(_surface); + var sfh = surface_get_height(_surface); + var ss = min(sw / sfw, sh / sfh); + var _sx = sx0 + sw / 2 - ss * sfw / 2; + var _sy = sy0 + sh / 2 - ss * sfh / 2; + + draw_surface_ext_safe(_surface, _sx, _sy, ss, ss, 0, c_white, 1); + + if(_arrLen) { + var bxw = sx1 - sx0; + draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw, 4, COLORS.panel_bg_clear_inner, 1); + draw_sprite_stretched_ext(THEME.palette_mask, 1, sx0, sy1 - 3, bxw * (_arrInd + 1) / _arrLen, 4, COLORS._main_accent, 1); + } + + var _txt = $"[{max(1, _arrLen)}] {sfw}x{sfh}"; + + draw_set_text(_f_p4, fa_right, fa_bottom, COLORS._main_text_inner); + var _tw = string_width(_txt) + ui(6); + var _th = 14; + var _nx = sx1 - _tw; + var _ny = sy1 - _th; + + draw_sprite_stretched_ext(THEME.ui_panel, 0, _nx, _ny, _tw, _th, COLORS.panel_bg_clear_inner, 0.85); + draw_text_add(sx1 - ui(3), sy1 + ui(1), _txt); + } + + draw_sprite_ui_uniform(THEME.scroll_box_arrow, 0, _x + _w - min(_h / 2, ui(20)), _y + _h / 2, min(1, _h / 64), COLORS._main_icon, 0.5 + 0.5 * interactable); if(WIDGET_CURRENT == self) draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1); @@ -140,9 +139,5 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor { return h; } - static clone = function() { - var cln = new surfaceBox(onModify, def_path); - - return cln; - } + static clone = function() /*=>*/ {return new surfaceBox(onModify, def_path)}; } \ No newline at end of file diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index afe0c071c..c22a4b117 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -601,7 +601,7 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw function surface_free_safe(surface) { INLINE - if(!is_surface(surface)) return; + if(!surface_exists(surface)) return; __surface_free(surface); }