diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 21ffda41f..9d3113374 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -147,6 +147,7 @@ {"name":"effect","order":4,"path":"folders/nodes/data/pixel builder/effect.yy",}, {"name":"render","order":3,"path":"folders/nodes/data/render.yy",}, {"name":"simulation","order":16,"path":"folders/nodes/data/simulation.yy",}, + {"name":"FLIP","order":4,"path":"folders/nodes/data/simulation/FLIP.yy",}, {"name":"smokeSim","order":1,"path":"folders/nodes/data/simulation/smokeSim.yy",}, {"name":"strandSim","order":3,"path":"folders/nodes/data/simulation/strandSim.yy",}, {"name":"VFX","order":2,"path":"folders/nodes/data/simulation/VFX.yy",}, @@ -219,6 +220,7 @@ {"name":"filter","order":4,"path":"folders/shader/filter.yy",}, {"name":"color","order":53,"path":"folders/shader/filter/color.yy",}, {"name":"shadow caster","order":46,"path":"folders/shader/filter/shadow caster.yy",}, + {"name":"FLIP","order":23,"path":"folders/shader/FLIP.yy",}, {"name":"flood fill","order":11,"path":"folders/shader/flood fill.yy",}, {"name":"fluid","order":20,"path":"folders/shader/fluid.yy",}, {"name":"generator","order":1,"path":"folders/shader/generator.yy",}, @@ -420,6 +422,7 @@ {"name":"node_flip","order":13,"path":"scripts/node_flip/node_flip.yy",}, {"name":"s_node_pb_fx_subtract","order":1,"path":"sprites/s_node_pb_fx_subtract/s_node_pb_fx_subtract.yy",}, {"name":"Room_FirebaseFirestore_Query","order":1,"path":"rooms/Room_FirebaseFirestore_Query/Room_FirebaseFirestore_Query.yy",}, + {"name":"node_FLIP_spawner","order":6,"path":"scripts/node_FLIP_spawner/node_FLIP_spawner.yy",}, {"name":"Obj_FirebaseREST_Listener_Once_Firestore","order":4,"path":"objects/Obj_FirebaseREST_Listener_Once_Firestore/Obj_FirebaseREST_Listener_Once_Firestore.yy",}, {"name":"sh_FXAA","order":52,"path":"shaders/sh_FXAA/sh_FXAA.yy",}, {"name":"s_biterator_slider","order":6,"path":"sprites/s_biterator_slider/s_biterator_slider.yy",}, @@ -928,6 +931,7 @@ {"name":"fd_rectangle_shift_content","order":19,"path":"scripts/fd_rectangle_shift_content/fd_rectangle_shift_content.yy",}, {"name":"sh_texture_remap","order":24,"path":"shaders/sh_texture_remap/sh_texture_remap.yy",}, {"name":"node_application_in","order":20,"path":"scripts/node_application_in/node_application_in.yy",}, + {"name":"FLIP_Domain","order":4,"path":"objects/FLIP_Domain/FLIP_Domain.yy",}, {"name":"obj_fd_rectangle","order":1,"path":"objects/obj_fd_rectangle/obj_fd_rectangle.yy",}, {"name":"node_noise_simplex","order":7,"path":"scripts/node_noise_simplex/node_noise_simplex.yy",}, {"name":"sh_fd_visualize_velocity_divergence_glsl","order":18,"path":"shaders/sh_fd_visualize_velocity_divergence_glsl/sh_fd_visualize_velocity_divergence_glsl.yy",}, @@ -954,6 +958,7 @@ {"name":"node_json_file_read","order":7,"path":"scripts/node_json_file_read/node_json_file_read.yy",}, {"name":"s_node_array_remove","order":7,"path":"sprites/s_node_array_remove/s_node_array_remove.yy",}, {"name":"s_node_zigzag","order":18,"path":"sprites/s_node_zigzag/s_node_zigzag.yy",}, + {"name":"node_FLIP_render","order":3,"path":"scripts/node_FLIP_render/node_FLIP_render.yy",}, {"name":"s_key_display_mouse","order":1,"path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",}, {"name":"node_3d_repeat","order":1,"path":"scripts/node_3d_repeat/node_3d_repeat.yy",}, {"name":"node_pb_fx_add","order":6,"path":"scripts/node_pb_fx_add/node_pb_fx_add.yy",}, @@ -1118,6 +1123,7 @@ {"name":"node_fluid_domain_queue","order":9,"path":"scripts/node_fluid_domain_queue/node_fluid_domain_queue.yy",}, {"name":"node_sequence_to_anim","order":3,"path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",}, {"name":"sh_blend_replace","order":50,"path":"shaders/sh_blend_replace/sh_blend_replace.yy",}, + {"name":"node_FLIP_domain","order":1,"path":"scripts/node_FLIP_domain/node_FLIP_domain.yy",}, {"name":"node_rigid_render","order":3,"path":"scripts/node_rigid_render/node_rigid_render.yy",}, {"name":"node_image_splice_sheet","order":4,"path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",}, {"name":"node_VFX_renderer_output","order":8,"path":"scripts/node_VFX_renderer_output/node_VFX_renderer_output.yy",}, @@ -1482,6 +1488,7 @@ {"name":"directory_object","order":3,"path":"scripts/directory_object/directory_object.yy",}, {"name":"s_node_isosurf","order":2,"path":"sprites/s_node_isosurf/s_node_isosurf.yy",}, {"name":"node_pb_box_divide","order":5,"path":"scripts/node_pb_box_divide/node_pb_box_divide.yy",}, + {"name":"FLIP","order":5,"path":"extensions/FLIP/FLIP.yy",}, {"name":"node_websocket_sender","order":1,"path":"scripts/node_websocket_sender/node_websocket_sender.yy",}, {"name":"fd_rectangle_get_acceleration_b","order":1,"path":"scripts/fd_rectangle_get_acceleration_b/fd_rectangle_get_acceleration_b.yy",}, {"name":"surface_draw_functions","order":7,"path":"scripts/surface_draw_functions/surface_draw_functions.yy",}, @@ -1714,6 +1721,7 @@ {"name":"s_node_group_output","order":15,"path":"sprites/s_node_group_output/s_node_group_output.yy",}, {"name":"node_path_l_system","order":10,"path":"scripts/node_path_l_system/node_path_l_system.yy",}, {"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",}, + {"name":"_FLIP","order":2,"path":"scripts/_FLIP/_FLIP.yy",}, {"name":"sh_draw_r16","order":10,"path":"shaders/sh_draw_r16/sh_draw_r16.yy",}, {"name":"sh_channel_S","order":5,"path":"shaders/sh_channel_S/sh_channel_S.yy",}, {"name":"string_scale","order":4,"path":"scripts/string_scale/string_scale.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index cf7b7387e..24b9bae5b 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -175,6 +175,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"effect","folderPath":"folders/nodes/data/pixel builder/effect.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"render","folderPath":"folders/nodes/data/render.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"simulation","folderPath":"folders/nodes/data/simulation.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"FLIP","folderPath":"folders/nodes/data/simulation/FLIP.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/data/simulation/rigidSim.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"smokeSim","folderPath":"folders/nodes/data/simulation/smokeSim.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"strandSim","folderPath":"folders/nodes/data/simulation/strandSim.yy",}, @@ -251,6 +252,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/shader/filter.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/shader/filter/color.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"shadow caster","folderPath":"folders/shader/filter/shadow caster.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"FLIP","folderPath":"folders/shader/FLIP.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"flood fill","folderPath":"folders/shader/flood fill.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"fluid","folderPath":"folders/shader/fluid.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"generator","folderPath":"folders/shader/generator.yy",}, @@ -519,6 +521,7 @@ {"id":{"name":"ds_list_queue","path":"scripts/ds_list_queue/ds_list_queue.yy",},}, {"id":{"name":"s_node_scale","path":"sprites/s_node_scale/s_node_scale.yy",},}, {"id":{"name":"sh_color_picker_value","path":"shaders/sh_color_picker_value/sh_color_picker_value.yy",},}, + {"id":{"name":"node_FLIP_group","path":"scripts/node_FLIP_group/node_FLIP_group.yy",},}, {"id":{"name":"textInput","path":"scripts/textInput/textInput.yy",},}, {"id":{"name":"Obj_FirebaseFirestore_Document_Read","path":"objects/Obj_FirebaseFirestore_Document_Read/Obj_FirebaseFirestore_Document_Read.yy",},}, {"id":{"name":"node_dither","path":"scripts/node_dither/node_dither.yy",},}, @@ -632,6 +635,7 @@ {"id":{"name":"s_node_pb_fx_subtract","path":"sprites/s_node_pb_fx_subtract/s_node_pb_fx_subtract.yy",},}, {"id":{"name":"Room_FirebaseFirestore_Query","path":"rooms/Room_FirebaseFirestore_Query/Room_FirebaseFirestore_Query.yy",},}, {"id":{"name":"panel_node_credit","path":"scripts/panel_node_credit/panel_node_credit.yy",},}, + {"id":{"name":"node_FLIP_spawner","path":"scripts/node_FLIP_spawner/node_FLIP_spawner.yy",},}, {"id":{"name":"Obj_FirebaseREST_Listener_Once_Firestore","path":"objects/Obj_FirebaseREST_Listener_Once_Firestore/Obj_FirebaseREST_Listener_Once_Firestore.yy",},}, {"id":{"name":"sh_FXAA","path":"shaders/sh_FXAA/sh_FXAA.yy",},}, {"id":{"name":"s_biterator_slider","path":"sprites/s_biterator_slider/s_biterator_slider.yy",},}, @@ -1216,6 +1220,7 @@ {"id":{"name":"node_application_in","path":"scripts/node_application_in/node_application_in.yy",},}, {"id":{"name":"sh_fluid_bleach","path":"shaders/sh_fluid_bleach/sh_fluid_bleach.yy",},}, {"id":{"name":"__node_3d_modifier","path":"scripts/__node_3d_modifier/__node_3d_modifier.yy",},}, + {"id":{"name":"FLIP_Domain","path":"objects/FLIP_Domain/FLIP_Domain.yy",},}, {"id":{"name":"obj_fd_rectangle","path":"objects/obj_fd_rectangle/obj_fd_rectangle.yy",},}, {"id":{"name":"node_noise_simplex","path":"scripts/node_noise_simplex/node_noise_simplex.yy",},}, {"id":{"name":"sh_fd_visualize_velocity_divergence_glsl","path":"shaders/sh_fd_visualize_velocity_divergence_glsl/sh_fd_visualize_velocity_divergence_glsl.yy",},}, @@ -1243,6 +1248,7 @@ {"id":{"name":"node_json_file_read","path":"scripts/node_json_file_read/node_json_file_read.yy",},}, {"id":{"name":"s_node_array_remove","path":"sprites/s_node_array_remove/s_node_array_remove.yy",},}, {"id":{"name":"s_node_zigzag","path":"sprites/s_node_zigzag/s_node_zigzag.yy",},}, + {"id":{"name":"node_FLIP_render","path":"scripts/node_FLIP_render/node_FLIP_render.yy",},}, {"id":{"name":"s_key_display_mouse","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},}, {"id":{"name":"node_3d_repeat","path":"scripts/node_3d_repeat/node_3d_repeat.yy",},}, {"id":{"name":"node_pb_fx_add","path":"scripts/node_pb_fx_add/node_pb_fx_add.yy",},}, @@ -1424,6 +1430,7 @@ {"id":{"name":"node_fluid_domain_queue","path":"scripts/node_fluid_domain_queue/node_fluid_domain_queue.yy",},}, {"id":{"name":"node_sequence_to_anim","path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",},}, {"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},}, + {"id":{"name":"node_FLIP_domain","path":"scripts/node_FLIP_domain/node_FLIP_domain.yy",},}, {"id":{"name":"node_rigid_render","path":"scripts/node_rigid_render/node_rigid_render.yy",},}, {"id":{"name":"node_image_splice_sheet","path":"scripts/node_image_splice_sheet/node_image_splice_sheet.yy",},}, {"id":{"name":"node_VFX_renderer_output","path":"scripts/node_VFX_renderer_output/node_VFX_renderer_output.yy",},}, @@ -1700,6 +1707,7 @@ {"id":{"name":"s_node_pb_draw_angle","path":"sprites/s_node_pb_draw_angle/s_node_pb_draw_angle.yy",},}, {"id":{"name":"node_PCX_var","path":"scripts/node_PCX_var/node_PCX_var.yy",},}, {"id":{"name":"_f_p3","path":"fonts/_f_p3/_f_p3.yy",},}, + {"id":{"name":"sh_FLIP_render_threshold","path":"shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.yy",},}, {"id":{"name":"cornerBox","path":"scripts/cornerBox/cornerBox.yy",},}, {"id":{"name":"node_group_input","path":"scripts/node_group_input/node_group_input.yy",},}, {"id":{"name":"fd_rectangle_set_material_dissipation_type","path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},}, @@ -1844,6 +1852,7 @@ {"id":{"name":"s_node_isosurf","path":"sprites/s_node_isosurf/s_node_isosurf.yy",},}, {"id":{"name":"node_combine_hsv","path":"scripts/node_combine_hsv/node_combine_hsv.yy",},}, {"id":{"name":"node_pb_box_divide","path":"scripts/node_pb_box_divide/node_pb_box_divide.yy",},}, + {"id":{"name":"FLIP","path":"extensions/FLIP/FLIP.yy",},}, {"id":{"name":"node_dilate","path":"scripts/node_dilate/node_dilate.yy",},}, {"id":{"name":"node_websocket_sender","path":"scripts/node_websocket_sender/node_websocket_sender.yy",},}, {"id":{"name":"fd_rectangle_get_acceleration_b","path":"scripts/fd_rectangle_get_acceleration_b/fd_rectangle_get_acceleration_b.yy",},}, @@ -2116,6 +2125,7 @@ {"id":{"name":"node_path_l_system","path":"scripts/node_path_l_system/node_path_l_system.yy",},}, {"id":{"name":"panel_gradient","path":"scripts/panel_gradient/panel_gradient.yy",},}, {"id":{"name":"Obj_FirebaseFirestore_Collection_Add","path":"objects/Obj_FirebaseFirestore_Collection_Add/Obj_FirebaseFirestore_Collection_Add.yy",},}, + {"id":{"name":"_FLIP","path":"scripts/_FLIP/_FLIP.yy",},}, {"id":{"name":"sh_draw_r16","path":"shaders/sh_draw_r16/sh_draw_r16.yy",},}, {"id":{"name":"sh_channel_S","path":"shaders/sh_channel_S/sh_channel_S.yy",},}, {"id":{"name":"string_scale","path":"scripts/string_scale/string_scale.yy",},}, diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 1ff5417e4..c5972f728 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 0b0acac60..f1a8d1f8d 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 a8fc43048..ebb895a3f 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 0719dd920..6e3bf1b15 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 2f1f9dbb0..671b8b0d4 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/FLIP_Domain/CleanUp_0.gml b/objects/FLIP_Domain/CleanUp_0.gml new file mode 100644 index 000000000..713e3a489 --- /dev/null +++ b/objects/FLIP_Domain/CleanUp_0.gml @@ -0,0 +1,5 @@ +/// @description Insert description here +FLIP_cleanDomain(domain); +buffer_delete(particlePosBuff); + +domain = noone; \ No newline at end of file diff --git a/objects/FLIP_Domain/Create_0.gml b/objects/FLIP_Domain/Create_0.gml new file mode 100644 index 000000000..6850427d8 --- /dev/null +++ b/objects/FLIP_Domain/Create_0.gml @@ -0,0 +1,72 @@ +/// @description Insert description here +#region params + domain = noone; + particlePosBuff = noone; + + width = 0; + height = 0; + particleSize = 0; + density = 0; + maxParticles = 0; + + numParticles = 0; + velocityDamping = 0.9; + + dt = 0.1; + iteration = 8; + + g = 1; + flipRatio = 0.8; + numPressureIters = 3; + numParticleIters = 3; + overRelaxation = 1.5; +#endregion + +function init(width, height, particleSize, density, maxParticles) { #region domain init + particlePos = array_create(2 * maxParticles); + obstracles = []; + numParticles = 0; + + if(domain != noone && + self.width == width && + self.height == height && + self.particleSize == particleSize && + self.density == density && + self.maxParticles == maxParticles) { + + FLIP_resetDomain(domain); + return; + } + + self.width = width ; + self.height = height ; + self.particleSize = particleSize; + self.density = density ; + self.maxParticles = maxParticles; + + particlePosBuff = buffer_create(maxParticles * 2 * 8, buffer_grow, 8); + domain = FLIP_initDomain(width, height, particleSize, density, maxParticles); + particleRadius = FLIP_getParticleRadius(domain); +} #endregion + +function update() { #region + FLIP_setQuality( domain, iteration, numPressureIters, numParticleIters); + FLIP_setGravity( domain, g); + FLIP_setFlipRatio( domain, flipRatio); + FLIP_setVelocityDamping( domain, velocityDamping); + FLIP_setOverRelaxation( domain, overRelaxation); +} #endregion + +function step() { #region + FLIP_resetDensity(domain); + + for( var i = 0, n = array_length(obstracles); i < n; i++ ) + obstracles[i].apply(); + + FLIP_simulate(domain, dt); + + FLIP_setParticleBuffer(domain, buffer_get_address(particlePosBuff)); + buffer_seek(particlePosBuff, buffer_seek_start, 0); + for(var i = 0; i < 2 * maxParticles; i++) + particlePos[i] = buffer_read(particlePosBuff, buffer_f64); +} #endregion \ No newline at end of file diff --git a/objects/FLIP_Domain/Draw_64.gml b/objects/FLIP_Domain/Draw_64.gml new file mode 100644 index 000000000..176484756 --- /dev/null +++ b/objects/FLIP_Domain/Draw_64.gml @@ -0,0 +1,18 @@ +/// @description Insert description here +/* +draw_set_color(c_white); +draw_set_alpha(1); +for( var i = 0; i < numParticles; i++ ) { + var _x = particlePos[i * 2]; + var _y = particlePos[i * 2 + 1]; + + draw_circle(dx + _x, dy + _y, particleRadius * 1, false); + //draw_point(_x, _y); +} + +obstracles[0].draw(); +obstracles[1].draw(); + +draw_set_color(c_white); +draw_set_halign(fa_right); +draw_text(room_width - 16, 16, fps_real); \ No newline at end of file diff --git a/objects/FLIP_Domain/FLIP_Domain.yy b/objects/FLIP_Domain/FLIP_Domain.yy new file mode 100644 index 000000000..07add7878 --- /dev/null +++ b/objects/FLIP_Domain/FLIP_Domain.yy @@ -0,0 +1,36 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "FLIP_Domain", + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":12,"isDnD":false,}, + ], + "managed": true, + "overriddenProperties": [], + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, + "parentObjectId": null, + "persistent": false, + "physicsAngularDamping": 0.1, + "physicsDensity": 0.5, + "physicsFriction": 0.2, + "physicsGroup": 1, + "physicsKinematic": false, + "physicsLinearDamping": 0.1, + "physicsObject": false, + "physicsRestitution": 0.1, + "physicsSensor": false, + "physicsShape": 1, + "physicsShapePoints": [], + "physicsStartAwake": true, + "properties": [], + "solid": false, + "spriteId": null, + "spriteMaskId": null, + "visible": true, +} \ No newline at end of file diff --git a/objects/FLIP_Domain/Step_0.gml b/objects/FLIP_Domain/Step_0.gml new file mode 100644 index 000000000..eb34a6b38 --- /dev/null +++ b/objects/FLIP_Domain/Step_0.gml @@ -0,0 +1,2 @@ +/// @description Insert description here +//step(); \ No newline at end of file diff --git a/objects/o_dialog_color_selector/Draw_64.gml b/objects/o_dialog_color_selector/Draw_64.gml index 83af6fb24..847a156b9 100644 --- a/objects/o_dialog_color_selector/Draw_64.gml +++ b/objects/o_dialog_color_selector/Draw_64.gml @@ -42,17 +42,18 @@ if !ready exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); + var bs = ui(28); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) __initPalette(); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2) shellOpenExplorer($"{DIRECTORY}Palettes"); - + draw_sprite_ui_uniform(THEME.path_open_20, 1, bx + bs / 2, by + bs / 2, 1, c_white); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Show on Selector"), THEME.display_palette, NODE_COLOR_SHOW_PALETTE, c_white) == 2) NODE_COLOR_SHOW_PALETTE = !NODE_COLOR_SHOW_PALETTE; bx -= ui(32); #endregion diff --git a/objects/o_dialog_gradient/Create_0.gml b/objects/o_dialog_gradient/Create_0.gml index f26d30de3..85ed3595c 100644 --- a/objects/o_dialog_gradient/Create_0.gml +++ b/objects/o_dialog_gradient/Create_0.gml @@ -128,7 +128,9 @@ event_inherited(); } return hh; - }) + }); + + sp_presets.always_scroll = true; #endregion #region palette @@ -210,7 +212,9 @@ event_inherited(); click_block = false; return hh; - }) + }); + + sp_palettes.always_scroll = true; #endregion #region action diff --git a/objects/o_dialog_gradient/Draw_64.gml b/objects/o_dialog_gradient/Draw_64.gml index 3ec32d000..466018cd3 100644 --- a/objects/o_dialog_gradient/Draw_64.gml +++ b/objects/o_dialog_gradient/Draw_64.gml @@ -47,37 +47,34 @@ if !ready exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); + var bs = ui(28); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset")) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) { var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); dia.onModify = function (txt) { var gradStr = ""; + for(var i = 0; i < array_length(gradient.keys); i++) { var gr = gradient.keys[i]; - var cc = gr.value; - var tt = gr.time; - - gradStr += string(cc) + "," + string(tt) + "\n"; + gradStr += $"{gr.value},{gr.time}\n"; } - var file = file_text_open_write(txt + ".txt"); - file_text_write_string(file, gradStr); - file_text_close(file); + file_text_write_all(txt + ".txt", gradStr); __initGradient(); }; dia.path = DIRECTORY + "Gradients/" } - draw_sprite_ui_uniform(THEME.add, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) __initGradient(); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("graident_editor_open_folder", "Open gradient folder"), THEME.folder) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("graident_editor_open_folder", "Open gradient folder"), THEME.path_open_20) == 2) { var _realpath = DIRECTORY + "Gradients"; shellOpenExplorer(_realpath) } + draw_sprite_ui_uniform(THEME.path_open_20, 1, bx + bs / 2, by + bs / 2, 1, c_white); bx -= ui(32); #endregion diff --git a/objects/o_dialog_palette/Create_0.gml b/objects/o_dialog_palette/Create_0.gml index 7ebaa84ad..94a17ff23 100644 --- a/objects/o_dialog_palette/Create_0.gml +++ b/objects/o_dialog_palette/Create_0.gml @@ -102,7 +102,9 @@ event_inherited(); } return hh; - }) + }); + + sp_presets.always_scroll = true; #endregion #region tools diff --git a/objects/o_dialog_palette/Draw_64.gml b/objects/o_dialog_palette/Draw_64.gml index 6ccffb62b..83fd11424 100644 --- a/objects/o_dialog_palette/Draw_64.gml +++ b/objects/o_dialog_palette/Draw_64.gml @@ -41,8 +41,9 @@ if palette == 0 exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); + var bs = ui(28); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add_20) == 2) { var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); dia.onModify = function (txt) { var file = file_text_open_write(txt + ".hex"); @@ -52,8 +53,7 @@ if palette == 0 exit; var g = number_to_hex(color_get_green(cc)); var b = number_to_hex(color_get_blue(cc)); - file_text_write_string(file, r + g + b); - file_text_writeln(file); + file_text_write_string(file, $"{r}{g}{b}\n"); } file_text_close(file); __initPalette(); @@ -62,17 +62,15 @@ if palette == 0 exit; } bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_20) == 2) __initPalette(); - - draw_sprite_ui_uniform(THEME.refresh, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.path_open_20) == 2) { var _realpath = DIRECTORY + "Palettes"; shellOpenExplorer(_realpath) } - draw_sprite_ui_uniform(THEME.folder, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); + draw_sprite_ui_uniform(THEME.path_open_20, 1, bx + bs / 2, by + bs / 2, 1, c_white); bx -= ui(32); #endregion diff --git a/objects/o_dialog_preference/Create_0.gml b/objects/o_dialog_preference/Create_0.gml index 86b04a7eb..865455f3c 100644 --- a/objects/o_dialog_preference/Create_0.gml +++ b/objects/o_dialog_preference/Create_0.gml @@ -777,7 +777,7 @@ event_inherited(); modified = true; var bx = x1 - ui(32); var by = yy + hh; - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_s) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16) == 2) { key.key = dkey; key.modi = dmod; @@ -856,7 +856,7 @@ event_inherited(); modified = true; var bx = x1 - ui(32); var by = yy + hh; - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_s) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16) == 2) { key.key = key.dkey; PREF_SAVE(); @@ -870,7 +870,7 @@ event_inherited(); //if(modified) { // var bx = x1 - ui(32); // var by = yy + ui(2); - // if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset all"), THEME.refresh_s) == 2) { + // if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset all"), THEME.refresh_16) == 2) { // for(var j = 0; j < ds_list_size(HOTKEY_CONTEXT); j++) { // var ll = HOTKEYS[? HOTKEY_CONTEXT[| j]]; // for(var i = 0; i < ds_list_size(ll); i++) { @@ -971,9 +971,9 @@ event_inherited(); var _by = yy + th / 2 - _bs / 2; if(isEqual(data, _defVal)) - draw_sprite_ext(THEME.refresh_s, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); + draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); else { - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, sFOCUS, sHOVER && sp_pref.hover, __txt("Reset"), THEME.refresh_s) == 2) + if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, sFOCUS, sHOVER && sp_pref.hover, __txt("Reset"), THEME.refresh_16) == 2) _pref.onEdit(_defVal); } } diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 09c60be14..ec21313b4 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -309,5 +309,7 @@ global.__debug_runner = 0; __debug_animator_counter = 0; - //instance_create(0, 0, o_video_banner); + //instance_create(0, 0, o_video_banner, { title: "Trail effect" }); + //instance_create_depth(0, 0, -32000, FLIP_Domain); + //instance_create_depth(0, 0, -32000, FLIP_Domain); #endregion \ No newline at end of file diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index 78b2e5b9f..450d8414d 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -53,7 +53,7 @@ if(winMan_isMinimized()) exit; case VALUE_TYPE.pathnode : draw_tooltip_text("[" + __txt("Path Object") + "]"); break; - case VALUE_TYPE.fdomain : + case VALUE_TYPE.sdomain : draw_tooltip_text("[" + __txt("Domain") + " (id: " + string(content) + ")]"); break; case VALUE_TYPE.strands : diff --git a/objects/o_video_banner/Draw_75.gml b/objects/o_video_banner/Draw_75.gml index 1bfbd016d..b1544c4d9 100644 --- a/objects/o_video_banner/Draw_75.gml +++ b/objects/o_video_banner/Draw_75.gml @@ -16,7 +16,7 @@ surface_set_target(surface); draw_set_text(f_h3, fa_left, fa_top, c_white); draw_set_alpha(0.7); - draw_text(210, h / 2 + 10, "Tutorial 20: 3D in 1.16"); + draw_text(210, h / 2 + 10, title); draw_set_alpha(1); surface_reset_target(); diff --git a/scripts/_FLIP/_FLIP.gml b/scripts/_FLIP/_FLIP.gml new file mode 100644 index 000000000..690cc72a0 --- /dev/null +++ b/scripts/_FLIP/_FLIP.gml @@ -0,0 +1,19 @@ +function FLIP_Obstracle(domain) constructor { + x = 0; + y = 0; + r = 20; + + self.domain = domain; + raw = FLIP_createObstracle(domain); + + static apply = function() { + FLIP_setObstacle_circle(domain, raw, x, y, r, false); + return self; + } + + static draw = function() { + draw_set_color(c_red); + draw_circle(x, y, r, false); + return self; + } +} \ No newline at end of file diff --git a/scripts/_FLIP/_FLIP.yy b/scripts/_FLIP/_FLIP.yy new file mode 100644 index 000000000..d00ca1657 --- /dev/null +++ b/scripts/_FLIP/_FLIP.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "_FLIP", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, +} \ No newline at end of file diff --git a/scripts/__panel_linear_setting/__panel_linear_setting.gml b/scripts/__panel_linear_setting/__panel_linear_setting.gml index 4da6b30e3..af35552de 100644 --- a/scripts/__panel_linear_setting/__panel_linear_setting.gml +++ b/scripts/__panel_linear_setting/__panel_linear_setting.gml @@ -112,9 +112,9 @@ function Panel_Linear_Setting() : PanelContent() constructor { #region var _by = yy - _bs / 2; if(isEqual(_data, _defVal)) - draw_sprite_ext(THEME.refresh_s, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); + draw_sprite_ext(THEME.refresh_16, 0, _bx + _bs / 2, _by + _bs / 2, 1, 1, 0, COLORS._main_icon_dark); else { - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, __txt("Reset"), THEME.refresh_s) == 2) + if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, [ mx, my ], pFOCUS, pHOVER, __txt("Reset"), THEME.refresh_16) == 2) _prop.onEdit(_defVal); } } diff --git a/scripts/buttonColor/buttonColor.gml b/scripts/buttonColor/buttonColor.gml index 616df6724..ef637999a 100644 --- a/scripts/buttonColor/buttonColor.gml +++ b/scripts/buttonColor/buttonColor.gml @@ -116,9 +116,9 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { } if(is_array(current_color)) - drawPalette(current_color, _x + ui(6), _y + ui(6), _cw - ui(12), _h - ui(12)); + drawPalette(current_color, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8)); else if(is_real(current_color)) - draw_sprite_stretched_ext(THEME.button_color_overlay, 0, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8), current_color, 1); + draw_sprite_stretched_ext(THEME.palette_mask, 1, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8), current_color, 1); if(WIDGET_CURRENT == self) draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1); diff --git a/scripts/buttonGradient/buttonGradient.gml b/scripts/buttonGradient/buttonGradient.gml index 0412cf398..a08914fe6 100644 --- a/scripts/buttonGradient/buttonGradient.gml +++ b/scripts/buttonGradient/buttonGradient.gml @@ -28,8 +28,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { y = _y; w = _w; - var _gw = _w - ui(12); - var _gh = _h - ui(12); + var _gw = _w - ui(8); + var _gh = _h - ui(8); current_gradient = _gradient; @@ -66,8 +66,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { for( var i = 0, n = array_length(_gradient); i < n; i++ ) { var _grad = _gradient[i]; - var _gx = _x + ui(6); - var _gy = _y + ui(6) + i * _gh; + var _gx = _x + ui(4); + var _gy = _y + ui(4) + i * _gh; if(is_instanceof(_grad, gradientObject)) _grad.draw(_gx, _gy, _gw, _gh); diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index 4e51918cf..2648c9615 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -28,8 +28,8 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { w = _w; h = _h; - var _pw = _w - ui(12); - var _ph = _h - ui(12); + var _pw = _w - ui(8); + var _ph = _h - ui(8); current_palette = _color; @@ -64,8 +64,8 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { for( var i = 0, n = array_length(_color); i < n; i++ ) { var _pal = _color[i]; - var _px = _x + ui(6); - var _py = _y + ui(6) + i * _ph; + var _px = _x + ui(4); + var _py = _y + ui(4) + i * _ph; if(is_array(_pal)) drawPalette(_pal, _px, _py, _pw, _ph); @@ -86,21 +86,35 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { } } -function drawPalette(_pal, _x, _y, _w, _h, _a = 1) { - var ww = _w / array_length(_pal); - draw_set_alpha(_a); - for(var i = 0; i < array_length(_pal); i++) { - if(!is_real(_pal[i])) continue; - draw_set_color(_pal[i]); - var _x0 = _x + i * ww; - var _x1 = _x0 + ww - 1; - draw_rectangle(_x0, _y, _x1, _y + _h, false); +function drawPalette(_pal, _x, _y, _w, _h, _a = 1) { #region + var aa = array_length(_pal); + + if(aa == 1) { + draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y, _w, _h, _pal[0], _a); + return; } - draw_set_alpha(1); -} + + var ww = _w / aa; + var _x0 = _x; + + for(var i = 0; i < aa; i++) { + if(!is_real(_pal[i])) continue; + + var _in = 0; + + if(i == 0) + _in = 2; + else if(i == aa - 1) + _in = 3; + + draw_sprite_stretched_ext(THEME.palette_mask, _in, floor(_x0), _y, ceil(ww), _h, _pal[i], _a); + + _x0 += ww; + } +} #endregion -function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { +function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { #region var amo = array_length(_pal); var col = floor(_w / _gs); var row = ceil(amo / col); @@ -123,4 +137,4 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { draw_set_color(c_white); draw_rectangle_border(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, 2); } -} +} #endregion \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 22b8670a5..d73791b89 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -25,10 +25,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; LATEST_VERSION = 11500; - VERSION = 11610; - SAVE_VERSION = 11610; - VERSION_STRING = "1.16.1.0"; - BUILD_NUMBER = 11610; + VERSION = 11620; + SAVE_VERSION = 11620; + VERSION_STRING = "1.16.2.0"; + BUILD_NUMBER = 11620; globalvar APPEND_MAP; APPEND_MAP = ds_map_create(); diff --git a/scripts/gradients_function/gradients_function.gml b/scripts/gradients_function/gradients_function.gml index 0d413864e..3b57f9cf7 100644 --- a/scripts/gradients_function/gradients_function.gml +++ b/scripts/gradients_function/gradients_function.gml @@ -18,6 +18,7 @@ function gradientObject(color = c_black) constructor { #region if(is_array(color)) keys = [ new gradientKey(0, color[0]), new gradientKey(1, color[1]) ]; else keys = [ new gradientKey(0, color) ]; type = GRADIENT_INTER.smooth; + surf = noone; static clone = function() { #region var g = new gradientObject(); @@ -93,25 +94,39 @@ function gradientObject(color = c_black) constructor { #region for(var i = 0; i < len; i++) { if(keys[i].value == undefined) return; - _grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255; + _grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255; _grad_color[i * 4 + 1] = color_get_green(keys[i].value) / 255; - _grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255; + _grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255; _grad_color[i * 4 + 3] = 1; - _grad_time[i] = keys[i].time; + _grad_time[i] = keys[i].time; } - - if(len == 0) { - draw_sprite_stretched_ext(s_fx_pixel, 0, _x, _y, _w, _h, c_white, _a) - } else { - shader_set(sh_gradient_display); - shader_set_uniform_i(uniform_grad_blend, type); - shader_set_uniform_f_array_safe(uniform_grad, _grad_color, GRADIENT_LIMIT * 4); - shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time); - shader_set_uniform_i(uniform_grad_key, len); + + surf = surface_verify(surf, _w, _h); + + surface_set_target(surf); + DRAW_CLEAR - draw_sprite_stretched_ext(s_fx_pixel, 0, _x, _y, _w, _h, c_white, _a) - shader_reset(); - } + gpu_set_colorwriteenable(0, 0, 0, 1); + draw_sprite_stretched_ext(THEME.gradient_mask, 0, 0, 0, _w, _h, c_white, _a) + gpu_set_colorwriteenable(1, 1, 1, 0); + + if(len == 0) { + draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _w, _h, c_white, 1); + } else { + shader_set(sh_gradient_display); + shader_set_uniform_i(uniform_grad_blend, type); + shader_set_uniform_f_array_safe(uniform_grad, _grad_color, GRADIENT_LIMIT * 4); + shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time); + shader_set_uniform_i(uniform_grad_key, len); + + draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _w, _h, c_white, 1); + shader_reset(); + } + + gpu_set_colorwriteenable(1, 1, 1, 1); + surface_reset_target(); + + draw_surface(surf, _x, _y); } #endregion static toArray = function() { #region diff --git a/scripts/instance_create/instance_create.gml b/scripts/instance_create/instance_create.gml index c2a765b59..f4d17d868 100644 --- a/scripts/instance_create/instance_create.gml +++ b/scripts/instance_create/instance_create.gml @@ -1,8 +1,4 @@ -/// @description Creates an instance of a given object at a given position. -/// @param x The x position the object will be created at. -/// @param y The y position the object will be created at. -/// @param obj The object to create an instance of. -function instance_create(_x, _y, object) { +function instance_create(_x, _y, object, params = {}) { var myDepth = object_get_depth( object ); - return instance_create_depth( _x, _y, myDepth, object ); + return instance_create_depth( _x, _y, myDepth, object, params ); } diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index c7fbd4271..2289b0eff 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -223,10 +223,10 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc bx -= ui(28); if(jun.is_modified) { - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_s, 0, COLORS._main_icon) == 2) + if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_16, 0, COLORS._main_icon) == 2) jun.resetValue(); } else - draw_sprite_ui(THEME.refresh_s, 0, bx, by,,,, COLORS._main_icon, 0.5); + draw_sprite_ui(THEME.refresh_16, 0, bx, by,,,, COLORS._main_icon, 0.5); bx -= ui(28); var ic_b = jun.expUse? c_white : COLORS._main_icon; diff --git a/scripts/node_FLIP_domain/node_FLIP_domain.gml b/scripts/node_FLIP_domain/node_FLIP_domain.gml new file mode 100644 index 000000000..b8362d8e8 --- /dev/null +++ b/scripts/node_FLIP_domain/node_FLIP_domain.gml @@ -0,0 +1,81 @@ +function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Domain"; + color = COLORS.node_blend_fluid; + icon = THEME.fluid_sim; + w = 96; + min_h = 96; + + manual_ungroupable = false; + update_on_frame = true; + + inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 1] = nodeValue("Particle Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2); + + inputs[| 2] = nodeValue("Particle Density", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 10); + + inputs[| 3] = nodeValue("FLIP Ratio", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.8) + .setDisplay(VALUE_DISPLAY.slider); + + inputs[| 4] = nodeValue("Resolve accelerator", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1.5); + + inputs[| 5] = nodeValue("Iteration", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 8); + + inputs[| 6] = nodeValue("Damping", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.8) + .setDisplay(VALUE_DISPLAY.slider); + + inputs[| 7] = nodeValue("Gravity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 5); + + inputs[| 8] = nodeValue("Time Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.05); + + input_display_list = [ + ["Domain", false], 0, 1, 2, + ["Solver", false], 3, 4, 5, + ["Physics", false], 8, 6, 7, + ] + + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + + attributes.max_particles = 10000; + + domain = instance_create(0, 0, FLIP_Domain); + + static update = function(frame = CURRENT_FRAME) { + var _dim = getInputData(0); + var _siz = getInputData(1); + var _den = getInputData(2); + + var _flp = getInputData(3); + var _ovr = getInputData(4); + var _itr = getInputData(5); + + var _dmp = getInputData(6); + var _grv = getInputData(7); + var _dt = getInputData(8); + + if(frame == 0 || domain == noone) { + var width = _dim[0] + _siz * 2; + var height = _dim[1] + _siz * 2; + var particleSize = _siz; + var density = _den; + var maxParticles = attributes.max_particles; + + domain.init(width, height, particleSize, density, maxParticles); + } + + domain.velocityDamping = _dmp; + domain.dt = _dt; + domain.iteration = _itr; + + domain.g = _grv; + domain.flipRatio = _flp; + domain.numPressureIters = 3; + domain.numParticleIters = 3; + domain.overRelaxation = _ovr; + + domain.update(); + + outputs[| 0].setValue(domain); + } +} \ No newline at end of file diff --git a/scripts/node_FLIP_domain/node_FLIP_domain.yy b/scripts/node_FLIP_domain/node_FLIP_domain.yy new file mode 100644 index 000000000..9771e907f --- /dev/null +++ b/scripts/node_FLIP_domain/node_FLIP_domain.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_FLIP_domain", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_FLIP_group/node_FLIP_group.gml b/scripts/node_FLIP_group/node_FLIP_group.gml new file mode 100644 index 000000000..01b63e540 --- /dev/null +++ b/scripts/node_FLIP_group/node_FLIP_group.gml @@ -0,0 +1,20 @@ +function Node_FLIP_Group_Inline(_x, _y, _group = noone) : Node_Collection_Inline(_x, _y, _group) constructor { + name = "FLIP Fluid"; + color = COLORS.node_blend_fluid; + icon = THEME.fluid_sim; + + update_on_frame = true; + + if(!LOADING && !APPENDING && !CLONING) { + var _domain = nodeBuild("Node_FLIP_Domain", x, y); + var _spawn = nodeBuild("Node_FLIP_Spawner", x + 160, y); + var _render = nodeBuild("Node_FLIP_Render", x + 320, y); + + _spawn.inputs[| 0].setFrom(_domain.outputs[| 0]); + _render.inputs[| 0].setFrom(_spawn.outputs[| 0]); + + addNode(_domain); + addNode(_spawn); + addNode(_render); + } +} \ No newline at end of file diff --git a/scripts/node_FLIP_group/node_FLIP_group.yy b/scripts/node_FLIP_group/node_FLIP_group.yy new file mode 100644 index 000000000..b7b2fe8e1 --- /dev/null +++ b/scripts/node_FLIP_group/node_FLIP_group.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_FLIP_group", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_FLIP_render/node_FLIP_render.gml b/scripts/node_FLIP_render/node_FLIP_render.gml new file mode 100644 index 000000000..afc6ef54c --- /dev/null +++ b/scripts/node_FLIP_render/node_FLIP_render.gml @@ -0,0 +1,58 @@ +function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Render"; + color = COLORS.node_blend_fluid; + icon = THEME.fluid_sim; + + manual_ungroupable = false; + + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + .setVisible(true, true); + + input_display_list = [ 0 ]; + + outputs[| 0] = nodeValue("Rendered", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + + temp_surface = [ noone ] + + static update = function(frame = CURRENT_FRAME) { + var domain = getInputData(0); + if(!instance_exists(domain)) return; + + domain.step(); + + var _outSurf = outputs[| 0].getValue(); + var _padd = domain.particleSize; + var _ww = domain.width - _padd * 2; + var _hh = domain.height - _padd * 2; + + _outSurf = surface_verify(_outSurf, _ww, _hh); + temp_surface[0] = surface_verify(temp_surface[0], _ww, _hh); + + outputs[| 0].setValue(_outSurf); + + var _rad = domain.particleRadius; + + surface_set_target(temp_surface[0]); + DRAW_CLEAR + BLEND_ADD + + for( var i = 0; i < domain.numParticles; i++ ) { + var _x = domain.particlePos[i * 2 + 0]; + var _y = domain.particlePos[i * 2 + 1]; + + if(_x == 0 && _y == 0) continue; + + _x -= _padd + _y -= _padd + + draw_circle_color(_x, _y, _rad * 4, c_white, c_black, false); + } + + BLEND_NORMAL + surface_reset_target(); + + surface_set_shader(_outSurf, sh_FLIP_render_threshold); + draw_surface(temp_surface[0], 0, 0); + surface_reset_shader(); + } +} \ No newline at end of file diff --git a/scripts/node_FLIP_render/node_FLIP_render.yy b/scripts/node_FLIP_render/node_FLIP_render.yy new file mode 100644 index 000000000..2bb1b0da0 --- /dev/null +++ b/scripts/node_FLIP_render/node_FLIP_render.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_FLIP_render", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_FLIP_spawner/node_FLIP_spawner.gml b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml new file mode 100644 index 000000000..0b14cd7bf --- /dev/null +++ b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml @@ -0,0 +1,171 @@ +function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Spawner"; + color = COLORS.node_blend_fluid; + icon = THEME.fluid_sim; + w = 96; + min_h = 96; + + manual_ungroupable = false; + + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone ) + .setVisible(true, true); + + inputs[| 1] = nodeValue("Spawn shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 ) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Circle", "Surface" ]); + + inputs[| 2] = nodeValue("Spawn position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] ) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 3] = nodeValue("Spawn type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 ) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Stream", "Splash" ]); + + inputs[| 4] = nodeValue("Spawn frame", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 ); + + inputs[| 5] = nodeValue("Spawn amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 4 ); + + inputs[| 6] = nodeValue("Spawn velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] ) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 7] = nodeValue("Spawn surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone ); + + inputs[| 8] = nodeValue("Spawn radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 4 ) + .setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 0.1] }); + + inputs[| 9] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100000, 999999) ); + + input_display_list = [ 0, 9, + ["Spawner", false], 1, 7, 8, 2, 3, 4, 5, + ["Physics", false], 6, + ] + + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone ); + + spawn_amo = 0; + + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region + var _shp = getInputData(1); + var _posit = getInputData(2); + var _velo = getInputData(6); + + var _px = _x + _posit[0] * _s; + var _py = _y + _posit[1] * _s; + + var _vx = _px + _velo[0] * _s; + var _vy = _py + _velo[1] * _s; + + if(_shp == 0) { + var _rad = getInputData(8); + + if(inputs[| 8].drawOverlay(active, _px, _py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori)) active = false; + + draw_set_color(COLORS._main_accent); + draw_circle(_px, _py, _rad * _s, true); + } else if(_shp == 1) { + var _surf = getInputData(7); + if(!is_surface(_surf)) return; + + var _sw = surface_get_width_safe(_surf); + var _sh = surface_get_height_safe(_surf); + + draw_surface_ext(_surf, _px - _sw * _s / 2, _py - _sh * _s / 2, _s, _s, 0, c_white, 0.5); + } + + draw_set_color(COLORS._main_accent); + draw_set_alpha(0.5); + draw_line_width2(_px, _py, _vx, _vy, 6, 2); + draw_set_alpha(1); + + if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false; + if(inputs[| 6].drawOverlay(active, _px, _py, _s, _mx, _my, _snx, _sny)) active = false; + + } #endregion + + static step = function() { #region + var _shp = getInputData(1); + var _typ = getInputData(3); + + inputs[| 4].setVisible(_typ == 1); + inputs[| 7].setVisible(_shp == 1, _shp == 1); + inputs[| 8].setVisible(_shp == 0); + } #endregion + + static update = function(frame = CURRENT_FRAME) { + var domain = getInputData(0); + if(!instance_exists(domain)) return; + + outputs[| 0].setValue(domain); + + var _shape = getInputData(1); + var _posit = getInputData(2); + var _type = getInputData(3); + var _fra = getInputData(4); + var _amo = getInputData(5); + var _vel = getInputData(6); + var _surf = getInputData(7); + var _rad = getInputData(8); + var _seed = getInputData(9); + + _amo = min(_amo, domain.maxParticles - domain.numParticles); + spawn_amo += _amo; + + if(spawn_amo < 1) return; + if(_type == 1 && frame != _fra) return; + if(_shape == 1 && !is_surface(_surf)) return; + + var _samo = floor(spawn_amo); + spawn_amo -= _samo; + + if(_shape == 1) { + var _sw = surface_get_width(_surf); + var _sh = surface_get_height(_surf); + + var _points = get_points_from_dist(_surf, _samo, _seed + ceil(_amo) * frame); + _samo = array_length(_points); + + if(_samo == 0) return; + } + + domain.numParticles += _samo; + + var _buffP = buffer_create(_samo * 2 * 8, buffer_fixed, 8); + var _buffV = buffer_create(_samo * 2 * 8, buffer_fixed, 8); + + buffer_seek(_buffP, buffer_seek_start, 0); + buffer_seek(_buffV, buffer_seek_start, 0); + + random_set_seed(_seed + ceil(_amo) * frame); + var ind = 0; + + repeat(_samo) { + var _x = _posit[0]; + var _y = _posit[1]; + + if(_shape == 0) { + var _dir = random(360); + var _dis = sqrt(random(1)) * _rad; + + _x = _posit[0] + lengthdir_x(_dis, _dir); + _y = _posit[1] + lengthdir_y(_dis, _dir); + + buffer_write(_buffP, buffer_f64, _x); + buffer_write(_buffP, buffer_f64, _y); + } else if(_shape == 1) { + _x = _posit[0] - _sw / 2 + _points[ind][0] * _sw; + _y = _posit[1] - _sh / 2 + _points[ind][1] * _sh; + + buffer_write(_buffP, buffer_f64, _x); + buffer_write(_buffP, buffer_f64, _y); + } + + buffer_write(_buffV, buffer_f64, _vel[0]); + buffer_write(_buffV, buffer_f64, _vel[1]); + + ind++; + } + + FLIP_spawnParticles(domain.domain, buffer_get_address(_buffP), buffer_get_address(_buffV), _amo); + + buffer_delete(_buffP); + buffer_delete(_buffV); + } +} \ No newline at end of file diff --git a/scripts/node_FLIP_spawner/node_FLIP_spawner.yy b/scripts/node_FLIP_spawner/node_FLIP_spawner.yy new file mode 100644 index 000000000..769977e4a --- /dev/null +++ b/scripts/node_FLIP_spawner/node_FLIP_spawner.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_FLIP_spawner", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "FLIP", + "path": "folders/nodes/data/simulation/FLIP.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_color/node_color.gml b/scripts/node_color/node_color.gml index c42fc92b8..c9a6bf687 100644 --- a/scripts/node_color/node_color.gml +++ b/scripts/node_color/node_color.gml @@ -1,5 +1,5 @@ function Node_Color(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { - name = "Color"; + name = "Color"; w = 96; inputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); @@ -21,7 +21,6 @@ function Node_Color(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con return; } - draw_set_color(col); - draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0); + draw_sprite_stretched_ext(THEME.palette_mask, 1, bbox.x0, bbox.y0, bbox.w, bbox.h, col, 1); } } \ No newline at end of file diff --git a/scripts/node_color_replacement/node_color_replacement.gml b/scripts/node_color_replacement/node_color_replacement.gml index bfc716230..880bdf437 100644 --- a/scripts/node_color_replacement/node_color_replacement.gml +++ b/scripts/node_color_replacement/node_color_replacement.gml @@ -36,7 +36,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g var by = _y; var bs = ui(24); - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.refresh_s) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, _m, _focus, _hover,, THEME.refresh_16) == 2) refreshPalette(); bx += bs + ui(4); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 86034949f..3d3f1f8ae 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -982,7 +982,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x draw_set_text(f_p1, fa_left, fa_center, cc); - if(hasInspector1Update()) icon = THEME.refresh_s; + if(hasInspector1Update()) icon = THEME.refresh_16; var ts = clamp(power(_s, 0.5), 0.5, 1); var aa = 0.5 + 0.5 * renderActive; diff --git a/scripts/node_fluid_add/node_fluid_add.gml b/scripts/node_fluid_add/node_fluid_add.gml index a5f179e3f..a9176c84b 100644 --- a/scripts/node_fluid_add/node_fluid_add.gml +++ b/scripts/node_fluid_add/node_fluid_add.gml @@ -7,7 +7,7 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Fluid brush", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); @@ -36,7 +36,7 @@ function Node_Fluid_Add(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) con _prevPos = noone; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); temp_surface = [ surface_create(1, 1) ]; diff --git a/scripts/node_fluid_add_collider/node_fluid_add_collider.gml b/scripts/node_fluid_add_collider/node_fluid_add_collider.gml index 0a62ca701..5543d5363 100644 --- a/scripts/node_fluid_add_collider/node_fluid_add_collider.gml +++ b/scripts/node_fluid_add_collider/node_fluid_add_collider.gml @@ -5,7 +5,7 @@ function Node_Fluid_Add_Collider(_x, _y, _group = noone) : Node_Fluid(_x, _y, _g manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Collider", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); @@ -18,7 +18,7 @@ function Node_Fluid_Add_Collider(_x, _y, _group = noone) : Node_Fluid(_x, _y, _g ["Collider", false], 1, 2, ]; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { var _mat = getInputData(1); diff --git a/scripts/node_fluid_apply_velo/node_fluid_apply_velo.gml b/scripts/node_fluid_apply_velo/node_fluid_apply_velo.gml index 19c7985bb..6a9e7c795 100644 --- a/scripts/node_fluid_apply_velo/node_fluid_apply_velo.gml +++ b/scripts/node_fluid_apply_velo/node_fluid_apply_velo.gml @@ -5,7 +5,7 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y, manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Brush", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); @@ -23,7 +23,7 @@ function Node_Fluid_Apply_Velocity(_x, _y, _group = noone) : Node_Fluid(_x, _y, ["Velocity", false], 4, 1, 2, 3 ]; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { var _mat = getInputData(1); diff --git a/scripts/node_fluid_domain/node_fluid_domain.gml b/scripts/node_fluid_domain/node_fluid_domain.gml index 6919f3ac3..c0577acc9 100644 --- a/scripts/node_fluid_domain/node_fluid_domain.gml +++ b/scripts/node_fluid_domain/node_fluid_domain.gml @@ -40,7 +40,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) inputs[| 11] = nodeValue("Wrap", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); input_display_list = [ ["Domain", false], 0, 11, 1, diff --git a/scripts/node_fluid_domain_queue/node_fluid_domain_queue.gml b/scripts/node_fluid_domain_queue/node_fluid_domain_queue.gml index 7e9326176..00be2eae7 100644 --- a/scripts/node_fluid_domain_queue/node_fluid_domain_queue.gml +++ b/scripts/node_fluid_domain_queue/node_fluid_domain_queue.gml @@ -4,12 +4,12 @@ function Node_Fluid_Domain_Queue(_x, _y, _group = noone) : Node_Fluid(_x, _y, _g manual_ungroupable = false; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static createNewInput = function() { var index = ds_list_size(inputs); - inputs[| index] = nodeValue("Input", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone ) + inputs[| index] = nodeValue("Input", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone ) .setVisible(true, true); return inputs[| index]; diff --git a/scripts/node_fluid_render/node_fluid_render.gml b/scripts/node_fluid_render/node_fluid_render.gml index ff7949b64..1ade0bf0e 100644 --- a/scripts/node_fluid_render/node_fluid_render.gml +++ b/scripts/node_fluid_render/node_fluid_render.gml @@ -6,7 +6,7 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) diff --git a/scripts/node_fluid_render_output/node_fluid_render_output.gml b/scripts/node_fluid_render_output/node_fluid_render_output.gml index 7b3ba7a4e..676a212a4 100644 --- a/scripts/node_fluid_render_output/node_fluid_render_output.gml +++ b/scripts/node_fluid_render_output/node_fluid_render_output.gml @@ -11,7 +11,7 @@ function Node_Fluid_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) diff --git a/scripts/node_fluid_repulse/node_fluid_repulse.gml b/scripts/node_fluid_repulse/node_fluid_repulse.gml index 05f8339e2..4f08d34b0 100644 --- a/scripts/node_fluid_repulse/node_fluid_repulse.gml +++ b/scripts/node_fluid_repulse/node_fluid_repulse.gml @@ -5,7 +5,7 @@ function Node_Fluid_Repulse(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) @@ -24,7 +24,7 @@ function Node_Fluid_Repulse(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) ["Repulse", false], 4, 1, 2, 3 ]; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { var _pos = getInputData(1); diff --git a/scripts/node_fluid_turbulence/node_fluid_turbulence.gml b/scripts/node_fluid_turbulence/node_fluid_turbulence.gml index 601b99440..e24531d5b 100644 --- a/scripts/node_fluid_turbulence/node_fluid_turbulence.gml +++ b/scripts/node_fluid_turbulence/node_fluid_turbulence.gml @@ -5,7 +5,7 @@ function Node_Fluid_Turbulence(_x, _y, _group = noone) : Node_Fluid(_x, _y, _gro manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Effect area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, AREA_DEF) @@ -27,7 +27,7 @@ function Node_Fluid_Turbulence(_x, _y, _group = noone) : Node_Fluid(_x, _y, _gro ["Turbulence", false], 5, 1, 2, 4, 3 ]; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); diff --git a/scripts/node_fluid_update/node_fluid_update.gml b/scripts/node_fluid_update/node_fluid_update.gml index b2afc27f2..d943382ab 100644 --- a/scripts/node_fluid_update/node_fluid_update.gml +++ b/scripts/node_fluid_update/node_fluid_update.gml @@ -7,7 +7,7 @@ function Node_Fluid_Update(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); @@ -17,7 +17,7 @@ function Node_Fluid_Update(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) ["Update", false], 1, ] - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); static update = function(frame = CURRENT_FRAME) { if(!PROJECT.animator.is_playing) return; diff --git a/scripts/node_fluid_vortex/node_fluid_vortex.gml b/scripts/node_fluid_vortex/node_fluid_vortex.gml index 8174371e4..c30eab726 100644 --- a/scripts/node_fluid_vortex/node_fluid_vortex.gml +++ b/scripts/node_fluid_vortex/node_fluid_vortex.gml @@ -5,7 +5,7 @@ function Node_Fluid_Vortex(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) manual_ungroupable = false; - inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.fdomain, noone) + inputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.input, VALUE_TYPE.sdomain, noone) .setVisible(true, true); inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) @@ -27,7 +27,7 @@ function Node_Fluid_Vortex(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) ["Vortex", false], 5, 1, 2, 3, 4 ]; - outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.fdomain, noone); + outputs[| 0] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.sdomain, noone); outputs[| 1] = nodeValue("Domain", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index b6dc8ab20..699bde0e5 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -26,7 +26,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru data_type_map = [ VALUE_TYPE.integer, VALUE_TYPE.float, VALUE_TYPE.boolean, VALUE_TYPE.color, VALUE_TYPE.surface, VALUE_TYPE.path, VALUE_TYPE.curve, VALUE_TYPE.text, VALUE_TYPE.object, VALUE_TYPE.node, noone, VALUE_TYPE.any, VALUE_TYPE.pathnode, VALUE_TYPE.particle, VALUE_TYPE.rigid, - VALUE_TYPE.fdomain, VALUE_TYPE.struct, VALUE_TYPE.strands, VALUE_TYPE.mesh, VALUE_TYPE.trigger, + VALUE_TYPE.sdomain, VALUE_TYPE.struct, VALUE_TYPE.strands, VALUE_TYPE.mesh, VALUE_TYPE.trigger, noone, VALUE_TYPE.d3Mesh, VALUE_TYPE.d3Light, VALUE_TYPE.d3Scene, VALUE_TYPE.d3Material, noone, VALUE_TYPE.audioBit, diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index cf53f63ca..98be33c75 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -81,7 +81,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio if(!_node) return noone; - if(!LOADING && !APPENDING) _node.doUpdate(); + //if(!LOADING && !APPENDING) _node.doUpdate(); return _node; } #endregion @@ -393,6 +393,16 @@ function __initNodes() { addNodeObject(smokeSim, "Turbulence", s_node_smokeSim_turbulence, "Node_Fluid_Turbulence", [1, Node_Fluid_Turbulence],, "Apply random velocity map to the smoke.").hideRecent().setVersion(1120); #endregion + var flipSim = ds_list_create(); #region + addNodeCatagory("FLIP Fluid", smokeSim, ["Node_FLIP_Group_Inline"]); + ds_list_add(flipSim, "Domain"); + addNodeObject(flipSim, "Domain", s_node_smokeSim_domain, "Node_FLIP_Domain", [1, Node_FLIP_Domain]).hideRecent().setVersion(11620); + addNodeObject(flipSim, "Render", s_node_smokeSim_domain, "Node_FLIP_Render", [1, Node_FLIP_Render]).hideRecent().setVersion(11620); + + ds_list_add(flipSim, "Fluid"); + addNodeObject(flipSim, "Spawner", s_node_smokeSim_domain, "Node_FLIP_Spawner", [1, Node_FLIP_Spawner]).hideRecent().setVersion(11620); + #endregion + var strandSim = ds_list_create(); #region addNodeCatagory("StrandSim", strandSim, ["Node_Strand_Group", "Node_Strand_Group_Inline"]); ds_list_add(strandSim, "Group"); @@ -636,7 +646,8 @@ function __initNodes() { addNodeObject(generator, "Particle", s_node_particle, "Node_Particle", [1, Node_Particle],, "Generate particle effect."); addNodeObject(generator, "VFX", s_node_vfx, "Node_VFX_Group_Inline", [1, Node_VFX_Group_Inline],, "Create VFX group, which generate particles that can be manipulated using different force nodes."); addNodeObject(generator, "RigidSim", s_node_rigidSim, "Node_Rigid_Group_Inline", [1, Node_Rigid_Group_Inline],, "Create group for rigidbody simulation.").setVersion(1110); - addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group_Inline", [1, Node_Fluid_Group_Inline],, "Create group for fluid simulation.").setVersion(1120); + /**/ addNodeObject(generator, "FLIP Fluid", s_node_rigidSim, "Node_FLIP_Group_Inline", [1, Node_FLIP_Group_Inline],, "Create group for fluid simulation.").setVersion(11620); + addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group_Inline", [1, Node_Fluid_Group_Inline],, "Create group for smoke simulation.").setVersion(1120); addNodeObject(generator, "StrandSim", s_node_strandSim, "Node_Strand_Group_Inline", [1, Node_Strand_Group_Inline], ["Hair"], "Create group for hair simulation.").setVersion(1140); ds_list_add(generator, "Region"); diff --git a/scripts/node_trail/node_trail.gml b/scripts/node_trail/node_trail.gml index c4af89704..0e0162032 100644 --- a/scripts/node_trail/node_trail.gml +++ b/scripts/node_trail/node_trail.gml @@ -3,23 +3,23 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { use_cache = CACHE_USE.manual; clearCacheOnChange = false; - inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); + inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); - inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 5); + inputs[| 1] = nodeValue("Max life", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 5); - inputs[| 2] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + inputs[| 2] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); - inputs[| 3] = nodeValue("Max distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -1, "Maximum distance to search for movement, set to -1 to search the entire image."); + inputs[| 3] = nodeValue("Max distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -1, "Maximum distance to search for movement, set to -1 to search the entire image."); - inputs[| 4] = nodeValue("Match color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make trail track pixels of the same color, instead of the closet pixels."); + inputs[| 4] = nodeValue("Match color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make trail track pixels of the same color, instead of the closet pixels."); - inputs[| 5] = nodeValue("Blend color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Blend color between two pixel smoothly."); + inputs[| 5] = nodeValue("Blend color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Blend color between two pixel smoothly."); - inputs[| 6] = nodeValue("Alpha over life", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11); + inputs[| 6] = nodeValue("Alpha over life", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11); - outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); - outputs[| 1] = nodeValue("Trail UV", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + outputs[| 1] = nodeValue("Trail UV", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); input_display_list = [ ["Surfaces", true], 0, @@ -30,8 +30,20 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ]; + cached_trail = []; + attribute_surface_depth(); + insp2UpdateTooltip = "Clear cache"; + insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ]; + + static onInspector2Update = function() { + clearCache(true); + for( var i = 0, n = array_length(cached_trail); i < n; i++ ) + surface_free_safe(cached_trail[i]); + cached_trail = []; + } + static step = function() { var _colr = getInputData(4); @@ -73,7 +85,6 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var frame_amo = _loop? _life : min(_life, curf); var st_frame = curf - frame_amo; - BLEND_NORMAL for(var i = 0; i <= frame_amo; i++) { var frame_idx = st_frame + i; var prog = (frame_idx - (curf - _life)) / _life; @@ -123,7 +134,6 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { shader_reset(); } - BLEND_NORMAL surface_set_target(temp_surface[1]); shader_set(sh_trail_filler_pass2); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 14b5fd7bb..dbecf887a 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -32,7 +32,7 @@ enum VALUE_TYPE { pathnode = 12, particle = 13, rigid = 14, - fdomain = 15, + sdomain = 15, struct = 16, strands = 17, mesh = 18, @@ -57,6 +57,8 @@ enum VALUE_TYPE { audioBit = 33, + fdomain = 34, + action = 99, } @@ -161,7 +163,7 @@ function value_color(i) { #region #ffb5b5, //path #8fde5d, //particle #88ffe9, //rigid - #6d6e71, //fdomain + #6d6e71, //sdomain #8c3f5d, //struct #ff9166, //strand #c2c2d1, //mesh @@ -180,6 +182,7 @@ function value_color(i) { #region #ff6b97, //dynaSurf #c2c2d1, //PCX #8fde5d, //audiobit + #4da6ff, //flipfluid ]; if(i == 99) return $5dde8f; @@ -207,7 +210,7 @@ function value_color_bg_array(i) { #region #e28989, //path #3ca370, //particle #4da6ff, //rigid - #4b5bab, //fdomain + #4b5bab, //sdomain #5e315b, //struct #e36956, //strand #83839b, //mesh @@ -250,7 +253,7 @@ function value_bit(i) { #region case VALUE_TYPE.pathnode : return 1 << 15; case VALUE_TYPE.particle : return 1 << 16; case VALUE_TYPE.rigid : return 1 << 17; - case VALUE_TYPE.fdomain : return 1 << 18; + case VALUE_TYPE.sdomain : return 1 << 18; case VALUE_TYPE.struct : return 1 << 19; case VALUE_TYPE.strands : return 1 << 20; case VALUE_TYPE.mesh : return 1 << 21; @@ -273,6 +276,7 @@ function value_bit(i) { #region case VALUE_TYPE.PCXnode : return 1 << 34; case VALUE_TYPE.audioBit : return 1 << 35; + case VALUE_TYPE.fdomain : return 1 << 36; case VALUE_TYPE.any : return ~0 & ~(1 << 32); } @@ -324,7 +328,7 @@ function value_type_from_string(str) { #region case "pathnode" : return VALUE_TYPE.pathnode; case "particle" : return VALUE_TYPE.particle; case "rigid" : return VALUE_TYPE.rigid; - case "fdomain" : return VALUE_TYPE.fdomain; + case "sdomain" : return VALUE_TYPE.sdomain; case "struct" : return VALUE_TYPE.struct; case "strands" : return VALUE_TYPE.strands; case "mesh" : return VALUE_TYPE.mesh; diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 3b6caec62..fddb6555d 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -478,8 +478,9 @@ function Panel_Collection() : PanelContent() constructor { if(bx > rootx) { var txt = __txtx("panel_collection_open_file", "Open in file explorer"); - if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.button_path_open) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.path_open) == 2) shellOpenExplorer(context.path); + draw_sprite_ui_uniform(THEME.path_open, 1, bx + bs / 2, by + bs / 2, 1, c_white); } bx -= ui(36); diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 876b41b08..e3e86b867 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1048,9 +1048,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { try { var val = _node.drawNode(gr_x, gr_y, mx, my, graph_s, display_parameter); if(val) { + value_focus = val; if(key_mod_press(SHIFT)) TOOLTIP = [ val.getValue(), val.type ]; - value_focus = val; } } catch(e) { log_warning("NODE DRAW", exception_print(e)); @@ -1059,6 +1059,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { for(var i = 0; i < ds_list_size(nodes_list); i++) nodes_list[| i].drawBadge(gr_x, gr_y, graph_s); + + if(PANEL_INSPECTOR && PANEL_INSPECTOR.prop_hover != noone) + value_focus = PANEL_INSPECTOR.prop_hover; #endregion printIf(log, $"Draw node: {get_timer() - t}"); t = get_timer(); diff --git a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml index 5e4f9fa56..47f3ed5a6 100644 --- a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml +++ b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml @@ -131,7 +131,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, pFOCUS, pHOVER) == 2) refresh(); - draw_sprite_ui(THEME.refresh_s, 0, bx + ui(12), by + ui(12),,,, COLORS._main_icon, 1); + draw_sprite_ui(THEME.refresh_16, 0, bx + ui(12), by + ui(12),,,, COLORS._main_icon, 1); var sx = tx; var sy = ty + sh + ui(16); diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 1702fca39..a1bb7c94e 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -588,13 +588,11 @@ function Panel_Inspector() : PanelContent() constructor { draw_sprite_stretched_ext(THEME.ui_panel_active, 0, ui(4), yy, contentPane.surface_w - ui(4), _selH, COLORS._main_accent, aa); } - if(_hover && lbHov) { - if(prop_dragging == noone && mouse_press(mb_left, pFOCUS)) { - prop_dragging = jun; + if(_hover && lbHov && prop_dragging == noone && mouse_press(mb_left, pFOCUS)) { + prop_dragging = jun; - prop_sel_drag_x = mouse_mx; - prop_sel_drag_y = mouse_my; - } + prop_sel_drag_x = mouse_mx; + prop_sel_drag_y = mouse_my; } #endregion @@ -612,7 +610,9 @@ function Panel_Inspector() : PanelContent() constructor { if(_hover && point_in_rectangle(_m[0], _m[1], ui(4), _selY, contentPane.surface_w - ui(4), _selY + _selH)) { #region mouse in widget _HOVERING_ELEMENT = jun; - if(NODE_DROPPER_TARGET != noone && NODE_DROPPER_TARGET != jun) { + var hov = PANEL_GRAPH.value_dragging != noone || (NODE_DROPPER_TARGET != noone && NODE_DROPPER_TARGET != jun); + + if(hov) { draw_sprite_stretched_ext(THEME.ui_panel_active, 0, ui(4), _selY, contentPane.surface_w - ui(8), _selH, COLORS._main_value_positive, 1); if(mouse_press(mb_left, NODE_DROPPER_TARGET_CAN)) { NODE_DROPPER_TARGET.expression += $"{jun.node.internalName}.{jun.connect_type == JUNCTION_CONNECT.input? "inputs" : "outputs"}.{jun.internalName}"; diff --git a/scripts/scrollPane/scrollPane.gml b/scripts/scrollPane/scrollPane.gml index 4fde11a2b..5040e2893 100644 --- a/scripts/scrollPane/scrollPane.gml +++ b/scripts/scrollPane/scrollPane.gml @@ -13,10 +13,10 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { drawFunc = ondraw; - content_h = 0; - is_scroll = true; + content_h = 0; + is_scroll = true; always_scroll = false; - show_scroll = true; + show_scroll = true; scroll_step = 64; scroll_lock = false; diff --git a/scripts/theme_definition/theme_definition.gml b/scripts/theme_definition/theme_definition.gml index 7d9783744..b1d240f1e 100644 --- a/scripts/theme_definition/theme_definition.gml +++ b/scripts/theme_definition/theme_definition.gml @@ -138,7 +138,7 @@ function Theme() constructor { timeline_graph = noone; canvas_tools_pencil = noone; path_tools_draw = noone; - refresh_s = noone; + refresh_16 = noone; menu_button = noone; icon_save_all = noone; button_hide_middle = noone; diff --git a/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.fsh b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.fsh new file mode 100644 index 000000000..c736a6e83 --- /dev/null +++ b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.fsh @@ -0,0 +1,13 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() { + vec4 fluid = texture2D( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = vec4(0.); + + if(fluid.r * fluid.a > 0.5) + gl_FragColor = vec4(1.); +} diff --git a/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.vsh b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.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_FLIP_render_threshold/sh_FLIP_render_threshold.yy b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.yy new file mode 100644 index 000000000..53b03d63e --- /dev/null +++ b/shaders/sh_FLIP_render_threshold/sh_FLIP_render_threshold.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_FLIP_render_threshold", + "parent": { + "name": "FLIP", + "path": "folders/shader/FLIP.yy", + }, + "type": 1, +} \ No newline at end of file