Added import and export for the level designer

This commit is contained in:
2024-05-06 15:02:56 +01:00
parent ad2d467456
commit 031879cf46
18 changed files with 291 additions and 41 deletions

18
ImportPanel.gd Normal file
View File

@@ -0,0 +1,18 @@
extends PanelContainer
signal object_imported(data : Dictionary)
func show_panel() -> void:
$VBoxContainer/ImportedCode.text = ""
$VBoxContainer/ImportedCode.grab_focus()
visible = true
func _on_import_pressed() -> void:
var text = Marshalls.base64_to_utf8($VBoxContainer/ImportedCode.text)
var ob = JSON.parse_string(text)
if ob != null:
object_imported.emit(ob)
visible = false
func _on_cancel_pressed() -> void:
visible = false