Skip to content

Commit 4f2bb62

Browse files
committed
map resizing
1 parent 8a3abe1 commit 4f2bb62

File tree

4 files changed

+188
-68
lines changed

4 files changed

+188
-68
lines changed

Scenes/Main.tscn

+61-41
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ custom_colors/font_color_hover = Color( 1, 0.65098, 0.556863, 1 )
16501650
custom_colors/font_color_pressed = Color( 0.333333, 0.607843, 1, 1 )
16511651
text = "Edit"
16521652
align = 0
1653-
items = [ "Columns", null, 0, false, false, 0, 0, null, "", false, "Custom objects", null, 0, false, false, 1, 0, null, "", false, "Update all slabs", null, 0, false, false, 2, 0, null, "", false, "", null, 0, false, true, -1, 0, null, "", true, "Make a tileset", null, 0, false, false, 3, 0, null, "", false, "Slabset", null, 0, false, false, 4, 0, null, "", false ]
1653+
items = [ "Columns", null, 0, false, false, 0, 0, null, "", false, "Custom objects", null, 0, false, false, 1, 0, null, "", false, "Resize and shift", null, 0, false, false, 2, 0, null, "", false, "Update all slabs", null, 0, false, false, 3, 0, null, "", false, "", null, 0, false, true, -1, 0, null, "", true, "Make a tileset", null, 0, false, false, 4, 0, null, "", false, "Slabset", null, 0, false, false, 5, 0, null, "", false ]
16541654
switch_on_hover = true
16551655
__meta__ = {
16561656
"_edit_use_anchors_": false
@@ -3004,7 +3004,7 @@ margin_bottom = 264.0
30043004
rect_min_size = Vector2( 300, 105 )
30053005
popup_exclusive = true
30063006
window_title = "Confirm"
3007-
dialog_text = "Every slab on the map will be updated, this means column appearance and \"attached\" objects will be reset."
3007+
dialog_text = "Every slab on the map will be updated, column appearance and room objects will be reset."
30083008
dialog_autowrap = true
30093009
script = ExtResource( 61 )
30103010

@@ -3836,7 +3836,7 @@ margin_bottom = 965.0
38363836

38373837
[node name="GridContainer" type="GridContainer" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer"]
38383838
margin_right = 625.0
3839-
margin_bottom = 124.0
3839+
margin_bottom = 118.0
38403840
columns = 2
38413841

38423842
[node name="Label" type="Label" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer"]
@@ -3896,35 +3896,28 @@ items = [ "Classic format", null, false, 0, null, "KFX format", null, false, 1,
38963896
selected = 0
38973897

38983898
[node name="Label4" type="Label" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer"]
3899-
margin_top = 100.0
3899+
margin_top = 97.0
39003900
margin_right = 311.0
3901-
margin_bottom = 121.0
3901+
margin_bottom = 118.0
39023902
text = "Map size"
39033903

39043904
[node name="HBoxContainer2" type="HBoxContainer" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer"]
39053905
margin_left = 315.0
39063906
margin_top = 97.0
39073907
margin_right = 625.0
3908-
margin_bottom = 124.0
3908+
margin_bottom = 118.0
39093909
size_flags_horizontal = 3
39103910
size_flags_vertical = 3
39113911

39123912
[node name="MapSizeTextLabel" type="Label" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/HBoxContainer2"]
3913-
margin_right = 239.0
3914-
margin_bottom = 27.0
3913+
margin_right = 310.0
3914+
margin_bottom = 21.0
39153915
size_flags_horizontal = 3
39163916
size_flags_vertical = 3
39173917
text = "85 x 85"
39183918
align = 1
39193919
valign = 1
39203920

3921-
[node name="ResizeCurrentMapSizeButton" type="Button" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/HBoxContainer2"]
3922-
margin_left = 243.0
3923-
margin_right = 310.0
3924-
margin_bottom = 27.0
3925-
size_flags_horizontal = 8
3926-
text = "Resize"
3927-
39283921
[node name="HBoxContainer" type="HBoxContainer" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer"]
39293922
visible = false
39303923
margin_top = 167.0
@@ -3960,16 +3953,16 @@ size_flags_vertical = 2
39603953
columns = 2
39613954

39623955
[node name="AdvancedMapPropertiesCheckBox" type="CheckBox" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer"]
3963-
margin_top = 128.0
3956+
margin_top = 122.0
39643957
margin_right = 245.0
3965-
margin_bottom = 157.0
3958+
margin_bottom = 151.0
39663959
size_flags_horizontal = 0
39673960
text = "Edit Level Overview File"
39683961

39693962
[node name="AdvancedMapProperties" type="GridContainer" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer"]
3970-
margin_top = 161.0
3963+
margin_top = 155.0
39713964
margin_right = 625.0
3972-
margin_bottom = 503.0
3965+
margin_bottom = 497.0
39733966
columns = 2
39743967

39753968
[node name="Label5" type="Label" parent="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/AdvancedMapProperties"]
@@ -5671,13 +5664,15 @@ margin_top = -2160.0
56715664
margin_right = 1668.0
56725665
margin_bottom = -1820.0
56735666
rect_min_size = Vector2( 404, 340 )
5667+
mouse_filter = 1
56745668
window_title = "Resize map"
56755669
resizable = true
56765670
script = ExtResource( 153 )
56775671

56785672
[node name="MarginContainer" type="MarginContainer" parent="Ui/UiSystem/ResizeCurrentMapSize"]
56795673
anchor_right = 1.0
56805674
anchor_bottom = 1.0
5675+
mouse_filter = 1
56815676
size_flags_horizontal = 3
56825677
size_flags_vertical = 3
56835678
custom_constants/margin_right = 20
@@ -5719,6 +5714,7 @@ size_flags_horizontal = 0
57195714
text = "85"
57205715

57215716
[node name="GridContainer" type="GridContainer" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer"]
5717+
visible = false
57225718
margin_left = 130.0
57235719
margin_top = 35.0
57245720
margin_right = 234.0
@@ -5727,93 +5723,117 @@ size_flags_horizontal = 4
57275723
size_flags_vertical = 3
57285724
columns = 3
57295725

5730-
[node name="ColorRect" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5726+
[node name="ResizeSegment1" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57315727
margin_right = 32.0
57325728
margin_bottom = 32.0
57335729
rect_min_size = Vector2( 32, 32 )
5730+
mouse_filter = 1
57345731
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57355732

5736-
[node name="ColorRect2" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5733+
[node name="ResizeSegment2" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57375734
margin_left = 36.0
57385735
margin_right = 68.0
57395736
margin_bottom = 32.0
57405737
rect_min_size = Vector2( 32, 32 )
5738+
mouse_filter = 1
57415739
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57425740

5743-
[node name="ColorRect3" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5741+
[node name="ResizeSegment3" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57445742
margin_left = 72.0
57455743
margin_right = 104.0
57465744
margin_bottom = 32.0
57475745
rect_min_size = Vector2( 32, 32 )
5746+
mouse_filter = 1
57485747
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57495748

5750-
[node name="ColorRect4" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5749+
[node name="ResizeSegment4" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57515750
margin_top = 36.0
57525751
margin_right = 32.0
57535752
margin_bottom = 68.0
57545753
rect_min_size = Vector2( 32, 32 )
5754+
mouse_filter = 1
57555755
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57565756

5757-
[node name="ColorRect5" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5757+
[node name="ResizeSegment5" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57585758
margin_left = 36.0
57595759
margin_top = 36.0
57605760
margin_right = 68.0
57615761
margin_bottom = 68.0
57625762
rect_min_size = Vector2( 32, 32 )
5763+
mouse_filter = 1
57635764

5764-
[node name="ColorRect6" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5765+
[node name="ResizeSegment6" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57655766
margin_left = 72.0
57665767
margin_top = 36.0
57675768
margin_right = 104.0
57685769
margin_bottom = 68.0
57695770
rect_min_size = Vector2( 32, 32 )
5771+
mouse_filter = 1
57705772
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57715773

5772-
[node name="ColorRect7" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5774+
[node name="ResizeSegment7" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57735775
margin_top = 72.0
57745776
margin_right = 32.0
57755777
margin_bottom = 104.0
57765778
rect_min_size = Vector2( 32, 32 )
5779+
mouse_filter = 1
57775780
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57785781

5779-
[node name="ColorRect8" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5782+
[node name="ResizeSegment8" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57805783
margin_left = 36.0
57815784
margin_top = 72.0
57825785
margin_right = 68.0
57835786
margin_bottom = 104.0
57845787
rect_min_size = Vector2( 32, 32 )
5788+
mouse_filter = 1
57855789
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57865790

5787-
[node name="ColorRect9" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
5791+
[node name="ResizeSegment9" type="ColorRect" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/GridContainer"]
57885792
margin_left = 72.0
57895793
margin_top = 72.0
57905794
margin_right = 104.0
57915795
margin_bottom = 104.0
57925796
rect_min_size = Vector2( 32, 32 )
5797+
mouse_filter = 1
57935798
color = Color( 0.262745, 0.266667, 0.298039, 1 )
57945799

57955800
[node name="HBoxContainer2" type="HBoxContainer" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer"]
5796-
margin_top = 143.0
5801+
margin_top = 35.0
57975802
margin_right = 364.0
5798-
margin_bottom = 170.0
5803+
margin_bottom = 91.0
57995804

58005805
[node name="Label" type="Label" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2"]
5801-
margin_top = 3.0
5802-
margin_right = 96.0
5803-
margin_bottom = 24.0
5804-
text = "New area : "
5806+
margin_right = 125.0
5807+
margin_bottom = 56.0
5808+
size_flags_vertical = 1
5809+
text = "Fill new area :"
5810+
valign = 1
58055811

5806-
[node name="OptionButton" type="OptionButton" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2"]
5807-
margin_left = 100.0
5812+
[node name="VBoxContainer" type="VBoxContainer" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2"]
5813+
margin_left = 129.0
58085814
margin_right = 364.0
5809-
margin_bottom = 27.0
5815+
margin_bottom = 56.0
58105816
size_flags_horizontal = 3
58115817

5818+
[node name="ResizeFillWithIDLabel" type="Label" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"]
5819+
margin_right = 235.0
5820+
margin_bottom = 21.0
5821+
text = "Impenetrable"
5822+
align = 2
5823+
5824+
[node name="ResizeFillWithID" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer" instance=ExtResource( 152 )]
5825+
margin_left = 161.0
5826+
margin_top = 25.0
5827+
margin_right = 235.0
5828+
margin_bottom = 56.0
5829+
size_flags_horizontal = 10
5830+
58125831
[node name="ResizeMapApplyBorderCheckbox" type="CheckBox" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer"]
5813-
margin_top = 174.0
5832+
margin_top = 95.0
58145833
margin_right = 364.0
5815-
margin_bottom = 203.0
5816-
text = "Reapply border"
5834+
margin_bottom = 124.0
5835+
pressed = true
5836+
text = "Apply border"
58175837

58185838
[node name="Label" type="Label" parent="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer"]
58195839
margin_top = 224.0
@@ -6393,7 +6413,6 @@ script = SubResource( 20 )
63936413
[connection signal="text_changed" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/MapNameLineEdit" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_MapNameLineEdit_text_changed"]
63946414
[connection signal="item_selected" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/DungeonStyleList" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_DungeonStyleList_item_selected"]
63956415
[connection signal="item_selected" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/CurrentFormat" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_MapFormatSetting_item_selected"]
6396-
[connection signal="pressed" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/GridContainer/HBoxContainer2/ResizeCurrentMapSizeButton" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_ResizeCurrentMapSizeButton_pressed"]
63976416
[connection signal="pressed" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/AdvancedMapPropertiesCheckBox" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_AdvancedMapPropertiesCheckBox_pressed"]
63986417
[connection signal="text_changed" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/AdvancedMapProperties/AuthorLineEdit" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_AuthorLineEdit_text_changed"]
63996418
[connection signal="text_changed" from="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties/VBoxContainer/AdvancedMapProperties/DescriptionLineEdit" to="Ui/UiSystem/MapSettingsWindow/MapSettingsTabs/MapProperties" method="_on_DescriptionLineEdit_text_changed"]
@@ -6468,6 +6487,7 @@ script = SubResource( 20 )
64686487
[connection signal="about_to_show" from="Ui/UiSystem/ResizeCurrentMapSize" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_ResizeCurrentMapSize_about_to_show"]
64696488
[connection signal="focus_exited" from="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer/SettingsXSizeLine" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_SettingsXSizeLine_focus_exited"]
64706489
[connection signal="focus_exited" from="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer/SettingsYSizeLine" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_SettingsYSizeLine_focus_exited"]
6490+
[connection signal="value_changed" from="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer/ResizeFillWithID" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_ResizeFillWithID_value_changed"]
64716491
[connection signal="pressed" from="Ui/UiSystem/ResizeCurrentMapSize/MarginContainer/VBoxContainer/ResizeApplyButton" to="Ui/UiSystem/ResizeCurrentMapSize" method="_on_ResizeApplyButton_pressed"]
64726492
[connection signal="timeout" from="Ui/UiMessages/FPScounter/Timer" to="Ui/UiMessages/FPScounter" method="_on_Wait_timeout"]
64736493
[connection signal="about_to_show" from="Ui/UiPreviewExporter/ExportPreview" to="Ui/UiPreviewExporter/ExportPreview" method="_on_ExportPreview_about_to_show"]

Scenes/Menu.gd

+6-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ onready var oCurrentFormat = Nodelist.list["oCurrentFormat"]
3737
onready var oDataLof = Nodelist.list["oDataLof"]
3838
onready var oDkClm = Nodelist.list["oDkClm"]
3939
onready var oExportPreview = Nodelist.list["oExportPreview"]
40+
onready var oResizeCurrentMapSize = Nodelist.list["oResizeCurrentMapSize"]
4041

4142
var recentlyOpened = []
4243
var recentlyOpenedPopupMenu = PopupMenu.new()
@@ -182,12 +183,14 @@ func _on_EditSubmenu_Pressed(pressedID):
182183
Utils.popup_centered(oColumnEditor)
183184
1: # Custom objects
184185
Utils.popup_centered(oAddCustomObjectWindow)
185-
2: # Update all slabs
186+
2: # Resize and shift
187+
Utils.popup_centered(oResizeCurrentMapSize)
188+
3: # Update all slabs
186189
if oDataSlab.get_cell(0,0) != TileMap.INVALID_CELL:
187190
Utils.popup_centered(oConfirmAutoGen)
188-
3: # Texture editing
191+
4: # Texture editing
189192
Utils.popup_centered(oTextureEditingWindow)
190-
4: # Modify dynamic slabs
193+
5: # Modify slabset
191194
Utils.popup_centered(oSlabsetWindow)
192195

193196
func _on_slab_style_window_close_button_clicked():

Scenes/OverheadOwnership.gd

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func start():
4848
slabOwnershipImage.lock()
4949
for ySlab in M.ySize:
5050
for xSlab in M.xSize:
51-
var setValue = Constants.ownerRoomCol[oDataOwnership.get_cell(xSlab,ySlab)]
52-
slabOwnershipImage.set_pixel(xSlab, ySlab, setValue)
51+
var getOwner = oDataOwnership.get_cell(xSlab,ySlab)
52+
if getOwner <= 5:
53+
slabOwnershipImage.set_pixel(xSlab, ySlab, Constants.ownerRoomCol[getOwner])
5354
slabOwnershipImage.unlock()
5455

5556
slabOwnershipTexture.create_from_image(slabOwnershipImage, 0)

0 commit comments

Comments
 (0)