From 56ff68fe2324c58ebce4918c3aa8363e5a7321eb Mon Sep 17 00:00:00 2001 From: Tanasart Date: Fri, 1 Nov 2024 11:57:42 +0700 Subject: [PATCH] tileset part 1 --- PixelComposer.resource_order | 68 +++-- PixelComposer.yyp | 10 +- .../__tiler_autoterrain.gml | 96 ++++-- scripts/__tiler_rule/__tiler_rule.gml | 153 ++++++---- scripts/globals/globals.gml | 2 +- scripts/hotkey_data/hotkey_data.gml | 6 + .../node_ase_file_read/node_ase_file_read.gml | 30 +- .../node_ase_file_read/node_ase_file_read.yy | 4 +- scripts/node_ase_layer/node_ase_layer.gml | 1 + scripts/node_ase_layer/node_ase_layer.yy | 4 +- scripts/node_ase_tag/node_ase_tag.gml | 72 +++++ scripts/node_ase_tag/node_ase_tag.yy | 13 + scripts/node_composite/node_composite.gml | 8 +- scripts/node_data/node_data.gml | 12 +- scripts/node_registry/node_registry.gml | 8 +- scripts/node_tiler/node_tiler.gml | 155 ++++------ .../node_tiler_convert/node_tiler_convert.gml | 279 ++++++++++++++++++ .../node_tiler_convert/node_tiler_convert.yy | 13 + scripts/node_tiler_rule/node_tiler_rule.gml | 4 +- .../node_tiler_tileset/node_tiler_tileset.gml | 177 ++++++++--- scripts/node_value/node_value.gml | 33 ++- .../panel_file_explorer.gml | 6 +- scripts/panel_inspector/panel_inspector.gml | 4 +- scripts/panel_preview/panel_preview.gml | 4 +- .../surface_functions/surface_functions.gml | 6 +- scripts/tiler_tool_brush/tiler_tool_brush.gml | 2 - shaders/sh_sample/sh_sample.fsh | 2 +- .../sh_tile_rule_apply/sh_tile_rule_apply.fsh | 20 +- .../sh_tile_rule_select.fsh | 15 +- .../sh_tiler_autoterrain_apply.fsh | 4 +- .../sh_tiler_autoterrain_mask.fsh | 1 + shaders/sh_tiler_convert/sh_tiler_convert.fsh | 16 + shaders/sh_tiler_convert/sh_tiler_convert.vsh | 19 ++ shaders/sh_tiler_convert/sh_tiler_convert.yy | 12 + .../sh_tiler_convert_mask.fsh | 10 + .../sh_tiler_convert_mask.vsh | 19 ++ .../sh_tiler_convert_mask.yy | 12 + .../s_autoterrain_5x5/s_autoterrain_5x5.yy | 6 +- .../e60e12c6-85ae-4302-b2e9-d2f935920dd9.png | Bin 0 -> 446 bytes .../ad507ec9-d601-44ba-b597-d2c2e78911f3.png | Bin 0 -> 446 bytes sprites/s_junc_aseprite/s_junc_aseprite.yy | 90 ++++++ .../2b2af290-4ca4-4009-bebd-c6bc119ed291.png | Bin 0 -> 1348 bytes .../dd5525f9-b3ac-44fa-956f-a9edd94d6045.png | Bin 0 -> 1348 bytes .../s_node_tileset_convert.yy | 90 ++++++ .../a00816be-bfcb-4955-ac04-53eccc761f8a.png | Bin 0 -> 1479 bytes .../e3ed7e8b-cdba-4e78-ad91-517384a46d66.png | Bin 1288 -> 0 bytes .../509010d8-fd72-49a0-9491-56b1bfc12156.png | Bin 0 -> 1479 bytes .../1edcfe67-256c-45b7-a151-3e2c838774e2.png | Bin 1288 -> 0 bytes .../s_node_tileset_render.yy | 8 +- 49 files changed, 1168 insertions(+), 326 deletions(-) create mode 100644 scripts/node_ase_tag/node_ase_tag.gml create mode 100644 scripts/node_ase_tag/node_ase_tag.yy create mode 100644 scripts/node_tiler_convert/node_tiler_convert.gml create mode 100644 scripts/node_tiler_convert/node_tiler_convert.yy create mode 100644 shaders/sh_tiler_convert/sh_tiler_convert.fsh create mode 100644 shaders/sh_tiler_convert/sh_tiler_convert.vsh create mode 100644 shaders/sh_tiler_convert/sh_tiler_convert.yy create mode 100644 shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.fsh create mode 100644 shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.vsh create mode 100644 shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.yy create mode 100644 sprites/s_junc_aseprite/e60e12c6-85ae-4302-b2e9-d2f935920dd9.png create mode 100644 sprites/s_junc_aseprite/layers/e60e12c6-85ae-4302-b2e9-d2f935920dd9/ad507ec9-d601-44ba-b597-d2c2e78911f3.png create mode 100644 sprites/s_junc_aseprite/s_junc_aseprite.yy create mode 100644 sprites/s_node_tileset_convert/2b2af290-4ca4-4009-bebd-c6bc119ed291.png create mode 100644 sprites/s_node_tileset_convert/layers/2b2af290-4ca4-4009-bebd-c6bc119ed291/dd5525f9-b3ac-44fa-956f-a9edd94d6045.png create mode 100644 sprites/s_node_tileset_convert/s_node_tileset_convert.yy create mode 100644 sprites/s_node_tileset_render/a00816be-bfcb-4955-ac04-53eccc761f8a.png delete mode 100644 sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png create mode 100644 sprites/s_node_tileset_render/layers/a00816be-bfcb-4955-ac04-53eccc761f8a/509010d8-fd72-49a0-9491-56b1bfc12156.png delete mode 100644 sprites/s_node_tileset_render/layers/e3ed7e8b-cdba-4e78-ad91-517384a46d66/1edcfe67-256c-45b7-a151-3e2c838774e2.png diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index d6d4e3104..0faefcc98 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -69,6 +69,7 @@ {"name":"regions","order":19,"path":"folders/nodes/data/generator/regions.yy",}, {"name":"group","order":18,"path":"folders/nodes/data/group.yy",}, {"name":"io","order":19,"path":"folders/nodes/data/io.yy",}, + {"name":"aseprite","order":27,"path":"folders/nodes/data/io/aseprite.yy",}, {"name":"image","order":26,"path":"folders/nodes/data/io/image.yy",}, {"name":"network","order":22,"path":"folders/nodes/data/io/network.yy",}, {"name":"iterate","order":20,"path":"folders/nodes/data/iterate.yy",}, @@ -127,7 +128,6 @@ {"name":"blur","order":60,"path":"folders/nodes/icons/filter/blur.yy",}, {"name":"fluidSim","order":3,"path":"folders/nodes/icons/fluidSim.yy",}, {"name":"generator","order":4,"path":"folders/nodes/icons/generator.yy",}, - {"name":"tiler","order":17,"path":"folders/nodes/icons/tiler.yy",}, {"name":"IO","order":5,"path":"folders/nodes/icons/IO.yy",}, {"name":"misc","order":6,"path":"folders/nodes/icons/misc.yy",}, {"name":"MK effects","order":7,"path":"folders/nodes/icons/MK effects.yy",}, @@ -136,6 +136,7 @@ {"name":"rigidSim","order":10,"path":"folders/nodes/icons/rigidSim.yy",}, {"name":"smokeSim","order":11,"path":"folders/nodes/icons/smokeSim.yy",}, {"name":"strandSim","order":12,"path":"folders/nodes/icons/strandSim.yy",}, + {"name":"tiler","order":17,"path":"folders/nodes/icons/tiler.yy",}, {"name":"transform","order":13,"path":"folders/nodes/icons/transform.yy",}, {"name":"value","order":14,"path":"folders/nodes/icons/value.yy",}, {"name":"area","order":30,"path":"folders/nodes/icons/value/area.yy",}, @@ -217,6 +218,7 @@ {"name":"node","order":5,"path":"folders/shader/UI/node.yy",}, {"name":"palette mixer","order":2,"path":"folders/shader/UI/palette mixer.yy",}, {"name":"sprites","order":152,"path":"folders/sprites.yy",}, + {"name":"junctions","order":30,"path":"folders/sprites/nodes/junctions.yy",}, {"name":"Steamworks","order":153,"path":"folders/Steamworks.yy",}, {"name":"theme","order":156,"path":"folders/theme.yy",}, {"name":"icon","order":1,"path":"folders/theme/icon.yy",}, @@ -767,8 +769,8 @@ {"name":"node_array_split","order":20,"path":"scripts/node_array_split/node_array_split.yy",}, {"name":"node_array_zip","order":13,"path":"scripts/node_array_zip/node_array_zip.yy",}, {"name":"node_array","order":5,"path":"scripts/node_array/node_array.yy",}, - {"name":"node_ase_file_read","order":13,"path":"scripts/node_ase_file_read/node_ase_file_read.yy",}, - {"name":"node_ase_layer","order":14,"path":"scripts/node_ase_layer/node_ase_layer.yy",}, + {"name":"node_ase_layer","order":1,"path":"scripts/node_ase_layer/node_ase_layer.yy",}, + {"name":"node_ase_tag","order":2,"path":"scripts/node_ase_tag/node_ase_tag.yy",}, {"name":"node_atlas_get","order":1,"path":"scripts/node_atlas_get/node_atlas_get.yy",}, {"name":"node_atlas_set","order":2,"path":"scripts/node_atlas_set/node_atlas_set.yy",}, {"name":"node_atlas_to_struct","order":3,"path":"scripts/node_atlas_to_struct/node_atlas_to_struct.yy",}, @@ -1178,6 +1180,7 @@ {"name":"node_threshold","order":9,"path":"scripts/node_threshold/node_threshold.yy",}, {"name":"node_tile_random","order":16,"path":"scripts/node_tile_random/node_tile_random.yy",}, {"name":"node_tile","order":5,"path":"scripts/node_tile/node_tile.yy",}, + {"name":"node_tiler_convert","order":8,"path":"scripts/node_tiler_convert/node_tiler_convert.yy",}, {"name":"node_tiler_export","order":5,"path":"scripts/node_tiler_export/node_tiler_export.yy",}, {"name":"node_tiler_render","order":7,"path":"scripts/node_tiler_render/node_tiler_render.yy",}, {"name":"node_tiler_rule","order":6,"path":"scripts/node_tiler_rule/node_tiler_rule.yy",}, @@ -1779,6 +1782,8 @@ {"name":"sh_tile_rule_select","order":10,"path":"shaders/sh_tile_rule_select/sh_tile_rule_select.yy",}, {"name":"sh_tiler_autoterrain_apply","order":8,"path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",}, {"name":"sh_tiler_autoterrain_mask","order":7,"path":"shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.yy",}, + {"name":"sh_tiler_convert_mask","order":12,"path":"shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.yy",}, + {"name":"sh_tiler_convert","order":11,"path":"shaders/sh_tiler_convert/sh_tiler_convert.yy",}, {"name":"sh_time_remap","order":2,"path":"shaders/sh_time_remap/sh_time_remap.yy",}, {"name":"sh_trail_filler_pass1","order":26,"path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",}, {"name":"sh_trail_filler_pass2","order":28,"path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",}, @@ -2083,8 +2088,8 @@ {"name":"s_name","order":131,"path":"sprites/s_name/s_name.yy",}, {"name":"s_new_line_shift","order":133,"path":"sprites/s_new_line_shift/s_new_line_shift.yy",}, {"name":"s_new","order":132,"path":"sprites/s_new/s_new.yy",}, - {"name":"s_node_2d_light_shape","order":14,"path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",}, - {"name":"s_node_3d_affector_shape","order":13,"path":"sprites/s_node_3d_affector_shape/s_node_3d_affector_shape.yy",}, + {"name":"s_node_2d_light_shape","order":12,"path":"sprites/s_node_2d_light_shape/s_node_2d_light_shape.yy",}, + {"name":"s_node_3d_affector_shape","order":11,"path":"sprites/s_node_3d_affector_shape/s_node_3d_affector_shape.yy",}, {"name":"s_node_3d_array","order":7,"path":"sprites/s_node_3d_array/s_node_3d_array.yy",}, {"name":"s_node_3d_camera_set","order":24,"path":"sprites/s_node_3d_camera_set/s_node_3d_camera_set.yy",}, {"name":"s_node_3d_camera","order":13,"path":"sprites/s_node_3d_camera/s_node_3d_camera.yy",}, @@ -2116,7 +2121,7 @@ {"name":"s_node_3d_wall","order":36,"path":"sprites/s_node_3d_wall/s_node_3d_wall.yy",}, {"name":"s_node_ace","order":61,"path":"sprites/s_node_ace/s_node_ace.yy",}, {"name":"s_node_active_canvas","order":22,"path":"sprites/s_node_active_canvas/s_node_active_canvas.yy",}, - {"name":"s_node_alignment","order":4,"path":"sprites/s_node_alignment/s_node_alignment.yy",}, + {"name":"s_node_alignment","order":3,"path":"sprites/s_node_alignment/s_node_alignment.yy",}, {"name":"s_node_alpha_cut","order":1,"path":"sprites/s_node_alpha_cut/s_node_alpha_cut.yy",}, {"name":"s_node_alpha_grey","order":2,"path":"sprites/s_node_alpha_grey/s_node_alpha_grey.yy",}, {"name":"s_node_animation_control","order":31,"path":"sprites/s_node_animation_control/s_node_animation_control.yy",}, @@ -2153,9 +2158,9 @@ {"name":"s_node_atlas","order":3,"path":"sprites/s_node_atlas/s_node_atlas.yy",}, {"name":"s_node_audio_trim","order":3,"path":"sprites/s_node_audio_trim/s_node_audio_trim.yy",}, {"name":"s_node_audio_volume","order":5,"path":"sprites/s_node_audio_volume/s_node_audio_volume.yy",}, - {"name":"s_node_axis_type","order":17,"path":"sprites/s_node_axis_type/s_node_axis_type.yy",}, + {"name":"s_node_axis_type","order":15,"path":"sprites/s_node_axis_type/s_node_axis_type.yy",}, {"name":"s_node_bar_graph","order":27,"path":"sprites/s_node_bar_graph/s_node_bar_graph.yy",}, - {"name":"s_node_bend_type","order":21,"path":"sprites/s_node_bend_type/s_node_bend_type.yy",}, + {"name":"s_node_bend_type","order":19,"path":"sprites/s_node_bend_type/s_node_bend_type.yy",}, {"name":"s_node_bend","order":20,"path":"sprites/s_node_bend/s_node_bend.yy",}, {"name":"s_node_bevel","order":4,"path":"sprites/s_node_bevel/s_node_bevel.yy",}, {"name":"s_node_bg_glow","order":10,"path":"sprites/s_node_bg_glow/s_node_bg_glow.yy",}, @@ -2182,13 +2187,13 @@ {"name":"s_node_byte_file_write","order":27,"path":"sprites/s_node_byte_file_write/s_node_byte_file_write.yy",}, {"name":"s_node_cache_array","order":25,"path":"sprites/s_node_cache_array/s_node_cache_array.yy",}, {"name":"s_node_cache","order":27,"path":"sprites/s_node_cache/s_node_cache.yy",}, - {"name":"s_node_camera_repeat","order":19,"path":"sprites/s_node_camera_repeat/s_node_camera_repeat.yy",}, + {"name":"s_node_camera_repeat","order":17,"path":"sprites/s_node_camera_repeat/s_node_camera_repeat.yy",}, {"name":"s_node_camera","order":3,"path":"sprites/s_node_camera/s_node_camera.yy",}, {"name":"s_node_canvas_group","order":39,"path":"sprites/s_node_canvas_group/s_node_canvas_group.yy",}, {"name":"s_node_caustic","order":35,"path":"sprites/s_node_caustic/s_node_caustic.yy",}, {"name":"s_node_chromatic_abarration","order":10,"path":"sprites/s_node_chromatic_abarration/s_node_chromatic_abarration.yy",}, {"name":"s_node_color_adjust","order":1,"path":"sprites/s_node_color_adjust/s_node_color_adjust.yy",}, - {"name":"s_node_color_data_label","order":27,"path":"sprites/s_node_color_data_label/s_node_color_data_label.yy",}, + {"name":"s_node_color_data_label","order":25,"path":"sprites/s_node_color_data_label/s_node_color_data_label.yy",}, {"name":"s_node_color_data","order":2,"path":"sprites/s_node_color_data/s_node_color_data.yy",}, {"name":"s_node_color_from_hsv","order":3,"path":"sprites/s_node_color_from_hsv/s_node_color_from_hsv.yy",}, {"name":"s_node_color_from_rgb","order":4,"path":"sprites/s_node_color_from_rgb/s_node_color_from_rgb.yy",}, @@ -2198,7 +2203,7 @@ {"name":"s_node_color_replace","order":8,"path":"sprites/s_node_color_replace/s_node_color_replace.yy",}, {"name":"s_node_colorize","order":11,"path":"sprites/s_node_colorize/s_node_colorize.yy",}, {"name":"s_node_compose","order":1,"path":"sprites/s_node_compose/s_node_compose.yy",}, - {"name":"s_node_condition_type","order":9,"path":"sprites/s_node_condition_type/s_node_condition_type.yy",}, + {"name":"s_node_condition_type","order":7,"path":"sprites/s_node_condition_type/s_node_condition_type.yy",}, {"name":"s_node_convolution","order":12,"path":"sprites/s_node_convolution/s_node_convolution.yy",}, {"name":"s_node_coor_pin","order":1,"path":"sprites/s_node_coor_pin/s_node_coor_pin.yy",}, {"name":"s_node_corner","order":13,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -2214,7 +2219,7 @@ {"name":"s_node_csv_parse","order":19,"path":"sprites/s_node_csv_parse/s_node_csv_parse.yy",}, {"name":"s_node_curve_edit","order":14,"path":"sprites/s_node_curve_edit/s_node_curve_edit.yy",}, {"name":"s_node_curve_hsv","order":63,"path":"sprites/s_node_curve_hsv/s_node_curve_hsv.yy",}, - {"name":"s_node_curve","order":20,"path":"sprites/s_node_curve/s_node_curve.yy",}, + {"name":"s_node_curve","order":18,"path":"sprites/s_node_curve/s_node_curve.yy",}, {"name":"s_node_decorner","order":15,"path":"sprites/s_node_decorner/s_node_decorner.yy",}, {"name":"s_node_delay","order":7,"path":"sprites/s_node_delay/s_node_delay.yy",}, {"name":"s_node_deprecated_badge","order":4,"path":"sprites/s_node_deprecated_badge/s_node_deprecated_badge.yy",}, @@ -2238,7 +2243,7 @@ {"name":"s_node_feedback","order":3,"path":"sprites/s_node_feedback/s_node_feedback.yy",}, {"name":"s_node_FFT","order":5,"path":"sprites/s_node_FFT/s_node_FFT.yy",}, {"name":"s_node_filter_array","order":28,"path":"sprites/s_node_filter_array/s_node_filter_array.yy",}, - {"name":"s_node_flip_render","order":11,"path":"sprites/s_node_flip_render/s_node_flip_render.yy",}, + {"name":"s_node_flip_render","order":9,"path":"sprites/s_node_flip_render/s_node_flip_render.yy",}, {"name":"s_node_flip","order":12,"path":"sprites/s_node_flip/s_node_flip.yy",}, {"name":"s_node_flood_fill","order":24,"path":"sprites/s_node_flood_fill/s_node_flood_fill.yy",}, {"name":"s_node_flow_noise","order":48,"path":"sprites/s_node_flow_noise/s_node_flow_noise.yy",}, @@ -2273,7 +2278,7 @@ {"name":"s_node_gradient_palette","order":11,"path":"sprites/s_node_gradient_palette/s_node_gradient_palette.yy",}, {"name":"s_node_gradient_replace","order":12,"path":"sprites/s_node_gradient_replace/s_node_gradient_replace.yy",}, {"name":"s_node_gradient_shift","order":13,"path":"sprites/s_node_gradient_shift/s_node_gradient_shift.yy",}, - {"name":"s_node_gradient_type","order":8,"path":"sprites/s_node_gradient_type/s_node_gradient_type.yy",}, + {"name":"s_node_gradient_type","order":6,"path":"sprites/s_node_gradient_type/s_node_gradient_type.yy",}, {"name":"s_node_gradient","order":1,"path":"sprites/s_node_gradient/s_node_gradient.yy",}, {"name":"s_node_grain","order":69,"path":"sprites/s_node_grain/s_node_grain.yy",}, {"name":"s_node_grey_alpha","order":25,"path":"sprites/s_node_grey_alpha/s_node_grey_alpha.yy",}, @@ -2335,11 +2340,11 @@ {"name":"s_node_level_selector","order":33,"path":"sprites/s_node_level_selector/s_node_level_selector.yy",}, {"name":"s_node_level","order":32,"path":"sprites/s_node_level/s_node_level.yy",}, {"name":"s_node_line","order":7,"path":"sprites/s_node_line/s_node_line.yy",}, - {"name":"s_node_liquefy_type","order":30,"path":"sprites/s_node_liquefy_type/s_node_liquefy_type.yy",}, + {"name":"s_node_liquefy_type","order":28,"path":"sprites/s_node_liquefy_type/s_node_liquefy_type.yy",}, {"name":"s_node_liquefy","order":71,"path":"sprites/s_node_liquefy/s_node_liquefy.yy",}, {"name":"s_node_local_analyze","order":34,"path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",}, {"name":"s_node_logic_opr","order":1,"path":"sprites/s_node_logic_opr/s_node_logic_opr.yy",}, - {"name":"s_node_logic","order":3,"path":"sprites/s_node_logic/s_node_logic.yy",}, + {"name":"s_node_logic","order":2,"path":"sprites/s_node_logic/s_node_logic.yy",}, {"name":"s_node_loop_array","order":23,"path":"sprites/s_node_loop_array/s_node_loop_array.yy",}, {"name":"s_node_loop_input","order":14,"path":"sprites/s_node_loop_input/s_node_loop_input.yy",}, {"name":"s_node_loop_output","order":13,"path":"sprites/s_node_loop_output/s_node_loop_output.yy",}, @@ -2349,10 +2354,10 @@ {"name":"s_node_lua_global","order":19,"path":"sprites/s_node_lua_global/s_node_lua_global.yy",}, {"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",}, {"name":"s_node_magnitude","order":18,"path":"sprites/s_node_magnitude/s_node_magnitude.yy",}, - {"name":"s_node_math_operators","order":31,"path":"sprites/s_node_math_operators/s_node_math_operators.yy",}, + {"name":"s_node_math_operators","order":29,"path":"sprites/s_node_math_operators/s_node_math_operators.yy",}, {"name":"s_node_math","order":6,"path":"sprites/s_node_math/s_node_math.yy",}, {"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",}, - {"name":"s_node_mesh_type","order":15,"path":"sprites/s_node_mesh_type/s_node_mesh_type.yy",}, + {"name":"s_node_mesh_type","order":13,"path":"sprites/s_node_mesh_type/s_node_mesh_type.yy",}, {"name":"s_node_midi","order":24,"path":"sprites/s_node_midi/s_node_midi.yy",}, {"name":"s_node_mirror","order":3,"path":"sprites/s_node_mirror/s_node_mirror.yy",}, {"name":"s_node_mk_ball_grid","order":3,"path":"sprites/s_node_mk_ball_grid/s_node_mk_ball_grid.yy",}, @@ -2364,8 +2369,8 @@ {"name":"s_node_mk_flare","order":11,"path":"sprites/s_node_mk_flare/s_node_mk_flare.yy",}, {"name":"s_node_mk_flip_grid","order":2,"path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",}, {"name":"s_node_mk_fracture","order":13,"path":"sprites/s_node_mk_fracture/s_node_mk_fracture.yy",}, - {"name":"s_node_mk_grid_flip","order":18,"path":"sprites/s_node_mk_grid_flip/s_node_mk_grid_flip.yy",}, - {"name":"s_node_mk_rain_type","order":7,"path":"sprites/s_node_mk_rain_type/s_node_mk_rain_type.yy",}, + {"name":"s_node_mk_grid_flip","order":16,"path":"sprites/s_node_mk_grid_flip/s_node_mk_grid_flip.yy",}, + {"name":"s_node_mk_rain_type","order":5,"path":"sprites/s_node_mk_rain_type/s_node_mk_rain_type.yy",}, {"name":"s_node_mk_rain","order":4,"path":"sprites/s_node_mk_rain/s_node_mk_rain.yy",}, {"name":"s_node_mk_saber","order":1,"path":"sprites/s_node_mk_saber/s_node_mk_saber.yy",}, {"name":"s_node_mk_sparkle","order":7,"path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",}, @@ -2381,7 +2386,7 @@ {"name":"s_node_noise_perlin","order":11,"path":"sprites/s_node_noise_perlin/s_node_noise_perlin.yy",}, {"name":"s_node_noise_simplex","order":20,"path":"sprites/s_node_noise_simplex/s_node_noise_simplex.yy",}, {"name":"s_node_noise","order":8,"path":"sprites/s_node_noise/s_node_noise.yy",}, - {"name":"s_node_normal_light_type","order":29,"path":"sprites/s_node_normal_light_type/s_node_normal_light_type.yy",}, + {"name":"s_node_normal_light_type","order":27,"path":"sprites/s_node_normal_light_type/s_node_normal_light_type.yy",}, {"name":"s_node_normal_light","order":37,"path":"sprites/s_node_normal_light/s_node_normal_light.yy",}, {"name":"s_node_normal","order":36,"path":"sprites/s_node_normal/s_node_normal.yy",}, {"name":"s_node_normalize","order":62,"path":"sprites/s_node_normalize/s_node_normalize.yy",}, @@ -2458,7 +2463,7 @@ {"name":"s_node_pixel_math","order":70,"path":"sprites/s_node_pixel_math/s_node_pixel_math.yy",}, {"name":"s_node_pixel_sampler","order":54,"path":"sprites/s_node_pixel_sampler/s_node_pixel_sampler.yy",}, {"name":"s_node_pixel_sort","order":41,"path":"sprites/s_node_pixel_sort/s_node_pixel_sort.yy",}, - {"name":"s_node_plot_linear_type","order":10,"path":"sprites/s_node_plot_linear_type/s_node_plot_linear_type.yy",}, + {"name":"s_node_plot_linear_type","order":8,"path":"sprites/s_node_plot_linear_type/s_node_plot_linear_type.yy",}, {"name":"s_node_point_in_area","order":1,"path":"sprites/s_node_point_in_area/s_node_point_in_area.yy",}, {"name":"s_node_polar","order":5,"path":"sprites/s_node_polar/s_node_polar.yy",}, {"name":"s_node_posterize","order":42,"path":"sprites/s_node_posterize/s_node_posterize.yy",}, @@ -2478,8 +2483,8 @@ {"name":"s_node_regex_replace","order":10,"path":"sprites/s_node_regex_replace/s_node_regex_replace.yy",}, {"name":"s_node_regex_search","order":11,"path":"sprites/s_node_regex_search/s_node_regex_search.yy",}, {"name":"s_node_region_fill","order":29,"path":"sprites/s_node_region_fill/s_node_region_fill.yy",}, - {"name":"s_node_repeat_axis","order":16,"path":"sprites/s_node_repeat_axis/s_node_repeat_axis.yy",}, - {"name":"s_node_repeat_selection_types","order":28,"path":"sprites/s_node_repeat_selection_types/s_node_repeat_selection_types.yy",}, + {"name":"s_node_repeat_axis","order":14,"path":"sprites/s_node_repeat_axis/s_node_repeat_axis.yy",}, + {"name":"s_node_repeat_selection_types","order":26,"path":"sprites/s_node_repeat_selection_types/s_node_repeat_selection_types.yy",}, {"name":"s_node_repeat_texture","order":55,"path":"sprites/s_node_repeat_texture/s_node_repeat_texture.yy",}, {"name":"s_node_repeat","order":23,"path":"sprites/s_node_repeat/s_node_repeat.yy",}, {"name":"s_node_replace_palette","order":44,"path":"sprites/s_node_replace_palette/s_node_replace_palette.yy",}, @@ -2517,15 +2522,15 @@ {"name":"s_node_shadow_cast","order":50,"path":"sprites/s_node_shadow_cast/s_node_shadow_cast.yy",}, {"name":"s_node_shadow_type","order":1,"path":"sprites/s_node_shadow_type/s_node_shadow_type.yy",}, {"name":"s_node_shadow","order":49,"path":"sprites/s_node_shadow/s_node_shadow.yy",}, - {"name":"s_node_shape_3d","order":26,"path":"sprites/s_node_shape_3d/s_node_shape_3d.yy",}, + {"name":"s_node_shape_3d","order":24,"path":"sprites/s_node_shape_3d/s_node_shape_3d.yy",}, {"name":"s_node_shape_blur","order":7,"path":"sprites/s_node_shape_blur/s_node_shape_blur.yy",}, - {"name":"s_node_shape_circle","order":24,"path":"sprites/s_node_shape_circle/s_node_shape_circle.yy",}, - {"name":"s_node_shape_leaf","order":25,"path":"sprites/s_node_shape_leaf/s_node_shape_leaf.yy",}, + {"name":"s_node_shape_circle","order":22,"path":"sprites/s_node_shape_circle/s_node_shape_circle.yy",}, + {"name":"s_node_shape_leaf","order":23,"path":"sprites/s_node_shape_leaf/s_node_shape_leaf.yy",}, {"name":"s_node_shape_map","order":21,"path":"sprites/s_node_shape_map/s_node_shape_map.yy",}, - {"name":"s_node_shape_misc","order":6,"path":"sprites/s_node_shape_misc/s_node_shape_misc.yy",}, - {"name":"s_node_shape_poly_type","order":22,"path":"sprites/s_node_shape_poly_type/s_node_shape_poly_type.yy",}, + {"name":"s_node_shape_misc","order":4,"path":"sprites/s_node_shape_misc/s_node_shape_misc.yy",}, + {"name":"s_node_shape_poly_type","order":20,"path":"sprites/s_node_shape_poly_type/s_node_shape_poly_type.yy",}, {"name":"s_node_shape_polygon","order":25,"path":"sprites/s_node_shape_polygon/s_node_shape_polygon.yy",}, - {"name":"s_node_shape_rectangle","order":23,"path":"sprites/s_node_shape_rectangle/s_node_shape_rectangle.yy",}, + {"name":"s_node_shape_rectangle","order":21,"path":"sprites/s_node_shape_rectangle/s_node_shape_rectangle.yy",}, {"name":"s_node_shape","order":14,"path":"sprites/s_node_shape/s_node_shape.yy",}, {"name":"s_node_shard","order":33,"path":"sprites/s_node_shard/s_node_shard.yy",}, {"name":"s_node_shell_excecute","order":33,"path":"sprites/s_node_shell_excecute/s_node_shell_excecute.yy",}, @@ -2587,6 +2592,7 @@ {"name":"s_node_texture_map","order":53,"path":"sprites/s_node_texture_map/s_node_texture_map.yy",}, {"name":"s_node_threshold","order":54,"path":"sprites/s_node_threshold/s_node_threshold.yy",}, {"name":"s_node_tile_random","order":22,"path":"sprites/s_node_tile_random/s_node_tile_random.yy",}, + {"name":"s_node_tileset_convert","order":5,"path":"sprites/s_node_tileset_convert/s_node_tileset_convert.yy",}, {"name":"s_node_tileset_drawer","order":2,"path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",}, {"name":"s_node_tileset_export","order":3,"path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",}, {"name":"s_node_tileset_rule","order":4,"path":"sprites/s_node_tileset_rule/s_node_tileset_rule.yy",}, @@ -2600,7 +2606,7 @@ {"name":"s_node_transform","order":8,"path":"sprites/s_node_transform/s_node_transform.yy",}, {"name":"s_node_translate_point","order":13,"path":"sprites/s_node_translate_point/s_node_translate_point.yy",}, {"name":"s_node_trigger_bool","order":4,"path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",}, - {"name":"s_node_trigger_cond","order":12,"path":"sprites/s_node_trigger_cond/s_node_trigger_cond.yy",}, + {"name":"s_node_trigger_cond","order":10,"path":"sprites/s_node_trigger_cond/s_node_trigger_cond.yy",}, {"name":"s_node_trigger","order":2,"path":"sprites/s_node_trigger/s_node_trigger.yy",}, {"name":"s_node_tunnel_in","order":21,"path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",}, {"name":"s_node_tunnel_out","order":22,"path":"sprites/s_node_tunnel_out/s_node_tunnel_out.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index ee1d23449..cc239d2d7 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -159,6 +159,7 @@ {"$GMFolder":"","%Name":"regions","folderPath":"folders/nodes/data/generator/regions.yy","name":"regions","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"group","folderPath":"folders/nodes/data/group.yy","name":"group","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"io","folderPath":"folders/nodes/data/io.yy","name":"io","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"aseprite","folderPath":"folders/nodes/data/io/aseprite.yy","name":"aseprite","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"image","folderPath":"folders/nodes/data/io/image.yy","name":"image","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"network","folderPath":"folders/nodes/data/io/network.yy","name":"network","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"iterate","folderPath":"folders/nodes/data/iterate.yy","name":"iterate","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -227,7 +228,6 @@ {"$GMFolder":"","%Name":"blur","folderPath":"folders/nodes/icons/filter/blur.yy","name":"blur","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"fluidSim","folderPath":"folders/nodes/icons/fluidSim.yy","name":"fluidSim","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"generator","folderPath":"folders/nodes/icons/generator.yy","name":"generator","resourceType":"GMFolder","resourceVersion":"2.0",}, - {"$GMFolder":"","%Name":"tiler","folderPath":"folders/nodes/icons/tiler.yy","name":"tiler","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"IO","folderPath":"folders/nodes/icons/IO.yy","name":"IO","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"misc","folderPath":"folders/nodes/icons/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"MK effects","folderPath":"folders/nodes/icons/MK effects.yy","name":"MK effects","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -236,6 +236,7 @@ {"$GMFolder":"","%Name":"rigidSim","folderPath":"folders/nodes/icons/rigidSim.yy","name":"rigidSim","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"smokeSim","folderPath":"folders/nodes/icons/smokeSim.yy","name":"smokeSim","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"strandSim","folderPath":"folders/nodes/icons/strandSim.yy","name":"strandSim","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"tiler","folderPath":"folders/nodes/icons/tiler.yy","name":"tiler","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"transform","folderPath":"folders/nodes/icons/transform.yy","name":"transform","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"value","folderPath":"folders/nodes/icons/value.yy","name":"value","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"area","folderPath":"folders/nodes/icons/value/area.yy","name":"area","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -332,6 +333,7 @@ {"$GMFolder":"","%Name":"gameframe","folderPath":"folders/sprites/gameframe.yy","name":"gameframe","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"misc","folderPath":"folders/sprites/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"nodes","folderPath":"folders/sprites/nodes.yy","name":"nodes","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"junctions","folderPath":"folders/sprites/nodes/junctions.yy","name":"junctions","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"texture","folderPath":"folders/sprites/texture.yy","name":"texture","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Steamworks","folderPath":"folders/Steamworks.yy","name":"Steamworks","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"UGC","folderPath":"folders/Steamworks/UGC.yy","name":"UGC","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -1323,6 +1325,7 @@ {"id":{"name":"node_array","path":"scripts/node_array/node_array.yy",},}, {"id":{"name":"node_ase_file_read","path":"scripts/node_ase_file_read/node_ase_file_read.yy",},}, {"id":{"name":"node_ase_layer","path":"scripts/node_ase_layer/node_ase_layer.yy",},}, + {"id":{"name":"node_ase_tag","path":"scripts/node_ase_tag/node_ase_tag.yy",},}, {"id":{"name":"node_atlas_draw","path":"scripts/node_atlas_draw/node_atlas_draw.yy",},}, {"id":{"name":"node_atlas_get","path":"scripts/node_atlas_get/node_atlas_get.yy",},}, {"id":{"name":"node_atlas_set","path":"scripts/node_atlas_set/node_atlas_set.yy",},}, @@ -1784,6 +1787,7 @@ {"id":{"name":"node_threshold","path":"scripts/node_threshold/node_threshold.yy",},}, {"id":{"name":"node_tile_random","path":"scripts/node_tile_random/node_tile_random.yy",},}, {"id":{"name":"node_tile","path":"scripts/node_tile/node_tile.yy",},}, + {"id":{"name":"node_tiler_convert","path":"scripts/node_tiler_convert/node_tiler_convert.yy",},}, {"id":{"name":"node_tiler_export","path":"scripts/node_tiler_export/node_tiler_export.yy",},}, {"id":{"name":"node_tiler_render","path":"scripts/node_tiler_render/node_tiler_render.yy",},}, {"id":{"name":"node_tiler_rule","path":"scripts/node_tiler_rule/node_tiler_rule.yy",},}, @@ -2486,6 +2490,8 @@ {"id":{"name":"sh_tile_rule_select","path":"shaders/sh_tile_rule_select/sh_tile_rule_select.yy",},}, {"id":{"name":"sh_tiler_autoterrain_apply","path":"shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.yy",},}, {"id":{"name":"sh_tiler_autoterrain_mask","path":"shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.yy",},}, + {"id":{"name":"sh_tiler_convert_mask","path":"shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.yy",},}, + {"id":{"name":"sh_tiler_convert","path":"shaders/sh_tiler_convert/sh_tiler_convert.yy",},}, {"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},}, {"id":{"name":"sh_trail_filler_pass1","path":"shaders/sh_trail_filler_pass1/sh_trail_filler_pass1.yy",},}, {"id":{"name":"sh_trail_filler_pass2","path":"shaders/sh_trail_filler_pass2/sh_trail_filler_pass2.yy",},}, @@ -2772,6 +2778,7 @@ {"id":{"name":"s_inspector_text_halign","path":"sprites/s_inspector_text_halign/s_inspector_text_halign.yy",},}, {"id":{"name":"s_inspector_text_valign","path":"sprites/s_inspector_text_valign/s_inspector_text_valign.yy",},}, {"id":{"name":"s_itch","path":"sprites/s_itch/s_itch.yy",},}, + {"id":{"name":"s_junc_aseprite","path":"sprites/s_junc_aseprite/s_junc_aseprite.yy",},}, {"id":{"name":"s_junc_visible","path":"sprites/s_junc_visible/s_junc_visible.yy",},}, {"id":{"name":"s_junction_bypass","path":"sprites/s_junction_bypass/s_junction_bypass.yy",},}, {"id":{"name":"s_kenney","path":"sprites/s_kenney/s_kenney.yy",},}, @@ -3340,6 +3347,7 @@ {"id":{"name":"s_node_texture_map","path":"sprites/s_node_texture_map/s_node_texture_map.yy",},}, {"id":{"name":"s_node_threshold","path":"sprites/s_node_threshold/s_node_threshold.yy",},}, {"id":{"name":"s_node_tile_random","path":"sprites/s_node_tile_random/s_node_tile_random.yy",},}, + {"id":{"name":"s_node_tileset_convert","path":"sprites/s_node_tileset_convert/s_node_tileset_convert.yy",},}, {"id":{"name":"s_node_tileset_drawer","path":"sprites/s_node_tileset_drawer/s_node_tileset_drawer.yy",},}, {"id":{"name":"s_node_tileset_export","path":"sprites/s_node_tileset_export/s_node_tileset_export.yy",},}, {"id":{"name":"s_node_tileset_render","path":"sprites/s_node_tileset_render/s_node_tileset_render.yy",},}, diff --git a/scripts/__tiler_autoterrain/__tiler_autoterrain.gml b/scripts/__tiler_autoterrain/__tiler_autoterrain.gml index 0dffc6dd7..e21fb8fd0 100644 --- a/scripts/__tiler_autoterrain/__tiler_autoterrain.gml +++ b/scripts/__tiler_autoterrain/__tiler_autoterrain.gml @@ -9,61 +9,101 @@ enum AUTOTERRAIN_TYPE { global.autoterrain_amount = [ 9, 16, 15, 48, 55, ]; function tiler_brush_autoterrain(_type, _index) constructor { - name = "autoterrain"; - index = _index; + name = "autoterrain"; + index = _index; + prevInd = 0; + type = -1; - mask_surface = noone; - update_surface = noone; - drawing_surface = noone; - target_surface = noone; - eraseMode = false; + mask_surface = noone; + update_surface = noone; + draw_surface_mask = noone; + target_surface = noone; + eraseMode = false; preview_surface = noone; preview_surface_tile = noone; open = false; - sc_type = new scrollBox(["Simple box (3x3)", "Corner box (5x5)", "Side platform (5x3)", "Godot tile (12x4)", "Gamemaker tileset (11x5)"], function(ind) /*=>*/ { setType(ind); }); + sc_type = new scrollBox(["Simple box (3x3)", "Corner box (5x5)", "Side platform (5x3)", "Godot tile (12x4)", "Gamemaker tileset (11x5)"], function(ind) /*=>*/ { setType(ind); }, false); sc_type.font = f_p3; static indexMap48 = [ 8, 10, 11, 0, 1, 6, 5, 3, 2, 34, 12, 20, 33, 35, 12, 28, 30, 29, 31, 46, 21, 12, 44, 45, 47, 24, 16, 18, 17, 19, 9, 43, 40, 37, 38, 39, 36, 25, 42, 41, 27, 26, 7, 4, 13, 23, 32, 15, 14, 12 ]; + static indexMapOld = [ + [ 0, 1, 2, + 11, 12, 13, + 22, 23, 24 ], + + [-1, 0, 1, 2, -1, + 0, 28, 12, 27, 2, + 11, 12, 12, 12, 13, + 22, 17, 12, 16, 24, + -1, 22, 23, 24, -1 ], + + [ 0, 1, 2, 16, 17, + 11, 12, 13, 27, 28, + 22, 23, 24, 9, 20 ], + + [ 3, 4, 8, 7, 43, 6, 5, 42, 0, 30, 1, 2, + 14, 48, 52, 51, 26, 28, 27, 29, 11, 20, -1, 49, + 25, 37, 41, 40, 15, 17, 16, 18, 50, 12, 9, 13, + 36, 33, 34, 35, 32, 39, 38, 31, 22, 23, 19, 24, ], + + array_create_ext(55, function(i) /*=>*/ {return i}), + ]; static setType = function(_type) { - type = _type; + if(type == _type) return; - switch(type) { - case 0 : index = array_verify_ext(index, 9, function() /*=>*/ {return -1}); break; - case 1 : index = array_verify_ext(index, 25, function() /*=>*/ {return -1}); break; - case 2 : index = array_verify_ext(index, 15, function() /*=>*/ {return -1}); break; - case 3 : index = array_verify_ext(index, 48, function() /*=>*/ {return -1}); break; - case 4 : index = array_verify_ext(index, 55, function() /*=>*/ {return -1}); break; + if(type != -1) { + var _idMap = array_create(55, -1); + var _mapol = indexMapOld[ type]; + var _mapnw = indexMapOld[_type]; + + for( var i = 0, n = array_length(index); i < n; i++ ) { + if(_mapol[i] != -1) _idMap[_mapol[i]] = index[i]; + } } + switch(_type) { + case 0 : index = array_verify_ext(index, 9, function() /*=>*/ {return -1}); prevInd = 4; break; + case 1 : index = array_verify_ext(index, 25, function() /*=>*/ {return -1}); prevInd = 12; break; + case 2 : index = array_verify_ext(index, 15, function() /*=>*/ {return -1}); prevInd = 6; break; + case 3 : index = array_verify_ext(index, 48, function() /*=>*/ {return -1}); prevInd = 33; break; + case 4 : index = array_verify_ext(index, 55, function() /*=>*/ {return -1}); prevInd = 12; break; + } + + if(type != -1) { + for( var i = 0, n = array_length(index); i < n; i++ ) { + if(_mapnw[i] != -1) index[i] = _idMap[_mapnw[i]]; + else index[i] = -1; + } + } + + type = _type; + } setType(_type); static drawing_start = function(surface, _erase = false) { target_surface = surface; eraseMode = _erase; - var _dim = surface_get_dimension(surface); - drawing_surface = surface_verify(drawing_surface, _dim[0], _dim[1], surface_r8unorm); + var _dim = surface_get_dimension(surface); + draw_surface_mask = surface_verify(draw_surface_mask, _dim[0], _dim[1], surface_r8unorm); + mask_surface = surface_verify(mask_surface, _dim[0], _dim[1], surface_r8unorm); + update_surface = surface_verify(update_surface, _dim[0], _dim[1], surface_rgba16float); - //print($"Drawing start {surface} | {drawing_surface}"); + surface_clear(draw_surface_mask); + surface_clear(mask_surface); + surface_clear(update_surface); draw_set_color(c_white); - surface_set_target(drawing_surface); + surface_set_target(draw_surface_mask); DRAW_CLEAR } static drawing_end = function() { surface_reset_target(); - apply_drawing(); - } - - static apply_drawing = function() { - var _dim = surface_get_dimension(target_surface); - mask_surface = surface_verify(mask_surface, _dim[0], _dim[1], surface_r8unorm); - update_surface = surface_verify(update_surface, _dim[0], _dim[1], surface_rgba16float); // autoterrain mask // #000000 : not part of autoterrain @@ -71,7 +111,7 @@ function tiler_brush_autoterrain(_type, _index) constructor { // #FFFFFF : part of autoterrain, writable surface_set_shader(mask_surface, sh_tiler_autoterrain_mask); - shader_set_surface("drawSurface", drawing_surface); + shader_set_surface("drawSurface", draw_surface_mask); shader_set_i("indexes", index); shader_set_i("indexSize", array_length(index)); @@ -79,7 +119,7 @@ function tiler_brush_autoterrain(_type, _index) constructor { surface_reset_shader(); surface_set_shader(update_surface, sh_tiler_autoterrain_apply); - shader_set_2("dimension", _dim); + shader_set_2("dimension", surface_get_dimension(update_surface)); shader_set_surface("maskSurface", mask_surface); shader_set_i("bitmaskType", type); diff --git a/scripts/__tiler_rule/__tiler_rule.gml b/scripts/__tiler_rule/__tiler_rule.gml index cf0adfc50..92d74992a 100644 --- a/scripts/__tiler_rule/__tiler_rule.gml +++ b/scripts/__tiler_rule/__tiler_rule.gml @@ -9,6 +9,7 @@ function tiler_rule() constructor { range = 1; size = [ 1, 1 ]; + scanSize = [ 1, 1 ]; probability = 100; _probability = 1; @@ -25,25 +26,45 @@ function tiler_rule() constructor { __sel = []; static shader_select = function(tileset) { - shader_set_i("range", range); + var _sw = size[0] + range * 2; + var _sh = size[1] + range * 2; - selection_rules = array_verify_ext(selection_rules, (size[0] + range * 2) * (size[1] + range * 2), function() /*=>*/ {return -1} ); + selection_rules = array_verify_ext(selection_rules, _sw * _sh, function() /*=>*/ {return -1} ); __aut = []; __sel = []; var autI = []; - + var minX = 999, maxX = 0; + var minY = 999, maxY = 0; + + // print($"{size}, {range}") + for( var i = 0, n = array_length(selection_rules); i < n; i++ ) { - var _r = selection_rules[i]; + var _s = selection_rules[i]; + var _r = floor(i / _sw); + var _c = i % _sw; - if(is_array(_r)) { - var _auI = _r[1]; + if(_s != -1 && (_r < range || _r >= size[1] + range || _c < range || _c >= size[0] + range)) { + minX = min(minX, _c); + maxX = max(maxX, _c); + minY = min(minY, _r); + maxY = max(maxY, _r); + + // print($"{_s}: {_c}, {_r}"); + } + + if(is_array(_s)) { + var _auI = _s[1]; array_push(__sel, 10000 + _auI); - array_push_unique(autI, _auI); + array_push(autI, _auI); } else - array_push(__sel, _r); + array_push(__sel, _s); } + scanSize = [ max(1, maxX - minX + 1), max(1, maxY - minY + 1) ]; + // print($"{maxX}, {minX} | {maxY}, {minY} | {scanSize}"); + + autI = array_unique(autI); for( var i = 0, n = array_length(autI); i < n; i++ ) { var _i = autI[i]; var _t = tileset.autoterrain[_i]; @@ -54,16 +75,20 @@ function tiler_rule() constructor { __aut[_ind + 1 + j] = _t.index[j]; } - shader_set_f("selection", __sel); + var _selu = array_unique(__sel); + + shader_set_f("selection", _selu); + shader_set_i("selectionSize", array_length(_selu)); shader_set_f("selectionGroup", __aut); } static shader_submit = function(tileset) { shader_set_i("range", range); + shader_set_f("size", size); + shader_set_f("scanSize", scanSize); shader_set_f("probability", probability / 100); - shader_set_f("size", size); shader_set_f("selection", __sel); shader_set_f("selectionGroup", __aut); @@ -76,6 +101,9 @@ function tiler_rule() constructor { array_append(rep, _r.index); } + // print($"selection: {__sel}"); + // print($"selectGroup: {__aut}\n"); + shader_set_f("replacements", rep); shader_set_i("replacementCount", array_length(replacements)); } @@ -117,7 +145,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr tb_rename.font = f_p2; tb_rename.hide = true; - temp_surface = [ 0, 0, 0 ]; + temp_surface = [ noone, noone, noone ]; function setTileset(_tileset) { tileset = _tileset; return self; } @@ -125,6 +153,8 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr var _yy = _y; var _h = 0; + if(tileset == noone) return _h; + var _tileSet = tileset.texture; var _tileSiz = tileset.tileSize; @@ -173,7 +203,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); else if(is(_prin, tiler_rule_replacement)) { var _ind = array_safe_get(_prin.index, 0); - tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _ind, _px, _py, _pw, _ph); + tileset.drawTile(_ind, _px, _py, _pw, _ph); } var _tx = _px + _pw + ui(8); @@ -200,16 +230,16 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr if(_hov && _m[0] < _x + _w - ui(32 + 160)) { if(_m[0] > _tx) { - if(mouse_press(mb_left, _focus)) { - rule_dragging = _rl; - - } else if(DOUBLE_CLICK && _focus) { + if(DOUBLE_CLICK && _focus) { renaming = _rl; rename_text = _rl.name; tb_rename._current_text = _rl.name; tb_rename.activate(); - } + + } else if(mouse_press(mb_left, _focus)) { + rule_dragging = _rl; + } } else { draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent); @@ -259,12 +289,28 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr _ah += ui(4); var _sls = ui(28); + + var _rep = _rl.replacements; + var _siz = _rl.size; + + var _rpw = _sls * _siz[0]; + var _rph = _sls * _siz[1]; + var _radw = _rl.size[0] + _rl.range * 2; var _radh = _rl.size[1] + _rl.range * 2; var _slw = ui(16) + _radw * _sls; var _slh = ui(16) + _radh * _sls; var _hh0 = _slh; + var _dx = ui(8) + _slw + ui(16); + var _nln = (_rpw + ui(4)) * 2 > _w - _dx - ui(24); + var _sx = _x + ui(8); + + if(_nln) { + _sx = _w / 2 - _slw / 2 + ui(4); + _slw = _w - ui(16); + } + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x + ui(8), _yy, _slw, _slh, COLORS.node_composite_bg_blend, 1); for( var j = 0, m = array_length(_rl.selection_rules); j < m; j++ ) { @@ -275,8 +321,8 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr var _cen = _rl_col >= _rl.range && _rl_col < _rl.range + _rl.size[0] && _rl_row >= _rl.range && _rl_row < _rl.range + _rl.size[1]; - var _rl_x = _x + ui(16) + _rl_col * _sls; - var _rl_y = _yy + ui( 8) + _rl_row * _sls; + var _rl_x = _sx + ui(8) + _rl_col * _sls; + var _rl_y = _yy + ui(8) + _rl_row * _sls; var _rl_selected = tileset.object_selecting == _rl && tileset.object_select_id == j; var _rl_hov = _hover && point_in_rectangle(_m[0], _m[1], _rl_x, _rl_y, _rl_x + _sls - 1, _rl_y + _sls - 1); @@ -287,14 +333,14 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr if(is_array(_rl_sel)) { var _autt = tileset.autoterrain[_rl_sel[1]]; - tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _autt.index[0], _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); + tileset.drawTile(_autt.index[0], _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); draw_sprite_uniform(THEME.circle, 0, _rl_x + _sls - ui(8), _rl_y + _sls - ui(8), 1, COLORS._main_accent); } else if (_rl_sel == -10000) { draw_sprite_uniform(THEME.cross, 0, _rl_x + _sls / 2, _rl_y + _sls / 2, 1, _cc, _aa); } else if(_rl_sel != -1) { - tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _rl_sel, _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); + tileset.drawTile(_rl_sel, _rl_x + ui(2), _rl_y + ui(2), _sls - ui(4), _sls - ui(4)); } else if(!_cen) _pad = ui(10); @@ -318,38 +364,33 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - var _rep = _rl.replacements; - var _siz = _rl.size; + var _rx, _rpww; - var _rpw = _sls * _siz[0]; - var _rph = _sls * _siz[1]; - - var _dx = ui(8) + _slw + ui(16); - var _slw = _w - _dx - ui(8); - var _rx; - - if((_rpw + ui(4)) * 2 > _slw - ui(16)) { + if(_nln) { + _rx = _x + ui(8); + _rpww = _w - ui(16); + _hh0 = 0; + _yy += _slh + ui(8); _ah += _slh + ui(8); - draw_sprite_uniform(THEME.arrow, 0, _x + _w / 2, _yy + ui(6), 1, COLORS._main_icon, 1); + draw_sprite_uniform(THEME.arrow, 3, _x + _w / 2, _yy + ui(2), 1, COLORS._main_icon, 1); - _rx = _x + ui(8); - _slw = _w - ui(16); - _hh0 = 0; + _yy += ui(8); + _ah += ui(8); } else { - draw_sprite_uniform(THEME.arrow, 0, _x + ui(8) + _slw + ui(8), _yy + _slh / 2, 1, COLORS._main_icon, 1); - - _rx = _x + _dx; - _slw = _w - _dx - ui(8); + _rx = _x + _dx; + _rpww = _w - _dx - ui(8); + + draw_sprite_uniform(THEME.arrow, 0, _rx - ui(8), _yy + _slh / 2, 1, COLORS._main_icon, 1); } - var _col = max(1, floor((_slw - ui(16)) / (_rpw + ui(4)))); + var _col = max(1, floor((_rpww - ui(16)) / (_rpw + ui(4)))); var _row = ceil((array_length(_rep) + 1) / _col); - var _slh = ui(16) + _row * _rph; + var _rphh = ui(16) + _row * _rph; - draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _rx, _yy, _slw, max(_hh0, _slh), COLORS.node_composite_bg_blend, 1); + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _rx, _yy, _rpww, max(_hh0, _rphh), COLORS.node_composite_bg_blend, 1); var del_rep = -1; @@ -384,7 +425,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr var _rpbx = _rpx + _repBlockCol * _sls; var _rpby = _rpy + _repBlockRow * _sls; - if(_replace.index[k] != -1) tileset.drawTile(_tileSet, _tileAmo, _tileSiz, _replace.index[k], _rpbx, _rpby, _sls, _sls); + if(_replace.index[k] != -1) tileset.drawTile(_replace.index[k], _rpbx, _rpby, _sls, _sls); } var _rl_selected = tileset.object_selecting == _replace; @@ -399,10 +440,8 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr tileset.triggerRender(); } - if(mouse_press(mb_right, _focus)) { - del_rep = j; - tileset.triggerRender(); - } + if(mouse_press(mb_right, _focus)) + del_rep = j - 1; } } @@ -411,15 +450,15 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr tileset.triggerRender(); } - _yy += max(_hh0, _slh) + ui(8); - _ah += max(_hh0, _slh) + ui(8); + _yy += max(_hh0, _rphh) + ui(8); + _ah += max(_hh0, _rphh) + ui(8); } } if(rule_dragging != noone) { - array_remove(_rules, rule_dragging); - array_insert(_rules, rl_iHover, rule_dragging); + array_remove(ruleTiles, rule_dragging); + array_insert(ruleTiles, rl_iHover, rule_dragging); if(mouse_release(mb_left)) { rule_dragging = noone; @@ -428,7 +467,7 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr } if(del != -1) { - array_delete(_rules, del, 1); + array_delete(ruleTiles, del, 1); tileset.triggerRender(); } @@ -436,14 +475,14 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr return _h + _ah; } - function apply(_tilemap, _seed) { + function apply(_tilemap, _seed) { var _mapSize = surface_get_dimension(_tilemap); temp_surface[0] = surface_verify(temp_surface[0], _mapSize[0], _mapSize[1], surface_rgba16float); temp_surface[1] = surface_verify(temp_surface[1], _mapSize[0], _mapSize[1], surface_rgba16float); temp_surface[2] = surface_verify(temp_surface[2], _mapSize[0], _mapSize[1], surface_r16float); var bg = 0; - surface_set_shader(temp_surface[1], sh_sample, true, BLEND.over); + surface_set_shader(temp_surface[1], noone, true, BLEND.over); draw_surface(_tilemap, 0, 0); surface_reset_shader(); @@ -472,6 +511,10 @@ function Tileset_Rule(_tileset) : Inspector_Custom_Renderer(noone, noone) constr bg = !bg; } - return temp_surface[!bg]; + surface_set_shader(_tilemap, noone, true, BLEND.over); + draw_surface(temp_surface[!bg], 0, 0); + surface_reset_shader(); + + return _tilemap; } } \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 3b6b1b619..5c55a46dd 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -42,7 +42,7 @@ LATEST_VERSION = 1_18_00_0; VERSION = 1_18_01_0; SAVE_VERSION = 1_18_02_0; - VERSION_STRING = MAC? "1.18.003m" : "1.18.3.008"; + VERSION_STRING = MAC? "1.18.003m" : "1.18.3.010"; BUILD_NUMBER = 1_18_03_0; HOTKEYS = ds_map_create(); diff --git a/scripts/hotkey_data/hotkey_data.gml b/scripts/hotkey_data/hotkey_data.gml index 3f9c1dc85..2fa89516a 100644 --- a/scripts/hotkey_data/hotkey_data.gml +++ b/scripts/hotkey_data/hotkey_data.gml @@ -19,6 +19,12 @@ function __initHotKey() { hotkeySimple("Node_Canvas", "Skew", "S", MOD_KEY.alt); hotkeySimple("Node_Canvas", "Corner", "C", MOD_KEY.alt); + hotkeySimple("Node_Tile_Drawer", "Pencil", "B"); + hotkeySimple("Node_Tile_Drawer", "Eraser", "E"); + hotkeySimple("Node_Tile_Drawer", "Rectangle", "N"); + hotkeySimple("Node_Tile_Drawer", "Ellipse", "M"); + hotkeySimple("Node_Tile_Drawer", "Fill", "G"); + hotkeySimple("Node_Mesh_Warp", "Edit control point", "V"); hotkeySimple("Node_Mesh_Warp", "Pin mesh", "P"); hotkeySimple("Node_Mesh_Warp", "Mesh edit", "M"); diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index 47cbceb20..2cbbc7023 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -25,10 +25,9 @@ function Node_create_ASE_File_Read_path(_x, _y, path) { function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "ASE File In"; + w = 128; update_on_frame = false; - w = 128; - newInput(0, nodeValue_Path("Path", self, "")) .setDisplay(VALUE_DISPLAY.path_load, { filter: "Aseprite file|*.ase;*.aseprite" }); @@ -41,7 +40,8 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const newOutput(0, nodeValue_Output("Output", self, VALUE_TYPE.surface, noone)); - newOutput(1, nodeValue_Output("Content", self, VALUE_TYPE.object, self)); + newOutput(1, nodeValue_Output("Content", self, VALUE_TYPE.object, self)) + .setIcon(s_junc_aseprite, c_white); newOutput(2, nodeValue_Output("Path", self, VALUE_TYPE.path, "")); @@ -50,22 +50,16 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const hold_visibility = true; layer_renderer = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus) { - var amo = array_length(layers); - var hh = 28; - var _h = hh * amo + 16; var _vis = attributes.layer_visible; + var _amo = array_length(layers); + var hh = 24; + var _h = hh * _amo + 16; draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _y, _w, _h, COLORS.node_composite_bg_blend, 1); for( var i = 0, n = array_length(layers); i < n; i++ ) { var _yy = _y + 8 + i * hh; - var _layer = layers[i]; - - if(i) { - draw_set_color(COLORS.node_composite_separator); - draw_line(_x + 16, _yy - 2, _x + _w - 16, _yy - 2); - } - var _bx = _x + 24; + var _layer = layers[i]; if(_layer.type == 0) { var vis = array_safe_get_fast(_vis, i, true); @@ -85,8 +79,8 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const } else if(_layer.type == 1) draw_sprite_ui_uniform(THEME.folder_16, 0, _bx, _yy + hh / 2, 1, COLORS._main_icon); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(_bx + 16, _yy + hh / 2, _layer.name); + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); + draw_text_add(_bx + 16, _yy + hh / 2, _layer.name); } return _h; @@ -160,8 +154,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const temp_surface = [ 0, 0, 0 ]; blend_temp_surface = noone; - input_display_list = [ - ["File", true], 0, + input_display_list = [ 0, ["Layers", false], 1, 3, layer_renderer, ["Tags", false], 2, tag_renderer, ]; @@ -241,7 +234,6 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const content = read_ase(path); if(content == noone) return false; - // print(json_stringify(content)); layers = []; var vis = attributes.layer_visible; @@ -368,8 +360,6 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const blend_temp_surface = temp_surface[2]; for( var i = 0, n = array_length(layers); i < n; i++ ) { - // print($"{i}: {layers[i]}"); - layers[i].tag = tag; var cel = layers[i].getCel(CURRENT_FRAME - _tag_delay); if(!cel) continue; diff --git a/scripts/node_ase_file_read/node_ase_file_read.yy b/scripts/node_ase_file_read/node_ase_file_read.yy index 62770f539..71d13d6ad 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.yy +++ b/scripts/node_ase_file_read/node_ase_file_read.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_ase_file_read", "parent":{ - "name":"io", - "path":"folders/nodes/data/io.yy", + "name":"aseprite", + "path":"folders/nodes/data/io/aseprite.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_ase_layer/node_ase_layer.gml b/scripts/node_ase_layer/node_ase_layer.gml index 8d2200517..43d373409 100644 --- a/scripts/node_ase_layer/node_ase_layer.gml +++ b/scripts/node_ase_layer/node_ase_layer.gml @@ -2,6 +2,7 @@ function Node_ASE_layer(_x, _y, _group = noone) : Node(_x, _y, _group) construct name = "ASE Layer"; newInput(0, nodeValue("ASE data", self, CONNECT_TYPE.input, VALUE_TYPE.object, noone)) + .setIcon(s_junc_aseprite, c_white) .setVisible(false, true) .rejectArray(); diff --git a/scripts/node_ase_layer/node_ase_layer.yy b/scripts/node_ase_layer/node_ase_layer.yy index 96111ca42..f10776113 100644 --- a/scripts/node_ase_layer/node_ase_layer.yy +++ b/scripts/node_ase_layer/node_ase_layer.yy @@ -5,8 +5,8 @@ "isDnD":false, "name":"node_ase_layer", "parent":{ - "name":"io", - "path":"folders/nodes/data/io.yy", + "name":"aseprite", + "path":"folders/nodes/data/io/aseprite.yy", }, "resourceType":"GMScript", "resourceVersion":"2.0", diff --git a/scripts/node_ase_tag/node_ase_tag.gml b/scripts/node_ase_tag/node_ase_tag.gml new file mode 100644 index 000000000..c54ef83ca --- /dev/null +++ b/scripts/node_ase_tag/node_ase_tag.gml @@ -0,0 +1,72 @@ +function Node_ASE_Tag(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { + name = "ASE Tag"; + + newInput(0, nodeValue("ASE data", self, CONNECT_TYPE.input, VALUE_TYPE.object, noone)) + .setIcon(s_junc_aseprite, c_white) + .setVisible(false, true) + .rejectArray(); + + newInput(1, nodeValue_Text("Tag", self, "")); + + newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); + + temp_surface = [ 0, 0, 0 ]; + + static processData = function(_outSurf, _data, _output_index, _array_index) { + var _ase = _data[0]; + var _tag = _data[1]; + + if(_ase == noone || _ase.content == noone) return; + + var _cnt = _ase.content; + var ww = _cnt[$ "Width"]; + var hh = _cnt[$ "Height"]; + _outSurf = surface_verify(_outSurf, ww, hh); + + var tag = noone; + for( var i = 0, n = array_length(_ase.tags); i < n; i++ ) { + if(_ase.tags[i][$ "Name"] == _tag) { + tag = _ase.tags[i]; + break; + } + } + + if(tag == noone) return; + + for (var i = 0, n = array_length(temp_surface); i < n; i++) { + temp_surface[i] = surface_verify(temp_surface[i], ww, hh); + surface_clear(temp_surface[i]); + } + + blend_temp_surface = temp_surface[2]; + + var st = tag[$ "Frame start"]; + var ed = tag[$ "Frame end"]; + var fr = st + CURRENT_FRAME % (ed - st); + var bg = 0; + + for( var i = 0, n = array_length(_ase.layers); i < n; i++ ) { + var cel = _ase.layers[i].getCel(fr); + if(!cel) continue; + + var _inSurf = cel.getSurface(); + if(!is_surface(_inSurf)) continue; + + var xx = cel.data[$ "X"]; + var yy = cel.data[$ "Y"]; + + surface_set_shader(temp_surface[bg], sh_sample, true, BLEND.over); + draw_surface_blend_ext(temp_surface[!bg], _inSurf, xx, yy); + surface_reset_shader(); + + bg = !bg; + } + + surface_set_shader(_outSurf); + DRAW_CLEAR + draw_surface_safe(temp_surface[!bg]); + surface_reset_shader(); + + return _outSurf; + } +} \ No newline at end of file diff --git a/scripts/node_ase_tag/node_ase_tag.yy b/scripts/node_ase_tag/node_ase_tag.yy new file mode 100644 index 000000000..eff83e6e1 --- /dev/null +++ b/scripts/node_ase_tag/node_ase_tag.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"node_ase_tag", + "isCompatibility":false, + "isDnD":false, + "name":"node_ase_tag", + "parent":{ + "name":"aseprite", + "path":"folders/nodes/data/io/aseprite.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/node_composite/node_composite.gml b/scripts/node_composite/node_composite.gml index a3dbb9d88..792b162d4 100644 --- a/scripts/node_composite/node_composite.gml +++ b/scripts/node_composite/node_composite.gml @@ -194,7 +194,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(_junc_canvas) hover &= _m[0] > _txx + ui(8 + 16); - var tc = i == dynamic_input_inspecting? COLORS._main_text_accent : COLORS._main_icon; + var tc = ind == dynamic_input_inspecting? COLORS._main_text_accent : COLORS._main_icon; if(hover) tc = COLORS._main_text; draw_set_text(f_p1, fa_left, fa_center, tc); @@ -321,7 +321,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) layer_dragging = ind; surface_selecting = index; - dynamic_input_inspecting = i; + dynamic_input_inspecting = ind; refreshDynamicDisplay(); } } @@ -358,6 +358,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) layer_dragging = noone; if(canvas_group) canvas_group.onLayerChanged(); + refreshDynamicDisplay(); } layer_height = max(ui(16), _h); @@ -365,6 +366,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(layer_remove > -1) { deleteLayer(layer_remove); + refreshDynamicDisplay(); layer_remove = -1; } @@ -695,7 +697,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(mouse_press(mb_left, active)) { surface_selecting = hovering; - dynamic_input_inspecting = hovering; + // dynamic_input_inspecting = hovering; refreshDynamicDisplay(); } diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 255ada1ba..25fba6b8a 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -108,6 +108,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { h_param = h; will_setHeight = false; + preserve_height_for_preview = false; selectable = true; clonable = true; @@ -384,11 +385,11 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { /////========== DYNAMIC IO ========== - dummy_input = noone; - auto_input = false; - dyna_input_check_shift = 0; + dummy_input = noone; + auto_input = false; + dyna_input_check_shift = 0; input_display_dynamic = -1; - dynamic_input_inspecting = 0; + dynamic_input_inspecting = 0; static createNewInput = -1; static setDynamicInput = function(_data_length = 1, _auto_input = true, _dummy_type = VALUE_TYPE.any, _dynamic_input_cond = DYNA_INPUT_COND.connection) { @@ -681,8 +682,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { w = SHOW_PARAM? attributes.node_param_width : min_w; if(!auto_height) return; - var _ss = getGraphPreviewSurface(); - var _ps = is_surface(_ss); + var _ps = is_surface(getGraphPreviewSurface()) || preserve_height_for_preview; var _ou = preview_channel >= 0 && preview_channel < array_length(outputs) && outputs[preview_channel].type == VALUE_TYPE.surface; var _prev_surf = previewable && preview_draw && (_ps || _ou); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 2f2ef6542..17e62f7b2 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -534,6 +534,7 @@ function __initNodes() { addNodeObject(input, "Tile Drawer", s_node_tileset_drawer, "Node_Tile_Drawer", [1, Node_Tile_Drawer],, "Draw using tileset.").setVersion(1_18_03_0); addNodeObject(input, "Tile Rule", s_node_tileset_rule, "Node_Tile_Rule", [1, Node_Tile_Rule],, "Apply tileset rules.").setVersion(1_18_03_0); addNodeObject(input, "Render Tilemap", s_node_tileset_render, "Node_Tile_Render", [1, Node_Tile_Render],, "Render tilemap to image.").setVersion(1_18_03_0); + addNodeObject(input, "Convert to Tilemap", s_node_tileset_convert, "Node_Tile_Convert", [1, Node_Tile_Convert],, "Render tilemap to image.").setVersion(1_18_03_0); addNodeObject(input, "Export Tilemap", s_node_tileset_export, "Node_Tile_Tilemap_Export", [1, Node_Tile_Tilemap_Export],, "Export tilemap to file.").setVersion(1_18_03_0); ds_list_add(input, "Files"); @@ -543,8 +544,6 @@ function __initNodes() { addNodeObject(input, "CSV File Out", s_node_csv_file_write, "Node_CSV_File_Write", [1, Node_CSV_File_Write], ["comma separated value"], "Save array as .csv file.").setVersion(1090); addNodeObject(input, "JSON File In", s_node_json_file_read, "Node_Json_File_Read", [1, Node_Json_File_Read],, "Load .json file using keys.").setVersion(1090); addNodeObject(input, "JSON File Out", s_node_json_file_write, "Node_Json_File_Write", [1, Node_Json_File_Write],, "Save data to .json file.").setVersion(1090); - addNodeObject(input, "ASE File In", s_node_ase_file, "Node_ASE_File_Read", [0, Node_create_ASE_File_Read],, "Load Aseprite file with support for layers, tags.").setVersion(1100); - addNodeObject(input, "ASE Layer", s_node_ase_layer, "Node_ASE_layer", [1, Node_ASE_layer],, "Load Aseprite project file").setVersion(1100); addNodeObject(input, "WAV File In", s_node_wav_file_read, "Node_WAV_File_Read", [0, Node_create_WAV_File_Read],, "Load wav audio file.").setVersion(1144); addNodeObject(input, "WAV File Out", s_node_wav_file_write, "Node_WAV_File_Write", [1, Node_WAV_File_Write],, "Save wav audio file.").setVersion(1145); addNodeObject(input, "XML File In", s_node_xml_file_read, "Node_XML_File_Read", [0, Node_create_XML_File_Read],, "Load xml file.").setVersion(11720); @@ -552,6 +551,11 @@ function __initNodes() { addNodeObject(input, "Byte File In", s_node_byte_file_read, "Node_Byte_File_Read", [1, Node_Byte_File_Read],, "Load any file to buffer.").setVersion(11670); addNodeObject(input, "Byte File Out", s_node_byte_file_write, "Node_Byte_File_Write", [1, Node_Byte_File_Write],, "Save buffer content to a file.").setVersion(11670); addNodeObject(input, "Directory Search", s_node_directory, "Node_Directory_Search", [0, Node_create_Directory_Search],, "Search for files in directory.").setVersion(11710); + + ds_list_add(input, "Aseprite"); + addNodeObject(input, "ASE File In", s_node_ase_file, "Node_ASE_File_Read", [0, Node_create_ASE_File_Read],, "Load Aseprite file with support for layers, tags.").setVersion(1100); + addNodeObject(input, "ASE Layer", s_node_ase_layer, "Node_ASE_layer", [1, Node_ASE_layer],, "Load Aseprite project file").setVersion(1100); + addNodeObject(input, "ASE Tag", s_node_ase_layer, "Node_ASE_Tag", [1, Node_ASE_Tag],, "Read tag from ASE file.").setVersion(1_18_03_0); ds_list_add(input, "External"); addNodeObject(input, "Websocket Receiver", s_node_websocket_receive, "Node_Websocket_Receiver", [1, Node_Websocket_Receiver],, "Create websocket server to receive data from the network.").setVersion(1145); diff --git a/scripts/node_tiler/node_tiler.gml b/scripts/node_tiler/node_tiler.gml index 6ed0051d4..c23b233fe 100644 --- a/scripts/node_tiler/node_tiler.gml +++ b/scripts/node_tiler/node_tiler.gml @@ -77,10 +77,12 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou .setCollape(false); tool_fil8 = [ "Fill", tool_fil8_edit, "fillType", tool_attribute ]; - tools = [ - new NodeTool( "Pencil", THEME.canvas_tools_pencil) + tool_pencil = new NodeTool( "Pencil", THEME.canvas_tools_pencil) .setSetting(tool_size) - .setToolObject(tool_brush), + .setToolObject(tool_brush); + + tools = [ + tool_pencil, new NodeTool( "Eraser", THEME.canvas_tools_eraser) .setSetting(tool_size) @@ -100,21 +102,12 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou ]; #endregion - function apply_draw_surface() { - if(!is_surface(canvas_surface)) return; - if(!is_surface(drawing_surface)) return; + function apply_draw_surface() { + if(!is_surface(canvas_surface) || !is_surface(drawing_surface)) return; - if(selecting) { - surface_set_shader(canvas_surface, sh_draw_tile_apply_selection, true, BLEND.over); - shader_set_surface("selectionMask", selection_mask); - draw_surface(drawing_surface, 0, 0); - surface_reset_shader(); - - } else { - surface_set_shader(canvas_surface, sh_draw_tile_apply, true, BLEND.over); - draw_surface(drawing_surface, 0, 0); - surface_reset_shader(); - } + surface_set_shader(canvas_surface, sh_draw_tile_apply, true, BLEND.over); + draw_surface(drawing_surface, 0, 0); + surface_reset_shader(); triggerRender(); } @@ -125,7 +118,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou surface_reset_shader(); } - static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, params) { + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, params) { if(tileset == noone) return; var _mapSize = current_data[1]; @@ -133,13 +126,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou canvas_surface = surface_verify(canvas_surface, _mapSize[0], _mapSize[1], surface_rgba16float); - if(!surface_valid(drawing_surface, _mapSize[0], _mapSize[1], surface_rgba16float)) { - drawing_surface = surface_verify(drawing_surface, _mapSize[0], _mapSize[1], surface_rgba16float); - - surface_set_shader(drawing_surface, noone, true, BLEND.over); - draw_surface(canvas_surface, 0, 0); - surface_reset_shader(); - } + if(!surface_valid(drawing_surface, _mapSize[0], _mapSize[1], surface_rgba16float)) return false; #region surfaces var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ]; @@ -157,71 +144,51 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou #endregion - #region tools - var _currTool = PANEL_PREVIEW.tool_current; - var _tool = _currTool == noone? noone : _currTool.getToolObject(); - - if(!is(_tool, tiler_tool)) - _tool = noone; - - if(_tool) { - var brush = tileset.brush; - - brush.node = self; - brush.brush_size = tool_attribute.size; - brush.autoterrain = is(tileset.object_selecting, tiler_brush_autoterrain)? tileset.object_selecting : noone; - - _tool.brush = brush; - _tool.subtool = _currTool.selecting; - _tool.apply_draw_surface = apply_draw_surface; - _tool.drawing_surface = drawing_surface; - _tool.tile_size = _tileSiz; - - _tool.step(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); - - surface_set_target(preview_draw_overlay); - DRAW_CLEAR - _tool.drawPreview(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); - surface_reset_target(); - - surface_set_target(_preview_draw_mask); - DRAW_CLEAR - _tool.drawMask(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); - surface_reset_target(); - - surface_set_target(preview_draw_mask); - DRAW_CLEAR - draw_surface_ext(_preview_draw_mask, _x, _y, _s * _tileSiz[0], _s * _tileSiz[1], 0, c_white, 1); - surface_reset_target(); - - if(_tool.brush_resizable) { - if(hover && key_mod_press(CTRL)) { - if(mouse_wheel_down()) tool_attribute.size = max( 1, tool_attribute.size - 1); - if(mouse_wheel_up()) tool_attribute.size = min(64, tool_attribute.size + 1); - } - - brush.sizing(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); - } - } - #endregion - - #region draw preview surfaces + var _currTool = PANEL_PREVIEW.tool_current; + var _tool = _currTool == noone? noone : _currTool.getToolObject(); + + if(!is(_tool, tiler_tool)) + _tool = noone; + + if(_tool) { // tool action + var brush = tileset.brush; + + brush.node = self; + brush.brush_size = tool_attribute.size; + brush.autoterrain = is(tileset.object_selecting, tiler_brush_autoterrain)? tileset.object_selecting : noone; + + _tool.brush = brush; + _tool.subtool = _currTool.selecting; + _tool.apply_draw_surface = apply_draw_surface; + _tool.drawing_surface = drawing_surface; + _tool.tile_size = _tileSiz; - // surface_set_shader(preview_drawing_tile, sh_draw_tile_map, true, BLEND.over); - // shader_set_2("dimension", _outDim); - - // shader_set_surface("indexTexture", drawing_surface); - // shader_set_2("indexTextureDim", surface_get_dimension(drawing_surface)); - - // tileset.shader_submit(); + _tool.step(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); + + surface_set_target(preview_draw_overlay); + DRAW_CLEAR + _tool.drawPreview(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); + surface_reset_target(); + + surface_set_target(_preview_draw_mask); + DRAW_CLEAR + _tool.drawMask(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); + surface_reset_target(); + + surface_set_target(preview_draw_mask); + DRAW_CLEAR + draw_surface_ext(_preview_draw_mask, _x, _y, _s * _tileSiz[0], _s * _tileSiz[1], 0, c_white, 1); + surface_reset_target(); + + if(_tool.brush_resizable) { + if(hover && key_mod_press(CTRL)) { + if(mouse_wheel_down()) tool_attribute.size = max( 1, tool_attribute.size - 1); + if(mouse_wheel_up()) tool_attribute.size = min(64, tool_attribute.size + 1); + } - // draw_empty(); - // surface_reset_shader(); - - // draw_surface_ext(preview_drawing_tile, _x, _y, _s, _s, 0, c_white, 1); - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - + brush.sizing(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); + } + surface_set_shader(preview_draw_overlay_tile, sh_draw_tile_map, true, BLEND.over); shader_set_2("dimension", _outDim); @@ -237,16 +204,15 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou params.panel.drawNodeGrid(); -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - shader_set(sh_brush_outline); shader_set_f("dimension", _sw, _sh); draw_surface(preview_draw_mask, 0, 0); shader_reset(); - - #endregion + } - // if(!array_empty(autoterrains)) draw_surface_ext(autoterrains[0].mask_surface, 32, 32, 8, 8, 0, c_white, 1); + // if(!array_empty(tileset.autoterrain)) { + // draw_surface_ext_safe(tileset.autoterrain[0].mask_surface, 32, 32, 8, 8, 0, c_white, 1); + // } // if(surface_exists(canvas_surface)) draw_surface_ext(canvas_surface, 32, 32, 8, 8, 0, c_white, 1); // if(surface_exists(drawing_surface)) draw_surface_ext(drawing_surface, 232, 32, 8, 8, 0, c_white, 1); // draw_surface_ext(preview_draw_overlay, 432, 32, 8, 8, 0, c_white, 1); @@ -282,7 +248,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou var _seed = _data[3]; update_on_frame = _animated; - if(!is_surface(canvas_surface) && buffer_exists(canvas_buffer)) { + if(!is_surface(canvas_surface) && buffer_exists(canvas_buffer)) { canvas_surface = surface_create(_mapSize[0], _mapSize[1], surface_rgba16float); buffer_set_surface(canvas_buffer, canvas_surface, 0); } else @@ -307,6 +273,7 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou buffer_get_surface(canvas_buffer, canvas_surface, 0); var _applied = tileset.rules.apply(canvas_surface, _seed); + // var _applied = canvas_surface; surface_set_shader(_tileMap, sh_sample, true, BLEND.over); draw_surface(_applied, 0, 0); diff --git a/scripts/node_tiler_convert/node_tiler_convert.gml b/scripts/node_tiler_convert/node_tiler_convert.gml new file mode 100644 index 000000000..de7b7cd05 --- /dev/null +++ b/scripts/node_tiler_convert/node_tiler_convert.gml @@ -0,0 +1,279 @@ +function tilemap_convert_object(_color, _target = undefined) constructor { + color = _color; + target = _target; +} + +function Node_Tile_Convert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { + name = "Convert to Tilemap"; + + tileset = noone; + attributes.colorMap = {}; + attributes.colorList = []; + + newInput( 0, nodeValue_Surface("Surface", self)); + + newInput( 1, nodeValue_Tileset("Tileset", self, noone)) + .setVisible(true, true); + + newInput( 2, nodeValue_Bool("Animated", self, false)); + + newInput( 3, nodeValueSeed(self, VALUE_TYPE.float)); + + newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); + + newOutput(1, nodeValue_Output("Tilemap", self, VALUE_TYPE.surface, noone)); + + newOutput(2, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, noone)); + + tile_mapper = new Inspector_Custom_Renderer(function(_x, _y, _w, _m, _hover, _focus, _panel = noone) { + var bx = _x; + var by = _y; + + var bs = ui(24); + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.refresh_16) == 2) + refreshPalette(); + + var _cmap = attributes.colorMap; + var _clrs = attributes.colorList; + + var ss = ui(32); + var amo = array_length(_clrs); + var top = bs + ui(8); + var hh = top + (amo * (ss + ui(8)) + ui(8)); + var _yy = _y + top; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x, _yy, _w, hh - top, COLORS.node_composite_bg_blend, 1); + + var _sel_x0 = 0; + var _sel_x1 = 0; + var _sel_y0 = 0; + var _sel_y1 = 0; + + for( var i = 0; i < amo; i++ ) { + var cc = _clrs[i]; + var mp = _cmap[$ cc]; + + var _x0 = _x + ui(8); + var _y0 = _yy + ui(8) + i * (ss + ui(8)); + + draw_sprite_stretched_ext(THEME.color_picker_box, 0, _x0, _y0, ss, ss, c_white, .5); + draw_sprite_stretched_ext(THEME.color_picker_box, 1, _x0, _y0, ss, ss, cc, 1); + + var _x1 = _x0 + ss + ui(32); + var _x2 = _x + _w - ui(8); + var _xw = _x2 - _x1; + + draw_sprite_ext(THEME.arrow, 0, (_x0 + ss + _x1) / 2, _y0 + ss / 2, 1, 1, 0, c_white, 0.5); + draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, _x1, _y0, _xw, ss, COLORS.node_composite_bg_blend, 1); + + if(tileset == noone) continue; + + tileset.node_edit = self; + if(tileset.object_selecting == mp) + draw_sprite_stretched_ext(THEME.ui_panel, 1, _x1, _y0, _xw, ss, COLORS._main_accent); + + if(_hover && point_in_rectangle(_m[0], _m[1], _x1, _y0, _x1 + _xw, _y0 + ss)) { + draw_sprite_stretched_add(THEME.ui_panel, 1, _x1, _y0, _xw, ss, c_white, 0.25); + + if(mouse_press(mb_left, _focus)) + tileset.object_selecting = tileset.object_selecting == mp? noone : mp; + + if(mouse_press(mb_right, _focus)) + mp.target = undefined; + } + + var _targ = mp.target; + + var _px = _x1 + ui(4); + var _py = _y0 + ui(4); + var _pw = ss - ui(8); + var _ph = ss - ui(8); + + if(_targ == undefined) { + draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); + + } else if(is_array(_targ)) { + var _at = tileset.autoterrain[_targ[1]]; + var _prin = array_safe_get(_at.index, _at.prevInd, undefined); + if(_prin != undefined) tileset.drawTile(_prin, _px, _py, _pw, _ph); + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub); + draw_text_add(_x1 + ss + ui(8), _y0 + ss / 2, _at.name); + + } else { + tileset.drawTile(_targ, _px, _py, _pw, _ph); + + draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub); + draw_text_add(_x1 + ss + ui(8), _y0 + ss / 2, _targ >= 0? $"Tile {_targ}" : $"Animated tile {-_targ - 2}"); + } + + } + + return hh; + }); + + input_display_list = [ 1, 0, + ["Tile map", false], 3, 2, + ["Tile convert", false], tile_mapper, + ]; + + output_display_list = [ 2, 1, 0 ]; + temp_surface = [ 0, 0, 0 ]; + + static refreshPalette = function() { + var _surf = inputs[0].getValue(); + + if(!is_array(_surf)) _surf = [ _surf ]; + + var _pall = ds_map_create(); + + for( var i = 0, n = array_length(_surf); i < n; i++ ) { + var _s = _surf[i]; + if(!is_surface(_s)) continue; + + var ww = surface_get_width_safe(_s); + var hh = surface_get_height_safe(_s); + + var c_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2); + + buffer_get_surface(c_buffer, _s, 0); + buffer_seek(c_buffer, buffer_seek_start, 0); + + for( var i = 0; i < ww * hh; i++ ) { + var b = buffer_read(c_buffer, buffer_u32); + var c = b & ~(0b11111111 << 24); + var a = b & (0b11111111 << 24); + if(a == 0) continue; + c = make_color_rgb(color_get_red(c), color_get_green(c), color_get_blue(c)); + _pall[? c] = 1; + } + + buffer_delete(c_buffer); + } + + var palette = ds_map_keys_to_array(_pall); + var cmap = attributes.colorMap; + attributes.colorList = []; + + for( var i = 0, n = array_length(palette); i < n; i++ ) { + array_push(attributes.colorList, palette[i]); + cmap[$ palette[i]] = struct_has(cmap, palette[i])? cmap[$ palette[i]] : new tilemap_convert_object(palette[i]); + } + } + + static onValueFromUpdate = function(index) { + if(LOADING || APPENDING || CLONING) return; + if(index == 0) refreshPalette(); + } + + static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny, params) { + + } + + static processData = function(_outData, _data, _output_index, _array_index) { + var _surf = _data[0]; + tileset = _data[1]; + var _animated = _data[2]; + var _seed = _data[3]; + + _outData[2] = tileset; + update_on_frame = _animated; + + if(tileset == noone) return _outData; + if(!is_surface(_surf)) return _outData; + + var _mapSize = surface_get_dimension(_surf); + temp_surface[0] = surface_verify(temp_surface[0], _mapSize[0], _mapSize[1], surface_rgba16float); + temp_surface[1] = surface_verify(temp_surface[1], _mapSize[0], _mapSize[1], surface_rgba16float); + temp_surface[2] = surface_verify(temp_surface[2], _mapSize[0], _mapSize[1], surface_rgba16float); + + var _cmap = attributes.colorMap; + var _clrs = attributes.colorList; + var _bg = 0; + var _rpFr = []; + var _rpTo = []; + + surface_set_target(temp_surface[1]); + DRAW_CLEAR BLEND_OVERRIDE draw_surface(_surf, 0, 0); BLEND_NORMAL + surface_reset_target(); + + for( var i = 0, n = array_length(_clrs); i < n; i++ ) { + var cc = _clrs[i]; + var mp = _cmap[$ cc]; + var tg = mp.target; + + if(tg == undefined) continue; + if(!is_array(tg)) { + array_push(_rpFr, cc); + array_push(_rpTo, tg >= 0? tg + 1 : tg); + continue; + } + + var _at = tileset.autoterrain[tg[1]]; + if(!is(_at, tiler_brush_autoterrain)) continue; + + surface_set_shader(temp_surface[_bg], sh_tiler_convert_mask); + shader_set_color("target", cc); + shader_set_f("replace", _at.index[_at.prevInd]); + + draw_surface(temp_surface[!_bg], 0, 0); + surface_reset_shader(); + + surface_set_target(temp_surface[!_bg]); + DRAW_CLEAR BLEND_OVERRIDE draw_surface(temp_surface[_bg], 0, 0); BLEND_NORMAL + surface_reset_target(); + + _at.drawing_start(temp_surface[!_bg]); + draw_surface(temp_surface[_bg], 0, 0); + _at.drawing_end(); + + _bg = !_bg; + } + + surface_set_shader(temp_surface[!_bg], sh_tiler_convert); + shader_set_palette(_rpFr, "colorFrom", "colorAmount"); + shader_set_f("colorTo", _rpTo); + + draw_surface(temp_surface[_bg], 0, 0); + surface_reset_shader(); + + var _tileSiz = tileset.tileSize; + var _outDim = [ _tileSiz[0] * _mapSize[0], _tileSiz[1] * _mapSize[1] ]; + var _tileOut = surface_verify(_outData[0], _outDim[0], _outDim[1]); + var _tileMap = surface_verify(_outData[1], _mapSize[0], _mapSize[1], surface_rgba16float); + var _applied = tileset.rules.apply(temp_surface[!_bg], _seed); + + surface_set_shader(_tileMap, sh_sample, true, BLEND.over); + draw_surface(_applied, 0, 0); + surface_reset_shader(); + + surface_set_shader(_tileOut, sh_draw_tile_map, true, BLEND.over); + shader_set_2("dimension", _outDim); + + shader_set_surface("indexTexture", _tileMap); + shader_set_2("indexTextureDim", surface_get_dimension(_tileMap)); + + shader_set_f("frame", CURRENT_FRAME); + tileset.shader_submit(); + + draw_empty(); + surface_reset_shader(); + + return [ _tileOut, _tileMap, tileset ]; + } + + static attributeDeserialize = function(attr) { + struct_append(attributes, attr); + var _map = struct_try_get(attr, "colorMap", noone); + + if(_map != 0) { + var _keys = variable_struct_get_names(_map); + for( var i = 0, n = array_length(_keys); i < n; i++ ) { + var _k = _keys[i]; + _map[$ _k] = new tilemap_convert_object(_map[$ _k].color, _map[$ _k].target); + } + + attributes.colorMap = _map; + } + } +} \ No newline at end of file diff --git a/scripts/node_tiler_convert/node_tiler_convert.yy b/scripts/node_tiler_convert/node_tiler_convert.yy new file mode 100644 index 000000000..179010b75 --- /dev/null +++ b/scripts/node_tiler_convert/node_tiler_convert.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"node_tiler_convert", + "isCompatibility":false, + "isDnD":false, + "name":"node_tiler_convert", + "parent":{ + "name":"tiler", + "path":"folders/nodes/data/tiler.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/node_tiler_rule/node_tiler_rule.gml b/scripts/node_tiler_rule/node_tiler_rule.gml index 7cdfada20..24fdcf056 100644 --- a/scripts/node_tiler_rule/node_tiler_rule.gml +++ b/scripts/node_tiler_rule/node_tiler_rule.gml @@ -8,8 +8,6 @@ function Node_Tile_Rule(_x, _y, _group = noone) : Node(_x, _y, _group) construct newInput( 2, nodeValueSeed(self, VALUE_TYPE.float)); - newInput( 3, nodeValue_Bool("Animated", self, false)); - newOutput(0, nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone)); newOutput(1, nodeValue_Output("Tilemap", self, VALUE_TYPE.surface, noone)); @@ -19,7 +17,7 @@ function Node_Tile_Rule(_x, _y, _group = noone) : Node(_x, _y, _group) construct rules = new Tileset_Rule(noone); input_display_list = [ 2, - ["Tile data", false], 0, 1, 3, + ["Tile data", false], 0, 1, ["Rules", false, noone, rules.b_toggle ], rules, ]; diff --git a/scripts/node_tiler_tileset/node_tiler_tileset.gml b/scripts/node_tiler_tileset/node_tiler_tileset.gml index 6e379f6eb..be103a6bc 100644 --- a/scripts/node_tiler_tileset/node_tiler_tileset.gml +++ b/scripts/node_tiler_tileset/node_tiler_tileset.gml @@ -1,7 +1,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Tileset"; bypass_grid = true; + preserve_height_for_preview = true; + node_edit = noone; renaming = noone; rename_text = ""; tb_rename = new textBox(TEXTBOX_INPUT.text, function(_name) { @@ -18,27 +20,34 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr newOutput(0, nodeValue_Output("Tileset", self, VALUE_TYPE.tileset, self)); - static drawTile = function(_tileSet, _tileAmo, _tileSiz, index, _x, _y, _w, _h) { + static drawTile = function(index, _x, _y, _w, _h) { if(index < -1) { // animated var _an = -index - 2; var _at = array_safe_get(animatedTiles, _an, noone); if(_at == noone) return; var _prin = array_safe_get(_at.index, safe_mod(current_time / 1000 * 2, array_length(_at.index)), undefined); - if(_prin != undefined) drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _x, _y, _w, _h); + if(_prin != undefined) drawTile(_prin, _x, _y, _w, _h); return; } - var _prc = safe_mod(index, _tileAmo[0]); - var _prr = floor(index / _tileAmo[0]); + var _prc = safe_mod(index, tileAmount[0]); + var _prr = floor(index / tileAmount[0]); - var _pr_tx = _prc * _tileSiz[0]; - var _pr_ty = _prr * _tileSiz[1]; + var _pr_tx = _prc * tileSize[0]; + var _pr_ty = _prr * tileSize[1]; - var _pr_sx = _w / _tileSiz[0]; - var _pr_sy = _h / _tileSiz[1]; + var _pr_sx = _w / tileSize[0]; + var _pr_sy = _h / tileSize[1]; - draw_surface_part_ext(_tileSet, _pr_tx, _pr_ty, _tileSiz[0], _tileSiz[1], _x, _y, _pr_sx, _pr_sy, c_white, 1); + draw_surface_part_ext(texture, _pr_tx, _pr_ty, tileSize[0], tileSize[1], _x, _y, _pr_sx, _pr_sy, c_white, 1); + } + + static setPencil = function() { + var _n = PANEL_INSPECTOR.getInspecting(); + if(!is(_n, Node_Tile_Drawer)) continue; + if(PANEL_PREVIEW.tool_current != _n.tool_pencil) + _n.tool_pencil.toggle(); } #region ++++ tile selector ++++ @@ -60,6 +69,10 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr tile_selecting = false; tile_select_ss = [ 0, 0 ]; + tile_zoom_drag = false; + tile_zoom_mx = noone; + tile_zoom_sx = noone; + object_selecting = noone; object_select_id = noone; @@ -90,6 +103,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr brush.brush_height = 0; } + var _lx = bx + bs + ui(8); + bx = _x + _w - bs; if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover, "Zoom to fit", THEME.path_tools_transform, 0, COLORS._main_icon_light) == 2) { if(is_surface(_tileSet)) { @@ -101,11 +116,59 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr tile_selector_s = _ss; tile_selector_s_to = _ss; - tile_selector_x = _w / 2 - _tdim[0] * _ss / 2; + tile_selector_x = _w / 2 - _tdim[0] * _ss / 2; tile_selector_y = _tsh / 2 - _tdim[1] * _ss / 2; } } + var _rx = bx - ui(8); + + var _zw = ui(128); + var _zh = ui(12); + var _zx1 = _rx; + var _zx0 = max(_lx, _zx1 - _zw); + _zw = _zx1 - _zx0; + var _zy = by + bs / 2 - _zh / 2; + + if(_zw) { //zoom + var _zcc = (tile_selector_s_to - 0.5) / 3.5; + var _zcw = _zw * _zcc; + + draw_sprite_stretched_ext(THEME.textbox, 3, _zx0, _zy, _zw, _zh, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 4, _zx0, _zy, _zcw, _zh, c_white, 1); + + if(_hover && point_in_rectangle(_m[0], _m[1], _zx0, _zy, _zx0 + _zw, _zy + _zh)) { + draw_sprite_stretched_ext(THEME.textbox, 1, _zx0, _zy, _zw, _zh, c_white, 1); + + if(mouse_press(mb_left, _focus)) { + tile_zoom_drag = true; + tile_zoom_mx = _m[0]; + tile_zoom_sx = tile_selector_s_to; + } + } + + if(tile_zoom_drag) { + var _zl = clamp(tile_zoom_sx + (_m[0] - tile_zoom_mx) / _zw * 3.5, .5, 4); + + var _s = tile_selector_s; + tile_selector_s_to = _zl; + tile_selector_s = _zl; + + if(_s != tile_selector_s) { + var _ds = tile_selector_s - _s; + + var _msx = (_w / 2 - _pd) - tile_selector_x; + var _msy = (_tsh / 2 - _pd) - tile_selector_y; + + tile_selector_x -= _msx * _ds / _s; + tile_selector_y -= _msy * _ds / _s; + } + + if(mouse_release(mb_left)) + tile_zoom_drag = false; + } + } + _h += bs + ui(4); _yy += bs + ui(4); @@ -182,23 +245,18 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_color(c_black); draw_rectangle_width(_tileHov_x, _tileHov_y, _tileHov_x + _tileSel_w - 1, _tileHov_y + _tileSel_h - 1, 1); - if(is(object_selecting, tiler_brush_autoterrain)) TOOLTIP = "Set Autoterrain"; - else if(is(object_selecting, tiler_brush_animated)) TOOLTIP = "Set Animated tile"; - else if(is(object_selecting, tiler_rule)) TOOLTIP = "Set Rule selector"; + if(is(object_selecting, tiler_brush_autoterrain) && object_select_id != noone) TOOLTIP = "Set Autoterrain"; + else if(is(object_selecting, tiler_brush_animated) && object_select_id != noone) TOOLTIP = "Set Animated tile"; + else if(is(object_selecting, tiler_rule) && object_select_id != noone) TOOLTIP = "Set Rule selector"; else if(is(object_selecting, tiler_rule_replacement)) TOOLTIP = "Set Rule replacement"; + else if(is(object_selecting, tilemap_convert_object)) TOOLTIP = "Set Replacement target"; if(mouse_press(mb_left, _focus)) { - if(object_selecting == noone) { - tile_selecting = true; - tile_select_ss = [ _mtx, _mty ]; - - } else if(is(object_selecting, tiler_brush_autoterrain) || is(object_selecting, tiler_brush_animated)) { - if(object_select_id != noone) { - object_selecting.index[object_select_id] = _mid; - object_select_id++; - if(object_select_id >= array_length(object_selecting.index)) - object_select_id = noone; - } + if((is(object_selecting, tiler_brush_autoterrain) || is(object_selecting, tiler_brush_animated)) && object_select_id != noone) { + object_selecting.index[object_select_id] = _mid; + do { object_select_id++; } until(object_select_id == array_length(object_selecting.index) || object_selecting.index[object_select_id] == -1) + if(object_select_id >= array_length(object_selecting.index)) + object_select_id = noone; } else if(is(object_selecting, tiler_rule)) { if(object_select_id != noone) @@ -210,6 +268,17 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr tile_selecting = true; tile_select_ss = [ _mtx, _mty ]; + } else if(is(object_selecting, tilemap_convert_object)) { + object_selecting.target = _mid; + object_selecting = noone; + if(node_edit) node_edit.triggerRender(); + + } else { + object_selecting = noone; + object_select_id = noone; + tile_selecting = true; + tile_select_ss = [ _mtx, _mty ]; + } palette_using = false; @@ -225,7 +294,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr for( var i = 0, n = array_length(brush.brush_indices); i < n; i++ ) for( var j = 0, m = array_length(brush.brush_indices[i]); j < m; j++ ) { - var _bindex = floor(brush.brush_indices[i][j][0]); + var _bindex = floor(brush.brush_indices[i][j][0]); var _tileSel_row = floor(_bindex / _tileAmo[0]); var _tileSel_col = safe_mod(_bindex, _tileAmo[0]); @@ -267,6 +336,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr } + setPencil(); tile_selecting = false; } } @@ -337,7 +407,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_color(c_white); for( var j = 0, m = array_length(object_selecting.index); j < m; j++ ) { - var _bindex = object_selecting.index[j]; + var _bindex = object_selecting.index[j]; + if(_bindex < 0) continue; + var _tileSel_row = floor(_bindex / _tileAmo[0]); var _tileSel_col = safe_mod(_bindex, _tileAmo[0]); var _tileSel_x = tile_selector_x + _tileSel_col * _tileSiz[0] * tile_selector_s; @@ -518,12 +590,12 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr var _px = _x + ui(8); var _py = _yy + ui(4); - var _prin = array_safe_get(_at.index, 0, undefined); + var _prin = array_safe_get(_at.index, _at.prevInd, undefined); if(_prin == undefined) draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); else - drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _px, _py, _pw, _ph); + drawTile(_prin, _px, _py, _pw, _ph); var _tx = _px + _pw + ui(8); var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1); @@ -555,6 +627,15 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr triggerRender(); } + } else if(is(object_selecting, tilemap_convert_object)) { + TOOLTIP = "Set Replacement target"; + + if(mouse_press(mb_left, _focus)) { + object_selecting.target = [ "terrain", i ]; + object_selecting = noone; + if(node_edit) node_edit.triggerRender(); + } + } else if(_m[0] > _tx) { if(DOUBLE_CLICK && _focus) { renaming = _at; @@ -571,6 +652,8 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr brush.brush_width = 1; brush.brush_height = 1; palette_using = false; + + setPencil(); } } else { draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent); @@ -651,6 +734,18 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(_over != noone) draw_sprite_ext(_over, 0, _pre_sx, _pre_sy, _ss * _tileSiz[0] / 4, _ss * _tileSiz[1] / 4, 0, COLORS._main_icon, 0.5); draw_surface_ext(_at.preview_surface_tile, _pre_sx, _pre_sy, _ss, _ss, 0, c_white, 1); + draw_set_text(f_p3, fa_left, fa_top, COLORS._main_text); + BLEND_ADD + for( var iy = 0; iy < _roww; iy++ ) + for( var ix = 0; ix < _coll; ix++ ) { + var _indx = iy * _coll + ix; + var _inx = _pre_sx + ix * _ss * _tileSiz[0]; + var _iny = _pre_sy + iy * _ss * _tileSiz[1]; + + draw_text(_inx + 4, _iny + 4, _indx); + } + BLEND_NORMAL + if(grid_draw) { var _gw = _tileSiz[0] * _ss; var _gh = _tileSiz[1] * _ss; @@ -1227,7 +1322,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr if(_prin == undefined) draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_icon); else - drawTile(_tileSet, _tileAmo, _tileSiz, _prin, _px, _py, _pw, _ph); + drawTile(_prin, _px, _py, _pw, _ph); var _tx = _px + _pw + ui(8); var _hov = _hover && point_in_rectangle(_m[0], _m[1], _x, _yy, _x + _w, _yy + _hg - 1); @@ -1266,7 +1361,16 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr object_selecting = noone; triggerRender(); } - } else if(_m[0] > _tx) { + } else if(is(object_selecting, tilemap_convert_object)) { + TOOLTIP = "Set Replacement target"; + + if(mouse_press(mb_left, _focus)) { + object_selecting.target = -(i + 2); + object_selecting = noone; + if(node_edit) node_edit.triggerRender(); + } + + } else if(_m[0] > _tx) { if(DOUBLE_CLICK && _focus) { renaming = _at; rename_text = _at.name; @@ -1283,6 +1387,7 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr brush.brush_height = 1; palette_using = false; + setPencil(); } } else { draw_sprite_stretched_ext(THEME.ui_panel, 1, _px, _py, _pw, _ph, COLORS._main_accent); @@ -1399,10 +1504,11 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr animated_viewer.setName("Animated Tile"); #endregion - gmTile = noone; - texture = noone; - tileSize = [ 1, 1 ]; - rules = new Tileset_Rule(self); + gmTile = noone; + texture = noone; + tileSize = [ 1, 1 ]; + tileAmount = [ 1, 1 ]; + rules = new Tileset_Rule(self); input_display_list = [ 1, 0, ["Tileset", false, noone, tile_selector.b_toggle ], tile_selector, @@ -1427,6 +1533,9 @@ function Node_Tile_Tileset(_x, _y, _group = noone) : Node(_x, _y, _group) constr texture = inputs[0].getValue(); tileSize = inputs[1].getValue(); + var _tdim = surface_get_dimension(texture); + tileAmount = [ floor(_tdim[0] / tileSize[0]), floor(_tdim[1] / tileSize[1]) ]; + if(gmTile != noone) { var _spm = struct_try_get(gmTile.gmBinder.resourcesMap, gmTile.sprite, noone); var _spr = _spm == noone? noone : _spm.thumbnail; diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 004c88e71..c0f08f1ce 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -181,6 +181,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru overlay_text_valign = fa_top; graph_selecting = false; + + custom_icon = noone; + custom_color = noone; #endregion #region ---- timeline ---- @@ -273,6 +276,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static setTooltip = function(_tip) { tooltip = _tip; return self; } + static setIcon = function(_ico, _colr) { custom_icon = _ico; custom_color = _colr; return self; } + static nonValidate = function() { validateValue = false; return self; @@ -906,6 +911,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.path_font : editWidget = new fontScrollBox(function(val) /*=>*/ {return setValueInspector(FONT_INTERNAL[val])}); break; + + default : + editWidget = new textBox(TEXTBOX_INPUT.text, function(str) /*=>*/ {return setValueInspector(str)}); + break; } break; @@ -1893,7 +1902,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _aa = 0.75 + (!is_dummy * 0.25); hover_in_graph = _hov; - draw_set_color(draw_fg); + draw_set_color(custom_color == noone? draw_fg : custom_color); draw_set_alpha(_aa); if(node.previewable) @@ -1919,7 +1928,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var is_hover = hov && point_in_rectangle(_mx, _my, x - _d, y - _d, x + _d - 1, y + _d - 1); hover_in_graph = is_hover; - if(is_dummy) { + if(custom_icon != noone) { + __draw_sprite_ext(custom_icon, 0, x, y, _s, _s, 0, c_white, 1); + + } else if(is_dummy) { __draw_sprite_ext(THEME.node_junction_add, is_hover, x, y, _s, _s, 0, c_white, 0.5 + 0.5 * is_hover); } else if(type == VALUE_TYPE.action) { @@ -2045,7 +2057,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru _my *= aa; var _fade = PREFERENCES.connection_line_highlight_fade; - var col = merge_color(_fade, color_display, .5); + var col = custom_color == noone? merge_color(_fade, color_display, .5) : custom_color; draw_set_color(col); var _action = type == VALUE_TYPE.action; @@ -2085,8 +2097,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; } - __draw_sprite_ext(THEME.node_junctions_bg_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, draw_bg, 1); - __draw_sprite_ext(THEME.node_junctions_outline_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, col, 1); + if(custom_icon == noone) { + __draw_sprite_ext(THEME.node_junctions_bg_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, draw_bg, 1); + __draw_sprite_ext(THEME.node_junctions_outline_x2, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, col, 1); + } else + __draw_sprite_ext(custom_icon, draw_junction_index, _mx, _my, ss / 2, ss / 2, 0, c_white, 1); } /////========== EXPRESSION ========== @@ -2492,15 +2507,15 @@ function drawJuncConnection(from, to, params) { var _fade = PREFERENCES.connection_line_highlight_fade; var _colr = _selc? 1 : _fade; - c0 = merge_color(bg, from.color_display, _colr); - c1 = merge_color(bg, to.color_display, _colr); + c0 = merge_color(bg, from.custom_color == noone? from.color_display : from.custom_color, _colr); + c1 = merge_color(bg, to.custom_color == noone? to.color_display : to.custom_color, _colr); to.draw_blend_color = bg; to.draw_blend = _colr; from.draw_blend = max(from.draw_blend, _colr); } else { - c0 = from.color_display; - c1 = to.color_display; + c0 = from.custom_color == noone? from.color_display : from.custom_color; + c1 = to.custom_color == noone? to.color_display : to.custom_color; to.draw_blend_color = bg; to.draw_blend = -1; diff --git a/scripts/panel_file_explorer/panel_file_explorer.gml b/scripts/panel_file_explorer/panel_file_explorer.gml index 8b1b90bc2..8104fc44b 100644 --- a/scripts/panel_file_explorer/panel_file_explorer.gml +++ b/scripts/panel_file_explorer/panel_file_explorer.gml @@ -366,7 +366,7 @@ function Panel_File_Explorer() : PanelContent() constructor { } if(!_dropped) - o_main.load_file_path(path_dragging); + load_file_path(path_dragging); } if(_file_focus != file_focus) @@ -551,7 +551,7 @@ function Panel_File_Explorer() : PanelContent() constructor { } if(pFOCUS && DOUBLE_CLICK) - o_main.load_file_path([ _fil.path ], _graph_x, _graph_y); + load_file_path([ _fil.path ], _graph_x, _graph_y); } if(sprite_exists(_th)) { @@ -631,7 +631,7 @@ function Panel_File_Explorer() : PanelContent() constructor { } if(pFOCUS && DOUBLE_CLICK) - o_main.load_file_path([ _fil.path ], _graph_x, _graph_y); + load_file_path([ _fil.path ], _graph_x, _graph_y); } if(sprite_exists(_th)) { diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 90f246afe..9f6890696 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -803,8 +803,6 @@ function Panel_Inspector() : PanelContent() constructor { } else if(is_instanceof(jun, Inspector_Custom_Renderer)) { if(jun.popupPanel != noone) { - // draw_sprite_stretched_ext(THEME.ui_panel, 0, ui(16), yy, con_w - ui(32), ui(24), COLORS._main_icon, .05); - // draw_sprite_stretched_ext(THEME.ui_panel, 1, ui(16), yy, con_w - ui(32), ui(24), COLORS._main_icon, .2); draw_set_text(f_p2, fa_center, fa_center, COLORS._main_icon, .5); draw_text_add(con_w / 2, yy + ui(24) / 2 - ui(2), __txt("Pop-up content")); draw_set_alpha(1); @@ -930,7 +928,7 @@ function Panel_Inspector() : PanelContent() constructor { if(!is_instanceof(jun, NodeValue)) continue; - if(!jun.show_in_inspector || jun.type == VALUE_TYPE.object) continue; + if(!jun.show_in_inspector) continue; if(filter_text != "") { var pos = string_pos(filter_text, string_lower(jun.getName())); if(pos == 0) continue; diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index e06a59268..e717d6176 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -1780,7 +1780,7 @@ function Panel_Preview() : PanelContent() constructor { var thov = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, toolbar_width, h - toolbar_height); if(thov) canvas_hover = false; - for(var i = 0; i < array_length(_node.tools); i++) { // left tools + for(var i = 0; i < array_length(_node.tools); i++) { //// left tools var tool = _node.tools[i]; var _x0 = xx - tool_size / 2; var _y0 = yy - tool_size / 2; @@ -1890,7 +1890,7 @@ function Panel_Preview() : PanelContent() constructor { var thov = pHOVER && point_in_rectangle(mx, my, _tbx, toolbar_height, w, h - toolbar_height); if(thov) canvas_hover = false; - for(var i = 0; i < array_length(_node.rightTools); i++) { // right tools + for(var i = 0; i < array_length(_node.rightTools); i++) { //// right tools var tool = _node.rightTools[i]; var _x0 = xx - tool_size / 2; var _y0 = yy - tool_size / 2; diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index 523c39f8e..fde2ac43b 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -353,9 +353,9 @@ function surface_reset_target_override() { __surface_reset_target(); winwin_draw if(ww == width && hh == height) return surface; - surface_resize(surface, width, height); - //surface_clear(surface); - + surface_free(surface); + surface = surface_create(width, height, format == noone? surface_rgba8unorm : format); + return surface; } diff --git a/scripts/tiler_tool_brush/tiler_tool_brush.gml b/scripts/tiler_tool_brush/tiler_tool_brush.gml index dde8fbbf2..a1412800e 100644 --- a/scripts/tiler_tool_brush/tiler_tool_brush.gml +++ b/scripts/tiler_tool_brush/tiler_tool_brush.gml @@ -60,8 +60,6 @@ function tiler_tool_brush(node, _brush, eraser = false) : tiler_tool(node) const _auto.drawing_start(drawing_surface, isEraser); tiler_draw_point_brush(brush, mouse_cur_x, mouse_cur_y, false); _auto.drawing_end(); - - apply_draw_surface(); } mouse_holding = true; diff --git a/shaders/sh_sample/sh_sample.fsh b/shaders/sh_sample/sh_sample.fsh index c4aa7dc1f..d3d074c39 100644 --- a/shaders/sh_sample/sh_sample.fsh +++ b/shaders/sh_sample/sh_sample.fsh @@ -93,5 +93,5 @@ varying vec2 v_vTexcoord; varying vec4 v_vColour; void main() { - gl_FragColor = sampleTexture( gm_BaseTexture, v_vTexcoord ) * v_vColour; + gl_FragColor = sampleTexture( gm_BaseTexture, v_vTexcoord ); } \ No newline at end of file diff --git a/shaders/sh_tile_rule_apply/sh_tile_rule_apply.fsh b/shaders/sh_tile_rule_apply/sh_tile_rule_apply.fsh index b2d6be08b..edc6638cd 100644 --- a/shaders/sh_tile_rule_apply/sh_tile_rule_apply.fsh +++ b/shaders/sh_tile_rule_apply/sh_tile_rule_apply.fsh @@ -8,6 +8,7 @@ uniform float seed; uniform float probability; uniform vec2 size; +uniform vec2 scanSize; uniform int range; uniform float selection[64]; @@ -53,12 +54,23 @@ void main() { vec2 origin = v_vTexcoord; int repShf = -1; - for(int i = 0; i < int(size.y); i++) - for(int j = 0; j < int(size.x); j++) { - vec2 o = v_vTexcoord - vec2(j, i) * tx; + vec2 px = floor(v_vTexcoord * dimension); + vec2 blockCoord = mod(px, scanSize); + vec2 scanLeft = max(vec2(0.), size - scanSize) + 1.; + + // for(int i = 0; i < int(scanSize.y); i++) + // for(int j = 0; j < int(scanSize.x); j++) { + // vec2 o = v_vTexcoord - vec2(j, i) * tx; + + for(int i = 0; i < int(scanLeft.y); i++) + for(int j = 0; j < int(scanLeft.x); j++) { + vec2 shfCoord = blockCoord + vec2(j, i); + if(shfCoord.x >= size.x || shfCoord.y >= size.y) continue; + + vec2 o = v_vTexcoord - shfCoord * tx; if(match(o)) { origin = o; - repShf = i * int(size.x) + j; + repShf = int(shfCoord.y * size.x + shfCoord.x); break; } } diff --git a/shaders/sh_tile_rule_select/sh_tile_rule_select.fsh b/shaders/sh_tile_rule_select/sh_tile_rule_select.fsh index 89eb6fed2..ad57bf9db 100644 --- a/shaders/sh_tile_rule_select/sh_tile_rule_select.fsh +++ b/shaders/sh_tile_rule_select/sh_tile_rule_select.fsh @@ -2,7 +2,8 @@ varying vec2 v_vTexcoord; varying vec4 v_vColour; uniform vec2 dimension; -uniform int range; + +uniform int selectionSize; uniform float selection[64]; uniform float selectionGroup[640]; @@ -14,20 +15,18 @@ void main() { if(bs == -1.) return; - int _r = range * 2 + 1; - for(int i = 0; i < _r; i++) - for(int j = 0; j < _r; j++) { - float selInd = selection[i * _r + j]; + for(int i = 0; i < selectionSize; i++) { + float selInd = selection[i]; if(selInd < 10000.) continue; int _arr = int(selInd - 10000.); int _len = int(selectionGroup[_arr * 64]); for(int k = 0; k < _len; k++) { - float _selInd = selectionGroup[_arr * 64 + 1 + k]; - if(_selInd == -1.) continue; + float _subI = selectionGroup[_arr * 64 + 1 + k]; + if(_subI == -1.) continue; - if(bs == _selInd) { + if(bs == _subI) { gl_FragColor = vec4(selInd, 0., 0., 1.); return; } diff --git a/shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.fsh b/shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.fsh index 5ebf13ba9..c0e57b292 100644 --- a/shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.fsh +++ b/shaders/sh_tiler_autoterrain_apply/sh_tiler_autoterrain_apply.fsh @@ -326,7 +326,7 @@ void main() { if(_1(i0) && _1(i1) && _1(i2) && _1(i3) && _1(i5) && - _0(i6) && _1(i7) && _0(i8)) index = 8; + _0(i6) && _1(i7) && _0(i8)) index = 19; if(_0(i0) && _1(i1) && _0(i2) && _1(i3) && _1(i5) && @@ -370,7 +370,7 @@ void main() { _1(i3) && _1(i5) && _0(i6) && _1(i7) && _0(i8)) index = 52; - if(bitmaskType == 2) index = indexMapper48[index]; + if(bitmaskType == 3) index = indexMapper48[index]; } float res = float(indexes[index]); diff --git a/shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.fsh b/shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.fsh index 2138cf194..8ca1629f4 100644 --- a/shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.fsh +++ b/shaders/sh_tiler_autoterrain_mask/sh_tiler_autoterrain_mask.fsh @@ -13,6 +13,7 @@ void main() { vec4 res = vec4(0.); for(int i = 0; i < indexSize; i++) { + if(indexes[i] == -1) continue; if(ss == indexes[i]) res[0] = .5; } diff --git a/shaders/sh_tiler_convert/sh_tiler_convert.fsh b/shaders/sh_tiler_convert/sh_tiler_convert.fsh new file mode 100644 index 000000000..b03a6b583 --- /dev/null +++ b/shaders/sh_tiler_convert/sh_tiler_convert.fsh @@ -0,0 +1,16 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec4 colorFrom[1024]; +uniform float colorTo[1024]; +uniform int colorAmount; + +void main() { + vec4 base = texture2D( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = base; + + for(int i = 0; i < colorAmount; i++) { + if(base == colorFrom[i]) + gl_FragColor = vec4(colorTo[i], 0., 0., 1.); + } +} diff --git a/shaders/sh_tiler_convert/sh_tiler_convert.vsh b/shaders/sh_tiler_convert/sh_tiler_convert.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_tiler_convert/sh_tiler_convert.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_tiler_convert/sh_tiler_convert.yy b/shaders/sh_tiler_convert/sh_tiler_convert.yy new file mode 100644 index 000000000..57bd03a4b --- /dev/null +++ b/shaders/sh_tiler_convert/sh_tiler_convert.yy @@ -0,0 +1,12 @@ +{ + "$GMShader":"", + "%Name":"sh_tiler_convert", + "name":"sh_tiler_convert", + "parent":{ + "name":"shaders", + "path":"folders/nodes/data/tiler/shaders.yy", + }, + "resourceType":"GMShader", + "resourceVersion":"2.0", + "type":1, +} \ No newline at end of file diff --git a/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.fsh b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.fsh new file mode 100644 index 000000000..48272837c --- /dev/null +++ b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.fsh @@ -0,0 +1,10 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec4 target; +uniform float replace; + +void main() { + vec4 base = texture2D( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = base == target? vec4(replace, 0., 0., 1.) : vec4(0.); +} diff --git a/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.vsh b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.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_tiler_convert_mask/sh_tiler_convert_mask.yy b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.yy new file mode 100644 index 000000000..5e8b2a748 --- /dev/null +++ b/shaders/sh_tiler_convert_mask/sh_tiler_convert_mask.yy @@ -0,0 +1,12 @@ +{ + "$GMShader":"", + "%Name":"sh_tiler_convert_mask", + "name":"sh_tiler_convert_mask", + "parent":{ + "name":"shaders", + "path":"folders/nodes/data/tiler/shaders.yy", + }, + "resourceType":"GMShader", + "resourceVersion":"2.0", + "type":1, +} \ No newline at end of file diff --git a/sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy b/sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy index c96f82246..25c74f88b 100644 --- a/sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy +++ b/sprites/s_autoterrain_5x5/s_autoterrain_5x5.yy @@ -23,7 +23,7 @@ ], "name":"s_autoterrain_5x5", "nineSlice":null, - "origin":4, + "origin":0, "parent":{ "name":"sprites", "path":"folders/nodes/data/tiler/sprites.yy", @@ -75,8 +75,8 @@ ], "visibleRange":null, "volume":1.0, - "xorigin":10, - "yorigin":10, + "xorigin":0, + "yorigin":0, }, "swatchColours":null, "swfPrecision":0.5, diff --git a/sprites/s_junc_aseprite/e60e12c6-85ae-4302-b2e9-d2f935920dd9.png b/sprites/s_junc_aseprite/e60e12c6-85ae-4302-b2e9-d2f935920dd9.png new file mode 100644 index 0000000000000000000000000000000000000000..227b983dc98aec4df66a42f98b9c79c9b69f738f GIT binary patch literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbB6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_HUsu3@kvn$XBD8ZKG?e4%cSa{=v<9EpDOAW@Z8%uUg_7QIe8al4_M)lnSI6j0}uSbPWx3jSWK# zjI2z|tPD)G4GgRd4BWZrcA#j;%}>cptHiCrEKJn|s6hj6LrG?CYH>+oZUJsRiOwvq QfqED`UHx3vIVCg!09w$F0{{R3 literal 0 HcmV?d00001 diff --git a/sprites/s_junc_aseprite/layers/e60e12c6-85ae-4302-b2e9-d2f935920dd9/ad507ec9-d601-44ba-b597-d2c2e78911f3.png b/sprites/s_junc_aseprite/layers/e60e12c6-85ae-4302-b2e9-d2f935920dd9/ad507ec9-d601-44ba-b597-d2c2e78911f3.png new file mode 100644 index 0000000000000000000000000000000000000000..227b983dc98aec4df66a42f98b9c79c9b69f738f GIT binary patch literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbB6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_HUsu3@kvn$XBD8ZKG?e4%cSa{=v<9EpDOAW@Z8%uUg_7QIe8al4_M)lnSI6j0}uSbPWx3jSWK# zjI2z|tPD)G4GgRd4BWZrcA#j;%}>cptHiCrEKJn|s6hj6LrG?CYH>+oZUJsRiOwvq QfqED`UHx3vIVCg!09w$F0{{R3 literal 0 HcmV?d00001 diff --git a/sprites/s_junc_aseprite/s_junc_aseprite.yy b/sprites/s_junc_aseprite/s_junc_aseprite.yy new file mode 100644 index 000000000..8bc314f1e --- /dev/null +++ b/sprites/s_junc_aseprite/s_junc_aseprite.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_junc_aseprite", + "bboxMode":0, + "bbox_bottom":35, + "bbox_left":0, + "bbox_right":35, + "bbox_top":0, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":36, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"ad507ec9-d601-44ba-b597-d2c2e78911f3","blendMode":0,"displayName":"default","isLocked":false,"name":"ad507ec9-d601-44ba-b597-d2c2e78911f3","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_junc_aseprite", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"junctions", + "path":"folders/sprites/nodes/junctions.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_junc_aseprite", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_junc_aseprite", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"e60e12c6-85ae-4302-b2e9-d2f935920dd9","path":"sprites/s_junc_aseprite/s_junc_aseprite.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"d9c71224-4acb-4ee4-b5d1-eaebd6549e14","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":18, + "yorigin":18, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":36, +} \ No newline at end of file diff --git a/sprites/s_node_tileset_convert/2b2af290-4ca4-4009-bebd-c6bc119ed291.png b/sprites/s_node_tileset_convert/2b2af290-4ca4-4009-bebd-c6bc119ed291.png new file mode 100644 index 0000000000000000000000000000000000000000..2fe8dfc3cacb26260eaf93a915f4b57a5e846b1e GIT binary patch literal 1348 zcmZ{keKga19LK-2j8M1IWpm3dqEXmJd1}(_$A+SIEQ*+B#BH003DaeHxQB$hJeFce z%tcBpPdn7PWIbRVu7`Q(lE>yTWghSP=bm%_=zPxS^FHVOIj{5n=W{+u=bQ;URJ2q8 z06QFr5J|4K-&z?VpJf5TLvlGlC6dkpz}5$V6A!?u+~Q0E5QYI@ngW1T4gi`#_v_D} zkS`EdoCpxu`c}NAl5_yJnL9wITqF9Wxx+3VG-TUJmt;B`|8TFp?BF5sli<-;e^@FW z-hSvF?l?|;)VOgTQMB;lWQ)us;$YWcz(2%BjQ&z93V4Ag&qMp6AoO5Xl7b$)y#VjZZJ zh?kbOf~Lf@!Y;dvr#82U^DyqnOV>rJY<@}gLRvw_o{`8Ao%urkBw;t|=AbFBLlO}< zjZ;ptX*!8y+(T~E)GUJ!Fe?`nZ&WMMlTa!oSj@y;D%L;oB2EDy|m8@d5nbsia}Y42z~?X8RLaOl{LDT}@!89l_Xn~a1>wzwxx7S-g~hzHD3t!bS;NxHbb1A2&X#N1JhL1!{>Hs!yqXpANtgD(FN4IKu>LIc z=lCFRr=;vr-ge8B*^~v$K0H-ZP5UyaZikd{I|h z1w%@CD!dUVUUhZc!a{Y{T>;6_;K~yMf9%7J{=H^!Hk*yqvPyXUQKAPG49Ftk7Qu!2 zo12=fwQA2uc-8y$Pm+Bnx9S2Nyi-zOFFpv$l_(`WJw5K8Po~dHuAi!T5QWVqrslxb zxIRc$7;ShG4vUe&=GQjj^R`Px9vACebar?2*+ZM*e@%td89=Fkf?R%PE*&~{$$Pk0 zokI@U#@Rq?yHqtcW@P4{(LhvOgPn+8PizREs9rQT&lUa9+!U28xlNxH4fOXLw)duj zs-~v1I^0fNtu7e5(>7Yrur`?&#u&~!qLNnxOC+-W`;5t3+oyL@O!U$nF1S&ndd}Mk z-;G}dNl>hH_-1X`?P)#veQ+pM+?OpAz}-8BXr@(h6nH((W;5}i-PdPEcBZ?#INyA% zo2v`V5HnMZC=E_Z%7M3UTZOB9KHnz@v!VU@D-F&oGKJdOsaeaKX>H~wv^x%GDdgN= ze?xlj@=o>BA?@;Yn53$7<|pm63Dw>0zougk1MVIn)@JRsV6op?)6uNo_-+h>Iv!hF zd(H=M>F&r6vcJIQ2Ou!i%HYj)q*QtkiVw*oiHb9(6@?=7Dt@`;hTkNfLJIHH6D#Q~ z2IzAfEsuXa5@a~jD{*eM%)9@mb?H6C5GG%{Vx_2>Os?OA_YvLjOy!5R@~5K5vU6wo z`mktL)DW6n01ksQGs0qxFj!ZNnbk3KE1bm<48{tBVW6Ev{{!eu-vGbJ?*l)FEnSxb g=>HN}0d!g@%ZDEHeTGO8^W_Y1uyckgf1$+w3-^>@00000 literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_convert/layers/2b2af290-4ca4-4009-bebd-c6bc119ed291/dd5525f9-b3ac-44fa-956f-a9edd94d6045.png b/sprites/s_node_tileset_convert/layers/2b2af290-4ca4-4009-bebd-c6bc119ed291/dd5525f9-b3ac-44fa-956f-a9edd94d6045.png new file mode 100644 index 0000000000000000000000000000000000000000..2fe8dfc3cacb26260eaf93a915f4b57a5e846b1e GIT binary patch literal 1348 zcmZ{keKga19LK-2j8M1IWpm3dqEXmJd1}(_$A+SIEQ*+B#BH003DaeHxQB$hJeFce z%tcBpPdn7PWIbRVu7`Q(lE>yTWghSP=bm%_=zPxS^FHVOIj{5n=W{+u=bQ;URJ2q8 z06QFr5J|4K-&z?VpJf5TLvlGlC6dkpz}5$V6A!?u+~Q0E5QYI@ngW1T4gi`#_v_D} zkS`EdoCpxu`c}NAl5_yJnL9wITqF9Wxx+3VG-TUJmt;B`|8TFp?BF5sli<-;e^@FW z-hSvF?l?|;)VOgTQMB;lWQ)us;$YWcz(2%BjQ&z93V4Ag&qMp6AoO5Xl7b$)y#VjZZJ zh?kbOf~Lf@!Y;dvr#82U^DyqnOV>rJY<@}gLRvw_o{`8Ao%urkBw;t|=AbFBLlO}< zjZ;ptX*!8y+(T~E)GUJ!Fe?`nZ&WMMlTa!oSj@y;D%L;oB2EDy|m8@d5nbsia}Y42z~?X8RLaOl{LDT}@!89l_Xn~a1>wzwxx7S-g~hzHD3t!bS;NxHbb1A2&X#N1JhL1!{>Hs!yqXpANtgD(FN4IKu>LIc z=lCFRr=;vr-ge8B*^~v$K0H-ZP5UyaZikd{I|h z1w%@CD!dUVUUhZc!a{Y{T>;6_;K~yMf9%7J{=H^!Hk*yqvPyXUQKAPG49Ftk7Qu!2 zo12=fwQA2uc-8y$Pm+Bnx9S2Nyi-zOFFpv$l_(`WJw5K8Po~dHuAi!T5QWVqrslxb zxIRc$7;ShG4vUe&=GQjj^R`Px9vACebar?2*+ZM*e@%td89=Fkf?R%PE*&~{$$Pk0 zokI@U#@Rq?yHqtcW@P4{(LhvOgPn+8PizREs9rQT&lUa9+!U28xlNxH4fOXLw)duj zs-~v1I^0fNtu7e5(>7Yrur`?&#u&~!qLNnxOC+-W`;5t3+oyL@O!U$nF1S&ndd}Mk z-;G}dNl>hH_-1X`?P)#veQ+pM+?OpAz}-8BXr@(h6nH((W;5}i-PdPEcBZ?#INyA% zo2v`V5HnMZC=E_Z%7M3UTZOB9KHnz@v!VU@D-F&oGKJdOsaeaKX>H~wv^x%GDdgN= ze?xlj@=o>BA?@;Yn53$7<|pm63Dw>0zougk1MVIn)@JRsV6op?)6uNo_-+h>Iv!hF zd(H=M>F&r6vcJIQ2Ou!i%HYj)q*QtkiVw*oiHb9(6@?=7Dt@`;hTkNfLJIHH6D#Q~ z2IzAfEsuXa5@a~jD{*eM%)9@mb?H6C5GG%{Vx_2>Os?OA_YvLjOy!5R@~5K5vU6wo z`mktL)DW6n01ksQGs0qxFj!ZNnbk3KE1bm<48{tBVW6Ev{{!eu-vGbJ?*l)FEnSxb g=>HN}0d!g@%ZDEHeTGO8^W_Y1uyckgf1$+w3-^>@00000 literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_convert/s_node_tileset_convert.yy b/sprites/s_node_tileset_convert/s_node_tileset_convert.yy new file mode 100644 index 000000000..dec56406c --- /dev/null +++ b/sprites/s_node_tileset_convert/s_node_tileset_convert.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_node_tileset_convert", + "bboxMode":0, + "bbox_bottom":61, + "bbox_left":2, + "bbox_right":61, + "bbox_top":2, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"2b2af290-4ca4-4009-bebd-c6bc119ed291","name":"2b2af290-4ca4-4009-bebd-c6bc119ed291","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":64, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"dd5525f9-b3ac-44fa-956f-a9edd94d6045","blendMode":0,"displayName":"default","isLocked":false,"name":"dd5525f9-b3ac-44fa-956f-a9edd94d6045","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_node_tileset_convert", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"tiler", + "path":"folders/nodes/icons/tiler.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_node_tileset_convert", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_tileset_convert", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"2b2af290-4ca4-4009-bebd-c6bc119ed291","path":"sprites/s_node_tileset_convert/s_node_tileset_convert.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"c9ce5eed-61a3-4e84-9161-ed132eb34016","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file diff --git a/sprites/s_node_tileset_render/a00816be-bfcb-4955-ac04-53eccc761f8a.png b/sprites/s_node_tileset_render/a00816be-bfcb-4955-ac04-53eccc761f8a.png new file mode 100644 index 0000000000000000000000000000000000000000..e9a0ddcf99913e59db8a832214c0d94a586ce25c GIT binary patch literal 1479 zcmZ{kc{CJy6vuzFkiAKz8e*oR!NXt}rqU$Fk|oPzRE%OUSw_tBEGax|>h;DhqQ#Q! zS;mrV9a0_P)yO&&Sz?&*yos?qZ~Et*^Zw}EbMN<@d++DmbMGHF`MjNltQ1lT03d5+ zY33+W;&+!27sWFA^^YP!d0IN!0uZ4FKy(}c8=_S78~{IK0pNK6K*$E*Kv3Ruhm)d$ z_|gQKI2GNBKSq z;eur3SO;?p?aXbWwQnWb>DM!NX(KaX`5lw=i z()r5Qnp2V=xV3y6%`T|peC=u0Uo|!Nnav?u4Fr!&1<8U+i2E__9q+laz-?V6lhR zs0yYhF>$M1sp(jJIL>0dK{L*E;&2 z%zAG(&|nYWX@r9sicKS*lX{a|3&EZ`{60W2d9G1Q5lk*0W3$;+btxpDwK|lj4>U3o zlSu5dNhBZ9P=4uREk*Lx)b)gfK!gNyVpYgtZ*v^)SQbJvJJjPl)5486^)k8;m_j)~ z83*M>($VR)*4DzJ^uHeAtXe+(qDsCQ6%|E?fi}=4{!zp1=)U%XCl;_w@J><81V*8R zb?|s0P8y+IgLLbBY4jYA5Ys>J<-h3e0GZ=M_|fz}A1CavmFOOZmsX04Q*+__%^y`Q z;X)&AX;82nHYOwUx08#D%kp!XN_Z7@XQb}7{qPs#{3$dZhYR{=3*Z@Y?3R|xNT6`w zfNlA@>y*B4Pry`=(cIEbHj72g$q|;IfOW8hFWJqlx76vlw1Qg7H@#^lfzDVfsoKr3 zi`j4hxeVegleTjOjduyv@;O0IhBDA{c zGNZbtMn6tfo=Zr<*v^Y#p?Qlu-ZA-{Pr9tGsk=D*30aphWI^n+wxLN!5cG3osFs>0|Q+eBV!^CB4*&sBZP(tIxqGouV7|)~*eHVraOsy>yoL zgSS0Mdv2j!VR`}dlk520k@*nx%f=j_LF0}sy;yPM&ZbJjwi>Gf+j-hScFmD>pBwv> zpK=5`QYQz7+Hb!|7yUI=ra6V_b%jYIcm~r%0`#zYI4xaWEv&9H7Dq6^6ZCX7u~-5Y zyIC!F=zl-}!;9`6{$t=azoAG3VE&uHqzBMKm{$UVe$0%oXGMq@U}bJ+_J^rQ?7zAa BhY0`x literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png b/sprites/s_node_tileset_render/e3ed7e8b-cdba-4e78-ad91-517384a46d66.png deleted file mode 100644 index 7aeac961591ec8c3a0947c9d27cb0280f998838f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1288 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfr0tAr;B4q#jUrqFXmqk z6KUT+TX(US)GZfISu**jALtotTgJp2CS$2^()pP$aFUiUVp zLciSGWL`k%SLOt%9UMy<9_E!_S~QROdt-dV{8oYgrmPEAy*hqi{ekIs-);5X#lECf zV0AUan?Ikn|F)>GZCSr%;)9E(KD!kv%97?>vwPw0z$S6oZhy_rqnp!bhphg8>r(fL z$Fp0e=P?=VmP;u6n{a!*B8!Zj&7q~MQWPPTXp=E;nR}~gF?4v&emqw^!p-zSXz3Gv0=O&-l{btTE|NQYIMEc$C3;$ ze|8LJ;Fq)6BHAEwtL4JKvRf_bF714h+pk{vteLRAO3qR*>cDJW{rGBau*J(9(@B@6$Hzs#GYL2q{Q6=($L43NHDiX?Qa=Mj!?xp> zcjkQ+VQ5G(I{D;Dxs1h!iPnq^CpNiQ*&coHU;&WL((I@g;~~r^U72@f*Q{v=TUoRH zTSB&`?JTyN-@kI@<}+vio|~-hZ_S;M{d%jexQX`q>!)WL-!FQ7EmzL=)YiN8=a(H= z=T~L3ZR*Lsd%Rwgd=xhPwQnfM<-D@rx7L2Dm7{`zhuLrTt+T$0ytZg)Y-IdXXU}kN zmH4V>wJMW6ft>5>|GRC?vh|gn$kaP&$+xMV?o18lsYXH@!_;KC8Md8%va>kdvg(U) zIY@ZZ)!m-QnHjQEH|aBEWIfH>v^cdO^JU@R3Y9GjF&6*mfwmxpIVaok*WrxWs zo^83mg&HJx$~j!NRFKH|yYj=aV{W&vy^3WP=->V?E+O%u;?}7AJAUuguP<+S&G_ZW z?T7ZypU<58d$soUvcDV`m@C%hbF|*t-@G`QtNnY(mS1Tcwhh0lx`UV7DT`Qj2rw=8 z;%L4a!ulN-CxVN7g#W;mbgZgq$HN4S|t~y0x1R~10xe%Ljzr7 zgAfCADnC}Q!>*kacg*%zqJFXK?80>NoHh;DhqQ#Q! zS;mrV9a0_P)yO&&Sz?&*yos?qZ~Et*^Zw}EbMN<@d++DmbMGHF`MjNltQ1lT03d5+ zY33+W;&+!27sWFA^^YP!d0IN!0uZ4FKy(}c8=_S78~{IK0pNK6K*$E*Kv3Ruhm)d$ z_|gQKI2GNBKSq z;eur3SO;?p?aXbWwQnWb>DM!NX(KaX`5lw=i z()r5Qnp2V=xV3y6%`T|peC=u0Uo|!Nnav?u4Fr!&1<8U+i2E__9q+laz-?V6lhR zs0yYhF>$M1sp(jJIL>0dK{L*E;&2 z%zAG(&|nYWX@r9sicKS*lX{a|3&EZ`{60W2d9G1Q5lk*0W3$;+btxpDwK|lj4>U3o zlSu5dNhBZ9P=4uREk*Lx)b)gfK!gNyVpYgtZ*v^)SQbJvJJjPl)5486^)k8;m_j)~ z83*M>($VR)*4DzJ^uHeAtXe+(qDsCQ6%|E?fi}=4{!zp1=)U%XCl;_w@J><81V*8R zb?|s0P8y+IgLLbBY4jYA5Ys>J<-h3e0GZ=M_|fz}A1CavmFOOZmsX04Q*+__%^y`Q z;X)&AX;82nHYOwUx08#D%kp!XN_Z7@XQb}7{qPs#{3$dZhYR{=3*Z@Y?3R|xNT6`w zfNlA@>y*B4Pry`=(cIEbHj72g$q|;IfOW8hFWJqlx76vlw1Qg7H@#^lfzDVfsoKr3 zi`j4hxeVegleTjOjduyv@;O0IhBDA{c zGNZbtMn6tfo=Zr<*v^Y#p?Qlu-ZA-{Pr9tGsk=D*30aphWI^n+wxLN!5cG3osFs>0|Q+eBV!^CB4*&sBZP(tIxqGouV7|)~*eHVraOsy>yoL zgSS0Mdv2j!VR`}dlk520k@*nx%f=j_LF0}sy;yPM&ZbJjwi>Gf+j-hScFmD>pBwv> zpK=5`QYQz7+Hb!|7yUI=ra6V_b%jYIcm~r%0`#zYI4xaWEv&9H7Dq6^6ZCX7u~-5Y zyIC!F=zl-}!;9`6{$t=azoAG3VE&uHqzBMKm{$UVe$0%oXGMq@U}bJ+_J^rQ?7zAa BhY0`x literal 0 HcmV?d00001 diff --git a/sprites/s_node_tileset_render/layers/e3ed7e8b-cdba-4e78-ad91-517384a46d66/1edcfe67-256c-45b7-a151-3e2c838774e2.png b/sprites/s_node_tileset_render/layers/e3ed7e8b-cdba-4e78-ad91-517384a46d66/1edcfe67-256c-45b7-a151-3e2c838774e2.png deleted file mode 100644 index 7aeac961591ec8c3a0947c9d27cb0280f998838f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1288 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=3dtTpz6=aiY77hwEes65fI|H*Yfr0tAr;B4q#jUrqFXmqk z6KUT+TX(US)GZfISu**jALtotTgJp2CS$2^()pP$aFUiUVp zLciSGWL`k%SLOt%9UMy<9_E!_S~QROdt-dV{8oYgrmPEAy*hqi{ekIs-);5X#lECf zV0AUan?Ikn|F)>GZCSr%;)9E(KD!kv%97?>vwPw0z$S6oZhy_rqnp!bhphg8>r(fL z$Fp0e=P?=VmP;u6n{a!*B8!Zj&7q~MQWPPTXp=E;nR}~gF?4v&emqw^!p-zSXz3Gv0=O&-l{btTE|NQYIMEc$C3;$ ze|8LJ;Fq)6BHAEwtL4JKvRf_bF714h+pk{vteLRAO3qR*>cDJW{rGBau*J(9(@B@6$Hzs#GYL2q{Q6=($L43NHDiX?Qa=Mj!?xp> zcjkQ+VQ5G(I{D;Dxs1h!iPnq^CpNiQ*&coHU;&WL((I@g;~~r^U72@f*Q{v=TUoRH zTSB&`?JTyN-@kI@<}+vio|~-hZ_S;M{d%jexQX`q>!)WL-!FQ7EmzL=)YiN8=a(H= z=T~L3ZR*Lsd%Rwgd=xhPwQnfM<-D@rx7L2Dm7{`zhuLrTt+T$0ytZg)Y-IdXXU}kN zmH4V>wJMW6ft>5>|GRC?vh|gn$kaP&$+xMV?o18lsYXH@!_;KC8Md8%va>kdvg(U) zIY@ZZ)!m-QnHjQEH|aBEWIfH>v^cdO^JU@R3Y9GjF&6*mfwmxpIVaok*WrxWs zo^83mg&HJx$~j!NRFKH|yYj=aV{W&vy^3WP=->V?E+O%u;?}7AJAUuguP<+S&G_ZW z?T7ZypU<58d$soUvcDV`m@C%hbF|*t-@G`QtNnY(mS1Tcwhh0lx`UV7DT`Qj2rw=8 z;%L4a!ulN-CxVN7g#W;mbgZgq$HN4S|t~y0x1R~10xe%Ljzr7 zgAfCADnC}Q!>*kacg*%zqJFXK?80>NoH":"","Keyframes":[ {"$Keyframe":"","Channels":{ - "0":{"$SpriteFrameKeyframe":"","Id":{"name":"e3ed7e8b-cdba-4e78-ad91-517384a46d66","path":"sprites/s_node_tileset_render/s_node_tileset_render.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, - },"Disabled":false,"id":"9b9f013c-e20f-49dd-b336-ac74a8ca984d","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"a00816be-bfcb-4955-ac04-53eccc761f8a","path":"sprites/s_node_tileset_render/s_node_tileset_render.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"144c897b-beec-43ef-be75-f7ea83247014","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], "visibleRange":null,