diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index dc282ddfe..d2316da9b 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -11,13 +11,11 @@ {"name":"key displayer","order":2,"path":"folders/addons/key displayer.yy",}, {"name":"animation_curve","order":9,"path":"folders/animation_curve.yy",}, {"name":"dialog","order":4,"path":"folders/dialog.yy",}, - {"name":"animation","order":6,"path":"folders/dialog/animation.yy",}, {"name":"color selector","order":4,"path":"folders/dialog/color selector.yy",}, {"name":"graph","order":5,"path":"folders/dialog/graph.yy",}, {"name":"guide","order":12,"path":"folders/dialog/guide.yy",}, {"name":"inspector","order":8,"path":"folders/dialog/inspector.yy",}, {"name":"menu","order":10,"path":"folders/dialog/menu.yy",}, - {"name":"preview","order":7,"path":"folders/dialog/preview.yy",}, {"name":"widget","order":9,"path":"folders/dialog/widget.yy",}, {"name":"font","order":7,"path":"folders/font.yy",}, {"name":"functions","order":6,"path":"folders/functions.yy",}, @@ -158,6 +156,7 @@ {"name":"3d","order":29,"path":"folders/shader/3d.yy",}, {"name":"2d effect","order":14,"path":"folders/shader/3d/2d effect.yy",}, {"name":"legacy","order":13,"path":"folders/shader/3d/legacy.yy",}, + {"name":"ssao","order":24,"path":"folders/shader/3d/ssao.yy",}, {"name":"blend","order":18,"path":"folders/shader/blend.yy",}, {"name":"blur","order":38,"path":"folders/shader/blur.yy",}, {"name":"channels","order":42,"path":"folders/shader/channels.yy",}, @@ -191,7 +190,8 @@ {"name":"biterator","order":2,"path":"folders/VCT/biterator.yy",}, {"name":"widget","order":3,"path":"folders/VCT/widget.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, - {"name":"ssao","order":24,"path":"folders/shader/3d/ssao.yy",}, + {"name":"variables","order":41,"path":"folders/functions/variables.yy",}, + {"name":"animation","order":9,"path":"folders/panels/animation.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -291,7 +291,6 @@ {"name":"s_node_json_parse","order":2,"path":"sprites/s_node_json_parse/s_node_json_parse.yy",}, {"name":"s_node_noise_simplex","order":20,"path":"sprites/s_node_noise_simplex/s_node_noise_simplex.yy",}, {"name":"s_node_armature_sample","order":18,"path":"sprites/s_node_armature_sample/s_node_armature_sample.yy",}, - {"name":"o_dialog_notifications","order":6,"path":"objects/o_dialog_notifications/o_dialog_notifications.yy",}, {"name":"sh_draw_color","order":8,"path":"shaders/sh_draw_color/sh_draw_color.yy",}, {"name":"d3d_scene","order":4,"path":"scripts/d3d_scene/d3d_scene.yy",}, {"name":"sh_channel_R2A","order":13,"path":"shaders/sh_channel_R2A/sh_channel_R2A.yy",}, @@ -306,6 +305,7 @@ {"name":"_f_h1","order":11,"path":"fonts/_f_h1/_f_h1.yy",}, {"name":"_f_h2","order":12,"path":"fonts/_f_h2/_f_h2.yy",}, {"name":"s_node_level","order":28,"path":"sprites/s_node_level/s_node_level.yy",}, + {"name":"panel_graph_view_settings","order":8,"path":"scripts/panel_graph_view_settings/panel_graph_view_settings.yy",}, {"name":"node_scatter","order":1,"path":"scripts/node_scatter/node_scatter.yy",}, {"name":"s_node_bloom","order":8,"path":"sprites/s_node_bloom/s_node_bloom.yy",}, {"name":"node_atlas_set","order":2,"path":"scripts/node_atlas_set/node_atlas_set.yy",}, @@ -320,11 +320,11 @@ {"name":"bbmod_lerp_delta_time","order":1,"path":"scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.yy",}, {"name":"_3D","order":8,"path":"scripts/_3D/_3D.yy",}, {"name":"node_vector_cross2D","order":11,"path":"scripts/node_vector_cross2D/node_vector_cross2D.yy",}, - {"name":"o_dialog_preview_onion_skin","order":2,"path":"objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy",}, {"name":"sh_corner_erode","order":48,"path":"shaders/sh_corner_erode/sh_corner_erode.yy",}, {"name":"node_outline","order":11,"path":"scripts/node_outline/node_outline.yy",}, {"name":"sh_mesh_generation","order":4,"path":"shaders/sh_mesh_generation/sh_mesh_generation.yy",}, {"name":"math_function","order":7,"path":"scripts/math_function/math_function.yy",}, + {"name":"panel_preview_snap_setting","order":5,"path":"scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy",}, {"name":"__point","order":4,"path":"scripts/__point/__point.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",}, @@ -370,6 +370,7 @@ {"name":"sh_polar","order":1,"path":"shaders/sh_polar/sh_polar.yy",}, {"name":"s_node_warp_mesh","order":10,"path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",}, {"name":"sh_pixel_cloud","order":13,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",}, + {"name":"panel_graph_connection_settings","order":6,"path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",}, {"name":"sh_d3d_wireframe","order":17,"path":"shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy",}, {"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",}, {"name":"printer","order":2,"path":"scripts/printer/printer.yy",}, @@ -391,6 +392,7 @@ {"name":"s_node_path_l_system","order":10,"path":"sprites/s_node_path_l_system/s_node_path_l_system.yy",}, {"name":"s_node_noise_cell","order":10,"path":"sprites/s_node_noise_cell/s_node_noise_cell.yy",}, {"name":"s_node_atlas_set","order":1,"path":"sprites/s_node_atlas_set/s_node_atlas_set.yy",}, + {"name":"panel_preview_3d_setting","order":4,"path":"scripts/panel_preview_3d_setting/panel_preview_3d_setting.yy",}, {"name":"node_colorize","order":4,"path":"scripts/node_colorize/node_colorize.yy",}, {"name":"sh_fd_subtract_pressure_gradient_glsl","order":12,"path":"shaders/sh_fd_subtract_pressure_gradient_glsl/sh_fd_subtract_pressure_gradient_glsl.yy",}, {"name":"s_node_color_adjust","order":2,"path":"sprites/s_node_color_adjust/s_node_color_adjust.yy",}, @@ -549,6 +551,7 @@ {"name":"node_array_get","order":10,"path":"scripts/node_array_get/node_array_get.yy",}, {"name":"node_pb_fx_highlight","order":1,"path":"scripts/node_pb_fx_highlight/node_pb_fx_highlight.yy",}, {"name":"Apollo","order":5,"path":"extensions/Apollo/Apollo.yy",}, + {"name":"panel_graph_grid_settings","order":7,"path":"scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy",}, {"name":"sh_twirl","order":3,"path":"shaders/sh_twirl/sh_twirl.yy",}, {"name":"s_node_shape","order":14,"path":"sprites/s_node_shape/s_node_shape.yy",}, {"name":"time_source","order":25,"path":"scripts/time_source/time_source.yy",}, @@ -842,7 +845,6 @@ {"name":"node_lua_global","order":1,"path":"scripts/node_lua_global/node_lua_global.yy",}, {"name":"o_dialog_preset","order":1,"path":"objects/o_dialog_preset/o_dialog_preset.yy",}, {"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",}, - {"name":"o_dialog_tunnels","order":6,"path":"objects/o_dialog_tunnels/o_dialog_tunnels.yy",}, {"name":"s_node_erode","order":23,"path":"sprites/s_node_erode/s_node_erode.yy",}, {"name":"node_particle","order":14,"path":"scripts/node_particle/node_particle.yy",}, {"name":"node_pb_box_contract","order":8,"path":"scripts/node_pb_box_contract/node_pb_box_contract.yy",}, @@ -852,7 +854,6 @@ {"name":"node_array_range","order":12,"path":"scripts/node_array_range/node_array_range.yy",}, {"name":"node_animation_control","order":11,"path":"scripts/node_animation_control/node_animation_control.yy",}, {"name":"s_node_tunnel_in","order":21,"path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",}, - {"name":"o_dialog_graph_grid","order":3,"path":"objects/o_dialog_graph_grid/o_dialog_graph_grid.yy",}, {"name":"s_node_pb_draw_trapezoid","order":10,"path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",}, {"name":"append_function","order":1,"path":"scripts/append_function/append_function.yy",}, {"name":"fd_rectangle_reset_target","order":17,"path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",}, @@ -968,7 +969,6 @@ {"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",}, {"name":"s_node_pb_box_inset","order":22,"path":"sprites/s_node_pb_box_inset/s_node_pb_box_inset.yy",}, {"name":"node_glow","order":10,"path":"scripts/node_glow/node_glow.yy",}, - {"name":"o_dialog_preview_snap","order":4,"path":"objects/o_dialog_preview_snap/o_dialog_preview_snap.yy",}, {"name":"sh_blend_min","order":9,"path":"shaders/sh_blend_min/sh_blend_min.yy",}, {"name":"d3d_gizmo_circle_z","order":4,"path":"scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.yy",}, {"name":"sh_d3d_background","order":21,"path":"shaders/sh_d3d_background/sh_d3d_background.yy",}, @@ -1026,7 +1026,6 @@ {"name":"sh_channel_R2B","order":12,"path":"shaders/sh_channel_R2B/sh_channel_R2B.yy",}, {"name":"s_node_rigidSim_activate","order":6,"path":"sprites/s_node_rigidSim_activate/s_node_rigidSim_activate.yy",}, {"name":"s_transparent","order":1,"path":"sprites/s_transparent/s_transparent.yy",}, - {"name":"o_dialog_animation","order":1,"path":"objects/o_dialog_animation/o_dialog_animation.yy",}, {"name":"s_gizmo","order":4,"path":"sprites/s_gizmo/s_gizmo.yy",}, {"name":"node_pb_draw_line","order":9,"path":"scripts/node_pb_draw_line/node_pb_draw_line.yy",}, {"name":"s_node_3d_plane","order":6,"path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",}, @@ -1035,7 +1034,6 @@ {"name":"s_node_grid_tri","order":6,"path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",}, {"name":"s_node_local_analyze","order":52,"path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",}, {"name":"_f_p0b","order":5,"path":"fonts/_f_p0b/_f_p0b.yy",}, - {"name":"o_dialog_keyframe_curve","order":2,"path":"objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy",}, {"name":"s_node_armature_pose","order":15,"path":"sprites/s_node_armature_pose/s_node_armature_pose.yy",}, {"name":"sh_fd_visualize_pressure_glsl","order":16,"path":"shaders/sh_fd_visualize_pressure_glsl/sh_fd_visualize_pressure_glsl.yy",}, {"name":"s_node_rigidSim_force","order":2,"path":"sprites/s_node_rigidSim_force/s_node_rigidSim_force.yy",}, @@ -1096,7 +1094,7 @@ {"name":"s_node_loop_output","order":13,"path":"sprites/s_node_loop_output/s_node_loop_output.yy",}, {"name":"panel_notification","order":4,"path":"scripts/panel_notification/panel_notification.yy",}, {"name":"render_data","order":3,"path":"scripts/render_data/render_data.yy",}, - {"name":"o_dialog_graph_view","order":4,"path":"objects/o_dialog_graph_view/o_dialog_graph_view.yy",}, + {"name":"panel_preview_grid_setting","order":6,"path":"scripts/panel_preview_grid_setting/panel_preview_grid_setting.yy",}, {"name":"fd_rectangle_get_velocity_height","order":22,"path":"scripts/fd_rectangle_get_velocity_height/fd_rectangle_get_velocity_height.yy",}, {"name":"s_node_FXAA","order":57,"path":"sprites/s_node_FXAA/s_node_FXAA.yy",}, {"name":"logger","order":1,"path":"scripts/logger/logger.yy",}, @@ -1112,7 +1110,6 @@ {"name":"s_node_pb_draw_fill","order":14,"path":"sprites/s_node_pb_draw_fill/s_node_pb_draw_fill.yy",}, {"name":"s_node_rate_remap","order":4,"path":"sprites/s_node_rate_remap/s_node_rate_remap.yy",}, {"name":"node_pb_draw_semi_ellipse","order":6,"path":"scripts/node_pb_draw_semi_ellipse/node_pb_draw_semi_ellipse.yy",}, - {"name":"o_dialog_preview_window","order":1,"path":"objects/o_dialog_preview_window/o_dialog_preview_window.yy",}, {"name":"s_node_sampler","order":11,"path":"sprites/s_node_sampler/s_node_sampler.yy",}, {"name":"__background_get_element","order":1,"path":"scripts/__background_get_element/__background_get_element.yy",}, {"name":"node_FFT","order":12,"path":"scripts/node_FFT/node_FFT.yy",}, @@ -1146,6 +1143,7 @@ {"name":"node_text_file_read","order":7,"path":"scripts/node_text_file_read/node_text_file_read.yy",}, {"name":"node_pb_box_divide_grid","order":7,"path":"scripts/node_pb_box_divide_grid/node_pb_box_divide_grid.yy",}, {"name":"draw_tooltip","order":13,"path":"scripts/draw_tooltip/draw_tooltip.yy",}, + {"name":"panel_preview_onion_setting","order":7,"path":"scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy",}, {"name":"d3d_cylinder","order":2,"path":"scripts/d3d_cylinder/d3d_cylinder.yy",}, {"name":"sh_palette_replace","order":45,"path":"shaders/sh_palette_replace/sh_palette_replace.yy",}, {"name":"sh_cell_noise_random","order":3,"path":"shaders/sh_cell_noise_random/sh_cell_noise_random.yy",}, @@ -1153,6 +1151,7 @@ {"name":"s_node_atlas","order":5,"path":"sprites/s_node_atlas/s_node_atlas.yy",}, {"name":"node_fluid_add","order":4,"path":"scripts/node_fluid_add/node_fluid_add.yy",}, {"name":"sh_d3d_geometry","order":23,"path":"shaders/sh_d3d_geometry/sh_d3d_geometry.yy",}, + {"name":"__panel_linear_setting","order":8,"path":"scripts/__panel_linear_setting/__panel_linear_setting.yy",}, {"name":"BBMOD_Quaternion","order":3,"path":"scripts/BBMOD_Quaternion/BBMOD_Quaternion.yy",}, {"name":"d3d_cube","order":1,"path":"scripts/d3d_cube/d3d_cube.yy",}, {"name":"d3d_group","order":9,"path":"scripts/d3d_group/d3d_group.yy",}, @@ -1177,7 +1176,6 @@ {"name":"value_snap","order":10,"path":"scripts/value_snap/value_snap.yy",}, {"name":"file_dropper","order":1,"path":"extensions/file_dropper/file_dropper.yy",}, {"name":"s_biterator_b_shape_idle","order":3,"path":"sprites/s_biterator_b_shape_idle/s_biterator_b_shape_idle.yy",}, - {"name":"o_dialog_preview_3d_settings","order":3,"path":"objects/o_dialog_preview_3d_settings/o_dialog_preview_3d_settings.yy",}, {"name":"sh_mirror_mask","order":8,"path":"shaders/sh_mirror_mask/sh_mirror_mask.yy",}, {"name":"node_export","order":10,"path":"scripts/node_export/node_export.yy",}, {"name":"controlPointBox","order":21,"path":"scripts/controlPointBox/controlPointBox.yy",}, @@ -1412,7 +1410,6 @@ {"name":"draw_line_dashed","order":7,"path":"scripts/draw_line_dashed/draw_line_dashed.yy",}, {"name":"pseudo_regex","order":7,"path":"scripts/pseudo_regex/pseudo_regex.yy",}, {"name":"node_invert","order":6,"path":"scripts/node_invert/node_invert.yy",}, - {"name":"o_dialog_history","order":3,"path":"objects/o_dialog_history/o_dialog_history.yy",}, {"name":"draw_background_stretched","order":5,"path":"scripts/draw_background_stretched/draw_background_stretched.yy",}, {"name":"s_biterator_canvas","order":15,"path":"sprites/s_biterator_canvas/s_biterator_canvas.yy",}, {"name":"node_array_csv_parse","order":27,"path":"scripts/node_array_csv_parse/node_array_csv_parse.yy",}, @@ -1463,7 +1460,6 @@ {"name":"sh_de_corner","order":15,"path":"shaders/sh_de_corner/sh_de_corner.yy",}, {"name":"BBMOD_Vec3","order":5,"path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",}, {"name":"node_rigid_object_spawner","order":6,"path":"scripts/node_rigid_object_spawner/node_rigid_object_spawner.yy",}, - {"name":"o_dialog_graph_connection","order":5,"path":"objects/o_dialog_graph_connection/o_dialog_graph_connection.yy",}, {"name":"node_palette_shift","order":13,"path":"scripts/node_palette_shift/node_palette_shift.yy",}, {"name":"sh_fd_advect_velocity_0_glsl","order":6,"path":"shaders/sh_fd_advect_velocity_0_glsl/sh_fd_advect_velocity_0_glsl.yy",}, {"name":"s_node_pb_box_divide_grid","order":23,"path":"sprites/s_node_pb_box_divide_grid/s_node_pb_box_divide_grid.yy",}, @@ -1477,6 +1473,7 @@ {"name":"preferences","order":5,"path":"scripts/preferences/preferences.yy",}, {"name":"sh_fd_replace_material_advanced_glsl","order":11,"path":"shaders/sh_fd_replace_material_advanced_glsl/sh_fd_replace_material_advanced_glsl.yy",}, {"name":"sh_solid","order":15,"path":"shaders/sh_solid/sh_solid.yy",}, + {"name":"panel_animation_scaler","order":1,"path":"scripts/panel_animation_scaler/panel_animation_scaler.yy",}, {"name":"s_node_json_file_write","order":10,"path":"sprites/s_node_json_file_write/s_node_json_file_write.yy",}, {"name":"node_pb_fx_intersect","order":5,"path":"scripts/node_pb_fx_intersect/node_pb_fx_intersect.yy",}, {"name":"fd_rectangle_get_material_time_step","order":13,"path":"scripts/fd_rectangle_get_material_time_step/fd_rectangle_get_material_time_step.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 2d237bf29..c533c4186 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -31,13 +31,11 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"key displayer","folderPath":"folders/addons/key displayer.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation_curve","folderPath":"folders/animation_curve.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"dialog","folderPath":"folders/dialog.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/dialog/animation.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color selector","folderPath":"folders/dialog/color selector.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"graph","folderPath":"folders/dialog/graph.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"guide","folderPath":"folders/dialog/guide.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"inspector","folderPath":"folders/dialog/inspector.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"menu","folderPath":"folders/dialog/menu.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"preview","folderPath":"folders/dialog/preview.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/dialog/widget.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"font","folderPath":"folders/font.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"functions","folderPath":"folders/functions.yy",}, @@ -193,6 +191,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"3d","folderPath":"folders/shader/3d.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"2d effect","folderPath":"folders/shader/3d/2d effect.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"legacy","folderPath":"folders/shader/3d/legacy.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"ssao","folderPath":"folders/shader/3d/ssao.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blend","folderPath":"folders/shader/blend.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/shader/blur.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"channels","folderPath":"folders/shader/channels.yy",}, @@ -229,7 +228,8 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"biterator","folderPath":"folders/VCT/biterator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widget","folderPath":"folders/VCT/widget.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"ssao","folderPath":"folders/shader/3d/ssao.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"variables","folderPath":"folders/functions/variables.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/panels/animation.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, @@ -334,6 +334,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_hamburger_s.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_hamburger.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_heart.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_icon_accept_16.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_icon_accept_24.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_icon_accept_32.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_icon_array_processor.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, @@ -817,7 +818,6 @@ {"id":{"name":"s_node_json_parse","path":"sprites/s_node_json_parse/s_node_json_parse.yy",},}, {"id":{"name":"s_node_noise_simplex","path":"sprites/s_node_noise_simplex/s_node_noise_simplex.yy",},}, {"id":{"name":"s_node_armature_sample","path":"sprites/s_node_armature_sample/s_node_armature_sample.yy",},}, - {"id":{"name":"o_dialog_notifications","path":"objects/o_dialog_notifications/o_dialog_notifications.yy",},}, {"id":{"name":"sh_draw_color","path":"shaders/sh_draw_color/sh_draw_color.yy",},}, {"id":{"name":"d3d_scene","path":"scripts/d3d_scene/d3d_scene.yy",},}, {"id":{"name":"sh_channel_R2A","path":"shaders/sh_channel_R2A/sh_channel_R2A.yy",},}, @@ -836,6 +836,7 @@ {"id":{"name":"_f_h1","path":"fonts/_f_h1/_f_h1.yy",},}, {"id":{"name":"_f_h2","path":"fonts/_f_h2/_f_h2.yy",},}, {"id":{"name":"s_node_level","path":"sprites/s_node_level/s_node_level.yy",},}, + {"id":{"name":"panel_graph_view_settings","path":"scripts/panel_graph_view_settings/panel_graph_view_settings.yy",},}, {"id":{"name":"node_scatter","path":"scripts/node_scatter/node_scatter.yy",},}, {"id":{"name":"s_node_bloom","path":"sprites/s_node_bloom/s_node_bloom.yy",},}, {"id":{"name":"node_image","path":"scripts/node_image/node_image.yy",},}, @@ -853,12 +854,12 @@ {"id":{"name":"bbmod_lerp_delta_time","path":"scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.yy",},}, {"id":{"name":"_3D","path":"scripts/_3D/_3D.yy",},}, {"id":{"name":"node_vector_cross2D","path":"scripts/node_vector_cross2D/node_vector_cross2D.yy",},}, - {"id":{"name":"o_dialog_preview_onion_skin","path":"objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy",},}, {"id":{"name":"sh_corner_erode","path":"shaders/sh_corner_erode/sh_corner_erode.yy",},}, {"id":{"name":"__init_view","path":"scripts/__init_view/__init_view.yy",},}, {"id":{"name":"node_outline","path":"scripts/node_outline/node_outline.yy",},}, {"id":{"name":"sh_mesh_generation","path":"shaders/sh_mesh_generation/sh_mesh_generation.yy",},}, {"id":{"name":"math_function","path":"scripts/math_function/math_function.yy",},}, + {"id":{"name":"panel_preview_snap_setting","path":"scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy",},}, {"id":{"name":"__point","path":"scripts/__point/__point.yy",},}, {"id":{"name":"node_strand_sim","path":"scripts/node_strand_sim/node_strand_sim.yy",},}, {"id":{"name":"scrollBox","path":"scripts/scrollBox/scrollBox.yy",},}, @@ -910,6 +911,7 @@ {"id":{"name":"sh_polar","path":"shaders/sh_polar/sh_polar.yy",},}, {"id":{"name":"s_node_warp_mesh","path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},}, {"id":{"name":"sh_pixel_cloud","path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},}, + {"id":{"name":"panel_graph_connection_settings","path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",},}, {"id":{"name":"sh_d3d_wireframe","path":"shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy",},}, {"id":{"name":"s_biterator_b_grey_short","path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},}, {"id":{"name":"printer","path":"scripts/printer/printer.yy",},}, @@ -933,6 +935,7 @@ {"id":{"name":"s_node_path_l_system","path":"sprites/s_node_path_l_system/s_node_path_l_system.yy",},}, {"id":{"name":"s_node_noise_cell","path":"sprites/s_node_noise_cell/s_node_noise_cell.yy",},}, {"id":{"name":"s_node_atlas_set","path":"sprites/s_node_atlas_set/s_node_atlas_set.yy",},}, + {"id":{"name":"panel_preview_3d_setting","path":"scripts/panel_preview_3d_setting/panel_preview_3d_setting.yy",},}, {"id":{"name":"node_colorize","path":"scripts/node_colorize/node_colorize.yy",},}, {"id":{"name":"sh_fd_subtract_pressure_gradient_glsl","path":"shaders/sh_fd_subtract_pressure_gradient_glsl/sh_fd_subtract_pressure_gradient_glsl.yy",},}, {"id":{"name":"s_node_color_adjust","path":"sprites/s_node_color_adjust/s_node_color_adjust.yy",},}, @@ -1114,6 +1117,7 @@ {"id":{"name":"node_pb_fx_highlight","path":"scripts/node_pb_fx_highlight/node_pb_fx_highlight.yy",},}, {"id":{"name":"Apollo","path":"extensions/Apollo/Apollo.yy",},}, {"id":{"name":"node_lua_compute","path":"scripts/node_lua_compute/node_lua_compute.yy",},}, + {"id":{"name":"panel_graph_grid_settings","path":"scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy",},}, {"id":{"name":"sh_grid","path":"shaders/sh_grid/sh_grid.yy",},}, {"id":{"name":"sh_twirl","path":"shaders/sh_twirl/sh_twirl.yy",},}, {"id":{"name":"s_node_shape","path":"sprites/s_node_shape/s_node_shape.yy",},}, @@ -1271,6 +1275,7 @@ {"id":{"name":"o_dialog_textbox_function_guide","path":"objects/o_dialog_textbox_function_guide/o_dialog_textbox_function_guide.yy",},}, {"id":{"name":"node_3d_material","path":"scripts/node_3d_material/node_3d_material.yy",},}, {"id":{"name":"pcx_server","path":"scripts/pcx_server/pcx_server.yy",},}, + {"id":{"name":"panel_animation_settings","path":"scripts/panel_animation_settings/panel_animation_settings.yy",},}, {"id":{"name":"s_node_array_set","path":"sprites/s_node_array_set/s_node_array_set.yy",},}, {"id":{"name":"node_dust","path":"scripts/node_dust/node_dust.yy",},}, {"id":{"name":"node_noise_cell","path":"scripts/node_noise_cell/node_noise_cell.yy",},}, @@ -1329,11 +1334,9 @@ {"id":{"name":"node_fluid_update","path":"scripts/node_fluid_update/node_fluid_update.yy",},}, {"id":{"name":"s_node_checker","path":"sprites/s_node_checker/s_node_checker.yy",},}, {"id":{"name":"s_node_grid_noise","path":"sprites/s_node_grid_noise/s_node_grid_noise.yy",},}, - {"id":{"name":"o_dialog_preview_grid","path":"objects/o_dialog_preview_grid/o_dialog_preview_grid.yy",},}, {"id":{"name":"fd_rectangle_set_velocity_size","path":"scripts/fd_rectangle_set_velocity_size/fd_rectangle_set_velocity_size.yy",},}, {"id":{"name":"node_image_gif","path":"scripts/node_image_gif/node_image_gif.yy",},}, {"id":{"name":"node_iterator_each_output","path":"scripts/node_iterator_each_output/node_iterator_each_output.yy",},}, - {"id":{"name":"o_dialog_anim_time_scaler","path":"objects/o_dialog_anim_time_scaler/o_dialog_anim_time_scaler.yy",},}, {"id":{"name":"node_VCT","path":"scripts/node_VCT/node_VCT.yy",},}, {"id":{"name":"boneObject","path":"scripts/boneObject/boneObject.yy",},}, {"id":{"name":"s_node_strandSim_render_texture","path":"sprites/s_node_strandSim_render_texture/s_node_strandSim_render_texture.yy",},}, @@ -1452,7 +1455,6 @@ {"id":{"name":"node_lua_global","path":"scripts/node_lua_global/node_lua_global.yy",},}, {"id":{"name":"o_dialog_preset","path":"objects/o_dialog_preset/o_dialog_preset.yy",},}, {"id":{"name":"s_node_mesh_transform","path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",},}, - {"id":{"name":"o_dialog_tunnels","path":"objects/o_dialog_tunnels/o_dialog_tunnels.yy",},}, {"id":{"name":"s_node_erode","path":"sprites/s_node_erode/s_node_erode.yy",},}, {"id":{"name":"node_particle","path":"scripts/node_particle/node_particle.yy",},}, {"id":{"name":"node_pb_box_contract","path":"scripts/node_pb_box_contract/node_pb_box_contract.yy",},}, @@ -1462,7 +1464,6 @@ {"id":{"name":"node_array_range","path":"scripts/node_array_range/node_array_range.yy",},}, {"id":{"name":"node_animation_control","path":"scripts/node_animation_control/node_animation_control.yy",},}, {"id":{"name":"s_node_tunnel_in","path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",},}, - {"id":{"name":"o_dialog_graph_grid","path":"objects/o_dialog_graph_grid/o_dialog_graph_grid.yy",},}, {"id":{"name":"s_node_pb_draw_trapezoid","path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",},}, {"id":{"name":"append_function","path":"scripts/append_function/append_function.yy",},}, {"id":{"name":"fd_rectangle_reset_target","path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},}, @@ -1589,7 +1590,6 @@ {"id":{"name":"s_node_character","path":"sprites/s_node_character/s_node_character.yy",},}, {"id":{"name":"s_node_pb_box_inset","path":"sprites/s_node_pb_box_inset/s_node_pb_box_inset.yy",},}, {"id":{"name":"node_glow","path":"scripts/node_glow/node_glow.yy",},}, - {"id":{"name":"o_dialog_preview_snap","path":"objects/o_dialog_preview_snap/o_dialog_preview_snap.yy",},}, {"id":{"name":"sh_blend_min","path":"shaders/sh_blend_min/sh_blend_min.yy",},}, {"id":{"name":"d3d_gizmo_circle_z","path":"scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.yy",},}, {"id":{"name":"sh_d3d_background","path":"shaders/sh_d3d_background/sh_d3d_background.yy",},}, @@ -1598,6 +1598,7 @@ {"id":{"name":"node_polar","path":"scripts/node_polar/node_polar.yy",},}, {"id":{"name":"s_node_twirl","path":"sprites/s_node_twirl/s_node_twirl.yy",},}, {"id":{"name":"sh_2d_light","path":"shaders/sh_2d_light/sh_2d_light.yy",},}, + {"id":{"name":"instance_variable_set","path":"scripts/instance_variable_set/instance_variable_set.yy",},}, {"id":{"name":"node_image_animated","path":"scripts/node_image_animated/node_image_animated.yy",},}, {"id":{"name":"s_node_transform_array","path":"sprites/s_node_transform_array/s_node_transform_array.yy",},}, {"id":{"name":"node_palette_extract","path":"scripts/node_palette_extract/node_palette_extract.yy",},}, @@ -1650,7 +1651,6 @@ {"id":{"name":"sh_channel_R2B","path":"shaders/sh_channel_R2B/sh_channel_R2B.yy",},}, {"id":{"name":"s_node_rigidSim_activate","path":"sprites/s_node_rigidSim_activate/s_node_rigidSim_activate.yy",},}, {"id":{"name":"s_transparent","path":"sprites/s_transparent/s_transparent.yy",},}, - {"id":{"name":"o_dialog_animation","path":"objects/o_dialog_animation/o_dialog_animation.yy",},}, {"id":{"name":"s_gizmo","path":"sprites/s_gizmo/s_gizmo.yy",},}, {"id":{"name":"node_pb_draw_line","path":"scripts/node_pb_draw_line/node_pb_draw_line.yy",},}, {"id":{"name":"s_node_3d_plane","path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},}, @@ -1660,7 +1660,6 @@ {"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},}, {"id":{"name":"s_node_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},}, {"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},}, - {"id":{"name":"o_dialog_keyframe_curve","path":"objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy",},}, {"id":{"name":"s_node_armature_pose","path":"sprites/s_node_armature_pose/s_node_armature_pose.yy",},}, {"id":{"name":"sh_fd_visualize_pressure_glsl","path":"shaders/sh_fd_visualize_pressure_glsl/sh_fd_visualize_pressure_glsl.yy",},}, {"id":{"name":"s_node_rigidSim_force","path":"sprites/s_node_rigidSim_force/s_node_rigidSim_force.yy",},}, @@ -1729,7 +1728,7 @@ {"id":{"name":"_p_dialog","path":"objects/_p_dialog/_p_dialog.yy",},}, {"id":{"name":"panel_notification","path":"scripts/panel_notification/panel_notification.yy",},}, {"id":{"name":"render_data","path":"scripts/render_data/render_data.yy",},}, - {"id":{"name":"o_dialog_graph_view","path":"objects/o_dialog_graph_view/o_dialog_graph_view.yy",},}, + {"id":{"name":"panel_preview_grid_setting","path":"scripts/panel_preview_grid_setting/panel_preview_grid_setting.yy",},}, {"id":{"name":"fd_rectangle_get_velocity_height","path":"scripts/fd_rectangle_get_velocity_height/fd_rectangle_get_velocity_height.yy",},}, {"id":{"name":"s_node_FXAA","path":"sprites/s_node_FXAA/s_node_FXAA.yy",},}, {"id":{"name":"logger","path":"scripts/logger/logger.yy",},}, @@ -1749,7 +1748,6 @@ {"id":{"name":"s_node_rate_remap","path":"sprites/s_node_rate_remap/s_node_rate_remap.yy",},}, {"id":{"name":"s_node_3d_cube","path":"sprites/s_node_3d_cube/s_node_3d_cube.yy",},}, {"id":{"name":"node_pb_draw_semi_ellipse","path":"scripts/node_pb_draw_semi_ellipse/node_pb_draw_semi_ellipse.yy",},}, - {"id":{"name":"o_dialog_preview_window","path":"objects/o_dialog_preview_window/o_dialog_preview_window.yy",},}, {"id":{"name":"s_node_sampler","path":"sprites/s_node_sampler/s_node_sampler.yy",},}, {"id":{"name":"__background_get_element","path":"scripts/__background_get_element/__background_get_element.yy",},}, {"id":{"name":"node_animate_curve","path":"scripts/node_animate_curve/node_animate_curve.yy",},}, @@ -1785,6 +1783,7 @@ {"id":{"name":"s_menu_transparent","path":"sprites/s_menu_transparent/s_menu_transparent.yy",},}, {"id":{"name":"node_pb_box_divide_grid","path":"scripts/node_pb_box_divide_grid/node_pb_box_divide_grid.yy",},}, {"id":{"name":"draw_tooltip","path":"scripts/draw_tooltip/draw_tooltip.yy",},}, + {"id":{"name":"panel_preview_onion_setting","path":"scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy",},}, {"id":{"name":"d3d_cylinder","path":"scripts/d3d_cylinder/d3d_cylinder.yy",},}, {"id":{"name":"sh_palette_replace","path":"shaders/sh_palette_replace/sh_palette_replace.yy",},}, {"id":{"name":"buffer_functions","path":"scripts/buffer_functions/buffer_functions.yy",},}, @@ -1795,6 +1794,7 @@ {"id":{"name":"s_node_atlas","path":"sprites/s_node_atlas/s_node_atlas.yy",},}, {"id":{"name":"node_fluid_add","path":"scripts/node_fluid_add/node_fluid_add.yy",},}, {"id":{"name":"sh_d3d_geometry","path":"shaders/sh_d3d_geometry/sh_d3d_geometry.yy",},}, + {"id":{"name":"__panel_linear_setting","path":"scripts/__panel_linear_setting/__panel_linear_setting.yy",},}, {"id":{"name":"BBMOD_Quaternion","path":"scripts/BBMOD_Quaternion/BBMOD_Quaternion.yy",},}, {"id":{"name":"d3d_cube","path":"scripts/d3d_cube/d3d_cube.yy",},}, {"id":{"name":"d3d_group","path":"scripts/d3d_group/d3d_group.yy",},}, @@ -1829,7 +1829,6 @@ {"id":{"name":"node_pb_draw_rectangle","path":"scripts/node_pb_draw_rectangle/node_pb_draw_rectangle.yy",},}, {"id":{"name":"s_biterator_b_shape_idle","path":"sprites/s_biterator_b_shape_idle/s_biterator_b_shape_idle.yy",},}, {"id":{"name":"compat_path_array","path":"scripts/compat_path_array/compat_path_array.yy",},}, - {"id":{"name":"o_dialog_preview_3d_settings","path":"objects/o_dialog_preview_3d_settings/o_dialog_preview_3d_settings.yy",},}, {"id":{"name":"sh_mirror_mask","path":"shaders/sh_mirror_mask/sh_mirror_mask.yy",},}, {"id":{"name":"node_export","path":"scripts/node_export/node_export.yy",},}, {"id":{"name":"controlPointBox","path":"scripts/controlPointBox/controlPointBox.yy",},}, @@ -2100,7 +2099,6 @@ {"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},}, {"id":{"name":"pseudo_regex","path":"scripts/pseudo_regex/pseudo_regex.yy",},}, {"id":{"name":"node_invert","path":"scripts/node_invert/node_invert.yy",},}, - {"id":{"name":"o_dialog_history","path":"objects/o_dialog_history/o_dialog_history.yy",},}, {"id":{"name":"draw_background_stretched","path":"scripts/draw_background_stretched/draw_background_stretched.yy",},}, {"id":{"name":"s_node_path","path":"sprites/s_node_path/s_node_path.yy",},}, {"id":{"name":"s_biterator_canvas","path":"sprites/s_biterator_canvas/s_biterator_canvas.yy",},}, @@ -2160,7 +2158,6 @@ {"id":{"name":"sh_de_corner","path":"shaders/sh_de_corner/sh_de_corner.yy",},}, {"id":{"name":"BBMOD_Vec3","path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",},}, {"id":{"name":"node_rigid_object_spawner","path":"scripts/node_rigid_object_spawner/node_rigid_object_spawner.yy",},}, - {"id":{"name":"o_dialog_graph_connection","path":"objects/o_dialog_graph_connection/o_dialog_graph_connection.yy",},}, {"id":{"name":"node_palette_shift","path":"scripts/node_palette_shift/node_palette_shift.yy",},}, {"id":{"name":"sh_fd_advect_velocity_0_glsl","path":"shaders/sh_fd_advect_velocity_0_glsl/sh_fd_advect_velocity_0_glsl.yy",},}, {"id":{"name":"s_node_pb_box_divide_grid","path":"sprites/s_node_pb_box_divide_grid/s_node_pb_box_divide_grid.yy",},}, @@ -2176,6 +2173,7 @@ {"id":{"name":"preferences","path":"scripts/preferences/preferences.yy",},}, {"id":{"name":"sh_fd_replace_material_advanced_glsl","path":"shaders/sh_fd_replace_material_advanced_glsl/sh_fd_replace_material_advanced_glsl.yy",},}, {"id":{"name":"sh_solid","path":"shaders/sh_solid/sh_solid.yy",},}, + {"id":{"name":"panel_animation_scaler","path":"scripts/panel_animation_scaler/panel_animation_scaler.yy",},}, {"id":{"name":"s_node_json_file_write","path":"sprites/s_node_json_file_write/s_node_json_file_write.yy",},}, {"id":{"name":"node_pb_fx_intersect","path":"scripts/node_pb_fx_intersect/node_pb_fx_intersect.yy",},}, {"id":{"name":"timer_function","path":"scripts/timer_function/timer_function.yy",},}, diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index 6b0973623..a3e6a9f1f 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 6cc720fa2..430e39752 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -4,9 +4,9 @@ event_inherited(); #region data draggable = false; - node_target_x = 0; - node_target_y = 0; - node_called = noone; + node_target_x = 0; + node_target_y = 0; + node_called = noone; junction_hovering = noone; dialog_w = PREF_MAP[? "dialog_add_node_w"]; @@ -15,38 +15,39 @@ event_inherited(); destroy_on_click_out = true; node_selecting = 0; - node_focusing = -1; + node_focusing = -1; node_show_connectable = true; node_tooltip = noone; node_tooltip_x = 0; node_tooltip_y = 0; - var _con = PANEL_GRAPH.getCurrentContext(); - var context = _con == noone? "" : instanceof(_con); - - category = NODE_CATEGORY; - if(context == "Node_Pixel_Builder") - category = NODE_PB_CATEGORY; - - draw_set_font(f_p0); - var maxLen = 0; - for(var i = 0; i < ds_list_size(category); i++) { - var cat = category[| i]; - - if(array_length(cat.filter) && !array_exists(cat.filter, context)) - continue; - - var name = __txt(cat.name); - maxLen = max(maxLen, string_width(name)); - } - category_width = maxLen + ui(44); - anchor = ANCHOR.left | ANCHOR.top; - node_menu_selecting = noone; - function rightClick(node) { + var _con = PANEL_GRAPH.getCurrentContext(); + var context = _con == noone? "" : instanceof(_con); + + #region ---- category ---- + category = NODE_CATEGORY; + if(context == "Node_Pixel_Builder") + category = NODE_PB_CATEGORY; + + draw_set_font(f_p0); + var maxLen = 0; + for(var i = 0; i < ds_list_size(category); i++) { + var cat = category[| i]; + + if(array_length(cat.filter) && !array_exists(cat.filter, context)) + continue; + + var name = __txt(cat.name); + maxLen = max(maxLen, string_width(name)); + } + category_width = maxLen + ui(44); + #endregion + + function rightClick(node) { #region node_menu_selecting = node; var fav = array_exists(global.FAV_NODES, node.node); @@ -61,9 +62,9 @@ event_inherited(); ]; menuCall("add_node_window_manu",,, menu,, node_menu_selecting); - } + } #endregion - function filtered(node) { + function filtered(node) { #region if(!node_show_connectable) return true; if(node_called == noone && junction_hovering == noone) return true; if(!struct_has(global.NODE_GUIDE, node.node)) return true; @@ -108,16 +109,18 @@ event_inherited(); } return false; - } + } #endregion - function setPage(pageIndex) { - ADD_NODE_PAGE = min(pageIndex, ds_list_size(category) - 1); - node_list = pageIndex == -1? noone : category[| ADD_NODE_PAGE].list; - } - ADD_NODE_PAGE = 0; - setPage(NODE_PAGE_DEFAULT); + #region ---- set page ---- + function setPage(pageIndex) { + ADD_NODE_PAGE = min(pageIndex, ds_list_size(category) - 1); + node_list = pageIndex == -1? noone : category[| ADD_NODE_PAGE].list; + } + ADD_NODE_PAGE = 0; + setPage(NODE_PAGE_DEFAULT); + #endregion - function buildNode(_node, _param = "") { + function buildNode(_node, _param = "") { #region if(!_node) { instance_destroy(); instance_destroy(o_dialog_menubox); @@ -191,16 +194,17 @@ event_inherited(); //try to connect if(node_called != noone) { //dragging from junction - var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs; + var _call_input = node_called.connect_type == JUNCTION_CONNECT.input; + var _node_list = _call_input? _outputs : _inputs; for(var i = 0; i < ds_list_size(_node_list); i++) { var _target = _node_list[| i]; if(!_target.visible) continue; - if(_target.auto_connect && (value_bit(_target.type) & value_bit(node_called.type)) ) { - if(node_called.connect_type == JUNCTION_CONNECT.input) { + if(_target.auto_connect) { + if(_call_input && node_called.isConnectable(_node_list[| i])) { node_called.setFrom(_node_list[| i]); _new_node.x -= _new_node.w; - } else + } else if(!_call_input && _node_list[| i].isConnectable(node_called)) _node_list[| i].setFrom(node_called); break; } @@ -229,9 +233,9 @@ event_inherited(); instance_destroy(); instance_destroy(o_dialog_menubox); - } + } #endregion - catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) { + catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) { #region draw_clear_alpha(COLORS._main_text, 0); var hh = 0; @@ -284,9 +288,9 @@ event_inherited(); } return hh; - }); + }); #endregion - content_pane = new scrollPane(dialog_w - category_width - ui(8), dialog_h - ui(66), function(_y, _m) { + content_pane = new scrollPane(dialog_w - category_width - ui(8), dialog_h - ui(66), function(_y, _m) { #region draw_clear_alpha(c_white, 0); var hh = 0; var _hover = sHOVER && content_pane.hover; @@ -587,7 +591,7 @@ event_inherited(); ds_list_destroy(_list); return hh; - }); + }); #endregion #endregion #region resize diff --git a/objects/o_dialog_anim_time_scaler/Create_0.gml b/objects/o_dialog_anim_time_scaler/Create_0.gml deleted file mode 100644 index d257ce464..000000000 --- a/objects/o_dialog_anim_time_scaler/Create_0.gml +++ /dev/null @@ -1,37 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(368); - dialog_h = ui(120); - destroy_on_click_out = true; -#endregion - -#region scaler - scale_to = PROJECT.animator.frames_total; - tb_scale_frame = new textBox(TEXTBOX_INPUT.number, function(to) { - to = toNumber(to); - scale_to = to; - }); - - b_apply = button(function() { - var fac = scale_to / PROJECT.animator.frames_total; - var key = ds_map_find_first(PROJECT.nodeMap); - repeat(ds_map_size(PROJECT.nodeMap)) { - var _node = PROJECT.nodeMap[? key]; - key = ds_map_find_next(PROJECT.nodeMap, key); - if(!_node || !_node.active) continue; - - for(var i = 0; i < ds_list_size(_node.inputs); i++) { - var in = _node.inputs[| i]; - if(!in.is_anim) continue; - for(var j = 0; j < ds_list_size(in.animator.values); j++) { - var t = in.animator.values[| j]; - t.time = t.ratio * scale_to; - } - } - } - PROJECT.animator.frames_total = scale_to; - instance_destroy(); - }).setIcon(THEME.accept, 0, COLORS._main_icon_dark); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_anim_time_scaler/Draw_64.gml b/objects/o_dialog_anim_time_scaler/Draw_64.gml deleted file mode 100644 index 662579892..000000000 --- a/objects/o_dialog_anim_time_scaler/Draw_64.gml +++ /dev/null @@ -1,33 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("anim_scale_title", "Animation scaler")); -#endregion - -#region scaler - var yy = dialog_y + ui(44); - - tb_scale_frame.register(); - tb_scale_frame.setFocusHover(sFOCUS, sHOVER); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy + ui(17), __txtx("anim_scale_target_frame_length", "Target frame length")); - var tb_x = dialog_x + ui(200); - tb_scale_frame.draw(tb_x, yy, ui(96), TEXTBOX_HEIGHT, scale_to, mouse_ui); - - var sx1 = tb_x + ui(96); - draw_set_text(f_p1, fa_right, fa_top, COLORS._main_text_sub); - draw_text(sx1, yy + ui(38), __txtx("anim_scale_scale_factor", "Scaling factor: ") + string(scale_to / PROJECT.animator.frames_total)); - - var bx = sx1 + ui(16); - var by = yy; - - b_apply.register(); - b_apply.setFocusHover(sFOCUS, sHOVER); - b_apply.draw(bx, by, ui(36), ui(36), mouse_ui, THEME.button_lime); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_anim_time_scaler/o_dialog_anim_time_scaler.yy b/objects/o_dialog_anim_time_scaler/o_dialog_anim_time_scaler.yy deleted file mode 100644 index 9ba66bb79..000000000 --- a/objects/o_dialog_anim_time_scaler/o_dialog_anim_time_scaler.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_anim_time_scaler", - "eventList": [ - {"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":0,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "animation", - "path": "folders/dialog/animation.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_anim_time_scaler/o_dialog_warning.yy b/objects/o_dialog_anim_time_scaler/o_dialog_warning.yy deleted file mode 100644 index 53c7fa8a7..000000000 --- a/objects/o_dialog_anim_time_scaler/o_dialog_warning.yy +++ /dev/null @@ -1,38 +0,0 @@ -{ - "spriteId": null, - "solid": false, - "visible": true, - "spriteMaskId": null, - "persistent": false, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "physicsObject": false, - "physicsSensor": false, - "physicsShape": 1, - "physicsGroup": 1, - "physicsDensity": 0.5, - "physicsRestitution": 0.1, - "physicsLinearDamping": 0.1, - "physicsAngularDamping": 0.1, - "physicsFriction": 0.2, - "physicsStartAwake": true, - "physicsKinematic": false, - "physicsShapePoints": [], - "eventList": [ - {"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":2,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - ], - "properties": [], - "overriddenProperties": [], - "parent": { - "name": "dialog", - "path": "folders/dialog.yy", - }, - "resourceVersion": "1.0", - "name": "o_dialog_warning", - "tags": [], - "resourceType": "GMObject", -} \ No newline at end of file diff --git a/objects/o_dialog_animation/Create_0.gml b/objects/o_dialog_animation/Create_0.gml deleted file mode 100644 index a2bca18d6..000000000 --- a/objects/o_dialog_animation/Create_0.gml +++ /dev/null @@ -1,25 +0,0 @@ -/// @description init -event_inherited(); - -#region data - anchor = ANCHOR.right | ANCHOR.bottom; - - dialog_w = ui(368); - dialog_h = ui(188); - - destroy_on_click_out = true; -#endregion - -#region data - tb_length = new textBox(TEXTBOX_INPUT.number, function(str) { - PROJECT.animator.frames_total = real(str); - }) - - tb_framerate = new textBox(TEXTBOX_INPUT.number, function(str) { - PROJECT.animator.framerate = real(str); - }) - - eb_playback = new buttonGroup([__txt("Loop"), __txt("Stop")], function(b) { - PROJECT.animator.playback = b; - }); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_animation/Draw_64.gml b/objects/o_dialog_animation/Draw_64.gml deleted file mode 100644 index 214d28744..000000000 --- a/objects/o_dialog_animation/Draw_64.gml +++ /dev/null @@ -1,35 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txt("Animation")); -#endregion - -#region draw - var yy = dialog_y + ui(44); - - tb_length.setFocusHover(sFOCUS, sHOVER); - tb_length.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy + ui(17), __txtx("anim_length", "Animation length")); - tb_length.draw(dialog_x + dialog_w - ui(120), yy, ui(96), TEXTBOX_HEIGHT, PROJECT.animator.frames_total, mouse_ui); - - yy += ui(44); - tb_framerate.setFocusHover(sFOCUS, sHOVER); - tb_framerate.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy + ui(17), __txtx("anim_frame_rate", "Preview frame rate")); - tb_framerate.draw(dialog_x + dialog_w - ui(120), yy, ui(96), TEXTBOX_HEIGHT, PROJECT.animator.framerate, mouse_ui); - - yy += ui(44); - eb_playback.setFocusHover(sFOCUS, sHOVER); - eb_playback.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy + ui(17), __txtx("anim_on_end", "On end")); - eb_playback.draw(dialog_x + dialog_w - ui(152), yy, ui(128), TEXTBOX_HEIGHT, PROJECT.animator.playback, mouse_ui); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_animation/o_dialog_animation.yy b/objects/o_dialog_animation/o_dialog_animation.yy deleted file mode 100644 index dc421c885..000000000 --- a/objects/o_dialog_animation/o_dialog_animation.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_animation", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "animation", - "path": "folders/dialog/animation.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_graph_connection/Create_0.gml b/objects/o_dialog_graph_connection/Create_0.gml deleted file mode 100644 index 5bb1937ea..000000000 --- a/objects/o_dialog_graph_connection/Create_0.gml +++ /dev/null @@ -1,30 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(400); - dialog_h = ui(220); - - destroy_on_click_out = true; -#endregion - -#region data - bs_type = new buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ], - function(val) { - PREF_MAP[? "curve_connection_line"] = val; - } - ); - - tb_width = new textBox(TEXTBOX_INPUT.number, function(str) { - PREF_MAP[? "connection_line_width"] = max(0.5, real(str)); - }) - - tb_corner = new textBox(TEXTBOX_INPUT.number, function(str) { - PREF_MAP[? "connection_line_corner"] = max(0, real(str)); - }) - tb_corner.slidable = true; - - tb_aa = new textBox(TEXTBOX_INPUT.number, function(str) { - PREF_MAP[? "connection_line_aa"] = max(1, real(str)); - }) -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_connection/Draw_64.gml b/objects/o_dialog_graph_connection/Draw_64.gml deleted file mode 100644 index 226a35dd5..000000000 --- a/objects/o_dialog_graph_connection/Draw_64.gml +++ /dev/null @@ -1,43 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("dialog_connection_title", "Connection settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(128); - - bs_type.setFocusHover(sFOCUS, sHOVER); - bs_type.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Type")); - bs_type.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PREF_MAP[? "curve_connection_line"], mouse_ui); - - yy += ui(40); - tb_width.setFocusHover(sFOCUS, sHOVER); - tb_width.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("dialog_connection_thickness", "Line thickness")); - tb_width.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PREF_MAP[? "connection_line_width"], mouse_ui,, fa_right, fa_center); - - yy += ui(40); - tb_corner.setFocusHover(sFOCUS, sHOVER); - tb_corner.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("dialog_connection_radius", "Corner radius")); - tb_corner.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PREF_MAP[? "connection_line_corner"], mouse_ui,, fa_right, fa_center); - - yy += ui(40); - tb_aa.setFocusHover(sFOCUS, sHOVER); - tb_aa.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("pref_connection_aa", "Connection anti aliasing")); - tb_aa.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PREF_MAP[? "connection_line_aa"], mouse_ui,, fa_right, fa_center); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_connection/o_dialog_graph_connection.yy b/objects/o_dialog_graph_connection/o_dialog_graph_connection.yy deleted file mode 100644 index eb88b9815..000000000 --- a/objects/o_dialog_graph_connection/o_dialog_graph_connection.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_graph_connection", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "graph", - "path": "folders/dialog/graph.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_graph_grid/Create_0.gml b/objects/o_dialog_graph_grid/Create_0.gml deleted file mode 100644 index 04c0d0bba..000000000 --- a/objects/o_dialog_graph_grid/Create_0.gml +++ /dev/null @@ -1,31 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(320); - dialog_h = ui(220); - - destroy_on_click_out = true; -#endregion - -#region data - cb_enable = new checkBox(function(str) { - if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; - PANEL_GRAPH.project.graphGrid.snap = !PANEL_GRAPH.project.graphGrid.snap; - }) - - tb_size = new textBox(TEXTBOX_INPUT.number, function(str) { - if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; - PANEL_GRAPH.project.graphGrid.size = max(1, real(str)); - }) - - sl_opacity = new slider(0, 1, .05, function(str) { - if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; - PANEL_GRAPH.project.graphGrid.opacity = clamp(real(str), 0, 1); - }) - - cl_color = new buttonColor(function(color) { - if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; - PANEL_GRAPH.project.graphGrid.color = color; - }, self); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_grid/Draw_64.gml b/objects/o_dialog_graph_grid/Draw_64.gml deleted file mode 100644 index cded6d2e7..000000000 --- a/objects/o_dialog_graph_grid/Draw_64.gml +++ /dev/null @@ -1,45 +0,0 @@ -/// @description init -if !ready exit; -if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) - instance_destroy(); - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("grid_title", "Grid settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(128); - - cb_enable.setFocusHover(sFOCUS, sHOVER); - cb_enable.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("grid_snap", "Snap to grid")); - cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PANEL_GRAPH.project.graphGrid.snap, mouse_ui,, fa_center, fa_center); - - yy += ui(40); - tb_size.setFocusHover(sFOCUS, sHOVER); - tb_size.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("grid_size", "Grid size")); - tb_size.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.size, mouse_ui, fa_right, fa_center); - - yy += ui(40); - sl_opacity.setFocusHover(sFOCUS, sHOVER); - sl_opacity.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("project.graphGrid.opacity", "Grid opacity")); - sl_opacity.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.opacity, mouse_ui, ui(52), fa_right, fa_center); - - yy += ui(40); - cl_color.setFocusHover(sFOCUS, sHOVER); - cl_color.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("project.graphGrid.color", "Grid color")); - cl_color.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PANEL_GRAPH.project.graphGrid.color, mouse_ui); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_grid/o_dialog_graph_grid.yy b/objects/o_dialog_graph_grid/o_dialog_graph_grid.yy deleted file mode 100644 index 0f18af0c5..000000000 --- a/objects/o_dialog_graph_grid/o_dialog_graph_grid.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_graph_grid", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "graph", - "path": "folders/dialog/graph.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_graph_view/Create_0.gml b/objects/o_dialog_graph_view/Create_0.gml deleted file mode 100644 index 31c602035..000000000 --- a/objects/o_dialog_graph_view/Create_0.gml +++ /dev/null @@ -1,41 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(320); - - destroy_on_click_out = true; - display_parameter = {}; -#endregion - -#region data - properties = [ - [ - new checkBox(function() { display_parameter.show_grid = !display_parameter.show_grid; }), - __txt("Grid"), - function() { return display_parameter.show_grid }, - ], - [ - new checkBox(function() { display_parameter.show_dimension = !display_parameter.show_dimension; }), - __txtx("graph_visibility_dim", "Dimension"), - function() { return display_parameter.show_dimension }, - ], - [ - new checkBox(function() { display_parameter.show_compute = !display_parameter.show_compute; }), - __txtx("graph_visibility_compute", "Compute time"), - function() { return display_parameter.show_compute }, - ], - [ - new checkBox(function() { display_parameter.avoid_label = !display_parameter.avoid_label; }), - __txtx("graph_visibility_avoid_label", "Avoid Label"), - function() { return display_parameter.avoid_label }, - ], - [ - new slider(50, 100, 1, function(val) { display_parameter.preview_scale = val; }), - __txtx("graph_visibility_preview_scale", "Preview Scale"), - function() { return display_parameter.preview_scale }, - ], - ] - - dialog_h = ui(60 + 40 * array_length(properties)); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_view/Draw_64.gml b/objects/o_dialog_graph_view/Draw_64.gml deleted file mode 100644 index 8a1af4547..000000000 --- a/objects/o_dialog_graph_view/Draw_64.gml +++ /dev/null @@ -1,41 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("graph_visibility_title", "Visibility settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(128); - var wh = TEXTBOX_HEIGHT; - - for( var i = 0, n = array_length(properties); i < n; i++ ) { - var _prop = properties[i]; - - var _widg = _prop[0]; - var _text = _prop[1]; - var _data = _prop[2](); - - _widg.setFocusHover(sFOCUS, sHOVER); - _widg.register(); - - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, _text); - - var params = new widgetParam(dialog_x + dialog_w - ui(16) - ww, yy - wh / 2, ww, wh, _data); - if(is_instanceof(_widg, checkBox)) { - params.halign = fa_center; - params.valign = fa_center; - } - - _widg.drawParam(params); - - yy += ui(40); - } -#endregion \ No newline at end of file diff --git a/objects/o_dialog_graph_view/o_dialog_graph_view.yy b/objects/o_dialog_graph_view/o_dialog_graph_view.yy deleted file mode 100644 index bf0b1717c..000000000 --- a/objects/o_dialog_graph_view/o_dialog_graph_view.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_graph_view", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "graph", - "path": "folders/dialog/graph.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_history/Create_0.gml b/objects/o_dialog_history/Create_0.gml deleted file mode 100644 index c93a0b37e..000000000 --- a/objects/o_dialog_history/Create_0.gml +++ /dev/null @@ -1,157 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(400); - dialog_h = ui(480); - - destroy_on_click_out = true; - - anchor = ANCHOR.left | ANCHOR.top; - hold = false; - - dialog_resizable = true; - dialog_w_min = 320; - dialog_h_min = 320; - hovering = -1; - - redo_list = ds_list_create(); - undo_list = ds_list_create(); - click_hold = noone; - - function refreshList() { - ds_list_clear(redo_list); - ds_list_clear(undo_list); - - while(!ds_stack_empty(REDO_STACK)) - ds_list_insert(redo_list, 0, ds_stack_pop(REDO_STACK)); - - for( var i = 0; i < ds_list_size(redo_list); i++ ) - ds_stack_push(REDO_STACK, redo_list[| i]); - - while(!ds_stack_empty(UNDO_STACK)) - ds_list_add(undo_list, ds_stack_pop(UNDO_STACK)); - - for( var i = ds_list_size(undo_list) - 1; i >= 0; i-- ) - ds_stack_push(UNDO_STACK, undo_list[| i]); - - } - refreshList(); -#endregion - -#region content - onResize = function() { - sc_history.resize(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding)); - } - - sc_history = new scrollPane(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding), function(_y, _m) { - draw_clear_alpha(COLORS._main_text, 0); - - if((ds_list_size(redo_list) != ds_stack_size(REDO_STACK)) || (ds_list_size(undo_list) != ds_stack_size(UNDO_STACK))) - refreshList(); - - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - - var lh = line_get_height() + ui(8); - var _h = 0, hh; - var yy = _y + ui(8); - - var lw = sc_history.surface_w - ui(32 + 2); - var red = ds_list_size(redo_list); - var amo = ds_list_size(redo_list) + ds_list_size(undo_list) + 1; - var _hover = -1; - var connect_line_st = 0; - var connect_line_ed = 0; - var action = -1; - - for( var i = 0; i < amo; i++ ) { - if(i == red) { - draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, 0, yy, sc_history.surface_w, ui(4), COLORS._main_accent, 1); - connect_line_st = yy + ui(2); - - _h += ui(4 + 8); - yy += ui(4 + 8); - continue; - } - - var item; - if(i < red) item = redo_list[| i]; - else item = undo_list[| i - red - 1]; - - var itamo = array_length(item); - var amoDisp = itamo; - if(itamo > 3) { - itamo = 3; - amoDisp = 4; - } - hh = amoDisp * lh; - - BLEND_OVERRIDE; - if(sHOVER && sc_history.hover && point_in_rectangle(_m[0], _m[1], ui(32), yy - ui(4), lw, yy + hh + ui(4) - 1)) { - draw_sprite_stretched_ext(THEME.node_bg, 0, ui(32), yy - ui(2), lw, hh + ui(4), COLORS._main_icon_light, 1); - _hover = i; - - if(array_length(item) > itamo) { - TOOLTIP = ""; - for( var j = 0; j < array_length(item); j++ ) - TOOLTIP += (j? "\n" : "") + item[j].toString(); - } - - if(mouse_click(mb_left) && click_hold != item) { - click_hold = item; - action = i; - } - } else - draw_sprite_stretched_ext(THEME.node_bg, 0, ui(32), yy - ui(2), lw, hh + ui(4), COLORS._main_icon, 1); - - var cc = COLORS._main_icon_dark; - var _yc = yy; - - if(i == hovering) cc = COLORS._main_accent; - if(i < red) _yc = yy + ui(6); - else _yc = yy + hh; - - draw_sprite_ui(THEME.scroll_box_arrow, 0, ui(16), _yc, 1, 1 - (i > red) * 2, 0, cc, 1); - BLEND_NORMAL; - - if(i == hovering) - connect_line_ed = _yc; - - for( var j = 0; j < amoDisp; j++ ) { - var _ty = yy + lh * (j + 0.5); - if(j == 3) { - draw_set_color(COLORS._main_text_sub); - draw_text_add(ui(32 + 12), _ty, string(array_length(item) - 3) + __txtx("more_actions", " more actions...")); - } else { - draw_set_color(COLORS._main_text); - draw_text_add(ui(32 + 12), _ty, item[j].toString()); - } - } - - _h += hh + ui(8); - yy += hh + ui(8); - } - - if(hovering > -1) { - draw_set_color(COLORS._main_accent); - draw_line_width(ui(16), connect_line_st, ui(16), connect_line_ed, ui(3)); - } - - if(mouse_release(mb_left)) - click_hold = noone; - hovering = _hover; - - if(action > -1) { - if(action < red) { - repeat(red - action) - REDO(); - } else { - repeat(action - red) - UNDO(); - } - hovering = -1; - } - - return _h; - }) -#endregion \ No newline at end of file diff --git a/objects/o_dialog_history/Destroy_0.gml b/objects/o_dialog_history/Destroy_0.gml deleted file mode 100644 index 260f905d0..000000000 --- a/objects/o_dialog_history/Destroy_0.gml +++ /dev/null @@ -1,5 +0,0 @@ -/// @description -event_inherited(); - -ds_list_destroy(redo_list); -ds_list_destroy(undo_list); \ No newline at end of file diff --git a/objects/o_dialog_history/Draw_64.gml b/objects/o_dialog_history/Draw_64.gml deleted file mode 100644 index 6a508fcc3..000000000 --- a/objects/o_dialog_history/Draw_64.gml +++ /dev/null @@ -1,28 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("History")); - - var bx = dialog_x + ui(24); - var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txt("Pin") : __txt("Unpin"), - THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) - destroy_on_click_out = !destroy_on_click_out; -#endregion - -#region preset - var px = dialog_x + ui(padding); - var py = dialog_y + ui(title_height); - var pw = dialog_w - ui(padding + padding); - var ph = dialog_h - ui(title_height + padding); - - draw_sprite_stretched(THEME.ui_panel_bg, 0, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16)); - sc_history.setFocusHover(sFOCUS, sHOVER); - sc_history.draw(px, py); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_history/o_dialog_history.yy b/objects/o_dialog_history/o_dialog_history.yy deleted file mode 100644 index e2a8a2e8c..000000000 --- a/objects/o_dialog_history/o_dialog_history.yy +++ /dev/null @@ -1,38 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_history", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"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":1,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "menu", - "path": "folders/dialog/menu.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_keyframe_curve/Create_0.gml b/objects/o_dialog_keyframe_curve/Create_0.gml deleted file mode 100644 index 94d7a4282..000000000 --- a/objects/o_dialog_keyframe_curve/Create_0.gml +++ /dev/null @@ -1,20 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(360); - dialog_h = ui(360); - - destroy_on_click_out = true; - - value_target = noone; -#endregion - -#region data - function setValueTarget(value) { - value_target = value; - } - - editWidget = new curveBox( - function(_modified) { value_target.inter_curve = _modified; }); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_keyframe_curve/Draw_64.gml b/objects/o_dialog_keyframe_curve/Draw_64.gml deleted file mode 100644 index 086f766f3..000000000 --- a/objects/o_dialog_keyframe_curve/Draw_64.gml +++ /dev/null @@ -1,19 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("anim_interpolation", "Interpolation curve")); -#endregion - -#region draw - if(value_target != noone) { - editWidget.setFocusHover(sFOCUS, sHOVER); - editWidget.draw(dialog_x + ui(16), dialog_y + ui(48), dialog_w - ui(32), dialog_h - ui(64), - value_target.inter_curve, mouse_ui); - } -#endregion \ No newline at end of file diff --git a/objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy b/objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy deleted file mode 100644 index 2e2b7c0ad..000000000 --- a/objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_keyframe_curve", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "animation", - "path": "folders/dialog/animation.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_notifications/Create_0.gml b/objects/o_dialog_notifications/Create_0.gml deleted file mode 100644 index e04641cf5..000000000 --- a/objects/o_dialog_notifications/Create_0.gml +++ /dev/null @@ -1,138 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(720); - dialog_h = ui(480); - - dialog_resizable = true; - destroy_on_click_out = true; - - current_page = 0; - filter = NOTI_TYPE.log | NOTI_TYPE.warning | NOTI_TYPE.error; - - rightClickMenu = [ - menuItem(__txtx("noti_clear_log", "Clear log messages"), function() { - for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { - if(STATUSES[| i].type == NOTI_TYPE.log) - ds_list_delete(STATUSES, i); - } - }), - menuItem(__txtx("noti_clear_warn", "Clear warning messages"), function() { - for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { - if(STATUSES[| i].type == NOTI_TYPE.warning) - ds_list_delete(STATUSES, i); - } - }), - -1, - menuItem(__txtx("noti_clear_all", "Clear all notifications"), function() { - ds_list_clear(STATUSES); - }), - -1, - menuItem(__txtx("noti_open_log", "Open log file"), function() { - shellOpenExplorer(DIRECTORY + "log/log.txt"); - }), - ]; - - onResize = function() { - sp_noti.resize(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding)); - } - - sp_noti = new scrollPane(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding), function(_y, _m) { - draw_clear_alpha(COLORS.panel_bg_clear, 0); - - var hh = 32; - var yy = _y; - var txw = sp_noti.surface_w - ui(48 + 48 + 20); - var amo = ds_list_size(STATUSES); - - draw_set_font(f_p3); - var timeW = string_width("00:00:00"); - - for( var i = 0; i < ds_list_size(STATUSES); i++ ) { - var index = amo - 1 - i; - var noti = STATUSES[| index]; - if(noti.type & filter == 0) continue; - - draw_set_font(f_p2); - var _w = sp_noti.surface_w; - var _h = ui(8) + string_height_ext(noti.txt, -1, txw) + ui(8); - - if(yy >= -_h && yy <= sp_noti.h) { - draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), _w, _h - ui(4), COLORS.dialog_notification_bg, 1); - - if(sHOVER && sp_noti.hover && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h - ui(4))) { - draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), _w, _h - ui(4), COLORS.dialog_notification_bg_hover, 1); - - if(noti.tooltip != "") - TOOLTIP = noti.tooltip; - - if(noti.onClick != noone && mouse_press(mb_left, sFOCUS)) - noti.onClick(); - - if(mouse_press(mb_right, sFOCUS)) { - var dia = menuCall("notification_menu",,, [ - menuItem(__txtx("noti_copy_message", "Copy notification message"), function() { - clipboard_set_text(o_dialog_menubox.noti.txt); - }), - menuItem(__txtx("noti_delete_message", "Delete notification"), function() { - ds_list_remove(STATUSES, o_dialog_menubox.noti); - }), - ],, noti); - dia.noti = noti; - } - } - - if(noti.life_max > 0) { - var _nwx = sp_noti.w - ui(12) - ui(40); - var _nw = _nwx * noti.life / noti.life_max; - - draw_sprite_stretched_ext(THEME.group_label, 0, ui(40), yy + ui(2), _nw, _h - ui(4), COLORS.dialog_notification_icon_bg, 1); - } - - draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(2), ui(48), _h - ui(4), noti.color, 1); - - if(noti.icon_end != noone) - draw_sprite_ui(noti.icon_end, 1, _w - ui(24), yy + _h / 2,,,, COLORS._main_icon); - - var ic = noti.icon; - if(noti.icon == noone) { - switch(noti.type) { - case NOTI_TYPE.log : ic = THEME.noti_icon_log; break; - case NOTI_TYPE.warning : ic = THEME.noti_icon_warning; break; - case NOTI_TYPE.error : ic = THEME.noti_icon_error; break; - } - } - - draw_sprite_ui(ic, 1, ui(24), yy + _h / 2); - - var tx = ui(48) + timeW + ui(12); - - draw_set_text(f_p3, fa_right, fa_center, COLORS._main_text_sub); - draw_text_line(tx - ui(4), yy + _h / 2, noti.time, -1, txw); - - draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text); - draw_text_line(tx + ui(4), yy + _h / 2, noti.txt, -1, txw); - - if(noti.amount > 1) { - draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); - var bw = max( ui(32), string_width(noti.amount) + ui(10) ); - var bh = ui(28); - - var bx = _w - ui(0) - bw; - var by = yy + ui(0) + ui(2); - - draw_sprite_stretched_ext(THEME.group_label, 0, bx, by, bw, bh, COLORS._main_icon_dark, 0.75); - - draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_accent); - draw_text(bx + bw / 2, by + bh / 2, noti.amount); - } - } - - yy += _h; - hh += _h; - } - - return hh; - }) -#endregion \ No newline at end of file diff --git a/objects/o_dialog_notifications/Draw_64.gml b/objects/o_dialog_notifications/Draw_64.gml deleted file mode 100644 index c36cf9867..000000000 --- a/objects/o_dialog_notifications/Draw_64.gml +++ /dev/null @@ -1,53 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("Notifications")); - - var bx = dialog_x + ui(24); - var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txt("Pin") : __txt("Unpin"), - THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) - destroy_on_click_out = !destroy_on_click_out; -#endregion - -#region text - var ww = ui(28); - var hh = ui(28); - var bx = dialog_x + dialog_w - ui(padding - 8) - ww; - var by = dialog_y + ui(18); - - var error = !!(filter & NOTI_TYPE.error); - var toolt = error? __txtx("noti_hide_error", "Hide error") : __txtx("noti_show_error", "Show error"); - var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_error, error, c_white, 0.3 + error * 0.7); - if(b == 2) filter = filter ^ NOTI_TYPE.error; - if(b == 3) menuCall("notification_error_menu",,, rightClickMenu); - bx -= ui(36); - - var warn = !!(filter & NOTI_TYPE.warning); - var toolt = warn? __txtx("noti_hide_warning", "Hide warning") : __txtx("noti_show_warning", "Show warning"); - var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_warning, warn, c_white, 0.3 + warn * 0.7); - if(b == 2) filter = filter ^ NOTI_TYPE.warning; - if(b == 3) menuCall("notification_warning_menu",,, rightClickMenu); - bx -= ui(36); - - var log = !!(filter & NOTI_TYPE.log); - var toolt = log? __txtx("noti_hide_log", "Hide log") : __txtx("noti_show_log", "Show log"); - var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_log, log, c_white, 0.3 + log * 0.7); - if(b == 2) filter = filter ^ NOTI_TYPE.log; - if(b == 3) menuCall("notification_log_menu",,, rightClickMenu); - - var px = dialog_x + ui(padding); - var py = dialog_y + ui(title_height); - var pw = dialog_w - ui(padding + padding); - var ph = dialog_h - ui(title_height + padding); - - draw_sprite_stretched(THEME.ui_panel_bg, 0, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16)); - sp_noti.setFocusHover(sFOCUS, sHOVER); - sp_noti.draw(px, py); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_notifications/o_dialog_notifications.yy b/objects/o_dialog_notifications/o_dialog_notifications.yy deleted file mode 100644 index 8a2b539a4..000000000 --- a/objects/o_dialog_notifications/o_dialog_notifications.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_notifications", - "eventList": [ - {"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":0,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "menu", - "path": "folders/dialog/menu.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_notifications/o_dialog_warning.yy b/objects/o_dialog_notifications/o_dialog_warning.yy deleted file mode 100644 index 53c7fa8a7..000000000 --- a/objects/o_dialog_notifications/o_dialog_warning.yy +++ /dev/null @@ -1,38 +0,0 @@ -{ - "spriteId": null, - "solid": false, - "visible": true, - "spriteMaskId": null, - "persistent": false, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "physicsObject": false, - "physicsSensor": false, - "physicsShape": 1, - "physicsGroup": 1, - "physicsDensity": 0.5, - "physicsRestitution": 0.1, - "physicsLinearDamping": 0.1, - "physicsAngularDamping": 0.1, - "physicsFriction": 0.2, - "physicsStartAwake": true, - "physicsKinematic": false, - "physicsShapePoints": [], - "eventList": [ - {"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":2,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - ], - "properties": [], - "overriddenProperties": [], - "parent": { - "name": "dialog", - "path": "folders/dialog.yy", - }, - "resourceVersion": "1.0", - "name": "o_dialog_warning", - "tags": [], - "resourceType": "GMObject", -} \ No newline at end of file diff --git a/objects/o_dialog_panel/Create_0.gml b/objects/o_dialog_panel/Create_0.gml index c50de6f0f..8df9fe114 100644 --- a/objects/o_dialog_panel/Create_0.gml +++ b/objects/o_dialog_panel/Create_0.gml @@ -62,4 +62,8 @@ event_inherited(); if(!content) return; content.onClose(); } + + function remove() { + instance_destroy(); + } #endregion \ No newline at end of file diff --git a/objects/o_dialog_panel/Draw_64.gml b/objects/o_dialog_panel/Draw_64.gml index 4105e3be5..16d3da131 100644 --- a/objects/o_dialog_panel/Draw_64.gml +++ b/objects/o_dialog_panel/Draw_64.gml @@ -11,6 +11,8 @@ if !ready exit; #region content if(!is_undefined(content) && content != noone) { + content.panel = self; + var cx = dialog_x + content.showHeader * padding; var cy = dialog_y + content.showHeader * (padding + title_height); content.x = cx; diff --git a/objects/o_dialog_preview_3d_settings/Create_0.gml b/objects/o_dialog_preview_3d_settings/Create_0.gml deleted file mode 100644 index 07b16e0eb..000000000 --- a/objects/o_dialog_preview_3d_settings/Create_0.gml +++ /dev/null @@ -1,61 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(400); - - destroy_on_click_out = true; - preview_panel = noone; -#endregion - -#region data - properties = [ - [ - new checkBox(function() { preview_panel.d3_scene_light_enabled = !preview_panel.d3_scene_light_enabled; }), - __txt("Preview Light"), - function() { return preview_panel.d3_scene_light_enabled }, - ], - [ - new buttonColor(function(col) { - preview_panel.d3_scene.lightAmbient = col; }), - __txt("Ambient Color"), - function() { return preview_panel.d3_scene.lightAmbient }, - ], - [ - new slider(0, 1, 0.01, function(val) { - preview_panel.d3_scene_light0.intensity = val; - preview_panel.d3_scene_light1.intensity = val; - }), - __txt("Light Intensity"), - function() { return preview_panel.d3_scene_light0.intensity }, - ], - [ - new checkBox(function() { - preview_panel.d3_scene_light0.shadow_active = !preview_panel.d3_scene_light0.shadow_active; }), - __txt("Shadow"), - function() { return preview_panel.d3_scene_light0.shadow_active }, - ], - [ - new vectorBox(2, function(index, value) { - if(index == 0) preview_panel.d3_view_camera.view_near = value; - else if(index == 1) preview_panel.d3_view_camera.view_far = value; - }), - __txt("View Plane"), - function() { return [ preview_panel.d3_view_camera.view_near, preview_panel.d3_view_camera.view_far ] }, - ], - [ - new checkBox(function() { - preview_panel.d3_scene.gammaCorrection = !preview_panel.d3_scene.gammaCorrection; }), - __txt("Gamma Correct"), - function() { return preview_panel.d3_scene.gammaCorrection }, - ], - [ - new checkBox(function() { - preview_panel.d3_scene.show_normal = !preview_panel.d3_scene.show_normal; }), - __txt("Normal"), - function() { return preview_panel.d3_scene.show_normal }, - ], - ] - - dialog_h = ui(60 + 40 * array_length(properties)); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_3d_settings/Draw_64.gml b/objects/o_dialog_preview_3d_settings/Draw_64.gml deleted file mode 100644 index 144b6c811..000000000 --- a/objects/o_dialog_preview_3d_settings/Draw_64.gml +++ /dev/null @@ -1,41 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("preview_3d_settings", "3D Preview Settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(200); - var wh = TEXTBOX_HEIGHT; - - for( var i = 0, n = array_length(properties); i < n; i++ ) { - var _prop = properties[i]; - - var _widg = _prop[0]; - var _text = _prop[1]; - var _data = _prop[2](); - - _widg.setFocusHover(sFOCUS, sHOVER); - _widg.register(); - - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, _text); - - var params = new widgetParam(dialog_x + dialog_w - ui(16) - ww, yy - wh / 2, ww, wh, _data); - if(is_instanceof(_widg, checkBox)) { - params.halign = fa_center; - params.valign = fa_center; - } - - _widg.drawParam(params); - - yy += ui(40); - } -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_3d_settings/o_dialog_preview_3d_settings.yy b/objects/o_dialog_preview_3d_settings/o_dialog_preview_3d_settings.yy deleted file mode 100644 index 20d428d55..000000000 --- a/objects/o_dialog_preview_3d_settings/o_dialog_preview_3d_settings.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_preview_3d_settings", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "preview", - "path": "folders/dialog/preview.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_preview_grid/Create_0.gml b/objects/o_dialog_preview_grid/Create_0.gml deleted file mode 100644 index 4c92e5222..000000000 --- a/objects/o_dialog_preview_grid/Create_0.gml +++ /dev/null @@ -1,35 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(320); - dialog_h = ui(300); - - destroy_on_click_out = true; -#endregion - -#region data - cb_enable = new checkBox(function() { - PROJECT.previewGrid.show = !PROJECT.previewGrid.show; - }); - - cb_snap = new checkBox(function() { - PROJECT.previewGrid.snap = !PROJECT.previewGrid.snap; - }); - - tb_width = new textBox(TEXTBOX_INPUT.number, function(str) { - PROJECT.previewGrid.width = max(1, real(str)); - }); - - tb_height = new textBox(TEXTBOX_INPUT.number, function(str) { - PROJECT.previewGrid.height = max(1, real(str)); - }); - - sl_opacity = new slider(0, 1, .05, function(str) { - PROJECT.previewGrid.opacity = clamp(real(str), 0, 1); - }); - - cl_color = new buttonColor(function(color) { - PROJECT.previewGrid.color = color; - }, self); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_grid/Draw_64.gml b/objects/o_dialog_preview_grid/Draw_64.gml deleted file mode 100644 index 18e81fbf6..000000000 --- a/objects/o_dialog_preview_grid/Draw_64.gml +++ /dev/null @@ -1,57 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("grid_title", "Grid settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(128); - - cb_enable.setFocusHover(sFOCUS, sHOVER); - cb_enable.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Enabled")); - cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PROJECT.previewGrid.show, mouse_ui,, fa_center, fa_center); - - yy += ui(40); - cb_snap.setFocusHover(sFOCUS, sHOVER); - cb_snap.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("grid_snap", "Snap to grid")); - cb_snap.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PROJECT.previewGrid.snap, mouse_ui,, fa_center, fa_center); - - yy += ui(40); - tb_width.setFocusHover(sFOCUS, sHOVER); - tb_width.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Grid width")); - tb_width.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PROJECT.previewGrid.width, mouse_ui,, fa_right, fa_center); - - yy += ui(40); - tb_height.setFocusHover(sFOCUS, sHOVER); - tb_height.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Grid height")); - tb_height.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PROJECT.previewGrid.height, mouse_ui,, fa_right, fa_center); - - yy += ui(40); - sl_opacity.setFocusHover(sFOCUS, sHOVER); - sl_opacity.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Grid opacity")); - sl_opacity.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PROJECT.previewGrid.opacity, mouse_ui, ui(52), fa_right, fa_center); - - yy += ui(40); - cl_color.setFocusHover(sFOCUS, sHOVER); - cl_color.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Grid Color")); - cl_color.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PROJECT.previewGrid.color, mouse_ui); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_grid/o_dialog_preview_grid.yy b/objects/o_dialog_preview_grid/o_dialog_preview_grid.yy deleted file mode 100644 index 08c762bcd..000000000 --- a/objects/o_dialog_preview_grid/o_dialog_preview_grid.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_preview_grid", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "preview", - "path": "folders/dialog/preview.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_preview_onion_skin/Create_0.gml b/objects/o_dialog_preview_onion_skin/Create_0.gml deleted file mode 100644 index 0267278f7..000000000 --- a/objects/o_dialog_preview_onion_skin/Create_0.gml +++ /dev/null @@ -1,41 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(400); - dialog_h = ui(300); - - destroy_on_click_out = true; -#endregion - -#region data - cb_enable = new checkBox(function() { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.enabled = !PROJECT.onion_skin.enabled; - }); - - cb_top = new checkBox(function() { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.on_top = !PROJECT.onion_skin.on_top; - }); - - tb_step = new textBox(TEXTBOX_INPUT.number, function(str) { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.step = max(1, round(real(str))); - }); - - cl_color_pre = new buttonColor(function(color) { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.color[0] = color; - }, self); - - cl_color_post = new buttonColor(function(color) { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.color[1] = color; - }, self); - - sl_opacity = new slider(0, 1, .05, function(str) { - var _node = PANEL_PREVIEW.getNodePreview(); - PROJECT.onion_skin.alpha = clamp(real(str), 0, 1); - }); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_onion_skin/Draw_64.gml b/objects/o_dialog_preview_onion_skin/Draw_64.gml deleted file mode 100644 index 0ea99ca6a..000000000 --- a/objects/o_dialog_preview_onion_skin/Draw_64.gml +++ /dev/null @@ -1,57 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txt("Onion Skin")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(208); - - cb_enable.setFocusHover(sFOCUS, sHOVER); - cb_enable.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Enabled")); - cb_enable.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PROJECT.onion_skin.enabled, mouse_ui,, fa_center, fa_center); - - yy += ui(40); - cb_top.setFocusHover(sFOCUS, sHOVER); - cb_top.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txtx("onion_skin_top", "Draw on top")); - cb_top.draw(dialog_x + dialog_w - ui(24) - ww / 2, yy, PROJECT.onion_skin.on_top, mouse_ui,, fa_center, fa_center); - - yy += ui(40); - tb_step.setFocusHover(sFOCUS, sHOVER); - tb_step.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Frame step")); - tb_step.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PROJECT.onion_skin.step, mouse_ui,, fa_right, fa_center); - - yy += ui(40); - cl_color_pre.setFocusHover(sFOCUS, sHOVER); - cl_color_pre.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Pre Color")); - cl_color_pre.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PROJECT.onion_skin.color[0], mouse_ui); - - yy += ui(40); - cl_color_post.setFocusHover(sFOCUS, sHOVER); - cl_color_post.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Post Color")); - cl_color_post.draw(dialog_x + dialog_w - ui(24) - ww, yy - TEXTBOX_HEIGHT / 2, ww, TEXTBOX_HEIGHT, PROJECT.onion_skin.color[1], mouse_ui); - - yy += ui(40); - sl_opacity.setFocusHover(sFOCUS, sHOVER); - sl_opacity.register(); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, __txt("Opacity")); - sl_opacity.draw(dialog_x + dialog_w - ui(24), yy, ww, TEXTBOX_HEIGHT, PROJECT.onion_skin.alpha, mouse_ui, ui(52), fa_right, fa_center); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy b/objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy deleted file mode 100644 index d60f03530..000000000 --- a/objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_preview_onion_skin", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "preview", - "path": "folders/dialog/preview.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_preview_snap/Create_0.gml b/objects/o_dialog_preview_snap/Create_0.gml deleted file mode 100644 index adefb05da..000000000 --- a/objects/o_dialog_preview_snap/Create_0.gml +++ /dev/null @@ -1,31 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(320); - - destroy_on_click_out = true; - preview_panel = noone; -#endregion - -#region data - properties = [ - [ - new checkBox(function() { preview_panel.d3_tool_snap = !preview_panel.d3_tool_snap; }), - __txt("Snap"), - function() { return preview_panel.d3_tool_snap }, - ], - [ - new textBox(TEXTBOX_INPUT.number, function(val) { preview_panel.d3_tool_snap_position = val; }), - __txt("Linear"), - function() { return preview_panel.d3_tool_snap_position }, - ], - [ - new textBox(TEXTBOX_INPUT.number, function(val) { preview_panel.d3_tool_snap_rotation = val; }), - __txt("Rotation"), - function() { return preview_panel.d3_tool_snap_rotation }, - ], - ] - - dialog_h = ui(60 + 40 * array_length(properties)); -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_snap/Draw_64.gml b/objects/o_dialog_preview_snap/Draw_64.gml deleted file mode 100644 index f547596d8..000000000 --- a/objects/o_dialog_preview_snap/Draw_64.gml +++ /dev/null @@ -1,41 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(16), __txtx("preview_3d_settings", "3D Preview Settings")); -#endregion - -#region draw - var yy = dialog_y + ui(64); - var ww = ui(128); - var wh = TEXTBOX_HEIGHT; - - for( var i = 0, n = array_length(properties); i < n; i++ ) { - var _prop = properties[i]; - - var _widg = _prop[0]; - var _text = _prop[1]; - var _data = _prop[2](); - - _widg.setFocusHover(sFOCUS, sHOVER); - _widg.register(); - - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(32), yy, _text); - - var params = new widgetParam(dialog_x + dialog_w - ui(16) - ww, yy - wh / 2, ww, wh, _data); - if(is_instanceof(_widg, checkBox)) { - params.halign = fa_center; - params.valign = fa_center; - } - - _widg.drawParam(params); - - yy += ui(40); - } -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_snap/o_dialog_preview_snap.yy b/objects/o_dialog_preview_snap/o_dialog_preview_snap.yy deleted file mode 100644 index 8fee59574..000000000 --- a/objects/o_dialog_preview_snap/o_dialog_preview_snap.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_preview_snap", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "preview", - "path": "folders/dialog/preview.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_preview_window/Create_0.gml b/objects/o_dialog_preview_window/Create_0.gml deleted file mode 100644 index 63e6eb22a..000000000 --- a/objects/o_dialog_preview_window/Create_0.gml +++ /dev/null @@ -1,65 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(240); - dialog_h = ui(240); - padding = 8; - title_height = 32; - - destroy_on_click_out = false; - dialog_resizable = true; - dialog_w_min = ui(64); - dialog_h_min = ui(64); - dialog_w_max = ui(1000); - dialog_h_max = ui(1000); - - node_target = noone; - preview_channel = 0; - - title_show = 0; - - scale = 0; - panx = 0; - pany = 0; - - panning = false; - pan_mx = 0; - pan_my = 0; - pan_sx = 0; - pan_sy = 0; -#endregion - -#region data - function surfaceCheck() { - content_surface = surface_verify(content_surface, dialog_w - ui(padding + padding), dialog_h - ui(padding + padding)); - } - - function reset() { - scale = 0; - panx = 0; - pany = 0; - } - function changeChannel(index) { - var channel = index - array_length(menu); - for( var i = 0; i < ds_list_size(node_target.outputs); i++ ) { - var o = node_target.outputs[| i]; - if(o.type != VALUE_TYPE.surface) continue; - if(channel-- == 0) { - preview_channel = i; - return; - } - } - } - - content_surface = noone; - surfaceCheck(); - - menu = [ - menuItem(__txt("Reset view"), function() { reset(); }), - -1, - menuItem(__txt("Inspect"), function() { PANEL_GRAPH.node_focus = node_target; }), - menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { PANEL_PREVIEW.setNodePreview(node_target); }), - -1, - ] -#endregion \ No newline at end of file diff --git a/objects/o_dialog_preview_window/Draw_64.gml b/objects/o_dialog_preview_window/Draw_64.gml deleted file mode 100644 index c0a97357c..000000000 --- a/objects/o_dialog_preview_window/Draw_64.gml +++ /dev/null @@ -1,117 +0,0 @@ -/// @description init -if !ready exit; -if(node_target == noone) { - instance_destroy() - exit; -} - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); -#endregion - -#region draw - var px = dialog_x + ui(padding); - var py = dialog_y + ui(padding); - var pw = dialog_w - ui(padding + padding); - var ph = dialog_h - ui(padding + padding); - - surfaceCheck(); - - surface_set_target(content_surface); - draw_clear_alpha(c_black, 0); - draw_sprite_tiled(s_transparent, 0, 0, 0); - - var surf = node_target.outputs[| preview_channel].getValue(); - if(is_array(surf)) - surf = array_spread(surf); - else - surf = [ surf ]; - - var dx = 0; - var dy = 0; - var ind = 0; - var col = round(sqrt(array_length(surf))); - - for( var i = 0, n = array_length(surf); i < n; i++ ) { - var s = surf[i]; - var sw = surface_get_width(s); - var sh = surface_get_height(s); - if(scale == 0) - scale = min(pw / sw, ph / sh); - var sx = dx + pw / 2 - (sw * scale) / 2 + panx; - var sy = dy + ph / 2 - (sh * scale) / 2 + pany; - - draw_surface_ext_safe(s, sx, sy, scale, scale, 0, c_white, 1); - draw_set_color(COLORS._main_icon); - draw_rectangle(sx, sy, sx + sw * scale, sy + sh * scale, true); - - if(++ind >= col) { - ind = 0; - dx = 0; - dy += (sh + 2) * scale; - } else - dx += (sw + 2) * scale; - } - surface_reset_target(); - draw_surface_safe(content_surface, px, py); - - if(panning) { - panx = pan_sx + (mouse_mx - pan_mx); - pany = pan_sy + (mouse_my - pan_my); - - if(mouse_release(mb_middle)) - panning = false; - } - - if(mouse_press(mb_middle, sFOCUS)) { - panning = true; - pan_mx = mouse_mx; - pan_my = mouse_my; - pan_sx = panx; - pan_sy = pany; - } - - if(sHOVER) { - var inc = 0.5; - if(scale > 16) inc = 2; - else if(scale > 8) inc = 1; - - var s = scale; - if(mouse_wheel_down()) scale = max(round(scale / inc) * inc - inc, 0.25); - if(mouse_wheel_up()) scale = min(round(scale / inc) * inc + inc, 32); - - var ds = scale - s; - panx = panx / s * scale; - pany = pany / s * scale; - } - - title_show = lerp_float(title_show, sHOVER || sFOCUS, 3); - - draw_sprite_stretched_ext(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, title_height, c_white, title_show); - - draw_set_alpha(0.5 + title_show * 0.5); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text(dialog_x + ui(padding + 8), dialog_y + ui(title_height) / 2, node_target.getFullName()); - draw_set_alpha(1); - - var bw = ui(24); - var bh = ui(24); - var bx = dialog_x + dialog_w - ui(4) - bw; - var by = dialog_y + ui(4); - if(buttonInstant(THEME.button_hide_fill, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER,, THEME.window_exit, 0, COLORS._main_accent) == 2) - instance_destroy(); - - if(mouse_click(mb_right, sFOCUS)) { - var _menu = array_clone(menu); - for( var i = 0; i < ds_list_size(node_target.outputs); i++ ) { - var o = node_target.outputs[| i]; - if(o.type != VALUE_TYPE.surface) continue; - - array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); })); - } - menuCall("preview_window_menu",,, _menu); - } -#endregion - -if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); \ No newline at end of file diff --git a/objects/o_dialog_preview_window/o_dialog_preview_window.yy b/objects/o_dialog_preview_window/o_dialog_preview_window.yy deleted file mode 100644 index 044cfe26c..000000000 --- a/objects/o_dialog_preview_window/o_dialog_preview_window.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_preview_window", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "preview", - "path": "folders/dialog/preview.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/o_dialog_tunnels/Create_0.gml b/objects/o_dialog_tunnels/Create_0.gml deleted file mode 100644 index e5bc7fb8a..000000000 --- a/objects/o_dialog_tunnels/Create_0.gml +++ /dev/null @@ -1,139 +0,0 @@ -/// @description init -event_inherited(); - -#region data - dialog_w = ui(320); - dialog_h = ui(480); - - destroy_on_click_out = true; - - build_x = 0; - build_y = 0; - - tunnel_ins = []; - tunnel_select = noone; - tunnel_hover = noone; - - var amo = ds_map_size(PROJECT.nodeMap); - var k = ds_map_find_first(PROJECT.nodeMap); - - repeat(amo) { - var node = PROJECT.nodeMap[? k]; - k = ds_map_find_next(PROJECT.nodeMap, k); - - if(instanceof(node) == "Node_Tunnel_In") - array_push(tunnel_ins, node); - } - - search_string = ""; - keyboard_lastchar = ""; - KEYBOARD_STRING = ""; - keyboard_lastkey = -1; - - search_res = []; - tb_search = new textBox(TEXTBOX_INPUT.text, function(str) { - search_string = string(str); - searchNodes(); - }); - tb_search.align = fa_left; - tb_search.auto_update = true; - tb_search.boxColor = COLORS._main_icon_light; - WIDGET_CURRENT = tb_search; - - function searchNodes() { - search_res = []; - for( var i = 0, n = array_length(tunnel_ins); i < n; i++ ) { - var node = tunnel_ins[i]; - var key = node.inputs[| 0].getValue(0); - - if(string_pos(search_string, key) == 0) continue; - array_push(search_res, node); - } - } -#endregion - -#region content - sc_tunnel = new scrollPane(dialog_w - ui(padding + padding), dialog_h - ui(title_height + padding + 40), function(_y, _m) { - draw_clear_alpha(COLORS.panel_bg_clear, 0); - var _h = 0; - var ww = sc_tunnel.surface_w; - var hg = ui(36); - var i = 0; - - var arr = search_string == ""? tunnel_ins : search_res; - tunnel_hover = noone; - - for( var i = 0, n = array_length(arr); i < n; i++ ) { - var node = arr[i]; - - if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) { - var cc = merge_color(COLORS._main_icon_light, COLORS._main_icon, 0.25); - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y, ww, hg, cc, 1); - tunnel_hover = node; - - if(mouse_press(mb_left, sc_tunnel.active) && _m[0] < ww - ui(32 + 32 * 2)) - tunnel_select = tunnel_select == node? noone : node; - } else - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y, ww, hg, COLORS._main_icon_light, 1); - - var key = node.inputs[| 0].getValue(0); - var bw = ui(28); - var bh = ui(28); - var bx = ww - ui(4) - bw; - var by = _y + (hg - bh) / 2; - var txt = __txtx("panel_node_goto", "Go to node"); - - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, txt, THEME.node_goto) == 2) - graphFocusNode(node); - bx -= ui(32); - txt = __txtx("panel_tunnel_create_tunnel", "Create tunnel"); - - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, txt, THEME.tunnel) == 2) { - var _node = nodeBuild("Node_Tunnel_Out", build_x, build_y); - _node.inputs[| 0].setValue(key); - - instance_destroy(); - } - bx -= ui(32); - - draw_sprite_ui(THEME.tunnel, 1, ui(4 + 16), _y + hg / 2); - draw_set_text(f_p0, fa_left, fa_center, key == ""? COLORS._main_text_sub : COLORS._main_text); - draw_text(ui(4 + 32 + 4), _y + hg / 2, key == ""? $"[{__txtx("panel_tunnel_no_key", "No key")}]" : key); - - _y += hg + ui(4); - _h += hg + ui(4); - - if(tunnel_select == node) { - var amo = ds_map_size(TUNNELS_OUT); - var k = ds_map_find_first(TUNNELS_OUT); - - repeat(amo) { - var _k = k; - k = ds_map_find_next(TUNNELS_OUT, k); - - var out = TUNNELS_OUT[? _k]; - if(out != key || !ds_map_exists(PROJECT.nodeMap, _k)) - continue; - - var _node = PROJECT.nodeMap[? _k]; - - draw_sprite_ui(THEME.tunnel, 0, ui(32), _y + ui(10), 0.75, 0.75, 0, COLORS._main_icon); - draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text_sub); - draw_text(ui(32 + 16), _y + ui(10), _node.display_name == ""? _node.name : _node.display_name); - - - if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + ui(20))) - tunnel_hover = _node; - - _y += ui(20); - _h += ui(20); - } - - _y += ui(8); - _h += ui(8); - } - } - - return _h; - }) -#endregion \ No newline at end of file diff --git a/objects/o_dialog_tunnels/Draw_64.gml b/objects/o_dialog_tunnels/Draw_64.gml deleted file mode 100644 index d798e1669..000000000 --- a/objects/o_dialog_tunnels/Draw_64.gml +++ /dev/null @@ -1,36 +0,0 @@ -/// @description init -if !ready exit; - -#region base UI - draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h); - if(sFOCUS) - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - - draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), dialog_y + ui(20), __txt("Tunnels")); -#endregion - -#region preset - var px = dialog_x + ui(padding); - var py = dialog_y + ui(title_height); - var pw = dialog_w - ui(padding + padding); - var ph = dialog_h - ui(title_height + padding) - - draw_sprite_stretched(THEME.ui_panel_bg, 0, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16)); - WIDGET_CURRENT = tb_search; - tb_search.draw(px, py, pw, ui(32), search_string, mouse_ui); - if(search_string == "") - tb_search.sprite_index = 1; - - sc_tunnel.setFocusHover(sFOCUS, sHOVER); - sc_tunnel.draw(px, py + ui(40)); - - var bx = dialog_x + dialog_w - ui(32 + 16); - var by = dialog_y + ui(16); - var txt = __txtx("panel_tunnel_create_tunnel", "Create tunnel"); - - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, txt, THEME.tunnel, 1, c_white) == 2) { - nodeBuild("Node_Tunnel_In", build_x, build_y); - instance_destroy(); - } -#endregion \ No newline at end of file diff --git a/objects/o_dialog_tunnels/o_dialog_tunnels.yy b/objects/o_dialog_tunnels/o_dialog_tunnels.yy deleted file mode 100644 index 32ce8134f..000000000 --- a/objects/o_dialog_tunnels/o_dialog_tunnels.yy +++ /dev/null @@ -1,37 +0,0 @@ -{ - "resourceType": "GMObject", - "resourceVersion": "1.0", - "name": "o_dialog_tunnels", - "eventList": [ - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, - {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,}, - ], - "managed": true, - "overriddenProperties": [], - "parent": { - "name": "graph", - "path": "folders/dialog/graph.yy", - }, - "parentObjectId": { - "name": "_p_dialog", - "path": "objects/_p_dialog/_p_dialog.yy", - }, - "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/scripts/__panel_linear_setting/__panel_linear_setting.gml b/scripts/__panel_linear_setting/__panel_linear_setting.gml new file mode 100644 index 000000000..fd626bd82 --- /dev/null +++ b/scripts/__panel_linear_setting/__panel_linear_setting.gml @@ -0,0 +1,53 @@ +function Panel_Linear_Setting() : PanelContent() constructor { + title = __txtx("preview_3d_settings", "3D Preview Settings"); + + w = ui(380); + + bg_y = -1; + + properties = [] + static setHeight = function() { h = ui(12 + 36 * array_length(properties)); } + + static drawSettings = function(panel) { + var yy = ui(24); + var th = ui(36); + var ww = ui(200); + var wh = TEXTBOX_HEIGHT; + + var bg_y_to = bg_y; + + if(bg_y) draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, ui(4), bg_y, w - ui(8), th, COLORS.panel_prop_bg, 0.5); + + for( var i = 0, n = array_length(properties); i < n; i++ ) { + var _prop = properties[i]; + + var _widg = _prop[0]; + var _text = _prop[1]; + var _data = _prop[2](); + + _widg.setFocusHover(pFOCUS, pHOVER); + _widg.register(); + + if(pHOVER && point_in_rectangle(mx, my, 0, yy - th / 2, w, yy + th / 2)) + bg_y_to = yy - th / 2; + + draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); + draw_text_add(ui(16), yy, _text); + + var params = new widgetParam(w - ui(8) - ww, yy - wh / 2, ww, wh, _data,, [ mx, my ], x, y); + if(is_instanceof(_widg, checkBox)) { + params.halign = fa_center; + params.valign = fa_center; + } + + _widg.drawParam(params); + + yy += th; + } + + if(bg_y == -1) bg_y = bg_y_to; + else bg_y = lerp_float(bg_y, bg_y_to, 3); + } + + function drawContent(panel) { drawSettings(panel); } +} \ No newline at end of file diff --git a/scripts/__panel_linear_setting/__panel_linear_setting.yy b/scripts/__panel_linear_setting/__panel_linear_setting.yy new file mode 100644 index 000000000..dd1901c78 --- /dev/null +++ b/scripts/__panel_linear_setting/__panel_linear_setting.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__panel_linear_setting", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "panels", + "path": "folders/panels.yy", + }, +} \ No newline at end of file diff --git a/scripts/__panel_linear_setting/panel_console.gml b/scripts/__panel_linear_setting/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/__panel_linear_setting/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/__vertex_function/__vertex_function.gml b/scripts/__vertex_function/__vertex_function.gml index abb74d242..53bcaa5a6 100644 --- a/scripts/__vertex_function/__vertex_function.gml +++ b/scripts/__vertex_function/__vertex_function.gml @@ -10,17 +10,20 @@ MATRIX_IDENTITY = matrix_build_identity(); #endregion function vertex_add_pt(buffer, position, texture) { + gml_pragma("forceinline"); vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_texcoord(buffer, texture[0], texture[1]); } function vertex_add_pnt(buffer, position, normal, texture) { + gml_pragma("forceinline"); vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_normal(buffer, normal[0], normal[1], normal[2]); vertex_texcoord(buffer, texture[0], texture[1]); } function vertex_add_pntc(buffer, position, normal, texture, color = c_white, alpha = 1) { + gml_pragma("forceinline"); vertex_position_3d(buffer, position[0], position[1], position[2]); vertex_normal(buffer, normal[0], normal[1], normal[2]); vertex_texcoord(buffer, texture[0], texture[1]); @@ -28,34 +31,33 @@ function vertex_add_pntc(buffer, position, normal, texture, color = c_white, alp } function vertex_add_2pc(buffer, _x, _y, color, alpha = 1) { + gml_pragma("forceinline"); vertex_position(buffer, _x, _y); vertex_color(buffer, color, alpha); } function vertex_add_v(buffer, vertex) { + gml_pragma("forceinline"); vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); } function vertex_add_vc(buffer, vertex) { + gml_pragma("forceinline"); vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); vertex_color(buffer, vertex.color, vertex.alpha); } function vertex_add_vnt(buffer, vertex) { - var _normal = vertex.normal; - var _uv = vertex.uv; - + gml_pragma("forceinline"); vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); - vertex_normal(buffer, _normal.x, _normal.y, _normal.z); - vertex_texcoord(buffer, _uv.x, _uv.y); + vertex_normal(buffer, vertex.nx, vertex.ny, vertex.nz); + vertex_texcoord(buffer, vertex.u, vertex.v); } function vertex_add_vntc(buffer, vertex) { - var _normal = vertex.normal; - var _uv = vertex.uv; - + gml_pragma("forceinline"); vertex_position_3d(buffer, vertex.x, vertex.y, vertex.z); - vertex_normal(buffer, _normal.x, _normal.y, _normal.z); - vertex_texcoord(buffer, _uv.x, _uv.y); + vertex_normal(buffer, vertex.nx, vertex.ny, vertex.nz); + vertex_texcoord(buffer, vertex.u, vertex.v); vertex_color(buffer, vertex.color, vertex.alpha); } \ No newline at end of file diff --git a/scripts/d3d_camera_object/d3d_camera_object.gml b/scripts/d3d_camera_object/d3d_camera_object.gml index 494785a52..0801f7f85 100644 --- a/scripts/d3d_camera_object/d3d_camera_object.gml +++ b/scripts/d3d_camera_object/d3d_camera_object.gml @@ -6,24 +6,24 @@ function __3dCamera_object() : __3dObject() constructor { len = 0.5; //cameraLength vertex = [[ - V3( -len, -ivw, ivh ), V3( -len, ivw, ivh ), - V3( -len, ivw, ivh ), V3( -len, ivw, -ivh ), - V3( -len, ivw, -ivh ), V3( -len, -ivw, -ivh ), - V3( -len, -ivw, -ivh ), V3( -len, -ivw, ivh ), + new __vertex( -len, -ivw, ivh ), new __vertex( -len, ivw, ivh ), + new __vertex( -len, ivw, ivh ), new __vertex( -len, ivw, -ivh ), + new __vertex( -len, ivw, -ivh ), new __vertex( -len, -ivw, -ivh ), + new __vertex( -len, -ivw, -ivh ), new __vertex( -len, -ivw, ivh ), - V3( len, -ovw, ovh ), V3( len, ovw, ovh ), - V3( len, ovw, ovh ), V3( len, ovw, -ovh ), - V3( len, ovw, -ovh ), V3( len, -ovw, -ovh ), - V3( len, -ovw, -ovh ), V3( len, -ovw, ovh ), + new __vertex( len, -ovw, ovh ), new __vertex( len, ovw, ovh ), + new __vertex( len, ovw, ovh ), new __vertex( len, ovw, -ovh ), + new __vertex( len, ovw, -ovh ), new __vertex( len, -ovw, -ovh ), + new __vertex( len, -ovw, -ovh ), new __vertex( len, -ovw, ovh ), - V3( -len, -ivw, ivh ), V3( len, -ovw, ovh ), - V3( -len, ivw, ivh ), V3( len, ovw, ovh ), - V3( -len, ivw, -ivh ), V3( len, ovw, -ovh ), - V3( -len, -ivw, -ivh ), V3( len, -ovw, -ovh ), + new __vertex( -len, -ivw, ivh ), new __vertex( len, -ovw, ovh ), + new __vertex( -len, ivw, ivh ), new __vertex( len, ovw, ovh ), + new __vertex( -len, ivw, -ivh ), new __vertex( len, ovw, -ovh ), + new __vertex( -len, -ivw, -ivh ), new __vertex( len, -ovw, -ovh ), - V3( len, -ovw * 0.5, ovh + 0.2 ), V3( len, ovw * 0.5, ovh + 0.2 ), - V3( len, 0, ovh + 0.6 ), V3( len, ovw * 0.5, ovh + 0.2 ), - V3( len, -ovw * 0.5, ovh + 0.2 ), V3( len, 0, ovh + 0.6 ), + new __vertex( len, -ovw * 0.5, ovh + 0.2 ), new __vertex( len, ovw * 0.5, ovh + 0.2 ), + new __vertex( len, 0, ovh + 0.6 ), new __vertex( len, ovw * 0.5, ovh + 0.2 ), + new __vertex( len, -ovw * 0.5, ovh + 0.2 ), new __vertex( len, 0, ovh + 0.6 ), ]]; VF = global.VF_POS_COL; diff --git a/scripts/d3d_cone/d3d_cone.gml b/scripts/d3d_cone/d3d_cone.gml index e4eb82b4e..146126bb5 100644 --- a/scripts/d3d_cone/d3d_cone.gml +++ b/scripts/d3d_cone/d3d_cone.gml @@ -28,9 +28,9 @@ function __3dCone(radius = 0.5, height = 1, sides = 8, smooth = false) : __3dObj var _u1 = 0.5 + lengthdir_x(0.5, a1); var _v1 = 0.5 + lengthdir_y(0.5, a1); - v0[i * 3 + 0] = V3( 0, 0, -_h).setNormal(0, 0, -1).setUV(0.5, 0.5); - v0[i * 3 + 1] = V3(x1, y1, -_h).setNormal(0, 0, -1).setUV(_u1, _v1); - v0[i * 3 + 2] = V3(x0, y0, -_h).setNormal(0, 0, -1).setUV(_u0, _v0); + v0[i * 3 + 0] = new __vertex( 0, 0, -_h).setNormal(0, 0, -1).setUV(0.5, 0.5); + v0[i * 3 + 1] = new __vertex(x1, y1, -_h).setNormal(0, 0, -1).setUV(_u1, _v1); + v0[i * 3 + 2] = new __vertex(x0, y0, -_h).setNormal(0, 0, -1).setUV(_u0, _v0); } for( var i = 0; i < sides; i++ ) { @@ -55,15 +55,14 @@ function __3dCone(radius = 0.5, height = 1, sides = 8, smooth = false) : __3dObj var ux0 = (i + 0) / sides; var ux1 = (i + 1) / sides; - vs[i * 3 + 0] = V3( 0, 0, _h).setNormal(nxc, nyc, nz).setUV(ux0, 0); - vs[i * 3 + 1] = V3(x0, y0, -_h).setNormal(nx0, ny0, nz).setUV(ux0, 1); - vs[i * 3 + 2] = V3(x1, y1, -_h).setNormal(nx1, ny1, nz).setUV(ux1, 0); + vs[i * 3 + 0] = new __vertex( 0, 0, _h).setNormal(nxc, nyc, nz).setUV(ux0, 0); + vs[i * 3 + 1] = new __vertex(x0, y0, -_h).setNormal(nx0, ny0, nz).setUV(ux0, 1); + vs[i * 3 + 2] = new __vertex(x1, y1, -_h).setNormal(nx1, ny1, nz).setUV(ux1, 0); } vertex = [ v0, vs ]; VB = build(); - generateNormal(); } initModel(); static onParameterUpdate = initModel; diff --git a/scripts/d3d_cube/d3d_cube.gml b/scripts/d3d_cube/d3d_cube.gml index 5ecd86eee..ae0854aeb 100644 --- a/scripts/d3d_cube/d3d_cube.gml +++ b/scripts/d3d_cube/d3d_cube.gml @@ -6,61 +6,60 @@ function __3dCube() : __3dObject() constructor { size /= 2; vertex = [[ - V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), - V3( size, size, size).setNormal(0, 0, 1).setUV(1, 0), - V3( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), - V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), - V3(-size, size, size).setNormal(0, 0, 1).setUV(1, 1), - V3( size, size, size).setNormal(0, 0, 1).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 1), - V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), - V3( size, -size, -size).setNormal(0, 0, -1).setUV(1, 0), - V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(1, 0), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), - V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), - V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), - V3(-size, size, -size).setNormal(0, 0, -1).setUV(0, 1), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(0, 1), - V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - V3(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 0), - V3(-size, size, size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(1, 1), - V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - V3(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), - V3(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), + new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), - V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), - V3( size, size, size).setNormal(1, 0, 0).setUV(1, 0), - V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, size).setNormal(1, 0, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), - V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - V3( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), - V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - V3( size, size, -size).setNormal(0, 1, 0).setUV(1, 0), - V3( size, size, size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex( size, size, size).setNormal(0, 1, 0).setUV(1, 1), - V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - V3(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), - V3( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), - V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - V3( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - V3(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), ]]; VB = build(); - generateNormal(); } initModel(1); } \ No newline at end of file diff --git a/scripts/d3d_cube_faces/d3d_cube_faces.gml b/scripts/d3d_cube_faces/d3d_cube_faces.gml index 44559f2a5..a6fa1e148 100644 --- a/scripts/d3d_cube_faces/d3d_cube_faces.gml +++ b/scripts/d3d_cube_faces/d3d_cube_faces.gml @@ -8,62 +8,61 @@ function __3dCubeFaces() : __3dObject() constructor { vertex = [ [ - V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), - V3( size, size, size).setNormal(0, 0, 1).setUV(1, 0), - V3( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(1, 0), + new __vertex( size, -size, size).setNormal(0, 0, 1).setUV(1, 1), - V3(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), - V3(-size, size, size).setNormal(0, 0, 1).setUV(1, 1), - V3( size, size, size).setNormal(0, 0, 1).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, 0, 1).setUV(0, 0), + new __vertex(-size, size, size).setNormal(0, 0, 1).setUV(1, 1), + new __vertex( size, size, size).setNormal(0, 0, 1).setUV(0, 1), ], [ - V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), - V3( size, -size, -size).setNormal(0, 0, -1).setUV(1, 0), - V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, 0, -1).setUV(1, 0), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), - V3(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), - V3( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), - V3(-size, size, -size).setNormal(0, 0, -1).setUV(0, 1), + new __vertex(-size, -size, -size).setNormal(0, 0, -1).setUV(0, 0), + new __vertex( size, size, -size).setNormal(0, 0, -1).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(0, 0, -1).setUV(0, 1), ], [ - V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - V3(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 0), - V3(-size, size, size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(1, 0), + new __vertex(-size, size, size).setNormal(-1, 0, 0).setUV(1, 1), - V3(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), - V3(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), - V3(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(-1, 0, 0).setUV(0, 0), + new __vertex(-size, -size, -size).setNormal(-1, 0, 0).setUV(1, 1), + new __vertex(-size, size, -size).setNormal(-1, 0, 0).setUV(0, 1), ], [ - V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), - V3( size, size, size).setNormal(1, 0, 0).setUV(1, 0), - V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, size).setNormal(1, 0, 0).setUV(1, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - V3( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), - V3( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), - V3( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), + new __vertex( size, -size, size).setNormal(1, 0, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(1, 0, 0).setUV(1, 1), + new __vertex( size, -size, -size).setNormal(1, 0, 0).setUV(0, 1), ], [ - V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - V3( size, size, -size).setNormal(0, 1, 0).setUV(1, 0), - V3( size, size, size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(1, 0), + new __vertex( size, size, size).setNormal(0, 1, 0).setUV(1, 1), - V3(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), - V3(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), - V3( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), + new __vertex(-size, size, size).setNormal(0, 1, 0).setUV(0, 0), + new __vertex(-size, size, -size).setNormal(0, 1, 0).setUV(1, 1), + new __vertex( size, size, -size).setNormal(0, 1, 0).setUV(0, 1), ], [ - V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - V3( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), - V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, size).setNormal(0, -1, 0).setUV(1, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - V3(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), - V3( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), - V3(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), + new __vertex(-size, -size, size).setNormal(0, -1, 0).setUV(0, 0), + new __vertex( size, -size, -size).setNormal(0, -1, 0).setUV(1, 1), + new __vertex(-size, -size, -size).setNormal(0, -1, 0).setUV(0, 1), ] ]; VB = build(); - generateNormal(); } initModel(1); } \ No newline at end of file diff --git a/scripts/d3d_cylinder/d3d_cylinder.gml b/scripts/d3d_cylinder/d3d_cylinder.gml index f4fb2047e..21797eb42 100644 --- a/scripts/d3d_cylinder/d3d_cylinder.gml +++ b/scripts/d3d_cylinder/d3d_cylinder.gml @@ -28,13 +28,13 @@ function __3dCylinder(radius = 0.5, height = 1, sides = 8, smooth = false) : __3 var _u1 = 0.5 + lengthdir_x(0.5, a1); var _v1 = 0.5 + lengthdir_y(0.5, a1); - v0[i * 3 + 0] = V3( 0, 0, _h).setNormal(0, 0, 1).setUV(0.5, 0.5); - v0[i * 3 + 1] = V3(x0, y0, _h).setNormal(0, 0, 1).setUV(_u0, _v0); - v0[i * 3 + 2] = V3(x1, y1, _h).setNormal(0, 0, 1).setUV(_u1, _v1); + v0[i * 3 + 0] = new __vertex( 0, 0, _h).setNormal(0, 0, 1).setUV(0.5, 0.5); + v0[i * 3 + 1] = new __vertex(x0, y0, _h).setNormal(0, 0, 1).setUV(_u0, _v0); + v0[i * 3 + 2] = new __vertex(x1, y1, _h).setNormal(0, 0, 1).setUV(_u1, _v1); - v1[i * 3 + 0] = V3( 0, 0, -_h).setNormal(0, 0, -1).setUV(0.5, 0.5); - v1[i * 3 + 1] = V3(x1, y1, -_h).setNormal(0, 0, -1).setUV(_u1, _v1); - v1[i * 3 + 2] = V3(x0, y0, -_h).setNormal(0, 0, -1).setUV(_u0, _v0); + v1[i * 3 + 0] = new __vertex( 0, 0, -_h).setNormal(0, 0, -1).setUV(0.5, 0.5); + v1[i * 3 + 1] = new __vertex(x1, y1, -_h).setNormal(0, 0, -1).setUV(_u1, _v1); + v1[i * 3 + 2] = new __vertex(x0, y0, -_h).setNormal(0, 0, -1).setUV(_u0, _v0); } for( var i = 0; i < sides; i++ ) { @@ -54,19 +54,18 @@ function __3dCylinder(radius = 0.5, height = 1, sides = 8, smooth = false) : __3 var ux0 = (i + 0) / sides; var ux1 = (i + 1) / sides; - vs[i * 3 * 2 + 0] = V3(x0, y0, _h).setNormal(nx0, ny0, 0).setUV(ux0, 0); - vs[i * 3 * 2 + 1] = V3(x0, y0, -_h).setNormal(nx0, ny0, 0).setUV(ux0, 1); - vs[i * 3 * 2 + 2] = V3(x1, y1, _h).setNormal(nx1, ny1, 0).setUV(ux1, 0); + vs[i * 3 * 2 + 0] = new __vertex(x0, y0, _h).setNormal(nx0, ny0, 0).setUV(ux0, 0); + vs[i * 3 * 2 + 1] = new __vertex(x0, y0, -_h).setNormal(nx0, ny0, 0).setUV(ux0, 1); + vs[i * 3 * 2 + 2] = new __vertex(x1, y1, _h).setNormal(nx1, ny1, 0).setUV(ux1, 0); - vs[i * 3 * 2 + 3] = V3(x0, y0, -_h).setNormal(nx0, ny0, 0).setUV(ux0, 1); - vs[i * 3 * 2 + 4] = V3(x1, y1, -_h).setNormal(nx1, ny1, 0).setUV(ux1, 1); - vs[i * 3 * 2 + 5] = V3(x1, y1, _h).setNormal(nx1, ny1, 0).setUV(ux1, 0); + vs[i * 3 * 2 + 3] = new __vertex(x0, y0, -_h).setNormal(nx0, ny0, 0).setUV(ux0, 1); + vs[i * 3 * 2 + 4] = new __vertex(x1, y1, -_h).setNormal(nx1, ny1, 0).setUV(ux1, 1); + vs[i * 3 * 2 + 5] = new __vertex(x1, y1, _h).setNormal(nx1, ny1, 0).setUV(ux1, 0); } vertex = [ v0, v1, vs ]; VB = build(); - generateNormal(); } initModel(); static onParameterUpdate = initModel; diff --git a/scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.gml b/scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.gml index 316054806..16a29feeb 100644 --- a/scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.gml +++ b/scripts/d3d_gizmo_circle_z/d3d_gizmo_circle_z.gml @@ -10,8 +10,8 @@ function __3dGizmoCircleZ(radius = 0.5, color = c_white, alpha = 1) : __3dGizmo( var x1 = lengthdir_x(radius, a1); var y1 = lengthdir_y(radius, a1); - vertex[0][_i++] = V3( x0, y0, 0, color, alpha ); - vertex[0][_i++] = V3( x1, y1, 0, color, alpha ); + vertex[0][_i++] = new __vertex( x0, y0, 0, color, alpha ); + vertex[0][_i++] = new __vertex( x1, y1, 0, color, alpha ); } VB = build(); diff --git a/scripts/d3d_gizmo_line/d3d_gizmo_line.gml b/scripts/d3d_gizmo_line/d3d_gizmo_line.gml index 1a7bd08f9..3269826ec 100644 --- a/scripts/d3d_gizmo_line/d3d_gizmo_line.gml +++ b/scripts/d3d_gizmo_line/d3d_gizmo_line.gml @@ -1,7 +1,7 @@ function __3dGizmoLine(from, to, color = c_white, alpha = 1) : __3dGizmo() constructor { vertex = [[ - V3( from.x, from.y, from.z, color, alpha ), - V3( to.x, to.y, to.z, color, alpha ), + new __vertex( from.x, from.y, from.z, color, alpha ), + new __vertex( to.x, to.y, to.z, color, alpha ), ]]; VB = build(); } \ No newline at end of file diff --git a/scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.gml b/scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.gml index 0279c4c92..47e919202 100644 --- a/scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.gml +++ b/scripts/d3d_gizmo_line_dashed/d3d_gizmo_line_dashed.gml @@ -5,7 +5,7 @@ function __3dGizmoLineDashed(from, to, dash = 0.1, color = c_white, alpha = 1) : vertex = [ array_create(_dash) ]; for( var i = 0; i < _dash; i++ ) { var prog = i / (_dash - 1); - vertex[0][i] = V3( lerp(from.x, to.x, prog), + vertex[0][i] = new __vertex( lerp(from.x, to.x, prog), lerp(from.y, to.y, prog), lerp(from.z, to.z, prog), color, alpha ); diff --git a/scripts/d3d_gizmo_sphere/d3d_gizmo_sphere.gml b/scripts/d3d_gizmo_sphere/d3d_gizmo_sphere.gml index 6706eb9a6..1fd4ab09f 100644 --- a/scripts/d3d_gizmo_sphere/d3d_gizmo_sphere.gml +++ b/scripts/d3d_gizmo_sphere/d3d_gizmo_sphere.gml @@ -10,12 +10,12 @@ function __3dGizmoSphere(radius = 0.5, color = c_white, alpha = 1) : __3dGizmo() var x1 = lengthdir_x(radius, a1); var y1 = lengthdir_y(radius, a1); - vertex[0][_i++] = V3( 0, x0, y0, color, alpha ); - vertex[0][_i++] = V3( 0, x1, y1, color, alpha ); - vertex[0][_i++] = V3( x0, 0, y0, color, alpha ); - vertex[0][_i++] = V3( x1, 0, y1, color, alpha ); - vertex[0][_i++] = V3( x0, y0, 0, color, alpha ); - vertex[0][_i++] = V3( x1, y1, 0, color, alpha ); + vertex[0][_i++] = new __vertex( 0, x0, y0, color, alpha ); + vertex[0][_i++] = new __vertex( 0, x1, y1, color, alpha ); + vertex[0][_i++] = new __vertex( x0, 0, y0, color, alpha ); + vertex[0][_i++] = new __vertex( x1, 0, y1, color, alpha ); + vertex[0][_i++] = new __vertex( x0, y0, 0, color, alpha ); + vertex[0][_i++] = new __vertex( x1, y1, 0, color, alpha ); } VB = build(); diff --git a/scripts/d3d_icosphere/d3d_icosphere.gml b/scripts/d3d_icosphere/d3d_icosphere.gml index 08f6598a1..b54c20d3e 100644 --- a/scripts/d3d_icosphere/d3d_icosphere.gml +++ b/scripts/d3d_icosphere/d3d_icosphere.gml @@ -136,14 +136,17 @@ function __3dICOSphere(radius = 0.5, level = 2, smt = false) : __3dObject() cons vertex = [ array_create(ds_list_size(_vertices)) ]; - for( var i = 0, n = ds_list_size(_vertices); i < n; i++ ) - vertex[0][i] = V3(_vertices[| i]).setNormal(_normals[| i]); + for( var i = 0, n = ds_list_size(_vertices); i < n; i++ ) { + var _v = _vertices[| i]; + var _n = _normals[| i]; + + vertex[0][i] = new __vertex(_v.x, _v.y, _v.z).setNormal(_n.x, _n.y, _n.z); + } ds_list_destroy(_vertices); ds_list_destroy(_normals); VB = build(); - generateNormal(); } initModel(); static onParameterUpdate = initModel; diff --git a/scripts/d3d_light/d3d_light.gml b/scripts/d3d_light/d3d_light.gml index 98a5528c9..eff4a6af2 100644 --- a/scripts/d3d_light/d3d_light.gml +++ b/scripts/d3d_light/d3d_light.gml @@ -1,7 +1,7 @@ function __3dLight() : __3dObject() constructor { UI_vertex = [ array_create(33) ]; for( var i = 0; i <= 32; i++ ) - UI_vertex[0][i] = V3(0, lengthdir_x(0.5, i / 32 * 360), lengthdir_y(0.5, i / 32 * 360), c_yellow, 0.8); + UI_vertex[0][i] = new __vertex(0, lengthdir_x(0.5, i / 32 * 360), lengthdir_y(0.5, i / 32 * 360), c_yellow, 0.8); VB_UI = build(noone, UI_vertex); color = c_white; diff --git a/scripts/d3d_light_directional/d3d_light_directional.gml b/scripts/d3d_light_directional/d3d_light_directional.gml index f75017343..7c9954a03 100644 --- a/scripts/d3d_light_directional/d3d_light_directional.gml +++ b/scripts/d3d_light_directional/d3d_light_directional.gml @@ -1,5 +1,5 @@ function __3dLightDirectional() : __3dLight() constructor { - vertex = [[ V3(1, 0, 0, c_yellow, 0.8), V3(3, 0, 0, c_yellow, 0.8) ]]; + vertex = [[ new __vertex(1, 0, 0, c_yellow, 0.8), new __vertex(3, 0, 0, c_yellow, 0.8) ]]; VF = global.VF_POS_COL; render_type = pr_linelist; VB = build(); diff --git a/scripts/d3d_object/d3d_object.gml b/scripts/d3d_object/d3d_object.gml index 855f26274..07bd06fb8 100644 --- a/scripts/d3d_object/d3d_object.gml +++ b/scripts/d3d_object/d3d_object.gml @@ -60,10 +60,11 @@ function __3dObject() constructor { vertex_begin(NVB[i], global.VF_POS_COL); for( var j = 0, n = array_length(vertex[i]); j < n; j++ ) { var _v = vertex[i][j]; + vertex_position_3d(NVB[i], _v.x, _v.y, _v.z); vertex_color(NVB[i], c_red, 1); - vertex_position_3d(NVB[i], _v.x + _v.normal.x * _s, _v.y + _v.normal.y * _s, _v.z + _v.normal.z * _s); + vertex_position_3d(NVB[i], _v.x + _v.nx * _s, _v.y + _v.ny * _s, _v.z + _v.nz * _s); vertex_color(NVB[i], c_red, 1); } vertex_end(NVB[i]); @@ -191,10 +192,13 @@ function __3dObject() constructor { shader_reset(); if(scene.show_normal && NVB != noone) { #region - shader_set(sh_d3d_wireframe); - for( var i = 0, n = array_length(NVB); i < n; i++ ) - vertex_submit(NVB[i], pr_linelist, -1); - shader_reset(); + if(NVB == noone) generateNormal(); + if(NVB != noone) { + shader_set(sh_d3d_wireframe); + for( var i = 0, n = array_length(NVB); i < n; i++ ) + vertex_submit(NVB[i], pr_linelist, -1); + shader_reset(); + } } #endregion matrix_stack_clear(); diff --git a/scripts/d3d_plane_mesh/d3d_plane_mesh.gml b/scripts/d3d_plane_mesh/d3d_plane_mesh.gml index 8c80e166a..7e73c0361 100644 --- a/scripts/d3d_plane_mesh/d3d_plane_mesh.gml +++ b/scripts/d3d_plane_mesh/d3d_plane_mesh.gml @@ -9,45 +9,41 @@ function __3dPlane() : __3dObject() constructor { var _nor = [ 0, 0, 1 ]; switch(normal) { case 0 : - _nor = [ 1, 0, 0 ]; vertex = [[ - V3(0, -side, -side).setNormal(_nor).setUV(0, 0), - V3(0, side, side).setNormal(_nor).setUV(1, 1), - V3(0, side, -side).setNormal(_nor).setUV(1, 0), + new __vertex(0, -side, -side).setNormal(1, 0, 0).setUV(0, 0), + new __vertex(0, side, side).setNormal(1, 0, 0).setUV(1, 1), + new __vertex(0, side, -side).setNormal(1, 0, 0).setUV(1, 0), - V3(0, -side, -side).setNormal(_nor).setUV(0, 0), - V3(0, -side, side).setNormal(_nor).setUV(0, 1), - V3(0, side, side).setNormal(_nor).setUV(1, 1), + new __vertex(0, -side, -side).setNormal(1, 0, 0).setUV(0, 0), + new __vertex(0, -side, side).setNormal(1, 0, 0).setUV(0, 1), + new __vertex(0, side, side).setNormal(1, 0, 0).setUV(1, 1), ]]; break; case 1 : - _nor = [ 0, 1, 0 ]; vertex = [[ - V3(-side, 0, -side).setNormal(_nor).setUV(0, 0), - V3( side, 0, -side).setNormal(_nor).setUV(1, 0), - V3( side, 0, side).setNormal(_nor).setUV(1, 1), + new __vertex(-side, 0, -side).setNormal(0, 1, 0).setUV(0, 0), + new __vertex( side, 0, -side).setNormal(0, 1, 0).setUV(1, 0), + new __vertex( side, 0, side).setNormal(0, 1, 0).setUV(1, 1), - V3(-side, 0, -side).setNormal(_nor).setUV(0, 0), - V3( side, 0, side).setNormal(_nor).setUV(1, 1), - V3(-side, 0, side).setNormal(_nor).setUV(0, 1), + new __vertex(-side, 0, -side).setNormal(0, 1, 0).setUV(0, 0), + new __vertex( side, 0, side).setNormal(0, 1, 0).setUV(1, 1), + new __vertex(-side, 0, side).setNormal(0, 1, 0).setUV(0, 1), ]]; break; case 2 : - _nor = [ 0, 0, 1 ]; vertex = [[ - V3(-side, -side, 0).setNormal(_nor).setUV(0, 0), - V3( side, side, 0).setNormal(_nor).setUV(1, 1), - V3( side, -side, 0).setNormal(_nor).setUV(1, 0), + new __vertex(-side, -side, 0).setNormal(0, 0, 1).setUV(0, 0), + new __vertex( side, side, 0).setNormal(0, 0, 1).setUV(1, 1), + new __vertex( side, -side, 0).setNormal(0, 0, 1).setUV(1, 0), - V3(-side, -side, 0).setNormal(_nor).setUV(0, 0), - V3(-side, side, 0).setNormal(_nor).setUV(0, 1), - V3( side, side, 0).setNormal(_nor).setUV(1, 1), + new __vertex(-side, -side, 0).setNormal(0, 0, 1).setUV(0, 0), + new __vertex(-side, side, 0).setNormal(0, 0, 1).setUV(0, 1), + new __vertex( side, side, 0).setNormal(0, 0, 1).setUV(1, 1), ]]; break; } VB = build(); - generateNormal(); } initModel(); onParameterUpdate = initModel; diff --git a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml index d1b313658..960deb40a 100644 --- a/scripts/d3d_surface_extrude/d3d_surface_extrude.gml +++ b/scripts/d3d_surface_extrude/d3d_surface_extrude.gml @@ -6,9 +6,14 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ self.height = height; self.smooth = smooth; + surface_w = 1; + surface_h = 1; + normal_draw_size = 0.05; static getHeight = function(h, gw, gh, i, j) { + gml_pragma("forceinline"); + var _i = round(i * gw); var _j = round(j * gh); @@ -27,6 +32,9 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ var ww = surface_get_width(_surface); var hh = surface_get_height(_surface); + surface_w = ww; + surface_h = hh; + var tw = 1 / ww; var th = 1 / hh; var sw = -ww / 2 * tw; @@ -87,7 +95,7 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ var _a = (cc & (0b11111111 << 24)) >> 24; ap[i][j] = _a; } - + buffer_delete(surface_buffer); #endregion @@ -148,21 +156,21 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ if(a3 && a1) d01 = (d3 + d1) / 2; if(a) { - ds_list_add(v, V3(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, V3(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, V3(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, V3(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, V3(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); } else if(!a0 && !a1 && a2 && a3) { //var _tx0 = tw * (i + 1), _tx1 = _tx0 + tw; //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; @@ -171,13 +179,13 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ d10 *= d1 * d2; d01 *= d1 * d3; - ds_list_add(v, V3(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, V3(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); } else if(!a0 && a1 && !a2 && a3) { //var _tx0 = tw * (i - 1), _tx1 = _tx0 + tw; //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; @@ -186,13 +194,13 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ d10 *= d1 * d2; d11 *= d2 * d3; - ds_list_add(v, V3(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, V3(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); - ds_list_add(v, V3(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); } else if(a0 && a1 && !a2 && !a3) { //var _tx0 = tw * (i - 1), _tx1 = _tx0 + tw; //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; @@ -201,13 +209,13 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ d01 *= d1 * d3; d11 *= d2 * d3; - ds_list_add(v, V3(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i0, -d01).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, V3(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, V3(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i0, d01).setNormal(0, 0, 1).setUV(tx0, ty1)); } else if(a0 && !a1 && a2 && !a3) { //var _tx0 = tw * (i + 1), _tx1 = _tx0 + tw; //var _ty0 = th * (j + 0), _ty1 = _ty0 + th; @@ -216,70 +224,70 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ d01 *= d1 * d3; d11 *= d2 * d3; - ds_list_add(v, V3(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j0, i1, -d10).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i1, -d11).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j0, i0, -d00).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, V3(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(j0, i1, d10).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(j1, i1, d11).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(j0, i0, d00).setNormal(0, 0, 1).setUV(tx0, ty0)); } #endregion } else { #region - ds_list_add(v, V3(i1, j0, -dep).setNormal(0, 0, -1).setUV(tx1, ty0)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 0, -1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); - ds_list_add(v, V3(i0, j1, -dep).setNormal(0, 0, -1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, 0, -1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 0, -1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, 0, -1).setUV(tx0, ty1)); - ds_list_add(v, V3(i1, j0, dep).setNormal(0, 0, 1).setUV(tx1, ty0)); - ds_list_add(v, V3(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 0, 1).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j1, dep).setNormal(0, 0, 1).setUV(tx0, ty1)); - ds_list_add(v, V3(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, 0, 1).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, 0, 1).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 0, 1).setUV(tx0, ty0)); if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j - 1)) || (j == 0 || ap[i][j - 1] == 0)) { //y side - ds_list_add(v, V3(i0, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty0)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i1, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j0, dep).setNormal(0, 1, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(0, 1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(0, 1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(0, 1, 0).setUV(tx0, ty1)); } - + if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i, j + 1)) || (j == hh - 1 || ap[i][j + 1] == 0)) { //y side - ds_list_add(v, V3(i0, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty0)); - ds_list_add(v, V3(i1, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i1, j1, dep).setNormal(0, -1, 0).setUV(tx0, ty1)); - ds_list_add(v, V3(i1, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(0, -1, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(0, -1, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(0, -1, 0).setUV(tx0, ty0)); } if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i - 1, j)) || (i == 0 || ap[i - 1][j] == 0)) { //x side - ds_list_add(v, V3(i0, j0, dep).setNormal(-1, 0, 0).setUV(tx1, ty0)); - ds_list_add(v, V3(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j0, dep).setNormal(-1, 0, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx0, ty1)); - ds_list_add(v, V3(i0, j1, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i0, j0, -dep).setNormal(-1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i0, j1, dep).setNormal(-1, 0, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i0, j1, -dep).setNormal(-1, 0, 0).setUV(tx0, ty0)); } if((useH && dep * 2 > getHeight(hei, hgtW, hgtH, i + 1, j)) || (i == ww - 1 || ap[i + 1][j] == 0)) { //x side - ds_list_add(v, V3(i1, j0, dep).setNormal(1, 0, 0).setUV(tx1, ty0)); - ds_list_add(v, V3(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j1, dep).setNormal(1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j0, dep).setNormal(1, 0, 0).setUV(tx1, ty0)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx1, ty1)); - ds_list_add(v, V3(i1, j1, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); - ds_list_add(v, V3(i1, j1, dep).setNormal(1, 0, 0).setUV(tx0, ty1)); + ds_list_add(v, new __vertex(i1, j0, -dep).setNormal(1, 0, 0).setUV(tx1, ty1)); + ds_list_add(v, new __vertex(i1, j1, -dep).setNormal(1, 0, 0).setUV(tx0, ty0)); + ds_list_add(v, new __vertex(i1, j1, dep).setNormal(1, 0, 0).setUV(tx0, ty1)); } #endregion } @@ -294,7 +302,6 @@ function __3dSurfaceExtrude(surface = noone, height = noone, smooth = false) : _ ds_list_destroy(v); VB = build(); - generateNormal(); } initModel(); static onParameterUpdate = initModel; diff --git a/scripts/d3d_uvsphere/d3d_uvsphere.gml b/scripts/d3d_uvsphere/d3d_uvsphere.gml index 7bba9ca36..3e3e4e503 100644 --- a/scripts/d3d_uvsphere/d3d_uvsphere.gml +++ b/scripts/d3d_uvsphere/d3d_uvsphere.gml @@ -53,13 +53,13 @@ function __3dUVSphere(radius = 0.5, hori = 16, vert = 8, smt = false) : __3dObje var ind = (i * hori + j) * 6; - vertex[0][ind + 0] = V3(hx0, hy0, hz0); - vertex[0][ind + 1] = V3(hx1, hy1, hz1); - vertex[0][ind + 2] = V3(hx2, hy2, hz2); + vertex[0][ind + 0] = new __vertex(hx0, hy0, hz0); + vertex[0][ind + 1] = new __vertex(hx1, hy1, hz1); + vertex[0][ind + 2] = new __vertex(hx2, hy2, hz2); - vertex[0][ind + 3] = V3(hx1, hy1, hz1); - vertex[0][ind + 4] = V3(hx3, hy3, hz3); - vertex[0][ind + 5] = V3(hx2, hy2, hz2); + vertex[0][ind + 3] = new __vertex(hx1, hy1, hz1); + vertex[0][ind + 4] = new __vertex(hx3, hy3, hz3); + vertex[0][ind + 5] = new __vertex(hx2, hy2, hz2); if(smooth) { vertex[0][ind + 0].setNormal(hx0, hy0, hz0); @@ -73,13 +73,13 @@ function __3dUVSphere(radius = 0.5, hori = 16, vert = 8, smt = false) : __3dObje var nor = d3_cross_product([hx2 - hx0, hy2 - hy0, hz2 - hz0], [hx1 - hx0, hy1 - hy0, hz1 - hz0]); nor = d3_normalize(nor); - vertex[0][ind + 0].setNormal(nor); - vertex[0][ind + 1].setNormal(nor); - vertex[0][ind + 2].setNormal(nor); + vertex[0][ind + 0].setNormal(nor[0], nor[1], nor[2]); + vertex[0][ind + 1].setNormal(nor[0], nor[1], nor[2]); + vertex[0][ind + 2].setNormal(nor[0], nor[1], nor[2]); - vertex[0][ind + 3].setNormal(nor); - vertex[0][ind + 4].setNormal(nor); - vertex[0][ind + 5].setNormal(nor); + vertex[0][ind + 3].setNormal(nor[0], nor[1], nor[2]); + vertex[0][ind + 4].setNormal(nor[0], nor[1], nor[2]); + vertex[0][ind + 5].setNormal(nor[0], nor[1], nor[2]); } vertex[0][ind + 0].setUV(u0, v0); @@ -92,7 +92,6 @@ function __3dUVSphere(radius = 0.5, hori = 16, vert = 8, smt = false) : __3dObje } VB = build(); - generateNormal(); } initModel(); static onParameterUpdate = initModel; diff --git a/scripts/d3d_vertex/d3d_vertex.gml b/scripts/d3d_vertex/d3d_vertex.gml index da1b487bc..341ddb3f3 100644 --- a/scripts/d3d_vertex/d3d_vertex.gml +++ b/scripts/d3d_vertex/d3d_vertex.gml @@ -1,25 +1,38 @@ -function V3(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) { - return new __vertex(_x, _y, _z, color, alpha); -} - -function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) : __vec3(_x, _y, _z) constructor { - normal = new __vec3(); - uv = new __vec2(); +function __vertex(_x = 0, _y = _x, _z = _x, color = c_white, alpha = 1) constructor { + x = _x; + y = _y; + z = _z; + + nx = 0; + ny = 0; + nz = 0; + + u = 0; + v = 0; self.color = color; self.alpha = alpha; static setNormal = function(_nx = 0, _ny = _nx, _nz = _nx) { - normal.set(_nx, _ny, _nz)._normalize(); + gml_pragma("forceinline"); + + nx = _nx; + ny = _ny; + nz = _nz; + return self; } static setUV = function(_u = 0, _v = _u) { - uv.set(_u, _v); + gml_pragma("forceinline"); + + u = _u; + v = _v; + return self; } - static toString = function() { return $"[ pos: ({x}, {y}, {z}), nor: {normal}, uv: {uv}, {color}, {alpha} ]"; } + static toString = function() { return $"[ pos: {position}, nor: {normal}, uv: {uv}, {color}, {alpha} ]"; } static clone = function() { gml_pragma("forceinline"); diff --git a/scripts/dialog_management/dialog_management.gml b/scripts/dialog_management/dialog_management.gml index e1b44d100..f48605a1e 100644 --- a/scripts/dialog_management/dialog_management.gml +++ b/scripts/dialog_management/dialog_management.gml @@ -18,11 +18,12 @@ function dialogCall(_dia, _x = noone, _y = noone, param = {}, create = false) { return dia; } -function dialogPanelCall(_panel, _x = noone, _y = noone) { +function dialogPanelCall(_panel, _x = noone, _y = noone, params = {}) { if(_x == noone) _x = WIN_SW / 2; if(_y == noone) _y = WIN_SH / 2; var dia = instance_create_depth(_x, _y, 0, o_dialog_panel); + variable_instance_set_struct(dia, params); dia.setContent(_panel); dia.x = _x; diff --git a/scripts/draw_UI_scale/draw_UI_scale.gml b/scripts/draw_UI_scale/draw_UI_scale.gml index 790c5deb9..c0bd9e9f6 100644 --- a/scripts/draw_UI_scale/draw_UI_scale.gml +++ b/scripts/draw_UI_scale/draw_UI_scale.gml @@ -21,7 +21,7 @@ function line_get_width(txt, font = noone, offset = 0) { } #region global - #macro TEXTBOX_HEIGHT line_get_height(f_p0, 12) + #macro TEXTBOX_HEIGHT line_get_height(f_p0, 8) function ui(val) { gml_pragma("forceinline"); diff --git a/scripts/instance_variable_set/instance_variable_set.gml b/scripts/instance_variable_set/instance_variable_set.gml new file mode 100644 index 000000000..9315ffa4f --- /dev/null +++ b/scripts/instance_variable_set/instance_variable_set.gml @@ -0,0 +1,5 @@ +function variable_instance_set_struct(object, params) { + var _keys = variable_struct_get_names(params); + for( var i = 0, n = array_length(_keys); i < n; i++ ) + variable_instance_set(object, _keys[i], params[$ _keys[i]]); +} \ No newline at end of file diff --git a/scripts/instance_variable_set/instance_variable_set.yy b/scripts/instance_variable_set/instance_variable_set.yy new file mode 100644 index 000000000..9ce0201ec --- /dev/null +++ b/scripts/instance_variable_set/instance_variable_set.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "instance_variable_set", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "variables", + "path": "folders/functions/variables.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.gml b/scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.gml index 72dfe2f3f..013174981 100644 --- a/scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.gml +++ b/scripts/node_3d_mesh_extrude/node_3d_mesh_extrude.gml @@ -34,5 +34,7 @@ function Node_3D_Mesh_Extrude(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _gr return object; } #endregion - static getPreviewValues = function() { return array_safe_get(all_inputs, in_mesh + 0, noone); } + static getPreviewValues = function() { + return array_safe_get(all_inputs, in_mesh + 0, noone); + } } \ No newline at end of file diff --git a/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml b/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml index 95575933c..bc401e70b 100644 --- a/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml +++ b/scripts/node_3d_mesh_obj/node_3d_mesh_obj.gml @@ -103,8 +103,6 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) object.vertex = _v.vertex; object.object_counts = _v.object_counts; - object.generateNormal(); - object.size = _v.model_size; materialNames = _v.materials; materialIndex = _v.material_index; diff --git a/scripts/node_noise_cell/node_noise_cell.gml b/scripts/node_noise_cell/node_noise_cell.gml index 15069b2ae..300ea0ecb 100644 --- a/scripts/node_noise_cell/node_noise_cell.gml +++ b/scripts/node_noise_cell/node_noise_cell.gml @@ -76,31 +76,19 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) else if(_type == 3) shader = sh_cell_noise_crystal; - uniform_dim = shader_get_uniform(shader, "dimension"); - uniform_pos = shader_get_uniform(shader, "position"); - uniform_sca = shader_get_uniform(shader, "scale"); - uniform_tim = shader_get_uniform(shader, "time"); - uniform_con = shader_get_uniform(shader, "contrast"); - uniform_pat = shader_get_uniform(shader, "pattern"); - uniform_mid = shader_get_uniform(shader, "middle"); - - uniform_rad = shader_get_uniform(shader, "radiusScale"); - uniform_sht = shader_get_uniform(shader, "radiusShatter"); - uniform_col = shader_get_uniform(shader, "colored"); - surface_set_target(_outSurf); shader_set(shader); - shader_set_uniform_f_array_safe(uniform_dim, _dim); - shader_set_uniform_f(uniform_tim, _tim); - shader_set_uniform_f_array_safe(uniform_pos, _pos); - shader_set_uniform_f(uniform_sca, _sca); - shader_set_uniform_f(uniform_con, _con); - shader_set_uniform_f(uniform_mid, _mid); - shader_set_uniform_f(uniform_rad, _rad); - shader_set_uniform_f(uniform_sht, _sht); - shader_set_uniform_i(uniform_pat, _pat); - shader_set_uniform_i(uniform_col, _col); - draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); + shader_set_f("dimension", _dim); + shader_set_f("time", _tim); + shader_set_f("position", _pos); + shader_set_f("scale", _sca); + shader_set_f("contrast", _con); + shader_set_f("middle", _mid); + shader_set_f("radiusScale", _rad); + shader_set_f("radiusShatter", _sht); + shader_set_i("pattern", _pat); + shader_set_i("colored", _col); + draw_sprite_stretched(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1]); shader_reset(); surface_reset_target(); diff --git a/scripts/obj_reader/obj_reader.gml b/scripts/obj_reader/obj_reader.gml index 77227778d..0e6b28863 100644 --- a/scripts/obj_reader/obj_reader.gml +++ b/scripts/obj_reader/obj_reader.gml @@ -192,9 +192,9 @@ function readObj(path, flipUV = false) { vertex_add_pntc(VB, _pf[2], _pfn[2], _pft[2]); vertex_add_pntc(VB, _pf[1], _pfn[1], _pft[1]); - ds_list_add(_v, V3(_pf[0]).setNormal(_pfn[0]).setUV(_pft[0])); - ds_list_add(_v, V3(_pf[2]).setNormal(_pfn[2]).setUV(_pft[2])); - ds_list_add(_v, V3(_pf[1]).setNormal(_pfn[1]).setUV(_pft[1])); + ds_list_add(_v, new __vertex(_pf[0][0], _pf[0][1], _pf[0][2]).setNormal(_pfn[0][0], _pfn[0][1]).setUV(_pft[0][0], _pft[0][1])); + ds_list_add(_v, new __vertex(_pf[2][0], _pf[2][1], _pf[2][2]).setNormal(_pfn[2][0], _pfn[2][1]).setUV(_pft[2][0], _pft[2][1])); + ds_list_add(_v, new __vertex(_pf[1][0], _pf[1][1], _pf[1][2]).setNormal(_pfn[1][0], _pfn[1][1]).setUV(_pft[1][0], _pft[1][1])); } if(_vlen >= 4) { @@ -202,9 +202,9 @@ function readObj(path, flipUV = false) { vertex_add_pntc(VB, _pf[3], _pfn[3], _pft[3]); vertex_add_pntc(VB, _pf[2], _pfn[2], _pft[2]); - ds_list_add(_v, V3(_pf[0]).setNormal(_pfn[0]).setUV(_pft[0])); - ds_list_add(_v, V3(_pf[3]).setNormal(_pfn[3]).setUV(_pft[3])); - ds_list_add(_v, V3(_pf[2]).setNormal(_pfn[2]).setUV(_pft[2])); + ds_list_add(_v, new __vertex(_pf[0][0], _pf[0][1], _pf[0][2]).setNormal(_pfn[0][0], _pfn[0][1]).setUV(_pft[0][0], _pft[0][1])); + ds_list_add(_v, new __vertex(_pf[3][0], _pf[3][1], _pf[3][2]).setNormal(_pfn[3][0], _pfn[3][1]).setUV(_pft[3][0], _pft[3][1])); + ds_list_add(_v, new __vertex(_pf[2][0], _pf[2][1], _pf[2][2]).setNormal(_pfn[2][0], _pfn[2][1]).setUV(_pft[2][0], _pft[2][1])); } } diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 4933d28f6..e28c95ce5 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -1804,13 +1804,11 @@ function Panel_Animation() : PanelContent() constructor { by += ui(36); bx = w - ui(44); if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_animation_settings", "Animation settings"), THEME.animation_setting, 2) == 2) - dialogCall(o_dialog_animation, x + bx + 32, y + by - 8); + dialogPanelCall(new Panel_Animation_Setting(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom }); by -= ui(40); if(by < 8) return; - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2) { - var dia = dialogCall(o_dialog_anim_time_scaler, x + bx + ui(32), y + by - ui(8)); - dia.anchor = ANCHOR.right | ANCHOR.bottom; - } + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2) + dialogPanelCall(new Panel_Animation_Scaler(), x + bx + ui(32), y + by - ui(8), { anchor: ANCHOR.right | ANCHOR.bottom }); if(by < ui(28)) return; by = ui(8); diff --git a/scripts/panel_animation_scaler/panel_animation_scaler.gml b/scripts/panel_animation_scaler/panel_animation_scaler.gml new file mode 100644 index 000000000..2eceb7758 --- /dev/null +++ b/scripts/panel_animation_scaler/panel_animation_scaler.gml @@ -0,0 +1,58 @@ +function Panel_Animation_Scaler() : Panel_Linear_Setting() constructor { + title = __txtx("anim_scale_title", "Animation scaler"); + + w = ui(380); + scale_to = PROJECT.animator.frames_total; + + #region data + properties = [ + [ + new textBox(TEXTBOX_INPUT.number, function(to) { + to = toNumber(to); + scale_to = to; + }), + __txtx("anim_scale_target_frame_length", "Target frame length"), + function() { return scale_to; }, + ] + ]; + + setHeight(); + h += ui(36); + + b_apply = button(function() { scale(); }) + .setIcon(THEME.accept_16, 0, COLORS._main_icon_dark); + #endregion + + static scale = function() { + var fac = scale_to / PROJECT.animator.frames_total; + var key = ds_map_find_first(PROJECT.nodeMap); + repeat(ds_map_size(PROJECT.nodeMap)) { + var _node = PROJECT.nodeMap[? key]; + key = ds_map_find_next(PROJECT.nodeMap, key); + if(!_node || !_node.active) continue; + + for(var i = 0; i < ds_list_size(_node.inputs); i++) { + var in = _node.inputs[| i]; + if(!in.is_anim) continue; + for(var j = 0; j < ds_list_size(in.animator.values); j++) { + var t = in.animator.values[| j]; + t.time = t.ratio * scale_to; + } + } + } + PROJECT.animator.frames_total = scale_to; + close(); + } + + function drawContent(panel) { + drawSettings(panel); + + var bs = ui(28); + var bx = w - ui(8) - bs; + var by = h - ui(8) - bs; + + b_apply.setFocusHover(pFOCUS, pHOVER); + b_apply.register(); + b_apply.draw(bx, by, bs, bs, [ mx, my ], THEME.button_lime); + } +} \ No newline at end of file diff --git a/scripts/panel_animation_scaler/panel_animation_scaler.yy b/scripts/panel_animation_scaler/panel_animation_scaler.yy new file mode 100644 index 000000000..f13301616 --- /dev/null +++ b/scripts/panel_animation_scaler/panel_animation_scaler.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_animation_scaler", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "animation", + "path": "folders/panels/animation.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_animation_scaler/panel_console.gml b/scripts/panel_animation_scaler/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_animation_scaler/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_animation_settings/panel_animation_settings.gml b/scripts/panel_animation_settings/panel_animation_settings.gml new file mode 100644 index 000000000..02e4bcaaa --- /dev/null +++ b/scripts/panel_animation_settings/panel_animation_settings.gml @@ -0,0 +1,33 @@ +function Panel_Animation_Setting() : Panel_Linear_Setting() constructor { + title = __txtx("animation_settings", "Animation Settings"); + + w = ui(380); + + #region data + properties = [ + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PROJECT.animator.frames_total = real(str); + }), + __txtx("anim_length", "Animation length"), + function() { return PROJECT.animator.frames_total; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PROJECT.animator.framerate = real(str); + }), + __txtx("anim_frame_rate", "Preview frame rate"), + function() { return PROJECT.animator.framerate; } + ], + [ + new buttonGroup([__txt("Loop"), __txt("Stop")], function(b) { + PROJECT.animator.playback = b; + }), + __txtx("anim_on_end", "On end"), + function() { return PROJECT.animator.playback; } + ] + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_animation_settings/panel_animation_settings.yy b/scripts/panel_animation_settings/panel_animation_settings.yy new file mode 100644 index 000000000..165ce83b3 --- /dev/null +++ b/scripts/panel_animation_settings/panel_animation_settings.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_animation_settings", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "animation", + "path": "folders/panels/animation.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_animation_settings/panel_console.gml b/scripts/panel_animation_settings/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_animation_settings/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_data/panel_data.gml b/scripts/panel_data/panel_data.gml index cee0b0970..6f2460e70 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -49,26 +49,27 @@ function Panel(_parent, _x, _y, _w, _h) constructor { tab_holding_my = 0; tab_holding_sx = 0; tab_holding_sy = 0; + tab_cover = noone; - border_rb_close = menuItem(__txt("Close"), function() { + border_rb_close = menuItem(__txt("Close"), function() { #region var con = getContent(); if(con == noone) return; con.close(); - }, THEME.cross); + }, THEME.cross); #endregion - border_rb_menu = [ + border_rb_menu = [ #region menuItem(__txt("Move"), function() { extract(); panel_mouse = 1; }), menuItem(__txtx("panel_pop_out", "Pop out"), function() { popWindow(); }, THEME.node_goto), border_rb_close - ]; + ]; #endregion static getContent = function() { return array_safe_get(content, content_index, noone, ARRAY_OVERFLOW._default); } static hasContent = function() { return bool(array_length(content)); } - function resetMask() { + function resetMask() { #region var tab = array_length(content) > 1; tx = x; ty = y + tab * ui(tab_height); tw = w; th = h - tab * ui(tab_height); @@ -81,15 +82,14 @@ function Panel(_parent, _x, _y, _w, _h) constructor { draw_sprite_stretched(THEME.ui_panel_bg, 0, padding, padding, tw - padding * 2, th - padding * 2); gpu_set_blendmode(bm_normal); surface_reset_target(); - } - resetMask(); + } resetMask(); #endregion - function setPadding(padding) { + function setPadding(padding) { #region self.padding = padding; refresh(); - } + } #endregion - function refresh() { + function refresh() { #region resetMask(); for( var i = 0, n = array_length(content); i < n; i++ ) @@ -97,9 +97,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { for( var i = 0; i < ds_list_size(childs); i++ ) childs[| i].refresh(); - } + } #endregion - function move(dx, dy) { + function move(dx, dy) { #region x += dx; y += dy; @@ -112,9 +112,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { content[i].x = x; content[i].y = y; } - } + } #endregion - function resizable(dw, dh, oppose = ANCHOR.left) { + function resizable(dw, dh, oppose = ANCHOR.left) { #region var tab = array_length(content) > 1; tx = x; ty = y + tab * ui(tab_height); tw = w; th = h - tab * ui(tab_height); @@ -130,9 +130,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var ind = hori? childs[| 1].w > childs[| 0].w : childs[| 1].h > childs[| 0].h; return childs[| ind].resizable(dw, dh, oppose); - } + } #endregion - function refreshSize(recur = true) { //refresh content surface after resize + function refreshSize(recur = true) { #region //refresh content surface after resize //__debug_counter("refresh size"); var tab = array_length(content) > 1; tx = x; ty = y + tab * ui(tab_height); @@ -187,9 +187,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { } refresh(); - } + } #endregion - function resize(dw, dh, oppose = ANCHOR.left) { + function resize(dw, dh, oppose = ANCHOR.left) { #region if(dw == 0 && dh == 0) return; if(ds_list_size(childs) == 2) { @@ -202,9 +202,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { h = max(round(h + dh), min_h); refreshSize(false); - } + } #endregion - function setContent(_content = noone, _switch = false) { + function setContent(_content = noone, _switch = false) { #region if(is_array(_content)) content = array_append(content, _content); else @@ -216,9 +216,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { if(_switch) setTab(array_find(content, _content)); refresh(); - } + } #endregion - function split_h(_w) { + function split_h(_w) { #region if(abs(_w) > w) { print("Error: Split panel larger than size w (" + string(_w) + " > " + string(w) + ")"); return noone; @@ -252,9 +252,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { content = []; return [ _panelL, _panelR ]; - } + } #endregion - function split_v(_h) { + function split_v(_h) { #region if(abs(_h) > h) { print("Error: Split panel larger than size h (" + string(_h) + " > " + string(h) + ")"); return noone; @@ -287,9 +287,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { content = []; return [_panelT, _panelB]; - } + } #endregion - function stepBegin() { + function stepBegin() { #region var con = getContent(); if(con) con.panelStepBegin(self); @@ -385,16 +385,16 @@ function Panel(_parent, _x, _y, _w, _h) constructor { } } } - } + } #endregion - static step = function() { + static step = function() { #region for(var i = 0; i < ds_list_size(childs); i++) { var _panel = childs[| i]; _panel.step(); } - } + } #endregion - function draw() { + function draw() { #region if(hasContent()) { drawPanel(); return; @@ -449,10 +449,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { if(self == PANEL_MAIN && o_main.panel_dragging != noone && key_mod_press(CTRL)) checkHover(); - } + } #endregion - tab_cover = noone; - function drawTab() { + function drawTab() { #region tab_surface = surface_verify(tab_surface, w - padding * 2 + 1, tab_height + ui(4)); var tsx = x + padding - 1; @@ -609,9 +608,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { surface_reset_target(); draw_surface(tab_surface, tsx, tsy); - } + } #endregion - function setTab(tabIndex) { + function setTab(tabIndex) { #region if(tabIndex < 0) return; if(tabIndex >= array_length(content)) return; @@ -622,9 +621,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var prec = array_safe_get(content, content_index); if(prec) prec.onFocusBegin(); - } + } #endregion - function drawPanel() { + function drawPanel() { #region if(w <= ui(16)) return; var tab = array_length(content) > 1; tx = x; ty = y + tab * ui(tab_height); @@ -689,18 +688,18 @@ function Panel(_parent, _x, _y, _w, _h) constructor { if(o_main.panel_dragging != noone && m_ot && !key_mod_press(CTRL)) checkHover(); - } + } #endregion - function drawGUI() { + function drawGUI() { #region for( var i = 0; i < ds_list_size(childs); i++ ) childs[| i].drawGUI(); var con = getContent(); if(con == noone) return; con.drawGUI(); - } + } #endregion - function extract() { + function extract() { #region var con = getContent(); con.dragSurface = surface_clone(content_surface); o_main.panel_dragging = con; @@ -735,18 +734,18 @@ function Panel(_parent, _x, _y, _w, _h) constructor { parent.setContent(sib.content); ds_list_clear(parent.childs); } - } + } #endregion - function popWindow() { + function popWindow() { #region var con = getContent(); if(con == noone) return; dialogPanelCall(con); extract(); o_main.panel_dragging = noone; - } + } #endregion - function checkHover() { + function checkHover() { #region var dx = (mouse_mx - x) / w; var dy = (mouse_my - y) / h; var p = ui(8); @@ -803,9 +802,9 @@ function Panel(_parent, _x, _y, _w, _h) constructor { } } } - } + } #endregion - function remove(con = getContent()) { + function remove(con = getContent()) { #region var curr = getContent(); array_remove(content, con); @@ -824,7 +823,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor { var otherPanel = parent.childs[| 0]; parent.setContent(otherPanel.content); ds_list_clear(parent.childs); - } + } #endregion } function PanelContent() constructor { @@ -859,10 +858,10 @@ function PanelContent() constructor { dragSurface = surface_create(1, 1); showHeader = true; - function refresh() { + function refresh() { #region setPanelSize(panel); onResize(); - } + } #endregion function onResize() {} @@ -871,35 +870,35 @@ function PanelContent() constructor { static initSize = function() {} - function setPanelSize(panel) { + function setPanelSize(panel) { #region x = panel.tx; y = panel.ty; w = panel.tw; h = panel.th; - } + } #endregion - function onSetPanel(panel) { + function onSetPanel(panel) { #region self.panel = panel; setPanelSize(panel); initSize(); onResize(); - } + } #endregion - function panelStepBegin(panel) { + function panelStepBegin(panel) { #region setPanelSize(panel); onStepBegin(); - } + } #endregion - function onStepBegin() { + function onStepBegin() { #region mx = mouse_mx - x; my = mouse_my - y; stepBegin(); - } + } #endregion function stepBegin() {} - function draw(panel) { + function draw(panel) { #region self.panel = panel; if(o_main.panel_dragging == noone) { pFOCUS = FOCUS == panel && panel.mouse_active; @@ -907,7 +906,7 @@ function PanelContent() constructor { } drawContent(panel); - } + } #endregion function drawContent(panel) {} diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index a0d5f69f5..774410e0b 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -181,8 +181,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { function() { return PREF_MAP[? "curve_connection_line"]; }, function() { return __txtx("panel_graph_connection_line", "Connection render settings"); }, function(param) { - var gs = dialogCall(o_dialog_graph_connection, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; + dialogPanelCall(new Panel_Graph_Connection_Setting(), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], [ @@ -190,8 +189,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { function() { return 0; }, function() { return __txtx("grid_title", "Grid settings"); }, function(param) { - var gs = dialogCall(o_dialog_graph_grid, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; + dialogPanelCall(new Panel_Graph_Grid_Setting(), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], [ @@ -199,8 +197,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { function() { return 0; }, function() { return __txtx("graph_visibility_title", "Visibility settings"); }, function(param) { - var gs = dialogCall(o_dialog_graph_view, param.x, param.y, { display_parameter }); - gs.anchor = ANCHOR.bottom | ANCHOR.left; + dialogPanelCall(new Panel_Graph_View_Setting(display_parameter), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], ]; #endregion diff --git a/scripts/panel_graph_connection_settings/panel_console.gml b/scripts/panel_graph_connection_settings/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_graph_connection_settings/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_graph_connection_settings/panel_graph_connection_settings.gml b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml new file mode 100644 index 000000000..4fbeb9b62 --- /dev/null +++ b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.gml @@ -0,0 +1,39 @@ +function Panel_Graph_Connection_Setting() : Panel_Linear_Setting() constructor { + title = __txtx("graph_connection_settings", "Connection Settings"); + + w = ui(380); + + #region data + properties = [ + [ + new buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ], + function(val) { PREF_MAP[? "curve_connection_line"] = val; }), + __txt("Type"), + function() { return PREF_MAP[? "curve_connection_line"]; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PREF_MAP[? "connection_line_width"] = max(0.5, real(str)); + }), + __txtx("dialog_connection_thickness", "Line thickness"), + function() { return PREF_MAP[? "connection_line_width"]; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PREF_MAP[? "connection_line_corner"] = max(0, real(str)); + }).setSlidable(), + __txtx("dialog_connection_radius", "Corner radius"), + function() { return PREF_MAP[? "connection_line_corner"]; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PREF_MAP[? "connection_line_aa"] = max(1, real(str)); + }), + __txtx("pref_connection_quality", "Render quality"), + function() { return PREF_MAP[? "connection_line_aa"]; } + ] + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy new file mode 100644 index 000000000..c5b2691d1 --- /dev/null +++ b/scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_graph_connection_settings", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "graph", + "path": "folders/panels/graph.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_graph_grid_settings/panel_console.gml b/scripts/panel_graph_grid_settings/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_graph_grid_settings/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_graph_grid_settings/panel_graph_grid_settings.gml b/scripts/panel_graph_grid_settings/panel_graph_grid_settings.gml new file mode 100644 index 000000000..3639efcd6 --- /dev/null +++ b/scripts/panel_graph_grid_settings/panel_graph_grid_settings.gml @@ -0,0 +1,44 @@ +function Panel_Graph_Grid_Setting() : Panel_Linear_Setting() constructor { + title = __txtx("graph_grid_settings", "Grid Settings"); + + w = ui(380); + + #region data + properties = [ + [ + new checkBox(function(str) { + if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; + PANEL_GRAPH.project.graphGrid.snap = !PANEL_GRAPH.project.graphGrid.snap; + }), + __txtx("grid_snap", "Snap to grid"), + function() { return PANEL_GRAPH.project.graphGrid.snap; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; + PANEL_GRAPH.project.graphGrid.size = max(1, real(str)); + }), + __txtx("grid_size", "Grid size"), + function() { return PANEL_GRAPH.project.graphGrid.size; } + ], + [ + new slider(0, 1, .05, function(str) { + if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; + PANEL_GRAPH.project.graphGrid.opacity = clamp(real(str), 0, 1); + }), + __txtx("project.graphGrid.opacity", "Grid opacity"), + function() { return PANEL_GRAPH.project.graphGrid.opacity; } + ], + [ + new buttonColor(function(color) { + if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; + PANEL_GRAPH.project.graphGrid.color = color; + }, self), + __txtx("project.graphGrid.color", "Grid color"), + function() { return PANEL_GRAPH.project.graphGrid.color; } + ] + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy b/scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy new file mode 100644 index 000000000..2446259b6 --- /dev/null +++ b/scripts/panel_graph_grid_settings/panel_graph_grid_settings.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_graph_grid_settings", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "graph", + "path": "folders/panels/graph.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_graph_view_settings/panel_console.gml b/scripts/panel_graph_view_settings/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_graph_view_settings/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_graph_view_settings/panel_graph_view_settings.gml b/scripts/panel_graph_view_settings/panel_graph_view_settings.gml new file mode 100644 index 000000000..4f6d3fa11 --- /dev/null +++ b/scripts/panel_graph_view_settings/panel_graph_view_settings.gml @@ -0,0 +1,38 @@ +function Panel_Graph_View_Setting(display) : Panel_Linear_Setting() constructor { + title = __txtx("graph_view_settings", "View Settings"); + + w = ui(380); + display_parameter = display; + + #region data + properties = [ + [ + new checkBox(function() { display_parameter.show_grid = !display_parameter.show_grid; }), + __txt("Grid"), + function() { return display_parameter.show_grid }, + ], + [ + new checkBox(function() { display_parameter.show_dimension = !display_parameter.show_dimension; }), + __txtx("graph_visibility_dim", "Dimension"), + function() { return display_parameter.show_dimension }, + ], + [ + new checkBox(function() { display_parameter.show_compute = !display_parameter.show_compute; }), + __txtx("graph_visibility_compute", "Compute time"), + function() { return display_parameter.show_compute }, + ], + [ + new checkBox(function() { display_parameter.avoid_label = !display_parameter.avoid_label; }), + __txtx("graph_visibility_avoid_label", "Avoid Label"), + function() { return display_parameter.avoid_label }, + ], + [ + new slider(50, 100, 1, function(val) { display_parameter.preview_scale = val; }), + __txtx("graph_visibility_preview_scale", "Preview Scale"), + function() { return display_parameter.preview_scale }, + ], + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_graph_view_settings/panel_graph_view_settings.yy b/scripts/panel_graph_view_settings/panel_graph_view_settings.yy new file mode 100644 index 000000000..d0071257f --- /dev/null +++ b/scripts/panel_graph_view_settings/panel_graph_view_settings.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_graph_view_settings", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "graph", + "path": "folders/panels/graph.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 5a7b3248e..d39a5b6e3 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -210,8 +210,7 @@ function Panel_Preview() : PanelContent() constructor { function() { return 0; }, function() { return __txtx("grid_title", "Grid setting") }, function(param) { - var gs = dialogCall(o_dialog_preview_grid, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; + var dia = dialogPanelCall(new Panel_Preview_Grid_Setting(), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], [ @@ -219,8 +218,7 @@ function Panel_Preview() : PanelContent() constructor { function() { return 0; }, function() { return __txt("Onion Skin") }, function(param) { - var gs = dialogCall(o_dialog_preview_onion_skin, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; + var dia = dialogPanelCall(new Panel_Preview_Onion_Setting(), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], ]; @@ -231,9 +229,7 @@ function Panel_Preview() : PanelContent() constructor { function() { return 0; }, function() { return __txt("3D Preview Settings") }, function(param) { - var gs = dialogCall(o_dialog_preview_3d_settings, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; - gs.preview_panel = self; + var dia = dialogPanelCall(new Panel_Preview_3D_Setting(self), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], [ @@ -241,9 +237,7 @@ function Panel_Preview() : PanelContent() constructor { function() { return 0; }, function() { return __txt("3D Snap Settings") }, function(param) { - var gs = dialogCall(o_dialog_preview_snap, param.x, param.y); - gs.anchor = ANCHOR.bottom | ANCHOR.left; - gs.preview_panel = self; + var dia = dialogPanelCall(new Panel_Preview_Snap_Setting(self), param.x, param.y, { anchor: ANCHOR.bottom | ANCHOR.left }); } ], ]; @@ -761,6 +755,7 @@ function Panel_Preview() : PanelContent() constructor { function draw3D() { #region var _prev_node = getNodePreview(); + if(_prev_node == noone) return; _prev_node.previewing = 1; d3_scene_preview = struct_has(_prev_node, "scene")? _prev_node.scene : d3_scene; @@ -966,27 +961,27 @@ function Panel_Preview() : PanelContent() constructor { } draw_set_text(f_p0, fa_right, fa_top, fps >= PROJECT.animator.framerate? COLORS._main_text_sub : COLORS._main_value_negative); - draw_text(w - ui(8), right_menu_y, __txt("fps") + " " + string(fps)); + draw_text(w - ui(8), right_menu_y, $"{__txt("fps")} {fps}"); right_menu_y += string_height("l"); draw_set_text(f_p0, fa_right, fa_top, COLORS._main_text_sub); - draw_text(w - ui(8), right_menu_y, __txt("Frame") + " " + string(PROJECT.animator.current_frame) + "/" + string(PROJECT.animator.frames_total)); + draw_text(w - ui(8), right_menu_y, $"{__txt("Frame")} {PROJECT.animator.current_frame}/{PROJECT.animator.frames_total}"); right_menu_y += string_height("l"); - draw_text(w - ui(8), right_menu_y, "x" + string(canvas_s)); + draw_text(w - ui(8), right_menu_y, $"x{canvas_s}"); if(pHOVER) { right_menu_y += string_height("l"); var mpx = floor((mx - canvas_x) / canvas_s); var mpy = floor((my - canvas_y) / canvas_s); - draw_text(w - ui(8), right_menu_y, "[" + string(mpx) + ", " + string(mpy) + "]"); + draw_text(w - ui(8), right_menu_y, $"[{mpx}, {mpy}]"); } if(_node == noone) return; right_menu_y += string_height("l"); - var txt = string(canvas_w) + "x" + string(canvas_h) + "px"; - if(canvas_a) txt = string(canvas_a) + " x " + txt; + var txt = $"{canvas_w} x {canvas_h}px"; + if(canvas_a) txt = $"{canvas_a} x {txt}"; draw_text(w - ui(8), right_menu_y, txt); right_menu_y += string_height("l"); @@ -1020,6 +1015,8 @@ function Panel_Preview() : PanelContent() constructor { for(var i = 0; i < array_length(pseq); i++) { var prev = pseq[i]; + if(is_instanceof(prev, __d3dMaterial)) + prev = prev.surface; if(!is_surface(prev)) continue; var prev_w = surface_get_width(prev); @@ -1409,12 +1406,14 @@ function Panel_Preview() : PanelContent() constructor { getPreviewData(); - if(d3_active) { - dragCanvas3D(); - draw3D(); - } else { - dragCanvas(); - drawNodePreview(); + if(_prev_node) { + if(d3_active) { + dragCanvas3D(); + draw3D(); + } else { + dragCanvas(); + drawNodePreview(); + } } drawPreviewOverlay(); diff --git a/scripts/panel_preview_3d_setting/panel_console.gml b/scripts/panel_preview_3d_setting/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_preview_3d_setting/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_preview_3d_setting/panel_preview_3d_setting.gml b/scripts/panel_preview_3d_setting/panel_preview_3d_setting.gml new file mode 100644 index 000000000..06e718a66 --- /dev/null +++ b/scripts/panel_preview_3d_setting/panel_preview_3d_setting.gml @@ -0,0 +1,58 @@ +function Panel_Preview_3D_Setting(panel) : Panel_Linear_Setting() constructor { + title = __txtx("preview_3d_settings", "3D Preview Settings"); + + w = ui(380); + preview_panel = panel; + + #region data + properties = [ + [ + new checkBox(function() { preview_panel.d3_scene_light_enabled = !preview_panel.d3_scene_light_enabled; }), + __txt("Preview Light"), + function() { return preview_panel.d3_scene_light_enabled }, + ], + [ + new buttonColor(function(col) { + preview_panel.d3_scene.lightAmbient = col; }), + __txt("Ambient Color"), + function() { return preview_panel.d3_scene.lightAmbient }, + ], + [ + new slider(0, 1, 0.01, function(val) { + preview_panel.d3_scene_light0.intensity = val; + preview_panel.d3_scene_light1.intensity = val; + }), + __txt("Light Intensity"), + function() { return preview_panel.d3_scene_light0.intensity }, + ], + [ + new checkBox(function() { + preview_panel.d3_scene_light0.shadow_active = !preview_panel.d3_scene_light0.shadow_active; }), + __txt("Shadow"), + function() { return preview_panel.d3_scene_light0.shadow_active }, + ], + [ + new vectorBox(2, function(index, value) { + if(index == 0) preview_panel.d3_view_camera.view_near = value; + else if(index == 1) preview_panel.d3_view_camera.view_far = value; + }), + __txt("View Plane"), + function() { return [ preview_panel.d3_view_camera.view_near, preview_panel.d3_view_camera.view_far ] }, + ], + [ + new checkBox(function() { + preview_panel.d3_scene.gammaCorrection = !preview_panel.d3_scene.gammaCorrection; }), + __txt("Gamma Correct"), + function() { return preview_panel.d3_scene.gammaCorrection }, + ], + [ + new checkBox(function() { + preview_panel.d3_scene.show_normal = !preview_panel.d3_scene.show_normal; }), + __txt("Normal"), + function() { return preview_panel.d3_scene.show_normal }, + ], + ] + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_preview_3d_setting/panel_preview_3d_setting.yy b/scripts/panel_preview_3d_setting/panel_preview_3d_setting.yy new file mode 100644 index 000000000..b3dc0495d --- /dev/null +++ b/scripts/panel_preview_3d_setting/panel_preview_3d_setting.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_preview_3d_setting", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "preview", + "path": "folders/panels/preview.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_preview_grid_setting/panel_console.gml b/scripts/panel_preview_grid_setting/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_preview_grid_setting/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_preview_grid_setting/panel_preview_grid_setting.gml b/scripts/panel_preview_grid_setting/panel_preview_grid_setting.gml new file mode 100644 index 000000000..df337a78e --- /dev/null +++ b/scripts/panel_preview_grid_setting/panel_preview_grid_setting.gml @@ -0,0 +1,54 @@ +function Panel_Preview_Grid_Setting() : Panel_Linear_Setting() constructor { + title = __txtx("preview_grid_settings", "Grid Settings"); + + w = ui(380); + + #region data + properties = [ + [ + new checkBox(function() { + PROJECT.previewGrid.show = !PROJECT.previewGrid.show; + }), + __txt("Enabled"), + function() { return PROJECT.previewGrid.show; } + ], + [ + new checkBox(function() { + PROJECT.previewGrid.snap = !PROJECT.previewGrid.snap; + }), + __txtx("grid_snap", "Snap to grid"), + function() { return PROJECT.previewGrid.snap; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PROJECT.previewGrid.width = max(1, real(str)); + }), + __txt("Grid width"), + function() { return PROJECT.previewGrid.width; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PROJECT.previewGrid.height = max(1, real(str)); + }), + __txt("Grid height"), + function() { return PROJECT.previewGrid.height; } + ], + [ + new slider(0, 1, .05, function(str) { + PROJECT.previewGrid.opacity = clamp(real(str), 0, 1); + }), + __txt("Grid opacity"), + function() { return PROJECT.previewGrid.opacity; } + ], + [ + new buttonColor(function(color) { + PROJECT.previewGrid.color = color; + }, self), + __txt("Grid color"), + function() { return PROJECT.previewGrid.color; } + ] + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_preview_grid_setting/panel_preview_grid_setting.yy b/scripts/panel_preview_grid_setting/panel_preview_grid_setting.yy new file mode 100644 index 000000000..16bca2851 --- /dev/null +++ b/scripts/panel_preview_grid_setting/panel_preview_grid_setting.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_preview_grid_setting", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "preview", + "path": "folders/panels/preview.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_preview_onion_setting/panel_console.gml b/scripts/panel_preview_onion_setting/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_preview_onion_setting/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_preview_onion_setting/panel_preview_onion_setting.gml b/scripts/panel_preview_onion_setting/panel_preview_onion_setting.gml new file mode 100644 index 000000000..ca2aa680b --- /dev/null +++ b/scripts/panel_preview_onion_setting/panel_preview_onion_setting.gml @@ -0,0 +1,54 @@ +function Panel_Preview_Onion_Setting() : Panel_Linear_Setting() constructor { + title = __txtx("preview_onion_skin_settings", "Onion skin Settings"); + + w = ui(380); + + #region data + properties = [ + [ + new checkBox(function() { + PROJECT.onion_skin.enabled = !PROJECT.onion_skin.enabled; + }), + __txt("Enabled"), + function() { return PROJECT.onion_skin.enabled; } + ], + [ + new checkBox(function() { + PROJECT.onion_skin.on_top = !PROJECT.onion_skin.on_top; + }), + __txtx("onion_skin_top", "Draw on top"), + function() { return PROJECT.onion_skin.on_top; } + ], + [ + new textBox(TEXTBOX_INPUT.number, function(str) { + PROJECT.onion_skin.step = max(1, round(real(str))); + }), + __txt("Frame step"), + function() { return PROJECT.onion_skin.step; } + ], + [ + new buttonColor(function(color) { + PROJECT.onion_skin.color[0] = color; + }, self), + __txt("Pre Color"), + function() { return PROJECT.onion_skin.color[0]; } + ], + [ + new buttonColor(function(color) { + PROJECT.onion_skin.color[1] = color; + }, self), + __txt("Post Color"), + function() { return PROJECT.onion_skin.color[1]; } + ], + [ + new slider(0, 1, .05, function(str) { + PROJECT.onion_skin.alpha = clamp(real(str), 0, 1); + }), + __txt("Opacity"), + function() { return PROJECT.onion_skin.alpha; } + ] + ]; + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy b/scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy new file mode 100644 index 000000000..986347eb1 --- /dev/null +++ b/scripts/panel_preview_onion_setting/panel_preview_onion_setting.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_preview_onion_setting", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "preview", + "path": "folders/panels/preview.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_preview_snap_setting/panel_console.gml b/scripts/panel_preview_snap_setting/panel_console.gml new file mode 100644 index 000000000..5dff86a32 --- /dev/null +++ b/scripts/panel_preview_snap_setting/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_preview_snap_setting/panel_preview_snap_setting.gml b/scripts/panel_preview_snap_setting/panel_preview_snap_setting.gml new file mode 100644 index 000000000..6b6c4d805 --- /dev/null +++ b/scripts/panel_preview_snap_setting/panel_preview_snap_setting.gml @@ -0,0 +1,28 @@ +function Panel_Preview_Snap_Setting(panel) : Panel_Linear_Setting() constructor { + title = __txtx("preview_snap_settings", "3D Snap Settings"); + + w = ui(380); + preview_panel = panel; + + #region data + properties = [ + [ + new checkBox(function() { preview_panel.d3_tool_snap = !preview_panel.d3_tool_snap; }), + __txt("Snap"), + function() { return preview_panel.d3_tool_snap }, + ], + [ + new textBox(TEXTBOX_INPUT.number, function(val) { preview_panel.d3_tool_snap_position = val; }), + __txt("Linear"), + function() { return preview_panel.d3_tool_snap_position }, + ], + [ + new textBox(TEXTBOX_INPUT.number, function(val) { preview_panel.d3_tool_snap_rotation = val; }), + __txt("Rotation"), + function() { return preview_panel.d3_tool_snap_rotation }, + ], + ] + + setHeight(); + #endregion +} \ No newline at end of file diff --git a/scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy b/scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy new file mode 100644 index 000000000..0f344c429 --- /dev/null +++ b/scripts/panel_preview_snap_setting/panel_preview_snap_setting.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_preview_snap_setting", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "preview", + "path": "folders/panels/preview.yy", + }, +} \ No newline at end of file diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 2d6a4a33f..d58eede3f 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -43,6 +43,11 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi text_surface = surface_create(1, 1); + static setSlidable = function(slidable = true) { + self.slidable = slidable; + return self; + } + static setFont = function(font) { self.font = font; return self; diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index 57af91dc3..f126dd112 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -81,7 +81,7 @@ function widgetParam(x, y, w, h, data, extra_data = 0, m = mouse_ui, rx = 0, ry self.w = w; self.h = h; - self.s = ui(28); + self.s = ui(24); self.data = data; self.extra_data = extra_data; self.m = m;