From 2bec13884497238a74a2f1dcd69443941c89f292 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Thu, 23 Nov 2023 19:39:35 +0700 Subject: [PATCH] 1.16rc3 --- PixelComposer.resource_order | 4 +- PixelComposer.yyp | 3 + .../node_active_canvas/node_active_canvas.gml | 10 +- scripts/node_camera/node_camera.gml | 2 +- .../node_crop_content/node_crop_content.gml | 69 +- scripts/node_data/node_data.gml | 5 +- scripts/node_image/node_image.gml | 13 +- .../node_image_animated.gml | 2 +- scripts/node_image_gif/node_image_gif.gml | 5 +- .../node_image_sequence.gml | 1 + scripts/node_particle/node_particle.gml | 2 +- scripts/node_registry/node_registry.gml | 14 +- scripts/node_scatter/node_scatter.gml | 2 +- .../node_scatter_points.gml | 2 +- .../node_simple_shape/node_simple_shape.gml | 2 +- scripts/node_value/node_value.gml | 1 + scripts/node_wrap/node_wrap.gml | 2 +- scripts/node_wrap_area/node_wrap_area.gml | 4 +- scripts/panel_menu/panel_menu.gml | 3 + .../preview_overlay_area.gml | 117 ++-- .../surface_functions/surface_functions.gml | 7 + scripts/testing_script/testing_script.gml | 31 +- scripts/theme_definition/theme_definition.gml | 627 ++++++++++-------- shaders/sh_find_boundary/sh_find_boundary.yy | 4 +- .../sh_find_boundary_stretch_x.fsh | 23 + .../sh_find_boundary_stretch_x.vsh | 19 + .../sh_find_boundary_stretch_x.yy | 10 + .../sh_find_boundary_stretch_y.fsh | 23 + .../sh_find_boundary_stretch_y.vsh | 19 + .../sh_find_boundary_stretch_y.yy | 10 + 30 files changed, 595 insertions(+), 441 deletions(-) create mode 100644 shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh create mode 100644 shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.vsh create mode 100644 shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy create mode 100644 shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh create mode 100644 shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.vsh create mode 100644 shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index c55d58551..fd776c806 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -241,6 +241,7 @@ {"name":"button","order":34,"path":"folders/widgets/button.yy",}, {"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",}, {"name":"text","order":36,"path":"folders/widgets/text.yy",}, + {"name":"find boundary","order":9,"path":"folders/shader/misc/find boundary.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -494,6 +495,7 @@ {"name":"s_node_gabor","order":32,"path":"sprites/s_node_gabor/s_node_gabor.yy",}, {"name":"s_node_dithering","order":21,"path":"sprites/s_node_dithering/s_node_dithering.yy",}, {"name":"node_3d_mesh_extrude","order":8,"path":"scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.yy",}, + {"name":"sh_find_boundary_stretch_x","order":1,"path":"shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy",}, {"name":"s_workshop_badge","order":1,"path":"sprites/s_workshop_badge/s_workshop_badge.yy",}, {"name":"node_pb_fx_brick","order":12,"path":"scripts/node_pb_fx_brick/node_pb_fx_brick.yy",}, {"name":"node_compare","order":16,"path":"scripts/node_compare/node_compare.yy",}, @@ -839,6 +841,7 @@ {"name":"pcx_parse","order":3,"path":"scripts/pcx_parse/pcx_parse.yy",}, {"name":"node_9slice","order":5,"path":"scripts/node_9slice/node_9slice.yy",}, {"name":"fd_rectangle_add_velocity_surface","order":24,"path":"scripts/fd_rectangle_add_velocity_surface/fd_rectangle_add_velocity_surface.yy",}, + {"name":"sh_find_boundary_stretch_y","order":2,"path":"shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy",}, {"name":"BBMOD_Vec2","order":4,"path":"scripts/BBMOD_Vec2/BBMOD_Vec2.yy",}, {"name":"sh_grid_hex","order":1,"path":"shaders/sh_grid_hex/sh_grid_hex.yy",}, {"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",}, @@ -1134,7 +1137,6 @@ {"name":"s_node_fluidSim_vortex","order":8,"path":"sprites/s_node_fluidSim_vortex/s_node_fluidSim_vortex.yy",}, {"name":"string_hexadecimal","order":1,"path":"scripts/string_hexadecimal/string_hexadecimal.yy",}, {"name":"s_node_camera","order":3,"path":"sprites/s_node_camera/s_node_camera.yy",}, - {"name":"sh_find_boundary","order":2,"path":"shaders/sh_find_boundary/sh_find_boundary.yy",}, {"name":"Obj_FirebaseFirestore_Document_Set","order":6,"path":"objects/Obj_FirebaseFirestore_Document_Set/Obj_FirebaseFirestore_Document_Set.yy",}, {"name":"_node_strand_affector","order":10,"path":"scripts/_node_strand_affector/_node_strand_affector.yy",}, {"name":"Steamworks","order":2,"path":"extensions/Steamworks/Steamworks.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 71ced256b..92aa3eb08 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -276,6 +276,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"find boundary","folderPath":"folders/shader/misc/find boundary.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, @@ -1088,6 +1089,7 @@ {"id":{"name":"s_node_gabor","path":"sprites/s_node_gabor/s_node_gabor.yy",},}, {"id":{"name":"s_node_dithering","path":"sprites/s_node_dithering/s_node_dithering.yy",},}, {"id":{"name":"node_3d_mesh_extrude","path":"scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.yy",},}, + {"id":{"name":"sh_find_boundary_stretch_x","path":"shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy",},}, {"id":{"name":"s_node_boolean","path":"sprites/s_node_boolean/s_node_boolean.yy",},}, {"id":{"name":"s_workshop_badge","path":"sprites/s_workshop_badge/s_workshop_badge.yy",},}, {"id":{"name":"node_pb_fx_brick","path":"scripts/node_pb_fx_brick/node_pb_fx_brick.yy",},}, @@ -1487,6 +1489,7 @@ {"id":{"name":"pcx_parse","path":"scripts/pcx_parse/pcx_parse.yy",},}, {"id":{"name":"node_9slice","path":"scripts/node_9slice/node_9slice.yy",},}, {"id":{"name":"fd_rectangle_add_velocity_surface","path":"scripts/fd_rectangle_add_velocity_surface/fd_rectangle_add_velocity_surface.yy",},}, + {"id":{"name":"sh_find_boundary_stretch_y","path":"shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy",},}, {"id":{"name":"sprite_add_functions","path":"scripts/sprite_add_functions/sprite_add_functions.yy",},}, {"id":{"name":"BBMOD_Vec2","path":"scripts/BBMOD_Vec2/BBMOD_Vec2.yy",},}, {"id":{"name":"sh_grid_hex","path":"shaders/sh_grid_hex/sh_grid_hex.yy",},}, diff --git a/scripts/node_active_canvas/node_active_canvas.gml b/scripts/node_active_canvas/node_active_canvas.gml index eae6d6f95..10f9c6fd5 100644 --- a/scripts/node_active_canvas/node_active_canvas.gml +++ b/scripts/node_active_canvas/node_active_canvas.gml @@ -32,7 +32,7 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const [ "Brush properties", false ], 1, 5, 6, 8, ]; - brush_prev = []; + brush_prev = noone; brush_next_dist = 0; static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { @@ -68,19 +68,21 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const _surf = surface_verify(_surf, _dim[0], _dim[1]); var _bdense = _bdst[0] == _bdst[1] && _bdst[0] == 1; + outputs[| 0].setValue(_surf); + surface_set_target(_surf); if(CURRENT_FRAME == 0) DRAW_CLEAR if(_bact) { if(!is_surface(_bsurf)) { - if(CURRENT_FRAME == 0) + if(CURRENT_FRAME == 0 || brush_prev == noone) draw_point_color(_bpos[0] - 1, _bpos[1] - 1, _bcol); else draw_line_color(brush_prev[2][0] - 1, brush_prev[2][1] - 1, _bpos[0] - 1, _bpos[1] - 1, brush_prev[5], _bcol); } else { BLEND_ALPHA - if(CURRENT_FRAME == 0) { + if(CURRENT_FRAME == 0 || brush_prev == noone) { brush_draw_surface(_bsurf, _bpos[0], _bpos[1], _bsca[0], _bsca[1], _brot, _bcol, _balp); } else { var _x0 = brush_prev[2][0]; @@ -120,7 +122,5 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const for( var i = 0, n = array_length(inputs_data); i < n; i++ ) brush_prev[i] = variable_clone(inputs_data[i], 1); - - outputs[| 0].setValue(_surf); } #endregion } \ No newline at end of file diff --git a/scripts/node_camera/node_camera.gml b/scripts/node_camera/node_camera.gml index ca861768e..c95de730a 100644 --- a/scripts/node_camera/node_camera.gml +++ b/scripts/node_camera/node_camera.gml @@ -4,7 +4,7 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); - onSurfaceSize = function() { return getInputData(0, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); }; inputs[| 1] = nodeValue("Focus area", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 16, 16, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); diff --git a/scripts/node_crop_content/node_crop_content.gml b/scripts/node_crop_content/node_crop_content.gml index 42e63990d..7d0c4af47 100644 --- a/scripts/node_crop_content/node_crop_content.gml +++ b/scripts/node_crop_content/node_crop_content.gml @@ -25,7 +25,7 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr drag_my = 0; drag_sv = 0; - temp_surface = [ surface_create(1, 1, surface_r32float) ]; + temp_surface = [ surface_create(1, 1, surface_r32float), surface_create(1, 1, surface_r32float) ]; static update = function() { var _inSurf = getInputData(0); @@ -44,6 +44,11 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr } var _arr = is_array(_inSurf); + _array &= _arr; + + if(!is_array(_inSurf) && !is_surface(_inSurf)) return; + if( is_array(_inSurf) && array_empty(_inSurf)) return; + if(!_arr) _inSurf = [ _inSurf ]; var _amo = array_length(_inSurf); @@ -57,36 +62,25 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _surf = _inSurf[j]; var _dim = [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; - var _minx = 0, _miny = 0, _maxx = _dim[0], _maxy = _dim[1]; - temp_surface[0] = surface_verify(temp_surface[0], 1, 1, surface_r32float); + var _minx = 0, _miny = 0, _maxx = _dim[0] - 1, _maxy = _dim[1] - 1; - for( var i = 0; i < 4; i++ ) { - surface_set_target(temp_surface[0]); - shader_set(sh_find_boundary); - shader_set_f("dimension", _dim); - shader_set_surface("texture", _surf); - - shader_set_i("mode", i); - shader_set_f("bbox", [ _minx, _miny, _maxx, _maxy ]); - - DRAW_CLEAR - BLEND_OVERRIDE - draw_sprite(s_fx_pixel, 0, 0, 0); - BLEND_NORMAL - - shader_reset(); - surface_reset_target(); - - var px = surface_getpixel(temp_surface[0], 0, 0); - px = px[0]; - - switch(i) { - case 0 : _minx = px; break; - case 1 : _miny = px; break; - case 2 : _maxx = px; break; - case 3 : _maxy = px; break; - } - } + temp_surface[0] = surface_verify(temp_surface[0], _dim[0], _dim[1], surface_r32float); + temp_surface[1] = surface_verify(temp_surface[1], _dim[0], _dim[1], surface_r32float); + + surface_set_shader(temp_surface[0], sh_find_boundary_stretch_x); + shader_set_f("dimension", _dim); + draw_surface_safe(_surf); + surface_reset_shader(); + + surface_set_shader(temp_surface[1], sh_find_boundary_stretch_y); + shader_set_f("dimension", _dim); + draw_surface_safe(_surf); + surface_reset_shader(); + + for( ; _minx < _dim[0]; _minx++ ) if(surface_get_pixel(temp_surface[0], _minx, 0) > 0) break; + for( ; _maxx >= 0; _maxx-- ) if(surface_get_pixel(temp_surface[0], _maxx, 0) > 0) break; + for( ; _miny < _dim[1]; _miny++ ) if(surface_get_pixel(temp_surface[1], 0, _miny) > 0) break; + for( ; _maxy >= 0; _maxy-- ) if(surface_get_pixel(temp_surface[1], 0, _maxy) > 0) break; if(_array) { minx[j] = _minx; @@ -115,12 +109,10 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr res[i] = surface_create_valid(resDim[DIMENSION.width], resDim[DIMENSION.height], cDep); - surface_set_target(res[i]); - DRAW_CLEAR - BLEND_OVERRIDE + surface_set_shader(res[i], noone); draw_surface_safe(_surf, -minx + _padd[PADDING.left], -miny + _padd[PADDING.top]); - BLEND_NORMAL - surface_reset_target(); + surface_reset_shader(); + } else if(_array == 1) { var resDim = [maxx[i] - minx[i] + 1, maxy[i] - miny[i] + 1]; resDim[DIMENSION.width] += _padd[PADDING.left] + _padd[PADDING.right]; @@ -128,12 +120,9 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constr res[i] = surface_create_valid(resDim[DIMENSION.width], resDim[DIMENSION.height], cDep); - surface_set_target(res[i]); - DRAW_CLEAR - BLEND_OVERRIDE + surface_set_shader(res[i], noone); draw_surface_safe(_surf, -minx[i] + _padd[PADDING.left], -miny[i] + _padd[PADDING.top]); - BLEND_NORMAL - surface_reset_target(); + surface_reset_shader(); } } diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 90089f7f6..7dad0e46e 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -48,6 +48,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x run_in(1, function() { resetInternalName(); + + if(renamed) return; display_name = __txt_node_name(instanceof(self), name); if(!LOCALE_DEF || TESTING) renamed = true; }); @@ -1660,8 +1662,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x array_push(_trigger, inspectInput2.serialize(scale, preset)); array_push(_trigger, updatedInTrigger.serialize(scale, preset)); array_push(_trigger, updatedOutTrigger.serialize(scale, preset)); + _map.inspectInputs = _trigger; - _map.renamed = renamed; + _map.renamed = renamed; doSerialize(_map); processSerialize(_map); diff --git a/scripts/node_image/node_image.gml b/scripts/node_image/node_image.gml index 47885b81f..faddafb7d 100644 --- a/scripts/node_image/node_image.gml +++ b/scripts/node_image/node_image.gml @@ -22,8 +22,8 @@ function Node_create_Image_path(_x, _y, path) { } function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Image"; - color = COLORS.node_blend_input; + name = "Image"; + color = COLORS.node_blend_input; inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load, { filter: "*.png" }) @@ -106,12 +106,9 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { _outsurf = surface_verify(_outsurf, ww, hh, attrDepth()); outputs[| 0].setValue(_outsurf); - surface_set_target(_outsurf); - DRAW_CLEAR - BLEND_OVERRIDE; - draw_sprite(spr, 0, pad[2], pad[1]); - BLEND_NORMAL; - surface_reset_target(); + surface_set_shader(_outsurf, noone); + draw_sprite(spr, 0, pad[2], pad[1]); + surface_reset_shader(); if(!first_update) return; first_update = false; diff --git a/scripts/node_image_animated/node_image_animated.gml b/scripts/node_image_animated/node_image_animated.gml index 0287dc2d7..58fda37cc 100644 --- a/scripts/node_image_animated/node_image_animated.gml +++ b/scripts/node_image_animated/node_image_animated.gml @@ -115,7 +115,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons path_loaded[i] = paths[i]; var path = try_get_path(paths[i]); if(path == -1) continue; - setDisplayName(string_replace(filename_name(path), filename_ext(path), "")); + setDisplayName(filename_name_only(path)); var ext = string_lower(filename_ext(path)); diff --git a/scripts/node_image_gif/node_image_gif.gml b/scripts/node_image_gif/node_image_gif.gml index 8a35670ac..8a4d49823 100644 --- a/scripts/node_image_gif/node_image_gif.gml +++ b/scripts/node_image_gif/node_image_gif.gml @@ -101,9 +101,10 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct if(ext != ".gif") return false; - + + setDisplayName(_name); outputs[| 1].setValue(path); - + if(spr) sprite_delete(spr); sprite_add_gif(path, function(_spr) { spr_builder = _spr; diff --git a/scripts/node_image_sequence/node_image_sequence.gml b/scripts/node_image_sequence/node_image_sequence.gml index f532813f0..cc0ed5d63 100644 --- a/scripts/node_image_sequence/node_image_sequence.gml +++ b/scripts/node_image_sequence/node_image_sequence.gml @@ -107,6 +107,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons var path = try_get_path(paths[i]); if(path == -1) continue; var ext = string_lower(filename_ext(path)); + setDisplayName(filename_name_only(path)); switch(ext) { case ".png" : diff --git a/scripts/node_particle/node_particle.gml b/scripts/node_particle/node_particle.gml index 0cac64242..e71f9fb61 100644 --- a/scripts/node_particle/node_particle.gml +++ b/scripts/node_particle/node_particle.gml @@ -2,7 +2,7 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _ name = "Particle"; use_cache = CACHE_USE.auto; - onSurfaceSize = function() { return getInputData(input_len, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(input_len, DEF_SURF)); }; inputs[| 3].setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); inputs[| 22].setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation", "Array" ]); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index a311b7ea3..2387d14be 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -229,6 +229,12 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio global.RECENT_NODES = file_exists(recPath)? json_load_struct(recPath) : []; if(!is_array(global.RECENT_NODES)) global.RECENT_NODES = []; + NODE_PAGE_DEFAULT = ds_list_size(NODE_CATEGORY); + ADD_NODE_PAGE = NODE_PAGE_DEFAULT; + + var fav = ds_list_create(); + addNodeCatagory("Favourites", fav); + var group = ds_list_create(); #region addNodeCatagory("Group", group, ["Node_Group"]); ds_list_add(group, "Groups"); @@ -373,12 +379,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio 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 - NODE_PAGE_DEFAULT = ds_list_size(NODE_CATEGORY); - ADD_NODE_PAGE = NODE_PAGE_DEFAULT; - - var fav = ds_list_create(); - addNodeCatagory("Favourites", fav); - + ////////////////////////////////////////////////////////////////////////////////// + var input = ds_list_create(); #region addNodeCatagory("IO", input); ds_list_add(input, "Images"); diff --git a/scripts/node_scatter/node_scatter.gml b/scripts/node_scatter/node_scatter.gml index b991e19cc..206bd2dec 100644 --- a/scripts/node_scatter/node_scatter.gml +++ b/scripts/node_scatter/node_scatter.gml @@ -15,7 +15,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c inputs[| 4] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0, 0 ] ) .setDisplay(VALUE_DISPLAY.rotation_random); - onSurfaceSize = function() { return getInputData(1, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(1, DEF_SURF)); }; inputs[| 5] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); diff --git a/scripts/node_scatter_points/node_scatter_points.gml b/scripts/node_scatter_points/node_scatter_points.gml index 7bf3331b1..f4434daaf 100644 --- a/scripts/node_scatter_points/node_scatter_points.gml +++ b/scripts/node_scatter_points/node_scatter_points.gml @@ -5,7 +5,7 @@ function Node_Scatter_Points(_x, _y, _group = noone) : Node(_x, _y, _group) cons w = 96; - onSurfaceSize = function() { return getInputData(7, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(7, DEF_SURF)); }; inputs[| 0] = nodeValue("Point area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); diff --git a/scripts/node_simple_shape/node_simple_shape.gml b/scripts/node_simple_shape/node_simple_shape.gml index a61d813d8..d7c45a9fd 100644 --- a/scripts/node_simple_shape/node_simple_shape.gml +++ b/scripts/node_simple_shape/node_simple_shape.gml @@ -20,7 +20,7 @@ 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, [ "Rectangle", "Ellipse", "Regular polygon", "Star", "Arc", "Teardrop", "Cross", "Leaf" ]); - onSurfaceSize = function() { return getInputData(0, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); }; inputs[| 3] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index abad6bf91..e3a46037c 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -956,6 +956,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru editWidget = new areaBox(function(index, val) { return setValueDirect(val, index); }, unit); + if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1); if(struct_has(display_data, "onSurfaceSize")) editWidget.onSurfaceSize = display_data.onSurfaceSize; diff --git a/scripts/node_wrap/node_wrap.gml b/scripts/node_wrap/node_wrap.gml index c9f894dee..60969802b 100644 --- a/scripts/node_wrap/node_wrap.gml +++ b/scripts/node_wrap/node_wrap.gml @@ -54,7 +54,7 @@ function Node_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons attributes[? "initalset"] = true; } - } #endregion + } if(!LOADING && !APPENDING) run_in(1, function() { onValueFromUpdate(0); }) #endregion static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region PROCESSOR_OVERLAY_CHECK diff --git a/scripts/node_wrap_area/node_wrap_area.gml b/scripts/node_wrap_area/node_wrap_area.gml index 18e2f5a2e..a2885d89f 100644 --- a/scripts/node_wrap_area/node_wrap_area.gml +++ b/scripts/node_wrap_area/node_wrap_area.gml @@ -3,7 +3,7 @@ function Node_Wrap_Area(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); - onSurfaceSize = function() { return getInputData(0, DEF_SURF); }; + onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); }; inputs[| 1] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16, 4, 4, AREA_SHAPE.rectangle ]) .setDisplay(VALUE_DISPLAY.area, { onSurfaceSize }); @@ -33,7 +33,7 @@ function Node_Wrap_Area(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 1].setValue([ _sw / 2, _sh / 2, _sw / 2, _sh / 2, AREA_SHAPE.rectangle ]); attributes[? "initalset"] = true; } - } #endregion + } if(!LOADING && !APPENDING) run_in(1, function() { onValueFromUpdate(0); }) #endregion static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index ae965c628..5c930e6ca 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -261,6 +261,9 @@ function Panel_Menu() : PanelContent() constructor { var dia = dialogPanelCall(new Panel_Node_Data_Gen()); dia.destroy_on_click_out = false; }), + menuItem(__txtx("panel_menu_test_gen_theme", "Generate theme object"), function() { + __test_generate_theme(); + }), -1, menuItem(__txtx("panel_menu_test_crash", "Force crash"), function() { print(1 + "a"); diff --git a/scripts/preview_overlay_area/preview_overlay_area.gml b/scripts/preview_overlay_area/preview_overlay_area.gml index 9886064e8..1a6c25fec 100644 --- a/scripts/preview_overlay_area/preview_overlay_area.gml +++ b/scripts/preview_overlay_area/preview_overlay_area.gml @@ -1,17 +1,28 @@ -function preview_overlay_area_padding(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, display_data) { +function preview_overlay_area_padding(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, display_data) { #region var _val = array_clone(getValue()); var hover = -1; if(!is_callable(display_data)) return hover; - var ss = display_data(); + var __ax = array_safe_get(_val, 0); + var __ay = array_safe_get(_val, 1); + var __aw = array_safe_get(_val, 2); + var __ah = array_safe_get(_val, 3); var __at = array_safe_get(_val, 4); - var _r = array_safe_get(_val, 0); - var _t = array_safe_get(_val, 1); - var _l = array_safe_get(_val, 2); - var _b = array_safe_get(_val, 3); - var _xc = ((ss[0] - _r) + _l) / 2; - var _yc = ((ss[1] - _b) + _t) / 2; + + var _x0 = __ax - __aw; + var _x1 = __ax + __aw; + var _y0 = __ay - __ah; + var _y1 = __ay + __ah; + + var ss = display_data(); + + var _l = _x0; + var _r = ss[0] - _x1; + var _t = _y0; + var _b = ss[1] - _y1; + var _xc = __ax; + var _yc = __ay; var x0 = _l * _s + _x; var y0 = _t * _s + _y; @@ -42,50 +53,19 @@ function preview_overlay_area_padding(interact, active, _x, _y, _s, _mx, _my, _s draw_sprite_colored(THEME.anchor_solid_hori, 0, x1, yc,, 90); } - if(drag_type == 1) { - var _xx = value_snap(drag_sx - (_mx - drag_mx) / _s, _snx); - _val[0] = _xx; - - if(setValue(_val)) - UNDO_HOLDING = true; - } else if(drag_type == 2) { - var _yy = value_snap(drag_sy + (_my - drag_my) / _s, _sny); - _val[1] = _yy; - - if(setValue(_val)) - UNDO_HOLDING = true; - } else if(drag_type == 3) { - var _xx = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx); - _val[2] = _xx; - - if(setValue(_val)) - UNDO_HOLDING = true; - } else if(drag_type == 4) { - var _yy = value_snap(drag_sy - (_my - drag_my) / _s, _sny); - _val[3] = _yy; - - if(setValue(_val)) - UNDO_HOLDING = true; - } else if(drag_type == 5) { - var _xx = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx); - var _yy = value_snap(drag_sy + (_my - drag_my) / _s, _sny); - var _w = ss[0] - _r - _l; - var _h = ss[1] - _b - _t; - - var nr = ss[0] - (_xx + _w / 2); - var nl = _xx - _w / 2; - var nt = _yy - _h / 2; - var nb = ss[1] - (_yy + _h / 2); - - _val = [ nr, nt, nl, nb, __at ]; - - if(setValue(_val)) - UNDO_HOLDING = true; - } + if(drag_type == 1) _r = value_snap(drag_sx - (_mx - drag_mx) / _s, _snx); + else if(drag_type == 2) _t = value_snap(drag_sy + (_my - drag_my) / _s, _sny); + else if(drag_type == 3) _l = value_snap(drag_sx + (_mx - drag_mx) / _s, _snx); + else if(drag_type == 4) _b = value_snap(drag_sy - (_my - drag_my) / _s, _sny); - if(drag_type && mouse_release(mb_left)) { - drag_type = 0; - UNDO_HOLDING = false; + if(drag_type) { + var _val = [ _r, _t, _l, _b, __at ]; + if(setValue(_val)) UNDO_HOLDING = true; + + if(mouse_release(mb_left)) { + drag_type = 0; + UNDO_HOLDING = false; + } } if(drawSize && active && point_in_circle(_mx, _my, xc, y0, 16)) { @@ -124,32 +104,25 @@ function preview_overlay_area_padding(interact, active, _x, _y, _s, _mx, _my, _s drag_sx = _r; drag_mx = _mx; } - } else if(drawPos && active && point_in_rectangle(_mx, _my, x0, y0, x1, y1)) { - draw_sprite_colored(THEME.anchor, 1, xc, yc); - hover = 4; - - if(mouse_press(mb_left)) { - drag_type = 5; - drag_sx = _xc; - drag_sy = _yc; - drag_mx = _mx; - drag_my = _my; - } } return hover; -} +} #endregion -function preview_overlay_area_two_point(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag) { +function preview_overlay_area_two_point(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag) { #region var _val = array_clone(getValue()); var hover = -1; + var __ax = array_safe_get(_val, 0); + var __ay = array_safe_get(_val, 1); + var __aw = array_safe_get(_val, 2); + var __ah = array_safe_get(_val, 3); var __at = array_safe_get(_val, 4); - var _x0 = array_safe_get(_val, 0); - var _y0 = array_safe_get(_val, 1); - var _x1 = array_safe_get(_val, 2); - var _y1 = array_safe_get(_val, 3); + var _x0 = __ax - __aw; + var _y0 = __ay - __ah; + var _x1 = __ax + __aw; + var _y1 = __ay + __ah; var x0 = _x0 * _s + _x; var y0 = _y0 * _s + _y; @@ -254,9 +227,9 @@ function preview_overlay_area_two_point(interact, active, _x, _y, _s, _mx, _my, } return hover; -} +} #endregion -function preview_overlay_area_span(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag) { +function preview_overlay_area_span(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag) { #region var _val = array_clone(getValue()); var hover = -1; @@ -265,7 +238,7 @@ function preview_overlay_area_span(interact, active, _x, _y, _s, _mx, _my, _snx, var __aw = array_safe_get(_val, 2); var __ah = array_safe_get(_val, 3); var __at = array_safe_get(_val, 4); - + var _ax = __ax * _s + _x; var _ay = __ay * _s + _y; var _aw = __aw * _s; @@ -357,7 +330,7 @@ function preview_overlay_area_span(interact, active, _x, _y, _s, _mx, _my, _snx, } return hover; -} +} #endregion function preview_overlay_area(interact, active, _x, _y, _s, _mx, _my, _snx, _sny, _flag, display_data) { var _val = array_clone(getValue()); diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index d331c73a7..b28df9ef9 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -174,6 +174,13 @@ function surface_get_height_safe(s, crop = true) { return surface_get_height(s); } +function surface_get_dimension(s) { + INLINE + + if(!is_surface(s)) return [ 1, 1 ]; + return [ surface_get_width_safe(s), surface_get_height_safe(s) ]; +} + //check function is_surface(s) { INLINE diff --git a/scripts/testing_script/testing_script.gml b/scripts/testing_script/testing_script.gml index c994eaed3..e83f6158b 100644 --- a/scripts/testing_script/testing_script.gml +++ b/scripts/testing_script/testing_script.gml @@ -1,4 +1,4 @@ -function __test_update_current_collections() { +function __test_update_current_collections() { #region var st = ds_stack_create(); ds_stack_push(st, PANEL_COLLECTION.context); @@ -25,9 +25,9 @@ function __test_update_current_collections() { ds_stack_destroy(st); print("---------- COLLECTION UPDATING ENDED ----------"); -} +} #endregion -function __test_update_sample_projects() { +function __test_update_sample_projects() { #region print("---------- PROJECT UPDATING STARTED ----------"); for( var i = 0; i < ds_list_size(SAMPLE_PROJECTS); i++ ) { @@ -40,9 +40,9 @@ function __test_update_sample_projects() { } print("---------- PROJECT UPDATING ENDED ----------"); -} +} #endregion -function __test_load_current_collections() { +function __test_load_current_collections() { #region var st = ds_stack_create(); ds_stack_push(st, PANEL_COLLECTION.context); @@ -104,9 +104,9 @@ function __test_load_current_collections() { ds_stack_destroy(st); print("---------- COLLECTION TESTING ENDED ----------"); -} +} #endregion -function __test_load_all_nodes() { +function __test_load_all_nodes() { #region var amo = ds_map_size(ALL_NODES); var k = ds_map_find_first(ALL_NODES); var xx = 0; @@ -148,9 +148,9 @@ function __test_load_all_nodes() { k = ds_map_find_next(ALL_NODES, k); } LOADING = false; -} +} #endregion -function __test_metadata_current_collections() { +function __test_metadata_current_collections() { #region var st = ds_stack_create(); ds_stack_push(st, PANEL_COLLECTION.context); @@ -176,4 +176,15 @@ function __test_metadata_current_collections() { ds_stack_destroy(st); print("---------- COLLECTION UPDATING ENDED ----------"); -} \ No newline at end of file +} #endregion + +function __test_generate_theme() { #region + var _txt = "function Theme() constructor {\n"; + var _spr = struct_get_names(THEME); + + for( var i = 0, n = array_length(_spr); i < n; i++ ) + _txt += $"\t{_spr[i]} = noone;\n"; + _txt += "}"; + + clipboard_set_text(_txt); +} #endregion \ No newline at end of file diff --git a/scripts/theme_definition/theme_definition.gml b/scripts/theme_definition/theme_definition.gml index 58030add9..7d9783744 100644 --- a/scripts/theme_definition/theme_definition.gml +++ b/scripts/theme_definition/theme_definition.gml @@ -1,290 +1,347 @@ function Theme() constructor { - color_picker_sample = noone; - button_color_overlay = noone; - color_picker_box = noone; - dialog_active = noone; - dialog_bg = noone; - group_label = noone; - shadow_drop_down_24 = noone; - menu_bg = noone; - - accept = noone; - add = noone; - animate_clock = noone; - animate_node_go = noone; - animate_onion_skin = noone; - animation_setting = noone; - animation_timing = noone; - animation_stretch = noone; - arrow = noone; - button_path_icon = noone; - button_path_not_found_icon = noone; - cache = noone; - circle = noone; - color_picker_dropper = noone; - cursor_select = noone; - file = noone; - explorer = noone; - fill = noone; - filter_type = noone; - fluid_sim = noone; - folder = noone; - folder_add = noone; - folder_content = noone; - gear = noone; - grad_blend = noone; - graph = noone; - group = noone; - group_s = noone; - hamburger = noone; - visible = noone; - workshop_download = noone; - workshop_upload = noone; - workshop_update = noone; - icon_visibility = noone; - info = noone; - junc_visible = noone; - loading = noone; - loading_s = noone; - feedback = noone; - loop = noone; - unit_ref = noone; - vfx = noone; - minus = noone; - text = noone; - new_file = noone; - node_processor = noone; - value_link = noone; - pin = noone; - play_all = noone; - project = noone; - preset = noone; - refresh = noone; - refresh_s = noone; - reverse = noone; - rigidSim = noone; - scroll_box_arrow = noone; - search = noone; - sequence_control = noone; - sort = noone; - steam = noone; - steam_creator = noone; - text_bullet = noone; - text_slider = noone; - timeline_clock = noone; - timeline_graph = noone; - view_group = noone; - view_mode = noone; - icon_delete = noone; - addon_icon = noone; - youtube = noone; - wiki = noone; - itch = noone; - undo = noone; - redo = noone; - action_history = noone; - cross = noone; - duplicate = noone; - copy = noone; - paste = noone; - node_resize = noone; - icon_curve_connection = noone; - node_output_visible = noone; - icon_minimap = noone; - noti_icon_tick = noone; - noti_icon_error = noone; - noti_icon_warning = noone; - noti_icon_log = noone; - noti_icon_file_load = noone; - noti_icon_file_save = noone; - icon_center_canvas = noone; - icon_grid = noone; - icon_grid_setting = noone; - icon_preview_export = noone; - icon_reset_when_preview = noone; - icon_split_view = noone; - icon_tile_view = noone; - icon_active_split = noone; - save = noone; - save_auto = noone; - window_exit = noone; - window_minimize = noone; - window_maximize = noone; - window_fullscreen = noone; - icon_splash_show_on_start = noone; - icon_array_processor = noone; - tunnel = noone; - lock = noone; - node_move = noone; - splash_thumbnail = noone; - node_goto = noone; - node_create = noone; - node_use_global = noone; - node_use_expression = noone; - icon_toggle = noone; - strandSim = noone; - star = noone; - panel_graph = noone; - panel_preview = noone; - panel_inspector = noone; - panel_animation = noone; - color_wheel = noone; - node_name_type = noone; - checkbox_on_start = noone; - addon_setting = noone; - keyframe_override = noone; - play_sound = noone; - trophy = noone; - chat = noone; - arrow_back_32 = noone; - discord = noone; - heart = noone; - websocket = noone; - node_dropper = noone; - bone = noone; - tab_exit = noone; - icon_save_all = noone; - onion_skin = noone; - - inspector_area = noone; - inspector_area_type = noone; - inspector_padding = noone; - inspector_surface_halign = noone; - inspector_surface_valign = noone; - inspector_text_halign = noone; - inspector_text_valign = noone; - prop_gradient = noone; - prop_keyframe = noone; - prop_on_end = noone; - prop_selecting = noone; - rotator_bg = noone; - rotator_knob = noone; - - icon_24 = noone; - icon_32 = noone; - icon_64 = noone; - node_draw_area = noone; - node_draw_path = noone; - node_junction_inspector = noone; - node_junctions_array = noone; - node_junctions_array_hover = noone; - node_junctions_single = noone; - node_junctions_single_hover = noone; - node_new_badge = noone; - node_pin_bg = noone; - node_pin_bg_active = noone; - node_active = noone; - node_bg = noone; - node_bg_name = noone; - node_glow = noone; - node_frame_bg = noone; - node_frame_title = noone; - node_junction_name_bg = noone; - node_state = noone; - node_bg_pill = noone; - node_trigger = noone; - node_slider = noone; - node_rotator_bg = noone; - node_rotator_knob = noone; - node_checkbox = noone; - node_coor_pin = noone; - node_websocket_receive = noone; - node_websocket_send = noone; - - menu_separator = noone; - menu_button = noone; - menu_button_mask = noone; - key_display = noone; - toolbar_shadow = noone; - ui_panel_active = noone; - ui_panel_tab = noone; - ui_panel_bg = noone; - ui_panel_fg = noone; - ui_panel_bg_cover = noone; - ui_scrollbar = noone; - ui_label_bg = noone; - toolbar = noone; - ui_selection = noone; - timeline_dopesheet_bg = noone; - - cursor_path_add = noone; - cursor_path_anchor = noone; - cursor_path_move = noone; - cursor_path_remove = noone; - anchor = noone; - anchor_rotate = noone; - anchor_scale = noone; - anchor_solid_hori = noone; - anchor_scale_hori = noone; - anchor_selector = noone; - anchor_arrow = noone; - preview_crosshair = noone; - preview_bone_IK = noone; - anchor_bone_stick = noone; - - timeline_ease = noone; - timeline_elastic = noone; - timeline_keyframe = noone; - timeline_keyframe_selecting = noone; - object_halign = noone; - object_valign = noone; + pixel_builder = noone; + junc_visible = noone; + tools_canvas_channel = noone; + ui_scrollbar = noone; + control_remove = noone; + vct = noone; + node_frame_title = noone; + duplicate = noone; + group_label = noone; + panel_graph = noone; + tunnel = noone; + icon_curve_connection = noone; + timeline_clock = noone; + animate_clock = noone; + prop_selecting = noone; + node_websocket_receive = noone; + text_slider = noone; + preview_bone_IK = noone; + tools_3d_transform_object = noone; + prop_anchor = noone; + node_draw_path = noone; + node_pin_bg_active = noone; + icon_splash_show_on_start = noone; + noti_icon_warning = noone; + pin = noone; + accept_16 = noone; + animate_prop_go = noone; + accept = noone; + bone_tool_detach = noone; + loading_s = noone; + loop = noone; + cursor_path_add = noone; + addon_icon = noone; + inspector_text_halign = noone; + anchor_scale_hori = noone; + noti_icon_file_save = noone; + minus_20 = noone; + node_junctions_outline = noone; + color_wheel = noone; + group_s = noone; + add = noone; + panel_animation = noone; + code_show_line = noone; + canvas_tools_rect_fill = noone; + path_tools_add = noone; + node_rotator_knob = noone; + discord = noone; + action_history = noone; + onion_skin = noone; timeline_onion_skin = noone; - - obj_distribute_h = noone; - obj_distribute_v = noone; - - canvas_tools_bucket = noone; - canvas_tools_ellip = noone; - canvas_tools_ellip_fill = noone; - canvas_tools_eraser = noone; - canvas_tools_pencil = noone; - canvas_tools_rect = noone; - canvas_tools_rect_fill = noone; - control_add = noone; - control_remove = noone; - control_pin = noone; - control_unpin = noone; - mesh_tool_edit = noone; - mesh_tool_delete = noone; - path_tools_add = noone; - path_tools_anchor = noone; - path_tools_circle = noone; - path_tools_rectangle = noone; - path_tools_draw = noone; - path_tools_transform = noone; - tools_canvas_channel = noone; - tools_3d_transform = noone; - tools_3d_rotate = noone; - tools_3d_scale = noone; - splice_draw = noone; - strand_comb = noone; - strand_cut = noone; - strand_grab = noone; - strand_push = noone; - strand_stretch = noone; - bone_tool_add = noone; - bone_tool_detach = noone; - bone_tool_remove = noone; - bone_tool_transform = noone; - bone_tool_IK = noone; - - button = noone; - button_hide = noone; - button_hide_fill = noone; - button_hide_left = noone; - button_hide_middle = noone; - button_hide_right = noone; - button_left = noone; - button_lime = noone; - button_middle = noone; - button_right = noone; - checkbox = noone; - slider = noone; - widget_selecting = noone; - textbox = noone; - textbox_header = noone; - textbox_code = noone; - progress_bar = noone; + animate_onion_skin = noone; + anchor_rotate = noone; + button_left = noone; + obj_distribute_v = noone; + node_goto = noone; + star = noone; + bone_tool_scale = noone; + node_junctions_single_hover = noone; + node_note_selecting = noone; + obj_angle = noone; + node_use_global = noone; + panel_inspector = noone; + steam_creator = noone; + animation_stretch = noone; + ui_panel_fg = noone; + toolbar = noone; + icon_visibility = noone; + node_use_project = noone; + ac_constant = noone; + redo = noone; + inspector_surface_valign = noone; + textbox_header = noone; + obj_direction = noone; + anchor_arrow = noone; + rigidSim = noone; + button = noone; + icon_64 = noone; + node_pin_bg = noone; + button_hide = noone; + window_maximize = noone; + animation_timing = noone; + new_file = noone; + play_action = noone; + canvas_tools_selection_rectangle = noone; + splice_draw = noone; + panel_preview = noone; + tools_3d_rotate = noone; + toolbar_shadow = noone; + inspector_area_type = noone; + noti_icon_log = noone; + prop_on_end = noone; + export_package = noone; + icon_split_view = noone; + grad_blend = noone; + node_bg = noone; + strand_grab = noone; + canvas_tools_ellip_fill = noone; + vfx = noone; + mesh_tool_edit = noone; + ui_panel_bg = noone; + node_trigger = noone; + timeline_ease = noone; + cache_group = noone; + chat = noone; + wiki = noone; + patreon = noone; + dialog_bg = noone; + color_picker_box = noone; + object_valign = noone; + addon_setting = noone; + sequence_control = noone; + node_junctions_array_hover = noone; + text = noone; + info = noone; + node_checkbox = noone; + splash_thumbnail = noone; + search = noone; + icon_active_split = noone; + timeline_node = noone; + textbox_code = noone; + file = noone; + undo = noone; + gear = noone; + bone_tool_IK = noone; + cursor_path_remove = noone; + lock = noone; + icon_24 = noone; + node_note_pin = noone; + minus_16 = noone; + window_exit = noone; + text_popup = noone; + animation_setting = noone; + folder = noone; + button_hide_circle_28 = noone; + feedback = noone; + tab_exit = noone; + timeline_graph = noone; + canvas_tools_pencil = noone; + path_tools_draw = noone; + refresh_s = noone; + menu_button = noone; + icon_save_all = noone; + button_hide_middle = noone; + icon_minimap = noone; + noti_icon_console = noone; + textbox = noone; + fluid_sim = noone; + ui_panel_tab = noone; + button_path_icon = noone; + strand_stretch = noone; + cursor_select = noone; + node_glow = noone; + control_pin = noone; + node_junction_name_bg = noone; + play_sound = noone; + view_group = noone; + copy = noone; + node_use_expression = noone; + ui_selection = noone; + color_picker_sample = noone; + ac_node = noone; + close_16 = noone; + anchor_bone_stick = noone; + cross = noone; + checkbox_on_start = noone; + node_new_badge = noone; + node_junction_inspector = noone; + icon_array_processor = noone; + icon_preview_export = noone; + play_all = noone; + timeline_folder = noone; + bone_tool_remove = noone; + cursor_path_anchor = noone; + workshop_project = noone; + explorer = noone; + inspector_text_valign = noone; + timeline_dopesheet_bg = noone; + node_dropper = noone; + icon_grid = noone; + node_note_title = noone; + widget_selecting = noone; + hamburger = noone; + menu_bg = noone; + code_show_auto = noone; + canvas_tools_rect = noone; + hamburger_s = noone; + path_tools_circle = noone; + node_bg_name = noone; + workshop_upload = noone; + node_websocket_send = noone; + heart = noone; + textbox_number_slider = noone; + node_resize = noone; + preview_light = noone; + button_color_overlay = noone; + button_path_not_found_icon = noone; + anchor_scale = noone; + button_right = noone; + timeline_keyframe_selecting = noone; + crop_tool = noone; + view_mode = noone; + strand_push = noone; + icon_delete = noone; + control_add = noone; + slider = noone; + bone_tool_move = noone; + node_frame_bg = noone; + paste = noone; + icon_toggle = noone; + text_bullet = noone; + ui_panel_active = noone; + visible = noone; + progress_bar = noone; + loading = noone; + fill = noone; + preview_crosshair = noone; + inspector_view = noone; + node_draw_area = noone; + window_fullscreen = noone; + icon_center_canvas = noone; + value_link = noone; + checkbox = noone; + bone_tool_add = noone; + workshop_update = noone; + tools_3d_transform = noone; + ui_label_bg = noone; + noti_icon_tick = noone; + inspector_padding = noone; + node_name_type = noone; + noti_icon_file_load = noone; + add_20 = noone; + icon_reset_when_preview = noone; + folder_16 = noone; + node_junctions_outline_hover = noone; + graph = noone; + inspector_corner = noone; + node_slider = noone; + new_line_shift = noone; + canvas_tools_ellip = noone; + cache = noone; + mesh_tool_delete = noone; + strandSim = noone; + save = noone; + node_rotator_bg = noone; + keyframe_override = noone; + arrow_back_32 = noone; + path_tools_anchor = noone; + itch = noone; + prop_keyframe = noone; + shadow_drop_down_24 = noone; + unit_angle = noone; + node_coor_pin = noone; + ac_function = noone; + obj_distribute_h = noone; + node_junctions_single = noone; + node_note_bg = noone; + anchor = noone; + node_create = noone; + sort = noone; + arrow = noone; + unit_audio = noone; + inspector_surface_halign = noone; + button_lime = noone; + anchor_solid_hori = noone; + preset = noone; + icon_32 = noone; + window_minimize = noone; + d3d_preview_settings = noone; + unit_ref = noone; + refresh = noone; + canvas_tools_selection_circle = noone; + path_tools_transform = noone; + timeline_keyframe = noone; + tools_3d_scale = noone; + key_display = noone; + display_palette = noone; + obj_hemicircle = noone; + inspector_area = noone; + button_hide_left = noone; + noti_icon_error = noone; + noti_icon_console_failed = noone; + ui_panel_bg_cover = noone; + icon_tile_view = noone; + node_junctions_bg = noone; + color_picker_dropper = noone; + folder_add = noone; + tool_side = noone; + strand_cut = noone; + canvas_tools_bucket = noone; + project = noone; + control_unpin = noone; + rotator_bg = noone; + node_bg_pill = noone; + smoke_sim = noone; + node_processor = noone; + object_halign = noone; + trophy = noone; + youtube = noone; + dialog_active = noone; + circle = noone; + bone = noone; + timeline_elastic = noone; + button_hide_fill = noone; + folder_content = noone; + node_deprecated_badge = noone; + node_junctions_array = noone; + node_note_resize = noone; + minus = noone; + node_move = noone; + workshop_collection = noone; + reverse = noone; + animate_node_go = noone; + menu_button_mask = noone; + obj_draw_line = noone; + bone_tool_transform = noone; + cursor_path_move = noone; + prop_gradient = noone; + add_16 = noone; + save_auto = noone; + d3d_snap_settings = noone; + scroll_box_arrow = noone; + rotator_random_mode = noone; + workshop_download = noone; + group = noone; + anchor_selector = noone; + node_active = noone; + code_syntax_highlight = noone; + inspector_channel = noone; + canvas_tools_eraser = noone; + node_state = noone; + path_tools_rectangle = noone; + rotator_knob = noone; + steam = noone; + menu_separator = noone; + timeline_color = noone; + websocket = noone; + button_hide_right = noone; + node_output_visible = noone; + reset_16 = noone; + icon_grid_setting = noone; + filter_type = noone; + button_middle = noone; + strand_comb = noone; } function ThemeColor() constructor { diff --git a/shaders/sh_find_boundary/sh_find_boundary.yy b/shaders/sh_find_boundary/sh_find_boundary.yy index 31c6f0464..fd236a2b4 100644 --- a/shaders/sh_find_boundary/sh_find_boundary.yy +++ b/shaders/sh_find_boundary/sh_find_boundary.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_find_boundary", "parent": { - "name": "misc", - "path": "folders/shader/misc.yy", + "name": "find boundary", + "path": "folders/shader/misc/find boundary.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh new file mode 100644 index 000000000..3c6f00117 --- /dev/null +++ b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.fsh @@ -0,0 +1,23 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; + +void main() { + vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); + if(col.a > 0.) { gl_FragColor = vec4(1.); return; } + + gl_FragColor = vec4(0.); + vec2 tx = 1. / dimension; + + for(float i = 0.; i < dimension.y; i++) { + vec4 col = texture2D( gm_BaseTexture, vec2(v_vTexcoord.x, tx.y * i) ); + if(col.a > 0.) { + gl_FragColor = vec4(1.); + break; + } + } +} diff --git a/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.vsh b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.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_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy new file mode 100644 index 000000000..bbf088d9c --- /dev/null +++ b/shaders/sh_find_boundary_stretch_x/sh_find_boundary_stretch_x.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_find_boundary_stretch_x", + "parent": { + "name": "find boundary", + "path": "folders/shader/misc/find boundary.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh new file mode 100644 index 000000000..e5f9f4bda --- /dev/null +++ b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.fsh @@ -0,0 +1,23 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; + +void main() { + vec4 col = texture2D( gm_BaseTexture, v_vTexcoord ); + if(col.a > 0.) { gl_FragColor = vec4(1.); return; } + + gl_FragColor = vec4(0.); + vec2 tx = 1. / dimension; + + for(float i = 0.; i < dimension.x; i++) { + vec4 col = texture2D( gm_BaseTexture, vec2(tx.x * i, v_vTexcoord.y) ); + if(col.a > 0.) { + gl_FragColor = vec4(1.); + break; + } + } +} diff --git a/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.vsh b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.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_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy new file mode 100644 index 000000000..04ea78c39 --- /dev/null +++ b/shaders/sh_find_boundary_stretch_y/sh_find_boundary_stretch_y.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_find_boundary_stretch_y", + "parent": { + "name": "find boundary", + "path": "folders/shader/misc/find boundary.yy", + }, + "type": 1, +} \ No newline at end of file