diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 9b8ed7318..0f69063fb 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -1,6 +1,6 @@ { "FolderOrderSettings": [ - {"name":"_extensions","order":16,"path":"folders/_extensions.yy",}, + {"name":"_extensions","order":13,"path":"folders/_extensions.yy",}, {"name":"BBMOD","order":6,"path":"folders/_extensions/BBMOD.yy",}, {"name":"Math","order":1,"path":"folders/_extensions/BBMOD/Math.yy",}, {"name":"FireBase","order":10,"path":"folders/_extensions/FireBase.yy",}, @@ -78,6 +78,7 @@ {"name":"nodes","order":32,"path":"folders/functions/nodes.yy",}, {"name":"packing","order":30,"path":"folders/functions/packing.yy",}, {"name":"PCX","order":11,"path":"folders/functions/PCX.yy",}, + {"name":"pen input","order":46,"path":"folders/functions/pen input.yy",}, {"name":"physics","order":21,"path":"folders/functions/physics.yy",}, {"name":"project","order":37,"path":"folders/functions/project.yy",}, {"name":"shader","order":16,"path":"folders/functions/shader.yy",}, @@ -209,6 +210,7 @@ {"name":"graph","order":1,"path":"folders/panels/graph.yy",}, {"name":"inspectors","order":2,"path":"folders/panels/inspectors.yy",}, {"name":"components","order":1,"path":"folders/panels/inspectors/components.yy",}, + {"name":"nodes","order":12,"path":"folders/panels/nodes.yy",}, {"name":"preview","order":3,"path":"folders/panels/preview.yy",}, {"name":"overlay","order":2,"path":"folders/panels/preview/overlay.yy",}, {"name":"sprites","order":3,"path":"folders/panels/preview/sprites.yy",}, @@ -451,6 +453,7 @@ {"name":"sh_d3d_extrude_extends","order":26,"path":"shaders/sh_d3d_extrude_extends/sh_d3d_extrude_extends.yy",}, {"name":"scrollBox","order":13,"path":"scripts/scrollBox/scrollBox.yy",}, {"name":"o_dialog_exit","order":2,"path":"objects/o_dialog_exit/o_dialog_exit.yy",}, + {"name":"s_node_vfx_triangulate","order":15,"path":"sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy",}, {"name":"node_shape_polygon","order":6,"path":"scripts/node_shape_polygon/node_shape_polygon.yy",}, {"name":"fd_rectangle_get_collision_mask_sprite","order":4,"path":"scripts/fd_rectangle_get_collision_mask_sprite/fd_rectangle_get_collision_mask_sprite.yy",}, {"name":"node_flip","order":13,"path":"scripts/node_flip/node_flip.yy",}, @@ -750,6 +753,7 @@ {"name":"node_iterator_each_inline_output","order":2,"path":"scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.yy",}, {"name":"sh_fd_advect_material_a_16_glsl","order":2,"path":"shaders/sh_fd_advect_material_a_16_glsl/sh_fd_advect_material_a_16_glsl.yy",}, {"name":"distribution_function","order":12,"path":"scripts/distribution_function/distribution_function.yy",}, + {"name":"TabletStuff","order":16,"path":"extensions/TabletStuff/TabletStuff.yy",}, {"name":"sh_blur_radial","order":9,"path":"shaders/sh_blur_radial/sh_blur_radial.yy",}, {"name":"node_iterator_each_input","order":1,"path":"scripts/node_iterator_each_input/node_iterator_each_input.yy",}, {"name":"json_minify","order":6,"path":"scripts/json_minify/json_minify.yy",}, @@ -1671,6 +1675,7 @@ {"name":"d3d_gizmo_line_dashed","order":3,"path":"scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.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_trigger_bool","order":4,"path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",}, + {"name":"node_VFX_triangulate","order":1,"path":"scripts/node_VFX_triangulate/node_VFX_triangulate.yy",}, {"name":"panel_color","order":1,"path":"scripts/panel_color/panel_color.yy",}, {"name":"s_node_line","order":7,"path":"sprites/s_node_line/s_node_line.yy",}, {"name":"Obj_FirebaseREST_Listener_On_firestore_collection","order":2,"path":"objects/Obj_FirebaseREST_Listener_On_firestore_collection/Obj_FirebaseREST_Listener_On_firestore_collection.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 7ea9fdac6..1dd73795c 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -101,6 +101,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"nodes","folderPath":"folders/functions/nodes.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"packing","folderPath":"folders/functions/packing.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"PCX","folderPath":"folders/functions/PCX.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"pen input","folderPath":"folders/functions/pen input.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"physics","folderPath":"folders/functions/physics.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"project","folderPath":"folders/functions/project.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"shader","folderPath":"folders/functions/shader.yy",}, @@ -240,6 +241,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"graph","folderPath":"folders/panels/graph.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"inspectors","folderPath":"folders/panels/inspectors.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"components","folderPath":"folders/panels/inspectors/components.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"nodes","folderPath":"folders/panels/nodes.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"preview","folderPath":"folders/panels/preview.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"overlay","folderPath":"folders/panels/preview/overlay.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/panels/preview/sprites.yy",}, @@ -667,6 +669,7 @@ {"id":{"name":"sh_d3d_extrude_extends","path":"shaders/sh_d3d_extrude_extends/sh_d3d_extrude_extends.yy",},}, {"id":{"name":"scrollBox","path":"scripts/scrollBox/scrollBox.yy",},}, {"id":{"name":"o_dialog_exit","path":"objects/o_dialog_exit/o_dialog_exit.yy",},}, + {"id":{"name":"s_node_vfx_triangulate","path":"sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy",},}, {"id":{"name":"node_shape_polygon","path":"scripts/node_shape_polygon/node_shape_polygon.yy",},}, {"id":{"name":"fd_rectangle_get_collision_mask_sprite","path":"scripts/fd_rectangle_get_collision_mask_sprite/fd_rectangle_get_collision_mask_sprite.yy",},}, {"id":{"name":"node_flip","path":"scripts/node_flip/node_flip.yy",},}, @@ -1001,6 +1004,7 @@ {"id":{"name":"node_iterator_each_inline_output","path":"scripts/node_iterator_each_inline_output/node_iterator_each_inline_output.yy",},}, {"id":{"name":"sh_fd_advect_material_a_16_glsl","path":"shaders/sh_fd_advect_material_a_16_glsl/sh_fd_advect_material_a_16_glsl.yy",},}, {"id":{"name":"distribution_function","path":"scripts/distribution_function/distribution_function.yy",},}, + {"id":{"name":"TabletStuff","path":"extensions/TabletStuff/TabletStuff.yy",},}, {"id":{"name":"sh_blur_radial","path":"shaders/sh_blur_radial/sh_blur_radial.yy",},}, {"id":{"name":"node_blur","path":"scripts/node_blur/node_blur.yy",},}, {"id":{"name":"node_iterator_each_input","path":"scripts/node_iterator_each_input/node_iterator_each_input.yy",},}, @@ -1058,6 +1062,7 @@ {"id":{"name":"sh_draw_surface","path":"shaders/sh_draw_surface/sh_draw_surface.yy",},}, {"id":{"name":"sh_warp_4points_pers","path":"shaders/sh_warp_4points_pers/sh_warp_4points_pers.yy",},}, {"id":{"name":"node_mirror","path":"scripts/node_mirror/node_mirror.yy",},}, + {"id":{"name":"__initPen","path":"scripts/__initPen/__initPen.yy",},}, {"id":{"name":"node_corner","path":"scripts/node_corner/node_corner.yy",},}, {"id":{"name":"node_3d_mesh_cylinder","path":"scripts/node_3d_mesh_cylinder/node_3d_mesh_cylinder.yy",},}, {"id":{"name":"__vertex_function","path":"scripts/__vertex_function/__vertex_function.yy",},}, @@ -2053,6 +2058,8 @@ {"id":{"name":"d3d_gizmo_line_dashed","path":"scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.yy",},}, {"id":{"name":"s_node_3d_camera_set","path":"sprites/s_node_3d_camera_set/s_node_3d_camera_set.yy",},}, {"id":{"name":"s_node_trigger_bool","path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",},}, + {"id":{"name":"panel_node_canvas_pressure","path":"scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.yy",},}, + {"id":{"name":"node_VFX_triangulate","path":"scripts/node_VFX_triangulate/node_VFX_triangulate.yy",},}, {"id":{"name":"panel_color","path":"scripts/panel_color/panel_color.yy",},}, {"id":{"name":"s_node_line","path":"sprites/s_node_line/s_node_line.yy",},}, {"id":{"name":"Obj_FirebaseREST_Listener_On_firestore_collection","path":"objects/Obj_FirebaseREST_Listener_On_firestore_collection/Obj_FirebaseREST_Listener_On_firestore_collection.yy",},}, diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 2f2fee848..8433d2ea7 100644 Binary files a/datafiles/data/Theme.zip and b/datafiles/data/Theme.zip differ diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index cc01448ad..8554ae3bd 100644 Binary files a/fonts/_f_sdf/_f_sdf.old.png and b/fonts/_f_sdf/_f_sdf.old.png differ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index f45dc6180..56410dca4 100644 Binary files a/fonts/_f_sdf/_f_sdf.png and b/fonts/_f_sdf/_f_sdf.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index a4b2a4d0c..80082c64e 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.old.png and b/fonts/_f_sdf_medium/_f_sdf_medium.old.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 61d40cdbd..12ccd970e 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.png and b/fonts/_f_sdf_medium/_f_sdf_medium.png differ diff --git a/objects/addon_key_displayer/Create_0.gml b/objects/addon_key_displayer/Create_0.gml index fad7b6928..2fa8ae189 100644 --- a/objects/addon_key_displayer/Create_0.gml +++ b/objects/addon_key_displayer/Create_0.gml @@ -30,5 +30,8 @@ event_inherited(); [vk_right, "Right"], ]; - mouse_left = []; + mouse_left = []; + mouse_right = []; + + mouse_pos = []; #endregion \ No newline at end of file diff --git a/objects/addon_key_displayer/Draw_75.gml b/objects/addon_key_displayer/Draw_75.gml index 1d23e4b7e..3fbeafc3b 100644 --- a/objects/addon_key_displayer/Draw_75.gml +++ b/objects/addon_key_displayer/Draw_75.gml @@ -26,16 +26,16 @@ var win_y = WIN_H; - #region graph + #region mouse graph if(show_graph) { - win_y -= 64; + win_y -= 128; draw_set_color(c_black); draw_set_alpha(0.5); draw_rectangle(0, win_y, WIN_W, WIN_H, false); draw_set_alpha(1); - draw_set_color(c_white); + draw_set_color(c_green); var mlx = WIN_W - array_length(mouse_left); var ox, oy, nx, ny; @@ -49,17 +49,48 @@ ox = nx; oy = ny; } + + draw_set_color(c_red); + var mlx = WIN_W - array_length(mouse_right); + var ox, oy, nx, ny; + + for( var i = 0, n = array_length(mouse_right); i < n; i++ ) { + nx = mlx + i; + ny = WIN_H - 64 - 4 - mouse_right[i] * 24; + + if(i) + draw_line(ox, oy, nx, ny); + + ox = nx; + oy = ny; + } + + for( var i = 1, n = array_length(mouse_pos); i < n; i++ ) + draw_line(mouse_pos[i - 1][0], mouse_pos[i - 1][1], mouse_pos[i][0], mouse_pos[i][1]); + + var mp = 0; + if(DOUBLE_CLICK) mp = 2; + else if(mouse_lpress(mb_left)) mp = 1.3; + else if(mouse_lrelease(mb_left)) mp = 1.3; + else if(mouse_lclick(mb_left)) mp = 1; + + array_push(mouse_left, mp); + if(array_length(mouse_left) > WIN_W) + array_delete(mouse_left, 0, 1); + + var mp = 0; + if(mouse_rpress(mb_right)) mp = 1.3; + else if(mouse_rrelease(mb_right)) mp = 1.3; + else if(mouse_rclick(mb_right)) mp = 1; + + array_push(mouse_right, mp); + if(array_length(mouse_right) > WIN_W) + array_delete(mouse_right, 0, 1); + + array_push(mouse_pos, [ mouse_mx, mouse_my ]) + if(array_length(mouse_pos) > 1000) + array_delete(mouse_pos, 0, 1); } - - var mp = 0; - if(DOUBLE_CLICK) mp = 2; - else if(mouse_press(mb_left)) mp = 1.2; - else if(mouse_release(mb_left)) mp = 1.2; - else if(mouse_click(mb_left)) mp = 1; - - array_push(mouse_left, mp); - if(array_length(mouse_left) > WIN_W) - array_delete(mouse_left, 0, 1); #endregion #region mouse @@ -95,7 +126,7 @@ draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1); #endregion - if(alpha > 0) { + if(alpha > 0) { #region draw_set_text(_f_h5, fa_right, fa_bottom, COLORS._main_icon_dark); var pd = ui(4); var ww = string_width(disp_text) + pd * 3; @@ -110,5 +141,5 @@ draw_set_alpha(alpha); draw_text(x1 - pd * 1.5, y1 - pd, disp_text); draw_set_alpha(1); - } + } #endregion #endregion \ No newline at end of file diff --git a/objects/o_main/Other_2.gml b/objects/o_main/Other_2.gml index ffac4ec75..e07d4352b 100644 --- a/objects/o_main/Other_2.gml +++ b/objects/o_main/Other_2.gml @@ -88,6 +88,7 @@ if(!IS_CMD) { __initAddon(); log_message("SESSION", $"> init Addon | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initPalette(); log_message("SESSION", $"> init Palette | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initGradient(); log_message("SESSION", $"> init Gradient | complete in {get_timer() - t}"); t = get_timer(); } + if(!IS_CMD) { __initPen(); log_message("SESSION", $"> init Pen | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { loadAddon(); log_message("SESSION", $"> init Addons | complete in {get_timer() - t}"); t = get_timer(); } diff --git a/objects/o_main/Other_20.gml b/objects/o_main/Other_20.gml new file mode 100644 index 000000000..3271947b4 --- /dev/null +++ b/objects/o_main/Other_20.gml @@ -0,0 +1,42 @@ +/// @description Pen tablet event + +var e; e = tabletstuff_get_event_data(); +if (!ds_map_exists(e, "pointer_info_pen")) exit; +PEN_USE = true; + +/* + See: + https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info + for flags and constants in the fields. +*/ + +var f = e[? "pointer_info_flags"]; + +var pp = e[? "pointer_info_pen_pressure"]; +var pr = e[? "pointer_info_pen_rotation"]; +var px = e[? "pointer_info_pixel_location_x"] - window_get_x(); +var py = e[? "pointer_info_pixel_location_y"] - window_get_y(); +var pb = e[? "pointer_info_button_change_type"]; + +var tx = e[? "pointer_info_pen_tilt_x"]; +var ty = e[? "pointer_info_pen_tilt_y"]; + +PEN_X = px; +PEN_Y = py; + +PEN_PRESSURE = pp; + +var contact = bool(f & 0x4); +if(PEN_CONTACT && !contact) + PEN_RELEASED = true; +PEN_CONTACT = contact; + +var b1 = bool(f & 0x10); // POINTER_FLAG_FIRSTBUTTON +var b2 = bool(f & 0x20); // POINTER_FLAG_SECONDBUTTON + +if(!PEN_RIGHT_CLICK && b2) PEN_RIGHT_PRESS = true; +if(PEN_RIGHT_CLICK && !b2) PEN_RIGHT_RELEASE = true; + +PEN_RIGHT_CLICK = b2; + +//print($"{PEN_RIGHT_CLICK} | {PEN_RIGHT_PRESS}, {PEN_RIGHT_RELEASE}"); diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index dd42a0052..34d397129 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -22,7 +22,7 @@ _HOVERING_ELEMENT = noone; } #endregion -#region window +#region window & mouse //if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG; if(_cursor != CURSOR) { @@ -36,6 +36,16 @@ _HOVERING_ELEMENT = noone; RENDER_ALL watcher_surface = surface_create(1, 1); } + + PEN_USE = false; + PEN_RELEASED = false; + PEN_RIGHT_PRESS = false; + PEN_RIGHT_RELEASE = false; + + if(!IS_CMD) tabletstuff_perform_event(id, ev_other, ev_user10); + + //print($"{PEN_RIGHT_CLICK} | {PEN_RIGHT_PRESS}, {PEN_RIGHT_RELEASE}"); + //print($"{mouse_x}, {mouse_y}"); #endregion #region focus diff --git a/objects/o_main/o_main.yy b/objects/o_main/o_main.yy index f00a07af1..af4a23f65 100644 --- a/objects/o_main/o_main.yy +++ b/objects/o_main/o_main.yy @@ -21,6 +21,7 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":68,"eventType":7,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":60,"eventType":7,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":70,"eventType":7,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":20,"eventType":7,"isDnD":false,}, ], "managed": true, "overriddenProperties": [], diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index fab1c2945..620d1b7b8 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -77,11 +77,12 @@ function __part(_node) constructor { drawsx = 0; drawsy = 0; - col = -1; - blend = c_white; - alp = 1; - alp_draw = alp; - alp_fade = 0; + col = -1; + blend = c_white; + alp = 1; + alp_draw = alp; + alp_fade = 0; + currColor = c_white; blend_history = []; alp_history = []; @@ -371,6 +372,8 @@ function __part(_node) constructor { blend_history[life_incr - 1] = cc; alp_history[life_incr - 1] = alp_draw; + currColor = cola(cc, alp_draw); + if(_useS && (x0 > surf_w || y0 > surf_h || x1 < 0 || y1 < 0)) return; diff --git a/scripts/__initPen/__initPen.gml b/scripts/__initPen/__initPen.gml new file mode 100644 index 000000000..86a664030 --- /dev/null +++ b/scripts/__initPen/__initPen.gml @@ -0,0 +1,18 @@ +globalvar PEN_USE, PEN_CONTACT, PEN_RELEASED, PEN_PRESSURE, PEN_X, PEN_Y; +globalvar PEN_RIGHT_CLICK, PEN_RIGHT_PRESS, PEN_RIGHT_RELEASE; + +PEN_X = 0; +PEN_Y = 0; + +PEN_CONTACT = false; +PEN_PRESSURE = 0; + +PEN_RIGHT_CLICK = false; +PEN_RIGHT_PRESS = false; +PEN_RIGHT_RELEASE = false; + +function __initPen() { + var c = tabletstuff_get_init_error_code(); + if (c != tabletstuff_error_none) + show_error("Unable to initialize TabletStuff. Code=" + tabletstuff_error_to_string(c), true); +} \ No newline at end of file diff --git a/scripts/__initPen/__initPen.yy b/scripts/__initPen/__initPen.yy new file mode 100644 index 000000000..8ac8a71e0 --- /dev/null +++ b/scripts/__initPen/__initPen.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__initPen", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "pen input", + "path": "folders/functions/pen input.yy", + }, +} \ No newline at end of file diff --git a/scripts/__vec2/__vec2.gml b/scripts/__vec2/__vec2.gml index b0c992135..4c7a32296 100644 --- a/scripts/__vec2/__vec2.gml +++ b/scripts/__vec2/__vec2.gml @@ -23,6 +23,12 @@ function __vec2(_x = 0, _y = _x) constructor { return self; } set(_x, _y); #endregion + ref = noone; + static setRef = function(ref = noone) { #region + self.ref = ref; + return self; + } #endregion + static setIndex = function(index, value) { #region INLINE switch(index) { diff --git a/scripts/__vertex_function/__vertex_function.gml b/scripts/__vertex_function/__vertex_function.gml index 4776888f3..fb32cbf3f 100644 --- a/scripts/__vertex_function/__vertex_function.gml +++ b/scripts/__vertex_function/__vertex_function.gml @@ -36,6 +36,13 @@ function vertex_add_2pc(buffer, _x, _y, color, alpha = 1) { vertex_color(buffer, color, alpha); } +function vertex_add_2pct(buffer, _x, _y, _u, _v, color, alpha = 1) { + INLINE + vertex_position(buffer, _x, _y); + vertex_color(buffer, color, alpha); + vertex_texcoord(buffer, _u, _v); +} + function vertex_add_v(buffer, vertex) { INLINE vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); diff --git a/scripts/argumentRenderer/argumentRenderer.gml b/scripts/argumentRenderer/argumentRenderer.gml index 4ffa6d2af..0a3bcd0c5 100644 --- a/scripts/argumentRenderer/argumentRenderer.gml +++ b/scripts/argumentRenderer/argumentRenderer.gml @@ -22,11 +22,11 @@ function argumentRenderer(_typeArray = []) { _h += _th + ui(8); - draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); - draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value")); - var _jValue = inputs[| i + 2]; if(argument_renderer.showValue && _jValue.editWidget != noone) { + draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); + draw_text_add(tx + ui(8), ty + _th + ui(8 + 6), __txt("Value")); + var params = new widgetParam(tx + ui(64), ty + _th + ui(10), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), {}, _m, argument_renderer.rx, argument_renderer.ry); _jValue.editWidget.setFocusHover(_focus, _hover); diff --git a/scripts/blurSurface/blurSurface.gml b/scripts/blurSurface/blurSurface.gml index 907dc6202..63552d520 100644 --- a/scripts/blurSurface/blurSurface.gml +++ b/scripts/blurSurface/blurSurface.gml @@ -28,14 +28,6 @@ function __gaussian_get_kernel(size) { } function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampleMode = 0, overColor = noone) { - static uni_bor = shader_get_uniform(sh_blur_gaussian, "sampleMode"); - static uni_dim = shader_get_uniform(sh_blur_gaussian, "dimension"); - static uni_hor = shader_get_uniform(sh_blur_gaussian, "horizontal"); - static uni_wei = shader_get_uniform(sh_blur_gaussian, "weight"); - static uni_sze = shader_get_uniform(sh_blur_gaussian, "size"); - static uni_ovr = shader_get_uniform(sh_blur_gaussian, "overrideColor"); - static uni_ovc = shader_get_uniform(sh_blur_gaussian, "overColor"); - var format = surface_get_format(surface); var _sw = surface_get_width_safe(surface); var _sh = surface_get_height_safe(surface); @@ -52,15 +44,15 @@ function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampl draw_clear_alpha(bg_c, bg); shader_set(sh_blur_gaussian); - shader_set_uniform_f_array_safe(uni_dim, [ _sw, _sh ]); - shader_set_uniform_f_array_safe(uni_wei, gau_array); + shader_set_f("dimension", [ _sw, _sh ]); + shader_set_f("weight", gau_array); - shader_set_uniform_i(uni_bor, sampleMode); - shader_set_uniform_i(uni_sze, size); - shader_set_uniform_i(uni_hor, 1); + shader_set_i("sampleMode", sampleMode); + shader_set_i("size", size); + shader_set_i("horizontal", 1); - shader_set_uniform_i(uni_ovr, overColor != noone); - shader_set_uniform_f_array_safe(uni_ovc, colToVec4(overColor)); + shader_set_i("overrideColor", overColor != noone); + shader_set_f("overColor", colToVec4(overColor)); draw_surface_safe(surface, 0, 0); shader_reset(); @@ -70,7 +62,7 @@ function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampl draw_clear_alpha(bg_c, bg); shader_set(sh_blur_gaussian); - shader_set_uniform_i(uni_hor, 0); + shader_set_i("horizontal", 0); draw_surface_safe(__blur_hori, 0, 0); shader_reset(); diff --git a/scripts/delaunay/delaunay.gml b/scripts/delaunay/delaunay.gml index e63fd367d..5044ba2ef 100644 --- a/scripts/delaunay/delaunay.gml +++ b/scripts/delaunay/delaunay.gml @@ -21,7 +21,7 @@ function delaunay_triangulation(points) { #region array_remove_triangles(triangles, bad_triangles[j]); for (var j = 0; j < array_length(polygon); j += 2) { - var new_triangle = [_point, polygon[j], polygon[j + 1]]; + var new_triangle = [ _point, polygon[j], polygon[j + 1] ]; array_push(triangles, new_triangle); } } diff --git a/scripts/draw_line_width2/draw_line_width2.gml b/scripts/draw_line_width2/draw_line_width2.gml index c11ba67b6..28e47daa0 100644 --- a/scripts/draw_line_width2/draw_line_width2.gml +++ b/scripts/draw_line_width2/draw_line_width2.gml @@ -1,4 +1,4 @@ -function draw_line_width2(x0, y0, x1, y1, w0, w1, cap = false) { +function draw_line_width2(x0, y0, x1, y1, w0, w1, cap = false, c0 = noone, c1 = noone) { var aa = point_direction(x0, y0, x1, y1) + 90; var _x0 = x0 + lengthdir_x(w0 / 2, aa); var _y0 = y0 + lengthdir_y(w0 / 2, aa); @@ -8,18 +8,20 @@ function draw_line_width2(x0, y0, x1, y1, w0, w1, cap = false) { var _y2 = y1 + lengthdir_y(w1 / 2, aa); var _x3 = x1 + lengthdir_x(w1 / 2, aa + 180); var _y3 = y1 + lengthdir_y(w1 / 2, aa + 180); - + + c0 = c0 == noone? draw_get_color() : c0; + c1 = c1 == noone? draw_get_color() : c1; + draw_primitive_begin(pr_trianglestrip); - draw_vertex(_x0, _y0); - draw_vertex(_x1, _y1); - draw_vertex(_x2, _y2); - draw_vertex(_x3, _y3); + draw_vertex_color(_x0, _y0, c0, 1); + draw_vertex_color(_x1, _y1, c0, 1); + draw_vertex_color(_x2, _y2, c1, 1); + draw_vertex_color(_x3, _y3, c1, 1); draw_primitive_end(); if(cap && w0 / 2 - 1 > 0) { - //draw_set_color(c_red); - draw_circle(x0 - 1, y0 - 1, w0 / 2 - 1, 0); - draw_circle(x1 - 1, y1 - 1, w1 / 2 - 1, 0); + draw_set_color(c0); draw_circle(x0 - 1, y0 - 1, w0 / 2 - 1, 0); + draw_set_color(c1); draw_circle(x1 - 1, y1 - 1, w1 / 2 - 1, 0); } } diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 4f7ff8d1d..07248989f 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -78,8 +78,8 @@ #macro UI_SCALE PREFERENCES.display_scaling - #macro mouse_mx device_mouse_x_to_gui(0) - #macro mouse_my device_mouse_y_to_gui(0) + #macro mouse_mx (PEN_USE? PEN_X : device_mouse_x_to_gui(0)) + #macro mouse_my (PEN_USE? PEN_Y : device_mouse_y_to_gui(0)) #macro mouse_raw_x (device_mouse_raw_x(0) + window_get_x()) #macro mouse_raw_y (device_mouse_raw_y(0) + window_get_y()) #macro mouse_ui [device_mouse_x_to_gui(0), device_mouse_y_to_gui(0)] diff --git a/scripts/mouse_input/mouse_input.gml b/scripts/mouse_input/mouse_input.gml index 5c5fc70fd..b60238824 100644 --- a/scripts/mouse_input/mouse_input.gml +++ b/scripts/mouse_input/mouse_input.gml @@ -5,6 +5,7 @@ MOUSE_WRAPPING = false; MOUSE_BLOCK = false; _MOUSE_BLOCK = false; + PEN_RELEASED = false; #macro SCROLL_SPEED PREFERENCES.mouse_wheel_speed @@ -14,17 +15,84 @@ } #endregion -function mouse_click(mouse, focus = true) { +function mouse_click(mouse, focus = true) { #region INLINE - return !_MOUSE_BLOCK && focus && mouse_check_button(mouse); -} + if(MOUSE_BLOCK) return false; + if(!focus) return false; + + if(PEN_RIGHT_CLICK) return mouse == mb_right; + + return mouse_check_button(mouse); +} #endregion -function mouse_press(mouse, focus = true) { +function mouse_press(mouse, focus = true) { #region INLINE - return !_MOUSE_BLOCK && focus && mouse_check_button_pressed(mouse); -} + if(MOUSE_BLOCK) return false; + if(!focus) return false; + + if(PEN_RIGHT_PRESS) return mouse == mb_right; + + return mouse_check_button_pressed(mouse); +} #endregion -function mouse_release(mouse, focus = true) { +function mouse_release(mouse, focus = true) { #region INLINE - return focus && mouse_check_button_released(mouse); -} \ No newline at end of file + if(!focus) return false; + + if(PEN_RIGHT_RELEASE) return mouse == mb_right; + + return mouse_check_button_released(mouse) || (mouse == mb_left && PEN_RELEASED); +} #endregion + +function mouse_lclick(focus = true) { #region + INLINE + if(MOUSE_BLOCK) return false; + if(!focus) return false; + if(PEN_RIGHT_CLICK || PEN_RIGHT_RELEASE) return false; + + return mouse_check_button(mb_left); +} #endregion + +function mouse_lpress(focus = true) { #region + INLINE + if(MOUSE_BLOCK) return false; + if(!focus) return false; + if(PEN_RIGHT_PRESS) return false; + + return mouse_check_button_pressed(mb_left); +} #endregion + +function mouse_lrelease(focus = true) { #region + INLINE + if(!focus) return false; + if(PEN_RIGHT_RELEASE) return false; + if(PEN_RELEASED) return true; + + return mouse_check_button_released(mb_left); +} #endregion + +function mouse_rclick(focus = true) { #region + INLINE + if(MOUSE_BLOCK) return false; + if(!focus) return false; + if(PEN_RIGHT_CLICK) return true; + + return mouse_check_button(mb_right); +} #endregion + +function mouse_rpress(focus = true) { #region + INLINE + if(MOUSE_BLOCK) return false; + if(!focus) return false; + if(PEN_RIGHT_PRESS) return true; + + return mouse_check_button_pressed(mb_right); +} #endregion + +function mouse_rrelease(focus = true) { #region + INLINE + if(!focus) return false; + if(PEN_RIGHT_RELEASE) return true; + + return mouse_check_button_released(mb_right); +} #endregion \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 37d16c6b7..2ce364806 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -5,6 +5,8 @@ function drawWidgetInit() { min_w = ui(160); lineBreak = PREFERENCES.inspector_view_default; + + tooltip_loop_type = new tooltipSelector(__txtx("panel_animation_looping_mode", "Looping mode"), global.junctionEndName); } function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0) { @@ -211,7 +213,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc draw_line(bx - ui(20), by - lhf, bx - ui(20), by + lhf); bx -= ui(26 + 12); - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_animation_looping_mode", "Looping mode") + " " + global.junctionEndName[jun.on_end], THEME.prop_on_end, jun.on_end) == 2) + tooltip_loop_type.index = jun.on_end; + if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, tooltip_loop_type, THEME.prop_on_end, jun.on_end) == 2) jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end)); } #endregion diff --git a/scripts/node_VFX_triangulate/node_VFX_triangulate.gml b/scripts/node_VFX_triangulate/node_VFX_triangulate.gml new file mode 100644 index 000000000..658053bc0 --- /dev/null +++ b/scripts/node_VFX_triangulate/node_VFX_triangulate.gml @@ -0,0 +1,130 @@ +function Node_VFX_Triangulate(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "VFX Triangulate"; + color = COLORS.node_blend_vfx; + icon = THEME.vfx; + use_cache = CACHE_USE.auto; + + function _Point(part) constructor { #region + self.part = part; + x = part.x; + y = part.y; + + static equal = function(point) { INLINE return x == point.x && y == point.y; } + } #endregion + + manual_ungroupable = false; + + inputs[| 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 1] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, -1 ) + .setVisible(true, true); + + inputs[| 2] = nodeValue("Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 ); + + inputs[| 3] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ); + + inputs[| 4] = nodeValue("Inherit Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + + inputs[| 5] = nodeValue("Inherit Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + + outputs[| 0] = nodeValue("Triangles", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + + input_display_list = [ 0, + [ "Particles", false], 1, + [ "Rendering", false], 4, 2, 5, 3, + ] + + insp2UpdateTooltip = "Clear cache"; + insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ]; + + static onInspector2Update = function() { clearCache(); } + + static step = function() { #region + var _ith = getInputData(4); + var _icl = getInputData(5); + + inputs[| 2].setVisible(!_ith); + inputs[| 3].setVisible(!_icl); + } #endregion + + static update = function() { #region + var _dim = getInputData(0); + var _par = getInputData(1); + + var _th = getInputData(2); + var _cl = getInputData(3); + var _ith = getInputData(4); + var _icl = getInputData(5); + + var _surf = outputs[| 0].getValue(); + _surf = surface_verify(_surf, _dim[0], _dim[1]); + outputs[| 0].setValue(_surf); + + var _vrx = array_create(array_length(_par)); + var _ind = 0; + + for( var i = 0, n = array_length(_par); i < n; i++ ) { + var p = _par[i]; + + if(!p.active) continue; + _vrx[_ind++] = new _Point(p); + } + + array_resize(_vrx, _ind); + + var tri = delaunay_triangulation(_vrx); + var c0, c1, c2; + + surface_set_shader(_surf, noone); + draw_set_color(c_white); + + for( var i = 0, n = array_length(tri); i < n; i++ ) { + var t = tri[i]; + var p0 = t[0].part; + var p1 = t[1].part; + var p2 = t[2].part; + + if(_ith) { + if(_icl) { + draw_line_width2(p0.x, p0.y, p1.x, p1.y, min(p0.scx, p0.scy), min(p1.scx, p1.scy), false, p0.currColor, p1.currColor); + draw_line_width2(p0.x, p0.y, p2.x, p2.y, min(p0.scx, p0.scy), min(p2.scx, p2.scy), false, p0.currColor, p2.currColor); + draw_line_width2(p1.x, p1.y, p2.x, p2.y, min(p1.scx, p1.scy), min(p2.scx, p2.scy), false, p1.currColor, p2.currColor); + } else { + draw_set_color(_cl); + draw_line_width2(p0.x, p0.y, p1.x, p1.y, min(p0.scx, p0.scy), min(p1.scx, p1.scy)); + draw_line_width2(p0.x, p0.y, p2.x, p2.y, min(p0.scx, p0.scy), min(p2.scx, p2.scy)); + draw_line_width2(p1.x, p1.y, p2.x, p2.y, min(p1.scx, p1.scy), min(p2.scx, p2.scy)); + } + + } else if(_th == 1) { + if(_icl) { + draw_line_color(p0.x, p0.y, p1.x, p1.y, p0.currColor, p1.currColor); + draw_line_color(p0.x, p0.y, p2.x, p2.y, p0.currColor, p2.currColor); + draw_line_color(p1.x, p1.y, p2.x, p2.y, p1.currColor, p2.currColor); + + } else { + draw_set_color(_cl); + draw_line(p0.x, p0.y, p1.x, p1.y); + draw_line(p0.x, p0.y, p2.x, p2.y); + draw_line(p1.x, p1.y, p2.x, p2.y); + } + } else { + if(_icl) { + draw_line_width_color(p0.x, p0.y, p1.x, p1.y, _th, p0.currColor, p1.currColor); + draw_line_width_color(p0.x, p0.y, p2.x, p2.y, _th, p0.currColor, p2.currColor); + draw_line_width_color(p1.x, p1.y, p2.x, p2.y, _th, p1.currColor, p2.currColor); + + } else { + draw_set_color(_cl); + draw_line_width(p0.x, p0.y, p1.x, p1.y, _th); + draw_line_width(p0.x, p0.y, p2.x, p2.y, _th); + draw_line_width(p1.x, p1.y, p2.x, p2.y, _th); + } + } + } + surface_reset_shader(); + + cacheCurrentFrame(_surf); + } #endregion +} \ No newline at end of file diff --git a/scripts/node_VFX_triangulate/node_VFX_triangulate.yy b/scripts/node_VFX_triangulate/node_VFX_triangulate.yy new file mode 100644 index 000000000..361fcbcfd --- /dev/null +++ b/scripts/node_VFX_triangulate/node_VFX_triangulate.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_VFX_triangulate", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "effects", + "path": "folders/nodes/data/simulation/VFX/effects.yy", + }, +} \ No newline at end of file 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 d557a8e08..ce1e76986 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -160,13 +160,18 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const ["Tags", false], 2, tag_renderer, ]; + attributes.file_checker = true; attributes.layer_visible = []; + array_push(attributeEditors, [ "File Watcher", function() { return attributes.file_checker; }, + new checkBox(function() { attributes.file_checker = !attributes.file_checker; }) ]); + content = ds_map_create(); layers = []; tags = []; _tag_delay = 0; path_current = ""; + edit_time = 0; first_update = false; @@ -214,6 +219,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const function updatePaths(path) { #region path_current = path; + edit_time = file_get_modify_s(path_current); path = try_get_path(path); if(path == -1) return false; @@ -302,6 +308,18 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const triggerRender(); } #endregion + static step = function() { + if(attributes.file_checker && path_current != "") { + var _ms = file_get_modify_s(path_current); + + if(_ms > edit_time) { + edit_time = _ms; + updatePaths(path_current); + update(); + } + } + } + static update = function(frame = CURRENT_FRAME) { #region var path = getInputData(0); var current_tag = getInputData(2); diff --git a/scripts/node_blur_simple/node_blur_simple.gml b/scripts/node_blur_simple/node_blur_simple.gml index 18b3751fa..15ef6c81e 100644 --- a/scripts/node_blur_simple/node_blur_simple.gml +++ b/scripts/node_blur_simple/node_blur_simple.gml @@ -27,9 +27,19 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou __init_mask_modifier(6); // inputs 10, 11, + inputs[| 12] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ c_black, c_white ]) ) + .setMappable(13); + + inputs[| 13] = nodeValueMap("Gradient map", self); + + inputs[| 14] = nodeValueGradientRange("Gradient map range", self, inputs[| 1]); + + inputs[| 15] = nodeValue("Use Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + input_display_list = [ 8, 9, ["Surfaces", true], 0, 6, 7, 10, 11, ["Blur", false], 1, 3, 4, 5, + ["Effects", false, 15], 12, 13, 14, ]; outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -39,6 +49,8 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou static step = function() { #region __step_mask_modifier(); + + inputs[| 12].mappableStep(); } #endregion static processData = function(_outSurf, _data, _output_index, _array_index) { #region @@ -50,10 +62,14 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou var _overc = _data[5]; var _msk = _data[6]; var _mix = _data[7]; + var _useGrd = _data[15]; inputs[| 5].setVisible(_isovr); surface_set_shader(_outSurf, sh_blur_simple); + shader_set_i("useGradient", _useGrd); + shader_set_gradient(_data[12], _data[13], _data[14], inputs[| 12]); + shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])); shader_set_f("size", _size); shader_set_i("sampleMode", _samp); diff --git a/scripts/node_canvas/node_canvas.gml b/scripts/node_canvas/node_canvas.gml index 01e977b36..b7374ba12 100644 --- a/scripts/node_canvas/node_canvas.gml +++ b/scripts/node_canvas/node_canvas.gml @@ -217,6 +217,10 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor brush_seed = irandom_range(100000, 999999); brush_next_dist = 0; + draw_stack = ds_list_create(); + #endregion + + #region ++++ tools ++++ tool_attribute.color = cola(c_white); tool_attribute.channel = [ true, true, true, true ]; @@ -224,13 +228,17 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor tool_settings = [ [ "Channel", tool_channel_edit, "channel", tool_attribute ] ]; tool_attribute.size = 1; - tool_size_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.size = max(1, round(val)); }).setSlidable(0.1, true, [ 1, 999999 ]); - tool_size_edit.font = f_p3; + tool_size_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.size = max(1, round(val)); }).setSlidable(0.1, true, [ 1, 999999 ]) + .setFont(f_p3) + .setSideButton(button(function() { dialogPanelCall(new Panel_Node_Canvas_Pressure(self), mouse_mx, mouse_my, { anchor: ANCHOR.top | ANCHOR.left }) }) + .setIcon(THEME.pen_pressure, 0, COLORS._main_icon)); tool_size = [ "Size", tool_size_edit, "size", tool_attribute ]; + tool_attribute.pressure = false; + tool_attribute.pressure_size = [ 1, 1 ]; + tool_attribute.thres = 0; - tool_thrs_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.thres = clamp(val, 0, 1); }).setSlidable(0.01, false, [ 0, 1 ]); - tool_thrs_edit.font = f_p3; + tool_thrs_edit = new textBox(TEXTBOX_INPUT.number, function(val) { tool_attribute.thres = clamp(val, 0, 1); }).setSlidable(0.01, false, [ 0, 1 ]).setFont(f_p3); tool_thrs = [ "Threshold", tool_thrs_edit, "thres", tool_attribute ]; tool_attribute.fill8 = false; @@ -256,8 +264,6 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor .setSetting(tool_thrs) .setSetting(tool_fil8), ]; - - draw_stack = ds_list_create(); #endregion function setToolColor(color) { tool_attribute.color = color; } @@ -379,7 +385,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var cDep = attrDepth(); var _canvas_surface = getCanvasSurface(index); - print($"Applying surface {index} - {_canvas_surface} [{is_surface(_canvas_surface)}]"); + //print($"Applying surface {index} - {_canvas_surface} [{is_surface(_canvas_surface)}]"); if(!is_surface(_canvas_surface)) { // recover surface //print($"recovering surface from buffer {random(1)}"); @@ -720,7 +726,11 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var _brushRotD = getInputData(16); var _brushRotR = getInputData(17); - brush_size = _siz; + if(PEN_USE && tool_attribute.pressure) + brush_size = round(lerp(tool_attribute.pressure_size[0], tool_attribute.pressure_size[1], power(PEN_PRESSURE / 1024, 2))); + else + brush_size = _siz; + brush_dist_min = max(1, _brushDist[0]); brush_dist_max = max(1, _brushDist[1]); brush_surface = is_surface(_brushSurf)? _brushSurf : noone; diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 255eb8298..8801ea5d2 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -108,8 +108,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { #endregion #region ---- junctions ---- - inputs = ds_list_create(); - outputs = ds_list_create(); + inputs = ds_list_create(); + outputs = ds_list_create(); inputMap = ds_map_create(); outputMap = ds_map_create(); input_value_map = {}; diff --git a/scripts/node_hlsl/node_hlsl.gml b/scripts/node_hlsl/node_hlsl.gml index f86cc0332..21f53c0a9 100644 --- a/scripts/node_hlsl/node_hlsl.gml +++ b/scripts/node_hlsl/node_hlsl.gml @@ -7,23 +7,12 @@ global.HLSL_VB_PLANE = vertex_create_buffer(); vertex_begin(global.HLSL_VB_PLANE, global.HLSL_VB_FORMAT); - - vertex_position(global.HLSL_VB_PLANE, 0, 0); - vertex_color( global.HLSL_VB_PLANE, c_white, 1); - vertex_texcoord(global.HLSL_VB_PLANE, 0, 0); - - vertex_position(global.HLSL_VB_PLANE, 0, 1); - vertex_color( global.HLSL_VB_PLANE, c_white, 1); - vertex_texcoord(global.HLSL_VB_PLANE, 0, 1); - vertex_position(global.HLSL_VB_PLANE, 1, 0); - vertex_color( global.HLSL_VB_PLANE, c_white, 1); - vertex_texcoord(global.HLSL_VB_PLANE, 1, 0); - - vertex_position(global.HLSL_VB_PLANE, 1, 1); - vertex_color( global.HLSL_VB_PLANE, c_white, 1); - vertex_texcoord(global.HLSL_VB_PLANE, 1, 1); - + vertex_add_2pct(global.HLSL_VB_PLANE, 0, 0, 0, 1, c_white); + vertex_add_2pct(global.HLSL_VB_PLANE, 0, 1, 0, 0, c_white); + vertex_add_2pct(global.HLSL_VB_PLANE, 1, 0, 1, 1, c_white); + vertex_add_2pct(global.HLSL_VB_PLANE, 1, 1, 1, 0, c_white); + vertex_end(global.HLSL_VB_PLANE); #endregion diff --git a/scripts/node_image/node_image.gml b/scripts/node_image/node_image.gml index 06b019969..f10bf3144 100644 --- a/scripts/node_image/node_image.gml +++ b/scripts/node_image/node_image.gml @@ -41,6 +41,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { path_current = []; first_update = false; + edit_time = []; on_drop_file = function(path) { #region inputs[| 0].setValue(path); @@ -67,7 +68,6 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { case ".jpeg": case ".gif": setDisplayName(_name); - spr = sprite_add(path, 1, false, false, 0, 0); if(spr == -1) { @@ -75,6 +75,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { break; } + edit_time = file_get_modify_s(path); return spr; } @@ -114,6 +115,20 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { outputs[| 1].setValue(path); if(path_current != path) updatePaths(path); + else { + //if(!is_array(path)) path = [ path ]; + //var _upd = false; + + //for( var i = 0, n = array_length(path); i < n; i++ ) { + // var _et = array_safe_get(edit_time, i); + // var _ms = file_get_modify_s(path[i]); + + // if(_ms > edit_time[i]) _upd = true; + // edit_time[i] = _ms; + //} + + //if(_upd) updatePaths(path); + } if(array_empty(spr)) return; diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index aafbcdab6..a8183b43b 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -384,7 +384,8 @@ function __initNodes() { addNodeObject(vfx, "Oscillate", s_node_vfx_osc, "Node_VFX_Oscillate", [1, Node_VFX_Oscillate],, "Swing particle around its original trajectory.").hideRecent().setVersion(11560); ds_list_add(vfx, "Effects"); - addNodeObject(vfx, "VFX Trail", s_node_vfx_trail, "Node_VFX_Trail", [1, Node_VFX_Trail],, "Generate path from particle movement.").hideRecent().setVersion(11560); + addNodeObject(vfx, "VFX Trail", s_node_vfx_trail, "Node_VFX_Trail", [1, Node_VFX_Trail],, "Generate path from particle movement.").hideRecent().setVersion(11560); + addNodeObject(vfx, "VFX Triangulate", s_node_vfx_triangulate, "Node_VFX_Triangulate", [1, Node_VFX_Triangulate],, "Render line between particles.").hideRecent().setVersion(11670); ds_list_add(vfx, "Instance control"); addNodeObject(vfx, "VFX Variable", s_node_vfx_variable, "Node_VFX_Variable", [1, Node_VFX_Variable],, "Extract variable from particle objects.").hideRecent().setVersion(1120); diff --git a/scripts/node_repeat/node_repeat.gml b/scripts/node_repeat/node_repeat.gml index 470c04cbd..4b9c26c08 100644 --- a/scripts/node_repeat/node_repeat.gml +++ b/scripts/node_repeat/node_repeat.gml @@ -13,7 +13,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor new scrollItem("Grid", s_node_repeat_axis, 1), new scrollItem("Circular", s_node_repeat_axis, 2), ]); - inputs[| 4] = nodeValue("Repeat position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [DEF_SURF_W / 2, 0]) + inputs[| 4] = nodeValue("Shift position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [DEF_SURF_W / 2, 0]) .setDisplay(VALUE_DISPLAY.vector) .setUnitRef(function() { return getDimension(); }); @@ -98,14 +98,16 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor ["Surfaces", true], 0, 1, 16, 17, ["Pattern", false], 3, 9, 2, 18, 7, 8, ["Path", true], 11, 12, 13, - ["Transform", false], 4, 26, 19, 5, 6, 10, + ["Position", false], 4, 26, 19, + ["Rotation", false], 5, + ["Scale", false], 6, 10, ["Render", false], 14, 30, ["Animator", true, 29], 20, 21, 25, 22, 23, 24, 27, ]; attribute_surface_depth(); - static getDimension = function() { + static getDimension = function() { #region var _surf = getInputData(0); if(is_array(_surf)) { if(array_length(_surf) == 0) return [1, 1]; @@ -115,9 +117,9 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor if(!is_surface(_surf)) return [1, 1]; return [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; - } + } #endregion - static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region var a = inputs[| 9].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny, THEME.anchor); active &= !a; var _pat = getInputData(3); @@ -137,13 +139,13 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor } var a = inputs[| 31].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny, getInputData(1)); active &= !a; - } + } #endregion static step = function() { #region inputs[| 14].mappableStep(); } #endregion - function doRepeat(_outSurf, _inSurf) { + function doRepeat(_outSurf, _inSurf) { #region var _dim = getInputData( 1); var _amo = getInputData( 2); var _pat = getInputData( 3); @@ -275,9 +277,9 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor if(_rsta == 2) runy += _sh / 2; } surface_reset_target(); - } + } #endregion - static update = function(frame = CURRENT_FRAME) { + static update = function(frame = CURRENT_FRAME) { #region var _inSurf = getInputData(0); if(is_array(_inSurf) && array_length(_inSurf) == 0) return; if(!is_array(_inSurf) && !is_surface(_inSurf)) return; @@ -316,5 +318,5 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor } outputs[| 0].setValue(_outSurf); - } + } #endregion } \ No newline at end of file diff --git a/scripts/node_scale/node_scale.gml b/scripts/node_scale/node_scale.gml index 1d05492bb..e47afd4b1 100644 --- a/scripts/node_scale/node_scale.gml +++ b/scripts/node_scale/node_scale.gml @@ -30,12 +30,12 @@ function Node_Scale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con attribute_surface_depth(); attribute_interpolation(); - static step = function() { + static step = function() { #region var _surf = getSingleValue(0); var _atlas = is_instanceof(_surf, SurfaceAtlas); inputs[| 5].setVisible(_atlas); - } + } #endregion static processData = function(_outSurf, _data, _output_index, _array_index) { var scale = _data[1]; diff --git a/scripts/node_scatter/node_scatter.gml b/scripts/node_scatter/node_scatter.gml index b895348a2..17ba0adb4 100644 --- a/scripts/node_scatter/node_scatter.gml +++ b/scripts/node_scatter/node_scatter.gml @@ -103,7 +103,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c inputs[| 32] = nodeValue("Rotate per radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.rotation); - inputs[| 33] = nodeValue("Random position", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0 ]) + inputs[| 33] = nodeValue("Random position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.vector_range); inputs[| 34] = nodeValue("Scale per radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ]) @@ -111,6 +111,9 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c inputs[| 35] = nodeValue("Angle range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 360 ]) .setDisplay(VALUE_DISPLAY.rotation_range); + + inputs[| 36] = nodeValue("Shift position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ]) + .setDisplay(VALUE_DISPLAY.vector); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -118,11 +121,11 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c .setVisible(false) .rejectArrayProcess(); - input_display_list = [ - ["Surfaces", true], 0, 1, 15, 10, 24, 25, 26, 27, + input_display_list = [ 10, + ["Surfaces", true], 0, 1, 15, 24, 25, 26, 27, ["Scatter", false], 6, 5, 13, 14, 17, 9, 31, 2, 30, 35, ["Path", false], 19, 20, 21, 22, - ["Position", false], 33, + ["Position", false], 33, 36, ["Rotation", false], 7, 4, 32, ["Scale", false], 3, 8, 34, ["Render", false], 18, 11, 28, 12, 16, 23, @@ -264,6 +267,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var posWig = _data[33]; var uniSca = _data[34]; var cirRng = _data[35]; + var posShf = _data[36]; var _in_w, _in_h; @@ -467,6 +471,9 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c if(_wigX) _x += random_range(posWig[0], posWig[1]); if(_wigY) _y += random_range(posWig[2], posWig[3]); + _x += posShf[0] * i; + _y += posShf[1] * i; + if(_unis) { _scy = max(_scx, _scy); _scx = _scy; diff --git a/scripts/node_shadow_cast/node_shadow_cast.gml b/scripts/node_shadow_cast/node_shadow_cast.gml index 576deb37e..59eddb176 100644 --- a/scripts/node_shadow_cast/node_shadow_cast.gml +++ b/scripts/node_shadow_cast/node_shadow_cast.gml @@ -18,7 +18,7 @@ function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou if(!is_surface(_surf)) return [1, 1]; - return [surface_get_width_safe(_surf), surface_get_height_safe(_surf)]; + return [ surface_get_width_safe(_surf), surface_get_height_safe(_surf) ]; }, VALUE_UNIT.reference); inputs[| 3] = nodeValue("Soft light radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index a2be18ecd..bc637a1db 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -335,6 +335,7 @@ function value_type_from_string(str) { #region case "strands" : return VALUE_TYPE.strands; case "mesh" : return VALUE_TYPE.mesh; case "trigger" : return VALUE_TYPE.trigger; + case "atlas" : return VALUE_TYPE.atlas; case "d3vertex" : return VALUE_TYPE.d3vertex; case "gradient" : return VALUE_TYPE.gradient; @@ -343,17 +344,19 @@ function value_type_from_string(str) { #region case "pbBox" : return VALUE_TYPE.pbBox; - case "d3Mesh" : return VALUE_TYPE.d3Mesh; - case "d3Light" : return VALUE_TYPE.d3Light; - case "d3Camera" : return VALUE_TYPE.d3Camera; - case "d3Scene" : return VALUE_TYPE.d3Scene; - case "d3Material" : return VALUE_TYPE.d3Material; + case "d3Mesh" : return VALUE_TYPE.d3Mesh; + case "d3Light" : return VALUE_TYPE.d3Light; + case "d3Camera" : return VALUE_TYPE.d3Camera; + case "d3Scene" : return VALUE_TYPE.d3Scene; + case "d3Material" : return VALUE_TYPE.d3Material; - case "dynaSurface" : return VALUE_TYPE.dynaSurface; - case "PCXnode" : return VALUE_TYPE.PCXnode; + case "dynaSurface" : return VALUE_TYPE.dynaSurface; + case "PCXnode" : return VALUE_TYPE.PCXnode; case "audioBit" : return VALUE_TYPE.audioBit; + case "fDomain" : return VALUE_TYPE.fdomain; + case "action" : return VALUE_TYPE.action; } @@ -751,6 +754,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static resetValue = function() { #region unit.mode = def_unit; setValue(unit.apply(def_val)); + attributes.mapped = false; + is_modified = false; } #endregion @@ -1922,6 +1927,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static setValueInspector = function(val = 0, index = noone) { #region INLINE var res = false; + val = unit.invApply(val); if(PANEL_INSPECTOR && PANEL_INSPECTOR.inspectGroup == 1) { var ind = self.index; diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 0ef8a12ff..63d6ad254 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -260,6 +260,12 @@ function Panel_Menu() : PanelContent() constructor { __test_generate_theme(); }), -1, + menuItem(__txtx("panel_menu_test_warning", "Display Warning"), function() { + noti_warning("Error message") + }), + menuItem(__txtx("panel_menu_test_error", "Display Error"), function() { + noti_error("Error message") + }), menuItem(__txtx("panel_menu_test_crash", "Force crash"), function() { print(1 + "a"); }), diff --git a/scripts/panel_node_canvas_pressure/panel_console.gml b/scripts/panel_node_canvas_pressure/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_node_canvas_pressure/panel_console.gml @@ -0,0 +1,73 @@ +function Panel_Console() : PanelContent() constructor { + title = "Console"; + w = ui(640); + h = ui(320); + + command = ""; + history = []; + cmd_history = []; + + cmd_index = 0; + + keyboard_string = ""; + + static submit_command = function() { + if(command == "") return; + array_push(history, { txt: command, color: COLORS._main_text_sub }); + array_push(cmd_history, command); + + var cmd = string_splice(command, " "); + + switch(cmd[0]) { + case "flag": + if(array_length(cmd) < 2) break; + var flg = array_safe_get(cmd, 1, ""); + global.FLAG[$ flg] = !global.FLAG[$ flg]; + + array_push(history, { txt: $"Toggled debug flag: {flg} = {global.FLAG[$ flg]? "True" : "False"}", color: COLORS._main_value_positive }); + break; + } + + keyboard_string = ""; + command = ""; + } + + function drawContent(panel) { + HOTKEY_BLOCK = true; + command = keyboard_string; + + draw_clear_alpha(CDEF.main_dkblack, 1); + + draw_set_color(c_black); + draw_set_alpha(0.75); + draw_rectangle(0, h - ui(28), w, h, false); + draw_set_alpha(1); + + draw_set_text(f_code, fa_left, fa_bottom, COLORS._main_text); + draw_text(ui(8), h - ui(4), command); + draw_set_color(COLORS._main_text_sub); + draw_text(ui(8) + string_width(command), h - ui(4), "_"); + + var hy = h - ui(32); + for( var i = 0; i < array_length(history); i++ ) { + var his = history[array_length(history) - i - 1]; + var txt = his.txt; + + draw_set_color(his.color); + draw_text_ext(ui(8), hy, txt, -1, w - ui(16)); + hy -= string_height_ext(txt, -1, w - ui(16)); + + if(hy <= 0) break; + } + + if(keyboard_check_pressed(vk_enter)) + submit_command(); + + if(keyboard_check_pressed(vk_up)) { + cmd_index = max(0, cmd_index - 1); + keyboard_string = array_safe_get(cmd_history, cmd_index, ""); + command = keyboard_string; + } else if(keyboard_check_pressed(vk_anykey)) + cmd_index = array_length(cmd_history); + } +} \ No newline at end of file diff --git a/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.gml b/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.gml new file mode 100644 index 000000000..8df934d4f --- /dev/null +++ b/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.gml @@ -0,0 +1,27 @@ +function Panel_Node_Canvas_Pressure(canvas) : Panel_Linear_Setting() constructor { + title = __txtx("pen_pressure_settings", "Per Pressure Settings"); + + w = ui(380); + self.canvas = canvas; + + #region data + properties = [ + new __Panel_Linear_Setting_Item( + __txt("Pressure"), + new checkBox(function() { canvas.tool_attribute.pressure = !canvas.tool_attribute.pressure; }), + function() { return canvas.tool_attribute.pressure; }, + function(val) { canvas.tool_attribute.pressure = val; }, + false, + ), + new __Panel_Linear_Setting_Item( + __txt("Size"), + new vectorBox(2, function(in, val) { canvas.tool_attribute.pressure_size[in] = val; }), + function() { return canvas.tool_attribute.pressure_size; }, + function(val) { canvas.tool_attribute.pressure_size = val; }, + [ 1, 1 ], + ), + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.yy b/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.yy new file mode 100644 index 000000000..9568b346a --- /dev/null +++ b/scripts/panel_node_canvas_pressure/panel_node_canvas_pressure.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_node_canvas_pressure", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "nodes", + "path": "folders/panels/nodes.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index b25750e7e..99d55ae90 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -1334,7 +1334,11 @@ function Panel_Preview() : PanelContent() constructor { wdg.setFocusHover(pFOCUS, pHOVER); switch(instanceof(wdg)) { - case "textBox" : tolw = ui(40); break; + case "textBox" : + tolw = ui(40); + if(wdg.side_button != noone) tolw += tolh + ui(8); + break; + case "checkBoxGroup" : tolw = tolh * wdg.size; break; case "checkBox" : tolw = tolh; break; case "scrollBox" : tolw = ui(96); break; diff --git a/scripts/pcx_parse/pcx_parse.gml b/scripts/pcx_parse/pcx_parse.gml index 500dc9925..46f00684b 100644 --- a/scripts/pcx_parse/pcx_parse.gml +++ b/scripts/pcx_parse/pcx_parse.gml @@ -146,6 +146,7 @@ ds_stack_push(call_st, con_if.if_true); ds_stack_push(blok_st, con_if); continue; + case "elseif": var con_if = ds_stack_pop(blok_st); var con_elif = new __funcIf(); @@ -155,12 +156,15 @@ ds_stack_push(call_st, con_elif.if_true); ds_stack_push(blok_st, con_elif); continue; + case "else": var con_if = ds_stack_pop(blok_st); ds_stack_push(call_st, con_if.if_false); continue; + case "for": + var con_for = new __funcFor(); var cond = string_splice(_cond, ":"); if(array_length(cond) == 2) { @@ -323,8 +327,8 @@ vsl = string_trim(vsl); switch(vsl) { - case "e" : ds_stack_push(vl, 2.71828); break; - case "pi": ds_stack_push(vl, pi); break; + case "e" : ds_stack_push(vl, 2.7182818284); break; + case "pi": ds_stack_push(vl, pi); break; default : ds_stack_push(vl, isNumber(vsl)? toNumber(vsl) : vsl); break; } diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index a6cf3a2e9..7beb4ccf3 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -148,7 +148,7 @@ function NodeListSort(_list, _nodeList) { #region _nodeList[| i].topoSorted = false; ds_list_clear(_list); - __sortGraph(_list, _nodeList); + topoSort(_list, _nodeList); } #endregion function __nodeIsRenderLeaf(_node) { #region diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index ba281d51c..db251cec7 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -102,6 +102,8 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor cut_line(); undo_delay = 10; + + if(PEN_USE) keyboard_virtual_show(kbv_type_default, kbv_returnkey_default, kbv_autocapitalize_none, true); } #endregion static deactivate = function() { #region @@ -110,6 +112,8 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor apply(); WIDGET_CURRENT = noone; UNDO_HOLDING = false; + + if(PEN_USE) keyboard_virtual_hide(); } #endregion static isCodeFormat = function() { INLINE return format == TEXT_AREA_FORMAT.codeLUA || format == TEXT_AREA_FORMAT.codeHLSL; } @@ -756,9 +760,11 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor w = _w; if(side_button && instanceof(side_button) == "buttonClass") { + var bs = min(h, ui(32)); + side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + side_button.draw(_x + _w - bs, _y + _h / 2 - bs / 2, bs, bs, _m, THEME.button_hide); + _w -= bs + ui(8); } var tx = ui(8); diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 7a4739b83..91adbafcf 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -113,6 +113,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { KEYBOARD_STRING = ""; keyboard_lastkey = -1; + + if(PEN_USE) keyboard_virtual_show(input == TEXTBOX_INPUT.number? kbv_type_numbers : kbv_type_default, kbv_returnkey_default, kbv_autocapitalize_none, true); } #endregion static deactivate = function() { #region @@ -121,6 +123,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { apply(); WIDGET_CURRENT = noone; UNDO_HOLDING = false; + + if(PEN_USE) keyboard_virtual_hide(); } #endregion static onKey = function(key) { #region @@ -372,9 +376,11 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } if(side_button && instanceof(side_button) == "buttonClass") { + var bs = min(h, ui(32)); + side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + side_button.draw(_x + _w - bs, _y + _h / 2 - bs / 2, bs, bs, _m, THEME.button_hide); + _w -= bs + ui(8); } draw_set_font(font == noone? f_p0 : font); diff --git a/shaders/sh_blur_simple/sh_blur_simple.fsh b/shaders/sh_blur_simple/sh_blur_simple.fsh index 93032fadb..c9f0338e2 100644 --- a/shaders/sh_blur_simple/sh_blur_simple.fsh +++ b/shaders/sh_blur_simple/sh_blur_simple.fsh @@ -1,6 +1,3 @@ -// -// Simple passthrough fragment shader -// varying vec2 v_vTexcoord; varying vec4 v_vColour; @@ -14,13 +11,150 @@ uniform int sampleMode; uniform int overrideColor; uniform vec4 overColor; -float sampleMask() { +uniform int useGradient; + +#region //////////////////////////////////// GRADIENT //////////////////////////////////// + #define GRADIENT_LIMIT 128 + + uniform int gradient_blend; + uniform vec4 gradient_color[GRADIENT_LIMIT]; + uniform float gradient_time[GRADIENT_LIMIT]; + uniform int gradient_keys; + uniform int gradient_use_map; + uniform vec4 gradient_map_range; + uniform sampler2D gradient_map; + + vec3 linearToGamma(vec3 c) { return pow(c, vec3( 2.2)); } + vec3 gammaToLinear(vec3 c) { return pow(c, vec3(1. / 2.2)); } + + vec3 rgbMix(vec3 c1, vec3 c2, float t) { #region + vec3 k1 = linearToGamma(c1); + vec3 k2 = linearToGamma(c2); + + return gammaToLinear(mix(k1, k2, t)); + } #endregion + + vec3 rgb2oklab(vec3 c) { #region + const mat3 kCONEtoLMS = mat3( + 0.4121656120, 0.2118591070, 0.0883097947, + 0.5362752080, 0.6807189584, 0.2818474174, + 0.0514575653, 0.1074065790, 0.6302613616); + + c = pow(c, vec3(2.2)); + c = pow( kCONEtoLMS * c, vec3(1.0 / 3.0) ); + + return c; + } #endregion + + vec3 oklab2rgb(vec3 c) { #region + const mat3 kLMStoCONE = mat3( + 4.0767245293, -1.2681437731, -0.0041119885, + -3.3072168827, 2.6093323231, -0.7034763098, + 0.2307590544, -0.3411344290, 1.7068625689); + + c = kLMStoCONE * (c * c * c); + c = pow(c, vec3(1. / 2.2)); + + return c; + } #endregion + + vec3 oklabMax(vec3 c1, vec3 c2, float t) { #region + vec3 k1 = rgb2oklab(c1); + vec3 k2 = rgb2oklab(c2); + + return oklab2rgb(mix(k1, k2, t)); + } #endregion + + vec3 rgb2hsv(vec3 c) { #region + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 0.0000000001; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); + } #endregion + + vec3 hsv2rgb(vec3 c) { #region + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + } #endregion + + float hueDist(float a0, float a1, float t) { #region + float da = fract(a1 - a0); + float ds = fract(2. * da) - da; + return a0 + ds * t; + } #endregion + + vec3 hsvMix(vec3 c1, vec3 c2, float t) { #region + vec3 h1 = rgb2hsv(c1); + vec3 h2 = rgb2hsv(c2); + + vec3 h = vec3(0.); + h.x = h.x + hueDist(h1.x, h2.x, t); + h.y = mix(h1.y, h2.y, t); + h.z = mix(h1.z, h2.z, t); + + return hsv2rgb(h); + } #endregion + + vec4 gradientEval(in float prog) { #region + if(gradient_use_map == 1) { + vec2 samplePos = mix(gradient_map_range.xy, gradient_map_range.zw, prog); + return texture2D( gradient_map, samplePos ); + } + + vec4 col = vec4(0.); + + for(int i = 0; i < GRADIENT_LIMIT; i++) { + if(gradient_time[i] == prog) { + col = gradient_color[i]; + break; + } else if(gradient_time[i] > prog) { + if(i == 0) + col = gradient_color[i]; + else { + float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]); + vec3 c0 = gradient_color[i - 1].rgb; + vec3 c1 = gradient_color[i].rgb; + float a = mix(gradient_color[i - 1].a, gradient_color[i].a, t); + + if(gradient_blend == 0) + col = vec4(mix(c0, c1, t), a); + + else if(gradient_blend == 1) + col = gradient_color[i - 1]; + + else if(gradient_blend == 2) + col = vec4(hsvMix(c0, c1, t), a); + + else if(gradient_blend == 3) + col = vec4(oklabMax(c0, c1, t), a); + + else if(gradient_blend == 4) + col = vec4(rgbMix(c0, c1, t), a); + } + break; + } + if(i >= gradient_keys - 1) { + col = gradient_color[gradient_keys - 1]; + break; + } + } + + return col; + } #endregion + +#endregion //////////////////////////////////// GRADIENT //////////////////////////////////// + +float sampleMask() { #region if(useMask == 0) return 1.; vec4 m = texture2D( mask, v_vTexcoord ); return (m.r + m.g + m.b) / 3. * m.a; -} +} #endregion -vec4 sampleTexture(vec2 pos) { +vec4 sampleTexture(vec2 pos) { #region if(pos.x >= 0. && pos.y >= 0. && pos.x <= 1. && pos.y <= 1.) return texture2D(gm_BaseTexture, pos); @@ -37,9 +171,9 @@ vec4 sampleTexture(vec2 pos) { return vec4(vec3(0.), 1.); return vec4(0.); -} +} #endregion -void main() { +void main() { #region vec4 clr = vec4(0.); float totalWeight = 0.; vec2 texel = 1. / dimension; @@ -53,27 +187,33 @@ void main() { } else if(realSize < 2.) realSize = 1.; - float cel = ceil(realSize); - float frac = fract(realSize); + float cel = ceil(realSize); + float frac = fract(realSize); + float weiTotal = 0.; for( float i = -cel; i <= cel; i++ ) for( float j = -cel; j <= cel; j++ ) { - if(i + j >= cel * 2.) continue; + if(abs(i + j) >= cel * 2.) continue; - vec4 sam = sampleTexture( v_vTexcoord + vec2(i, j) * texel ); + vec4 sam = sampleTexture( v_vTexcoord + vec2(i, j) * texel ); float wei = 1. - (abs(i) + abs(j)) / (realSize * 2.); wei *= clamp(abs(i + j - floor(realSize) * 2.), 0., 1.); totalWeight += wei; + weiTotal += wei * (sam.r + sam.g + sam.b) / 3. * sam.a; clr += sam * wei; } clr /= totalWeight; - gl_FragColor = clr; if(overrideColor == 1) { - gl_FragColor.rgb = overColor.rgb; - gl_FragColor.a *= overColor.a; + clr.rgb = overColor.rgb; + clr.a *= overColor.a; } -} + + if(useGradient == 1) + clr *= gradientEval(1. - weiTotal / totalWeight); + + gl_FragColor = clr; +} #endregion diff --git a/sprites/s_node_vfx_triangulate/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6.png b/sprites/s_node_vfx_triangulate/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6.png new file mode 100644 index 000000000..ee548e634 Binary files /dev/null and b/sprites/s_node_vfx_triangulate/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6.png differ diff --git a/sprites/s_node_vfx_triangulate/layers/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6/8511e3a0-0f83-4001-b767-e8cc525e1f93.png b/sprites/s_node_vfx_triangulate/layers/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6/8511e3a0-0f83-4001-b767-e8cc525e1f93.png new file mode 100644 index 000000000..ee548e634 Binary files /dev/null and b/sprites/s_node_vfx_triangulate/layers/b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6/8511e3a0-0f83-4001-b767-e8cc525e1f93.png differ diff --git a/sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy b/sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy new file mode 100644 index 000000000..48e55a522 --- /dev/null +++ b/sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "s_node_vfx_triangulate", + "bbox_bottom": 60, + "bbox_left": 5, + "bbox_right": 58, + "bbox_top": 3, + "bboxMode": 0, + "collisionKind": 1, + "collisionTolerance": 0, + "DynamicTexturePage": false, + "edgeFiltering": false, + "For3D": false, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6",}, + ], + "gridX": 0, + "gridY": 0, + "height": 64, + "HTile": false, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"8511e3a0-0f83-4001-b767-e8cc525e1f93","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,}, + ], + "nineSlice": null, + "origin": 4, + "parent": { + "name": "VFX", + "path": "folders/nodes/icons/VFX.yy", + }, + "preMultiplyAlpha": false, + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "s_node_vfx_triangulate", + "autoRecord": true, + "backdropHeight": 768, + "backdropImageOpacity": 0.5, + "backdropImagePath": "", + "backdropWidth": 1366, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "events": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "eventStubScript": null, + "eventToFunction": {}, + "length": 1.0, + "lockOrigin": false, + "moments": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "showBackdrop": true, + "showBackdropImage": false, + "timeUnits": 1, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[ + {"resourceType":"Keyframe","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"b6b2272d-e49a-4f8c-ac7b-46473f4ee1b6","path":"sprites/s_node_vfx_triangulate/s_node_vfx_triangulate.yy",},},},"Disabled":false,"id":"41a7f272-2b57-427a-9302-735209227d4f","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,}, + ],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange": null, + "volume": 1.0, + "xorigin": 32, + "yorigin": 32, + }, + "swatchColours": null, + "swfPrecision": 2.525, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "type": 0, + "VTile": false, + "width": 64, +} \ No newline at end of file