Skip to content

Commit 8d020e3

Browse files
committed
import/export defaults
1 parent c2f2f20 commit 8d020e3

File tree

2 files changed

+44
-47
lines changed

2 files changed

+44
-47
lines changed

Scenes/Main.tscn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7166,7 +7166,6 @@ script = SubResource( 20 )
71667166
[connection signal="value_changed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/ScrollContainer/VBoxContainer/PanelContainer3/VBoxContainer/SlabsetObjectSection/VBoxContainer/GridContainer/ObjThingTypeSpinBox" to="Ui/UiSystem/SlabsetWindow" method="_on_ObjThingTypeSpinBox_value_changed"]
71677167
[connection signal="toggled" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/ScrollContainer/VBoxContainer/PanelContainer3/VBoxContainer/SlabsetObjectSection/VBoxContainer/GridContainer/ObjIsLightCheckBox" to="Ui/UiSystem/SlabsetWindow" method="_on_ObjIsLightCheckBox_toggled"]
71687168
[connection signal="pressed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/ScrollContainer/VBoxContainer/SlabsetCopyValues" to="Ui/UiSystem/SlabsetWindow" method="_on_SlabsetCopyValues_pressed"]
7169-
[connection signal="pressed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/ExportSlabsDat" to="Ui/UiSystem/SlabsetWindow" method="_on_ExportSlabsDat_pressed"]
71707169
[connection signal="pressed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/ExportSlabsCfg" to="Ui/UiSystem/SlabsetWindow" method="_on_ExportSlabsCfg_pressed"]
71717170
[connection signal="pressed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/ImportSlabsCfg" to="Ui/UiSystem/SlabsetWindow" method="_on_ImportSlabsCfg_pressed"]
71727171
[connection signal="pressed" from="Ui/UiSystem/SlabsetWindow/SlabsetTabs/TabSlabset/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/SlabsetHelpButton" to="Ui/UiSystem/SlabsetWindow" method="_on_SlabsetHelpButton_pressed"]
@@ -7188,8 +7187,6 @@ script = SubResource( 20 )
71887187
[connection signal="timeout" from="Ui/UiSystem/NewMapWindow/MarginContainer/HBoxContainer/VBoxContainer/NewMapNoiseOptions/NoiseUpdateTimer" to="Ui/UiSystem/NewMapWindow" method="_on_NoiseUpdateTimer_timeout"]
71897188
[connection signal="pressed" from="Ui/UiSystem/NewMapWindow/MarginContainer/HBoxContainer/VBoxContainer/ButtonNewMapOK" to="Ui/UiSystem/NewMapWindow" method="_on_ButtonNewMapOK_pressed"]
71907189
[connection signal="gui_input" from="Ui/UiSystem/NewMapWindow/MarginContainer/HBoxContainer/QuickNoisePreview" to="Ui/UiSystem/NewMapWindow" method="_on_QuickNoisePreview_gui_input"]
7191-
[connection signal="file_selected" from="Ui/UiSystem/ExportSlabsetDatDialog" to="Ui/UiSystem/SlabsetWindow" method="_on_ExportSlabsetDatDialog_file_selected"]
7192-
[connection signal="file_selected" from="Ui/UiSystem/ExportSlabsetClmDialog" to="Ui/UiSystem/SlabsetWindow" method="_on_ExportSlabsetClmDialog_file_selected"]
71937190
[connection signal="file_selected" from="Ui/UiSystem/ExportSlabsetCfgDialog" to="Ui/UiSystem/SlabsetWindow" method="_on_ExportSlabsetCfgDialog_file_selected"]
71947191
[connection signal="file_selected" from="Ui/UiSystem/ImportSlabsetCfgDialog" to="Ui/UiSystem/SlabsetWindow" method="_on_ImportSlabsetCfgDialog_file_selected"]
71957192
[connection signal="file_selected" from="Ui/UiSystem/ImportColumnsetCfgDialog" to="Ui/UiSystem/SlabsetWindow" method="_on_ImportColumnsetCfgDialog_file_selected"]

Scenes/SlabsetWindow.gd

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -224,37 +224,37 @@ func _on_SlabsetCopyValues_pressed():
224224
oPickSlabWindow._on_pressed_add_new_custom_slab()
225225

226226

227-
func _on_ExportSlabsDat_pressed():
228-
Utils.popup_centered(oExportSlabsetDatDialog)
229-
oExportSlabsetDatDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
230-
oExportSlabsetDatDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
231-
oExportSlabsetDatDialog.current_file = "slabs.dat"
232-
func _on_ExportSlabsClm_pressed():
233-
Utils.popup_centered(oExportSlabsetClmDialog)
234-
oExportSlabsetClmDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
235-
oExportSlabsetClmDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
236-
oExportSlabsetClmDialog.current_file = "slabs.clm"
227+
#func _on_ExportSlabsDat_pressed():
228+
# Utils.popup_centered(oExportSlabsetDatDialog)
229+
# oExportSlabsetDatDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
230+
# oExportSlabsetDatDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
231+
# oExportSlabsetDatDialog.current_file = "slabs.dat"
232+
#func _on_ExportSlabsClm_pressed():
233+
# Utils.popup_centered(oExportSlabsetClmDialog)
234+
# oExportSlabsetClmDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
235+
# oExportSlabsetClmDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
236+
# oExportSlabsetClmDialog.current_file = "slabs.clm"
237237

238238
func _on_ExportSlabsCfg_pressed():
239239
Utils.popup_centered(oExportSlabsetCfgDialog)
240-
#oExportSlabsetCfgDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
241-
#oExportSlabsetCfgDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
240+
oExportSlabsetCfgDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
241+
oExportSlabsetCfgDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
242242
oExportSlabsetCfgDialog.current_file = "slabset.cfg"
243243
func _on_ImportSlabsCfg_pressed():
244244
Utils.popup_centered(oImportSlabsetCfgDialog)
245-
#oExportSlabsetCfgDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
246-
#oExportSlabsetCfgDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
245+
oImportSlabsetCfgDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
246+
oImportSlabsetCfgDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
247247
oImportSlabsetCfgDialog.current_file = "slabset.cfg"
248248

249249
func _on_ExportColumnsCfg_pressed():
250250
Utils.popup_centered(oExportColumnsetCfgDialog)
251-
#oExportColumnsetCfgDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
252-
#oExportColumnsetCfgDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
251+
oExportColumnsetCfgDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
252+
oExportColumnsetCfgDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
253253
oExportColumnsetCfgDialog.current_file = "columnset.cfg"
254254
func _on_ImportColumnsCfg_pressed():
255255
Utils.popup_centered(oImportColumnsetCfgDialog)
256-
#oExportSlabsetCfgDialog.current_dir = oGame.DK_DATA_DIRECTORY.plus_file("")
257-
#oExportSlabsetCfgDialog.current_path = oGame.DK_DATA_DIRECTORY.plus_file("")
256+
oImportColumnsetCfgDialog.current_dir = oGame.GAME_DIRECTORY.plus_file("")
257+
oImportColumnsetCfgDialog.current_path = oGame.GAME_DIRECTORY.plus_file("")
258258
oImportColumnsetCfgDialog.current_file = "columnset.cfg"
259259

260260

@@ -297,34 +297,34 @@ func _on_ExportSlabsetDatDialog_file_selected(filePath):
297297
oMessage.big("Error", "Couldn't save file, maybe try saving to another directory.")
298298

299299

300-
func _on_ExportSlabsetClmDialog_file_selected(filePath):
301-
var buffer = StreamPeerBuffer.new()
302-
303-
var numberOfClmEntries = 2048
304-
buffer.put_16(numberOfClmEntries)
305-
buffer.put_16(0)
300+
#func _on_ExportSlabsetClmDialog_file_selected(filePath):
301+
# var buffer = StreamPeerBuffer.new()
302+
#
303+
# var numberOfClmEntries = 2048
306304
# buffer.put_16(numberOfClmEntries)
307-
# buffer.put_data([0,0])
308305
# buffer.put_16(0)
309-
# buffer.put_data([0,0])
310-
311-
for entry in numberOfClmEntries:
312-
buffer.put_16(Columnset.utilized[entry]) # 0-1
313-
buffer.put_8((Columnset.permanent[entry] & 1) + ((Columnset.lintel[entry] & 7) << 1) + ((Columnset.height[entry] & 15) << 4))
314-
buffer.put_16(Columnset.solidMask[entry]) # 3-4
315-
buffer.put_16(Columnset.floorTexture[entry]) # 5-6
316-
buffer.put_8(Columnset.orientation[entry]) # 7
317-
318-
for cubeNumber in 8:
319-
buffer.put_16(Columnset.cubes[entry][cubeNumber]) # 8-23
320-
321-
var file = File.new()
322-
if file.open(filePath,File.WRITE) == OK:
323-
file.store_buffer(buffer.data_array)
324-
file.close()
325-
oMessage.quick("Saved: " + filePath)
326-
else:
327-
oMessage.big("Error", "Couldn't save file, maybe try saving to another directory.")
306+
## buffer.put_16(numberOfClmEntries)
307+
## buffer.put_data([0,0])
308+
## buffer.put_16(0)
309+
## buffer.put_data([0,0])
310+
#
311+
# for entry in numberOfClmEntries:
312+
# buffer.put_16(Columnset.utilized[entry]) # 0-1
313+
# buffer.put_8((Columnset.permanent[entry] & 1) + ((Columnset.lintel[entry] & 7) << 1) + ((Columnset.height[entry] & 15) << 4))
314+
# buffer.put_16(Columnset.solidMask[entry]) # 3-4
315+
# buffer.put_16(Columnset.floorTexture[entry]) # 5-6
316+
# buffer.put_8(Columnset.orientation[entry]) # 7
317+
#
318+
# for cubeNumber in 8:
319+
# buffer.put_16(Columnset.cubes[entry][cubeNumber]) # 8-23
320+
#
321+
# var file = File.new()
322+
# if file.open(filePath,File.WRITE) == OK:
323+
# file.store_buffer(buffer.data_array)
324+
# file.close()
325+
# oMessage.quick("Saved: " + filePath)
326+
# else:
327+
# oMessage.big("Error", "Couldn't save file, maybe try saving to another directory.")
328328

329329
func get_current_variation():
330330
return (int(oSlabsetIDSpinBox.value) * 28) + int(oVariationNumberSpinBox.value)

0 commit comments

Comments
 (0)