Skip to content

Commit

Permalink
tidy custom slab window
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 28, 2023
1 parent 0883e6e commit d68e60b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 6 additions & 0 deletions Scenes/AddCustomSlabWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
24 changes: 12 additions & 12 deletions Scenes/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 )
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Scenes/VoxelViewer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d68e60b

Please sign in to comment.