From 7450dd39cbbc4aca127041b3f97f3501b5a4943e Mon Sep 17 00:00:00 2001 From: jepsu Date: Sat, 27 Jun 2026 13:57:32 +0300 Subject: [PATCH] Added scroll container and margin to owned printers window --- Scenes/UI/ui.gd | 2 +- Scenes/UI/ui.tscn | 91 +++++++++++++++++++++++++++++------------------ 2 files changed, 58 insertions(+), 35 deletions(-) diff --git a/Scenes/UI/ui.gd b/Scenes/UI/ui.gd index 1c66e9d..0acd7f9 100644 --- a/Scenes/UI/ui.gd +++ b/Scenes/UI/ui.gd @@ -7,7 +7,7 @@ extends Control @onready var debug_xp: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP @onready var debug_money: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney @onready var debug_button: Button = $VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton -@onready var jobs_tab_button: Button = $VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton +@onready var jobs_tab_button: Button = $VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton const PRINTER = preload("uid://33ctlyrpibs3") diff --git a/Scenes/UI/ui.tscn b/Scenes/UI/ui.tscn index fb4c868..c3eea76 100644 --- a/Scenes/UI/ui.tscn +++ b/Scenes/UI/ui.tscn @@ -107,15 +107,24 @@ theme_override_styles/fill = SubResource("StyleBoxFlat_8fchy") value = 65.27 show_percentage = false -[node name="MainArea" type="HBoxContainer" parent="VBoxContainer" unique_id=352001241] +[node name="MainAreaMargin" type="MarginContainer" parent="VBoxContainer" unique_id=1858818142] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/margin_top = 5 + +[node name="MainArea" type="HBoxContainer" parent="VBoxContainer/MainAreaMargin" unique_id=352001241] layout_mode = 2 size_flags_vertical = 3 -[node name="LeftColumn" type="VBoxContainer" parent="VBoxContainer/MainArea" unique_id=497978034] +[node name="LeftColumn" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea" unique_id=497978034] layout_mode = 2 size_flags_horizontal = 3 -[node name="Header" type="MarginContainer" parent="VBoxContainer/MainArea/LeftColumn" unique_id=674103883] +[node name="MainMargin" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn" unique_id=1390444828] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Header" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn/MainMargin" unique_id=674103883] visible = false layout_mode = 2 theme_override_constants/margin_left = 10 @@ -123,21 +132,35 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="Label" type="Label" parent="VBoxContainer/MainArea/LeftColumn/Header" unique_id=1155403735] +[node name="Label" type="Label" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn/MainMargin/Header" unique_id=1155403735] layout_mode = 2 text = "Printers" -[node name="PrinterContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/LeftColumn" unique_id=374703275] +[node name="PrinterScroll" type="ScrollContainer" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn/MainMargin" unique_id=1351903470] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn/MainMargin/PrinterScroll" unique_id=134445001] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="PrinterContainer" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/LeftColumn/MainMargin/PrinterScroll/MarginContainer" unique_id=374703275] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +theme_override_constants/separation = 8 -[node name="RightColumn" type="VBoxContainer" parent="VBoxContainer/MainArea" unique_id=653054059] +[node name="RightColumn" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea" unique_id=653054059] layout_mode = 2 size_flags_horizontal = 3 -[node name="TabSwitcher" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=1366955734] +[node name="TabSwitcher" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn" unique_id=1366955734] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = 10 @@ -145,41 +168,41 @@ theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 script = ExtResource("13_vqjbf") -[node name="TabButtons" type="HBoxContainer" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher" unique_id=454550378] +[node name="TabButtons" type="HBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" unique_id=454550378] layout_mode = 2 -[node name="JobsTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=332022453] +[node name="JobsTabButton" type="Button" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=332022453] layout_mode = 2 size_flags_horizontal = 3 text = "Jobs" -[node name="ShopTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=748682284] +[node name="ShopTabButton" type="Button" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=748682284] layout_mode = 2 size_flags_horizontal = 3 text = "Shop" -[node name="MenuTabButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=1414728414] +[node name="MenuTabButton" type="Button" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons" unique_id=1414728414] layout_mode = 2 size_flags_horizontal = 3 text = "Menu" -[node name="MainMargin" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn" unique_id=562508461] +[node name="MainMargin" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn" unique_id=562508461] layout_mode = 2 size_flags_vertical = 3 theme_override_constants/margin_left = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="JobsTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin" unique_id=859027615] +[node name="JobsTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=859027615] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="JobScroll" type="ScrollContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/JobsTab" unique_id=1046443254] +[node name="JobScroll" type="ScrollContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab" unique_id=1046443254] layout_mode = 2 horizontal_scroll_mode = 0 -[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/JobsTab/JobScroll" unique_id=708828708] +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab/JobScroll" unique_id=708828708] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -188,22 +211,22 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="JobContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/JobsTab/JobScroll/MarginContainer" unique_id=1821891785] +[node name="JobContainer" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/JobsTab/JobScroll/MarginContainer" unique_id=1821891785] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 8 -[node name="ShopTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin" unique_id=23859514] +[node name="ShopTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=23859514] unique_name_in_owner = true layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_vqjbf") -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab" unique_id=1098619767] +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab" unique_id=1098619767] layout_mode = 2 -[node name="ShopTabSwitcher" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=40136169] +[node name="ShopTabSwitcher" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=40136169] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = 10 @@ -211,31 +234,31 @@ theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 script = ExtResource("14_vqjbf") -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" unique_id=1669205646] +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" unique_id=1669205646] layout_mode = 2 -[node name="PrintersButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=96323903] +[node name="PrintersButton" type="Button" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=96323903] layout_mode = 2 size_flags_horizontal = 3 text = "Printers" -[node name="FilamentsButton" type="Button" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=659653173] +[node name="FilamentsButton" type="Button" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer" unique_id=659653173] layout_mode = 2 size_flags_horizontal = 3 text = "Filaments" -[node name="Printers" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1896524960] +[node name="Printers" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1896524960] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 script = ExtResource("15_vqjbf") printers_array = Array[ExtResource("16_rdojl")]([ExtResource("17_llrls"), ExtResource("18_8rt22"), ExtResource("19_1ohgd")]) -[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" unique_id=1757920718] +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" unique_id=1757920718] layout_mode = 2 horizontal_scroll_mode = 0 -[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer" unique_id=64943590] +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer" unique_id=64943590] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -244,17 +267,17 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="PrinterList" type="VBoxContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer/MarginContainer" unique_id=474412195] +[node name="PrinterList" type="VBoxContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers/ScrollContainer/MarginContainer" unique_id=474412195] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/separation = 8 -[node name="Filaments" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1891341317] +[node name="Filaments" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer" unique_id=1891341317] unique_name_in_owner = true layout_mode = 2 -[node name="MenuTab" type="PanelContainer" parent="VBoxContainer/MainArea/RightColumn/MainMargin" unique_id=526907583] +[node name="MenuTab" type="PanelContainer" parent="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin" unique_id=526907583] unique_name_in_owner = true visible = false layout_mode = 2 @@ -265,10 +288,10 @@ autostart = true [connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugMoney" to="." method="_on_debug_money_pressed"] [connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugXP" to="." method="_on_debug_xp_pressed"] [connection signal="pressed" from="VBoxContainer/TopBar/VBoxContainer/MarginContainer/HBoxContainer/DebugButton" to="." method="_on_debug_button_pressed"] -[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_jobs_tab_button_pressed"] -[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/ShopTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_shop_tab_button_pressed"] -[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="VBoxContainer/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"] -[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"] -[connection signal="pressed" from="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"] -[connection signal="printer_purchase_requested" from="VBoxContainer/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" to="." method="_on_printers_printer_purchase_requested"] +[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/JobsTabButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_jobs_tab_button_pressed"] +[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/ShopTabButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_shop_tab_button_pressed"] +[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher/TabButtons/MenuTabButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/TabSwitcher" method="_on_menu_tab_button_pressed"] +[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/PrintersButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_printers_button_pressed"] +[connection signal="pressed" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher/HBoxContainer/FilamentsButton" to="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/ShopTabSwitcher" method="_on_filaments_button_pressed"] +[connection signal="printer_purchase_requested" from="VBoxContainer/MainAreaMargin/MainArea/RightColumn/MainMargin/ShopTab/VBoxContainer/Printers" to="." method="_on_printers_printer_purchase_requested"] [connection signal="timeout" from="JobSpawner" to="." method="_on_job_spawner_timeout"]