From d68e60b024be995241020653aedcc0252a5314f9 Mon Sep 17 00:00:00 2001 From: rainlizard Date: Tue, 28 Nov 2023 13:51:01 +1100 Subject: [PATCH] tidy custom slab window --- Scenes/AddCustomSlabWindow.gd | 6 ++++++ Scenes/Main.tscn | 24 ++++++++++++------------ Scenes/VoxelViewer.gd | 3 +++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Scenes/AddCustomSlabWindow.gd b/Scenes/AddCustomSlabWindow.gd index deb2b3a2..e4e0c3aa 100644 --- a/Scenes/AddCustomSlabWindow.gd +++ b/Scenes/AddCustomSlabWindow.gd @@ -47,6 +47,12 @@ func _on_AddCustomSlabWindow_visibility_changed(): if visible == true: update_type() oCustomSlabVoxelView.initialize() + + # Due to a strange bug I don't understand, the oCustomSlabVoxelView is skewed until I resize the window. This fixes that. + rect_size += Vector2(1,1) + yield(get_tree(),'idle_frame') + rect_size -= Vector2(1,1) + func shortcut_pressed(id): var spinbox = id.get_node("CustomSpinBox") diff --git a/Scenes/Main.tscn b/Scenes/Main.tscn index 1e2e4170..08ea8c32 100644 --- a/Scenes/Main.tscn +++ b/Scenes/Main.tscn @@ -4997,9 +4997,9 @@ __meta__ = { [node name="ColumnEditor" type="WindowDialog" parent="Ui/UiSystem"] visible = true -margin_left = -1326.0 +margin_left = -4310.0 margin_top = -1481.0 -margin_right = -46.0 +margin_right = -3030.0 margin_bottom = -728.0 window_title = "Map columns" resizable = true @@ -5082,10 +5082,10 @@ stretch_mode = 4 [node name="AddCustomSlabWindow" type="WindowDialog" parent="Ui/UiSystem"] visible = true -margin_left = -1358.0 +margin_left = -1595.0 margin_top = -2377.0 -margin_right = -16.0 -margin_bottom = -1544.0 +margin_right = -890.0 +margin_bottom = -1799.0 window_title = "Add custom slab" resizable = true script = ExtResource( 157 ) @@ -5101,17 +5101,17 @@ custom_constants/margin_bottom = 10 [node name="HBoxContainer" type="HBoxContainer" parent="Ui/UiSystem/AddCustomSlabWindow/MarginContainer"] margin_left = 10.0 margin_top = 10.0 -margin_right = 1332.0 -margin_bottom = 823.0 +margin_right = 695.0 +margin_bottom = 568.0 [node name="CustomSlabVoxelView" parent="Ui/UiSystem/AddCustomSlabWindow/MarginContainer/HBoxContainer" instance=ExtResource( 19 )] -margin_right = 971.0 -margin_bottom = 813.0 +margin_right = 334.0 +margin_bottom = 558.0 [node name="VBoxContainer2" type="VBoxContainer" parent="Ui/UiSystem/AddCustomSlabWindow/MarginContainer/HBoxContainer"] -margin_left = 975.0 -margin_right = 1322.0 -margin_bottom = 813.0 +margin_left = 338.0 +margin_right = 685.0 +margin_bottom = 558.0 [node name="PanelContainer2" type="PanelContainer" parent="Ui/UiSystem/AddCustomSlabWindow/MarginContainer/HBoxContainer/VBoxContainer2"] margin_right = 347.0 diff --git a/Scenes/VoxelViewer.gd b/Scenes/VoxelViewer.gd index dd103bcd..fabb2df4 100644 --- a/Scenes/VoxelViewer.gd +++ b/Scenes/VoxelViewer.gd @@ -42,6 +42,9 @@ func initialize(): if displayingType == DK_SLABSET: do_all() + if displayingType == MAP_CUSTOM_SLAB: + oVoxelCamera.size = 10 + do_one() print('Columns generated in: ' + str(OS.get_ticks_msec() - CODETIME_START) + 'ms')