From 9180a2335aca3f7794adb2f528afec02ac0a7f85 Mon Sep 17 00:00:00 2001 From: Yotam Ashman Date: Wed, 8 Apr 2026 00:17:53 +0300 Subject: [PATCH 1/3] Upgrade project files --- algorithms/pseudo_code/Kruskal.tres | 2 +- dev/profile_benchmark.tscn | 6 ++-- project.godot | 14 +++----- .../algorithm_controls.tscn | 1 - scenes/camera/camera.tscn | 3 +- scenes/edge_view/edge_view.tscn | 6 ++-- scenes/notifier/notify.tscn | 9 +++-- scenes/presets/preset_picker.tscn | 35 ++++++++---------- .../pseudo_visualizer/pseudo_visualizer.tscn | 2 -- scenes/tool_bar/tool_bar.tscn | 36 +++++++++---------- scenes/vertex_view/vertex_view.tscn | 8 ++--- 11 files changed, 51 insertions(+), 71 deletions(-) diff --git a/algorithms/pseudo_code/Kruskal.tres b/algorithms/pseudo_code/Kruskal.tres index d9c26b0..a375542 100644 --- a/algorithms/pseudo_code/Kruskal.tres +++ b/algorithms/pseudo_code/Kruskal.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="PseudoCodeData" format=3] +[gd_resource type="Resource" script_class="PseudoCodeData" format=3 uid="uid://dmj804lx6nflv"] [ext_resource type="Script" uid="uid://c8h8cvjik2tcu" path="res://algorithms/pseudo_code/pseudo_code_resource.gd" id="1_kruskal"] diff --git a/dev/profile_benchmark.tscn b/dev/profile_benchmark.tscn index 2de2da6..5e2b260 100644 --- a/dev/profile_benchmark.tscn +++ b/dev/profile_benchmark.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=2 format=3] +[gd_scene format=3 uid="uid://bnbegesykc4lk"] -[ext_resource type="Script" path="res://dev/profile_benchmark.gd" id="1"] +[ext_resource type="Script" uid="uid://dy1ix4u5djiuc" path="res://dev/profile_benchmark.gd" id="1"] -[node name="ProfileBenchmark" type="Node"] +[node name="ProfileBenchmark" type="Node" unique_id=1781357243] script = ExtResource("1") diff --git a/project.godot b/project.godot index 4316f18..2a25392 100644 --- a/project.godot +++ b/project.godot @@ -8,10 +8,6 @@ config_version=5 -[animation] - -compatibility/default_parent_skeleton_in_mesh_instance_3d=true - [application] config/name="Graphos" @@ -30,6 +26,10 @@ GLogger="*uid://b7vp5dn120dii" CommandManager="*uid://bstobjaowschd" Notify="*res://scenes/notifier/notify.tscn" +[debug] + +gdscript/warnings/treat_warnings_as_errors=false + [display] window/size/viewport_width=1280 @@ -146,9 +146,3 @@ renderer/rendering_method.mobile="gl_compatibility" environment/defaults/default_clear_color=Color(1, 1, 1, 1) 2d/snap/snap_2d_transforms_to_pixel=true 2d/snap/snap_2d_vertices_to_pixel=true - -[debug] - -gdscript/warnings/treat_warnings_as_errors=false -gdscript/warnings/inferred_declaration=0 -gdscript/warnings/untyped_declaration=0 diff --git a/scenes/algorithm_controls/algorithm_controls.tscn b/scenes/algorithm_controls/algorithm_controls.tscn index f56962b..9a4698f 100644 --- a/scenes/algorithm_controls/algorithm_controls.tscn +++ b/scenes/algorithm_controls/algorithm_controls.tscn @@ -228,7 +228,6 @@ theme_override_styles/focus = SubResource("StyleBoxFlat_speed_hover") text = "1x" [node name="ProgressTrack" type="Control" parent="Panel/VBox" unique_id=1420688071] -clip_contents = false custom_minimum_size = Vector2(0, 8) layout_mode = 2 size_flags_horizontal = 3 diff --git a/scenes/camera/camera.tscn b/scenes/camera/camera.tscn index 4ad2882..e90e002 100644 --- a/scenes/camera/camera.tscn +++ b/scenes/camera/camera.tscn @@ -1,7 +1,6 @@ [gd_scene format=3 uid="uid://cjtn7ni7fjvft"] -[ext_resource type="Script" path="res://scenes/camera/camera.gd" id="1_cam_script"] +[ext_resource type="Script" uid="uid://dp50yd7ftv7w4" path="res://scenes/camera/camera.gd" id="1_cam_script"] [node name="Camera" type="Camera2D" unique_id=603822564] script = ExtResource("1_cam_script") -enabled = true diff --git a/scenes/edge_view/edge_view.tscn b/scenes/edge_view/edge_view.tscn index 95e695f..bc3e5b0 100644 --- a/scenes/edge_view/edge_view.tscn +++ b/scenes/edge_view/edge_view.tscn @@ -35,7 +35,6 @@ antialiased = true [node name="Weight" type="Label" parent="." unique_id=152968238] texture_filter = 2 -mouse_filter = 2 offset_right = 40.0 offset_bottom = 23.0 theme_override_colors/font_color = Color(0.118, 0.118, 0.18, 1) @@ -47,16 +46,15 @@ vertical_alignment = 1 [node name="WeightEdit" type="LineEdit" parent="." unique_id=918274631] visible = false -mouse_filter = 2 offset_right = 56.0 offset_bottom = 30.0 +mouse_filter = 2 theme_override_colors/font_color = Color(0.118, 0.118, 0.18, 1) theme_override_fonts/font = ExtResource("2_ewg0c") theme_override_font_sizes/font_size = 22 theme_override_styles/normal = SubResource("StyleBoxEmpty_weight_edit") -theme_override_styles/focus = SubResource("StyleBoxEmpty_weight_edit") theme_override_styles/read_only = SubResource("StyleBoxEmpty_weight_edit") -theme_override_styles/disabled = SubResource("StyleBoxEmpty_weight_edit") +theme_override_styles/focus = SubResource("StyleBoxEmpty_weight_edit") alignment = 1 flat = true diff --git a/scenes/notifier/notify.tscn b/scenes/notifier/notify.tscn index 5b2b7b7..84af6aa 100644 --- a/scenes/notifier/notify.tscn +++ b/scenes/notifier/notify.tscn @@ -9,7 +9,6 @@ script = ExtResource("1_kfvck") [node name="PanelContainer" type="PanelContainer" parent="." unique_id=299046112] custom_minimum_size = Vector2(100, 50) -layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 @@ -23,12 +22,12 @@ theme_override_styles/panel = ExtResource("2_7r6yp") [node name="Label" type="Label" parent="PanelContainer" unique_id=853132152] layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 theme_override_colors/font_color = Color(0.118, 0.118, 0.18, 1) theme_override_colors/font_shadow_color = Color(0, 0, 0, 0) -theme_override_font_sizes/font_size = 15 theme_override_constants/line_spacing = 3 -autowrap_mode = 3 -size_flags_horizontal = 3 -size_flags_vertical = 1 +theme_override_font_sizes/font_size = 15 horizontal_alignment = 1 vertical_alignment = 1 +autowrap_mode = 3 diff --git a/scenes/presets/preset_picker.tscn b/scenes/presets/preset_picker.tscn index 0d9ad76..404ac05 100644 --- a/scenes/presets/preset_picker.tscn +++ b/scenes/presets/preset_picker.tscn @@ -1,15 +1,14 @@ -[gd_scene load_steps=3 format=3] +[gd_scene format=3 uid="uid://dor2q5ey20s4e"] -[ext_resource type="Script" path="res://scenes/presets/preset_picker.gd" id="1_script"] +[ext_resource type="Script" uid="uid://cvucfnlol4whc" path="res://scenes/presets/preset_picker.gd" id="1_script"] [ext_resource type="StyleBox" uid="uid://bdiessvqitwl2" path="res://scenes/tool_bar/tool_bar_background.tres" id="2_bar"] -[node name="PresetPickerRoot" type="CanvasLayer"] +[node name="PresetPickerRoot" type="CanvasLayer" unique_id=1141586939] layer = 2 script = ExtResource("1_script") -graph_controller_path = NodePath("../GraphController") -[node name="Margin" type="MarginContainer" parent="."] -anchors_preset = 2 +[node name="Margin" type="MarginContainer" parent="." unique_id=1174629466] +anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 offset_left = -202.0 @@ -18,13 +17,13 @@ offset_right = -20.0 offset_bottom = 68.0 grow_horizontal = 0 -[node name="HBox" type="HBoxContainer" parent="Margin"] +[node name="HBox" type="HBoxContainer" parent="Margin" unique_id=227239117] layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 4 theme_override_constants/separation = 8 -[node name="ShareButton" type="Button" parent="Margin/HBox"] +[node name="ShareButton" type="Button" parent="Margin/HBox" unique_id=1463491879] layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 @@ -32,7 +31,7 @@ tooltip_text = "Share Copy a link to this graph" text = "Share" -[node name="PresetsButton" type="Button" parent="Margin/HBox"] +[node name="PresetsButton" type="Button" parent="Margin/HBox" unique_id=1408462323] layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 @@ -40,15 +39,11 @@ tooltip_text = "Presets Load a sample graph" text = "Presets" -[node name="PresetsPopup" type="Popup" parent="."] -transparent = false -borderless = true -popup_window = true -unresizable = true -visible = false +[node name="PresetsPopup" type="Popup" parent="." unique_id=768198572] +size = Vector2i(328, 380) min_size = Vector2i(328, 380) -[node name="PanelRoot" type="PanelContainer" parent="PresetsPopup"] +[node name="PanelRoot" type="PanelContainer" parent="PresetsPopup" unique_id=408387991] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -56,21 +51,21 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = ExtResource("2_bar") -[node name="Margin" type="MarginContainer" parent="PresetsPopup/PanelRoot"] +[node name="Margin" type="MarginContainer" parent="PresetsPopup/PanelRoot" unique_id=1776170700] layout_mode = 2 theme_override_constants/margin_left = 6 theme_override_constants/margin_top = 6 theme_override_constants/margin_right = 6 theme_override_constants/margin_bottom = 6 -[node name="Scroll" type="ScrollContainer" parent="PresetsPopup/PanelRoot/Margin"] +[node name="Scroll" type="ScrollContainer" parent="PresetsPopup/PanelRoot/Margin" unique_id=1638118207] +custom_minimum_size = Vector2(0, 332) layout_mode = 2 size_flags_vertical = 3 -custom_minimum_size = Vector2(0, 332) horizontal_scroll_mode = 0 vertical_scroll_mode = 2 -[node name="Grid" type="GridContainer" parent="PresetsPopup/PanelRoot/Margin/Scroll"] +[node name="Grid" type="GridContainer" parent="PresetsPopup/PanelRoot/Margin/Scroll" unique_id=644374042] layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/h_separation = 6 diff --git a/scenes/pseudo_visualizer/pseudo_visualizer.tscn b/scenes/pseudo_visualizer/pseudo_visualizer.tscn index e575f07..df46922 100644 --- a/scenes/pseudo_visualizer/pseudo_visualizer.tscn +++ b/scenes/pseudo_visualizer/pseudo_visualizer.tscn @@ -7,7 +7,6 @@ [node name="CodeBackground" type="PanelContainer" unique_id=870985294] z_index = 10 texture_filter = 4 -custom_minimum_size = Vector2(0, 0) offset_right = 1.0 offset_bottom = 1.0 size_flags_horizontal = 8 @@ -57,4 +56,3 @@ text = "[outline_size=2][outline_color=black][color=#0080ffff][b]1. Q ← new Qu " fit_content = true autowrap_mode = 0 -vertical_alignment = 0 diff --git a/scenes/tool_bar/tool_bar.tscn b/scenes/tool_bar/tool_bar.tscn index cc349cb..fc0fd2b 100644 --- a/scenes/tool_bar/tool_bar.tscn +++ b/scenes/tool_bar/tool_bar.tscn @@ -2,23 +2,17 @@ [ext_resource type="Script" uid="uid://dcl6ckcas6der" path="res://scenes/tool_bar/tool_bar.gd" id="1_gdu6t"] [ext_resource type="Script" uid="uid://css85v57pq6ys" path="res://scenes/tool_bar/button_highlights.gd" id="1_uiivm"] -[ext_resource type="StyleBox" uid="uid://bdiessvqitwl2" path="res://scenes/tool_bar/tool_bar_background.tres" id="2_u1pd4"] [ext_resource type="StyleBox" uid="uid://npixnrumei6q" path="res://scenes/tool_bar/button_normal.tres" id="3_lpcgc"] -[ext_resource type="StyleBox" uid="uid://edc2pra87k3x" path="res://scenes/tool_bar/button_hover.tres" id="4_u1pd4"] [ext_resource type="Texture2D" uid="uid://v5eliv4lx04j" path="res://assets/icons/cursor-alt-svgrepo-com.svg" id="4_selection_icon"] +[ext_resource type="StyleBox" uid="uid://edc2pra87k3x" path="res://scenes/tool_bar/button_hover.tres" id="4_u1pd4"] [ext_resource type="Texture2D" uid="uid://cmgktymkkl21e" path="res://assets/icons/create_tool_icon.svg" id="5_2j54p"] -[ext_resource type="Texture2D" path="res://assets/icons/hand_toolbar.svg" id="6_pan"] +[ext_resource type="Texture2D" uid="uid://b6juabb4v03bc" path="res://assets/icons/hand_toolbar.svg" id="6_pan"] [ext_resource type="Texture2D" uid="uid://bqx8k2m4n7p3w" path="res://assets/icons/edge_tool_icon.png" id="7_edge_icon"] -[ext_resource type="Texture2D" path="res://assets/icons/eraser_icon.svg" id="8_eraser_icon"] - -[sub_resource type="StyleBoxLine" id="StyleBoxLine_lpcgc"] -color = Color(0.72, 0.72, 0.76, 0.85) -grow_begin = -4.0 -grow_end = -4.0 -thickness = 1 -vertical = true +[ext_resource type="Texture2D" uid="uid://c6mroisvwpr7w" path="res://assets/icons/eraser_icon.svg" id="8_eraser_icon"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_toolbar_panel"] +content_margin_left = 5.0 +content_margin_right = 5.0 bg_color = Color(1, 1, 1, 1) border_width_left = 1 border_width_top = 1 @@ -33,11 +27,15 @@ expand_margin_left = 7.0 expand_margin_top = 7.0 expand_margin_right = 7.0 expand_margin_bottom = 7.0 -shadow_color = Color(0, 0, 0, 0.10) +shadow_color = Color(0, 0, 0, 0.1) shadow_size = 6 shadow_offset = Vector2(0, 2) -content_margin_left = 5.0 -content_margin_right = 5.0 + +[sub_resource type="StyleBoxLine" id="StyleBoxLine_lpcgc"] +color = Color(0.72, 0.72, 0.76, 0.85) +grow_begin = -4.0 +grow_end = -4.0 +vertical = true [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_toggle_normal"] content_margin_left = 8.0 @@ -125,9 +123,9 @@ texture_filter = 4 custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_vertical = 4 -focus_mode = 0 tooltip_text = "Select Click or drag to select · Right-click selection for options" +focus_mode = 0 theme_override_styles/normal = ExtResource("3_lpcgc") theme_override_styles/pressed = ExtResource("4_u1pd4") theme_override_styles/hover = ExtResource("4_u1pd4") @@ -159,9 +157,9 @@ texture_filter = 4 custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_vertical = 4 -focus_mode = 0 tooltip_text = "Create Click to add vertex · Hold Ctrl + click two vertices to connect" +focus_mode = 0 theme_override_styles/normal = ExtResource("3_lpcgc") theme_override_styles/pressed = ExtResource("4_u1pd4") theme_override_styles/hover = ExtResource("4_u1pd4") @@ -194,9 +192,9 @@ texture_filter = 4 custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_vertical = 4 -focus_mode = 0 tooltip_text = "Edge Pick a start vertex, then a second to connect · Same vertex cancels" +focus_mode = 0 theme_override_styles/normal = ExtResource("3_lpcgc") theme_override_styles/pressed = ExtResource("4_u1pd4") theme_override_styles/hover = ExtResource("4_u1pd4") @@ -228,9 +226,9 @@ texture_filter = 4 custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_vertical = 4 -focus_mode = 0 tooltip_text = "Pan Drag to pan · Scroll to zoom" +focus_mode = 0 theme_override_styles/normal = ExtResource("3_lpcgc") theme_override_styles/pressed = ExtResource("4_u1pd4") theme_override_styles/hover = ExtResource("4_u1pd4") @@ -262,9 +260,9 @@ texture_filter = 4 custom_minimum_size = Vector2(36, 36) layout_mode = 2 size_flags_vertical = 4 -focus_mode = 0 tooltip_text = "Erase Click and drag to erase vertices and edges" +focus_mode = 0 theme_override_styles/normal = ExtResource("3_lpcgc") theme_override_styles/pressed = ExtResource("4_u1pd4") theme_override_styles/hover = ExtResource("4_u1pd4") diff --git a/scenes/vertex_view/vertex_view.tscn b/scenes/vertex_view/vertex_view.tscn index 92699cf..95ca74c 100644 --- a/scenes/vertex_view/vertex_view.tscn +++ b/scenes/vertex_view/vertex_view.tscn @@ -27,16 +27,16 @@ horizontal_alignment = 1 vertical_alignment = 1 metadata/_edit_use_anchors_ = true -[node name="KeyBadge" type="Node2D" parent="."] +[node name="KeyBadge" type="Node2D" parent="." unique_id=938544250] position = Vector2(16, -16) -[node name="BubbleRing" type="Polygon2D" parent="KeyBadge"] +[node name="BubbleRing" type="Polygon2D" parent="KeyBadge" unique_id=521154687] color = Color(0.58, 0.64, 0.72, 1) -[node name="Bubble" type="Polygon2D" parent="KeyBadge"] +[node name="Bubble" type="Polygon2D" parent="KeyBadge" unique_id=1470173891] color = Color(0.945098, 0.960784, 0.976471, 1) -[node name="KeyLabel" type="Label" parent="KeyBadge"] +[node name="KeyLabel" type="Label" parent="KeyBadge" unique_id=1944785353] offset_left = -15.0 offset_top = -10.0 offset_right = 15.0 From ce5493233c41405173d47025ea619c8c3d4da22c Mon Sep 17 00:00:00 2001 From: Yotam Ashman Date: Wed, 8 Apr 2026 00:20:50 +0300 Subject: [PATCH 2/3] Add more type inferring hints --- controller/ghost_edge_preview.gd | 2 +- controller/mouse_actions.gd | 2 +- core/graph/graph.gd | 2 +- scenes/selection_bounds/selection_bounds_view.gd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/ghost_edge_preview.gd b/controller/ghost_edge_preview.gd index a37ea3b..84436f6 100644 --- a/controller/ghost_edge_preview.gd +++ b/controller/ghost_edge_preview.gd @@ -6,7 +6,7 @@ const _PHYS_CTRL_R := 4194328 ## Right Ctrl physical keycode (Input map keycode const LINE_ALPHA := 0.42 const GHOST_DISK_ALPHA := 0.22 ## Placement hint only — smaller than a real vertex so it reads lighter than committed nodes. -const GHOST_DISK_RADIUS := Globals.VERTEX_RADIUS * 0.86 +const GHOST_DISK_RADIUS: float = Globals.VERTEX_RADIUS * 0.86 var _arrow: Polygon2D var _ghost_vertex: Polygon2D diff --git a/controller/mouse_actions.gd b/controller/mouse_actions.gd index 2044695..90de043 100644 --- a/controller/mouse_actions.gd +++ b/controller/mouse_actions.gd @@ -208,7 +208,7 @@ func _handle_left_click(event: InputEventMouseButton): return var selection_buffer = controller.selection_buffer - var ctrl_graph_path := is_ctrl and ( + var ctrl_graph_path: bool = is_ctrl and ( Globals.current_state == Globals.State.CREATE or Globals.current_state == Globals.State.EDGE ) diff --git a/core/graph/graph.gd b/core/graph/graph.gd index 1777210..e7db7ed 100644 --- a/core/graph/graph.gd +++ b/core/graph/graph.gd @@ -164,7 +164,7 @@ func get_incoming_edges(target: Vertex) -> Array[Edge]: ## Finds the vertex whose circle contains pos. Returns NOT_FOUND if none. func get_vertex_id_at(pos: Vector2) -> int: - var radius_sq := Globals.VERTEX_RADIUS * Globals.VERTEX_RADIUS + var radius_sq: float = Globals.VERTEX_RADIUS * Globals.VERTEX_RADIUS for id in _vertex_spatial_index.get_candidate_ids(pos): var v: Vertex = vertices.get(id) if v == null: diff --git a/scenes/selection_bounds/selection_bounds_view.gd b/scenes/selection_bounds/selection_bounds_view.gd index 80c77e5..d54ebcd 100644 --- a/scenes/selection_bounds/selection_bounds_view.gd +++ b/scenes/selection_bounds/selection_bounds_view.gd @@ -53,7 +53,7 @@ func _draw() -> void: func _handle_world_size(ui_scale: float) -> float: var target_screen_px := 8.0 var uncapped := target_screen_px * ui_scale - var max_world := Globals.VERTEX_RADIUS * 0.85 + var max_world: float = Globals.VERTEX_RADIUS * 0.85 return clampf(minf(uncapped, max_world), 1.2, max_world) func _draw_handle(pos: Vector2, size: float, outline_scale: float) -> void: From 323c55f7968a1d594969746e8527e929faa9f4f4 Mon Sep 17 00:00:00 2001 From: Yotam Ashman Date: Wed, 8 Apr 2026 00:33:38 +0300 Subject: [PATCH 3/3] Fix feedback control stopping mouse --- scenes/feedback/feedback.tscn | 1 + 1 file changed, 1 insertion(+) diff --git a/scenes/feedback/feedback.tscn b/scenes/feedback/feedback.tscn index c4d1c1c..fc0aa05 100644 --- a/scenes/feedback/feedback.tscn +++ b/scenes/feedback/feedback.tscn @@ -11,6 +11,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 script = ExtResource("1_kd6fv") [node name="MarginContainer" type="MarginContainer" parent="." unique_id=437233443]