diff --git a/godot/Game.gd b/godot/Game.gd index a690a0e8acd94db6754687a50e4558ce611b60c0..3bead7dc933c7bd230cf367d1f2f73d066c08088 100644 --- a/godot/Game.gd +++ b/godot/Game.gd @@ -22,7 +22,6 @@ func _ready(): local_map.visible = true local_map.spawn_party(party) local_map.quest_system = quest_system - $Debug/DebugInterface.initialize($GameSaver) func enter_battle(formation: Formation): """ diff --git a/godot/Game.tscn b/godot/Game.tscn index ae61a286a849afc011f96e0a6aa2a0b623ecce4f..02e651aae1e92fb4cc0590f0d21fdc99ee4e2692 100644 --- a/godot/Game.tscn +++ b/godot/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://Game.gd" type="Script" id=1] [ext_resource path="res://party/Party.tscn" type="PackedScene" id=2] @@ -8,8 +8,7 @@ [ext_resource path="res://interface/game_over/GameOverInterface.tscn" type="PackedScene" id=6] [ext_resource path="res://assets/audio/bgm/battle_theme.ogg" type="AudioStream" id=7] [ext_resource path="res://core/MusicPlayer.gd" type="Script" id=8] -[ext_resource path="res://core/save/GameSaver.tscn" type="PackedScene" id=9] -[ext_resource path="res://interface/debug/DebugInterface.tscn" type="PackedScene" id=10] +[ext_resource path="res://interface/debug/DebugInterface.tscn" type="PackedScene" id=9] [node name="Game" type="Node"] script = ExtResource( 1 ) @@ -36,13 +35,10 @@ stream = ExtResource( 7 ) bus = "Music" script = ExtResource( 8 ) -[node name="GameSaver" parent="." instance=ExtResource( 9 )] - [node name="Debug" type="CanvasLayer" parent="."] layer = 100 -[node name="DebugInterface" parent="Debug" instance=ExtResource( 10 )] -visible = false +[node name="DebugInterface" parent="Debug" instance=ExtResource( 9 )] [connection signal="combat_finished" from="." to="LocalMap" method="_on_Game_combat_finished"] [connection signal="combat_started" from="." to="QuestSystem" method="_on_Game_combat_started"] diff --git a/godot/interface/debug/DebugInterface.gd b/godot/interface/debug/DebugInterface.gd index 9f77811fdacd9ba7e9bce747b3ee026b6d1e5219..10569337ee259234729c5130984caf3ff6bc14d4 100644 --- a/godot/interface/debug/DebugInterface.gd +++ b/godot/interface/debug/DebugInterface.gd @@ -1,11 +1,7 @@ extends Control onready var spin_box : SpinBox = $Column/HBoxContainer/SpinBox - -var game_saver : Node = null - -func initialize(_game_saver): - game_saver = _game_saver +onready var game_saver : Node = $GameSaver func _on_SaveButton_pressed() -> void: game_saver.save(spin_box.value) diff --git a/godot/interface/debug/DebugInterface.tscn b/godot/interface/debug/DebugInterface.tscn index cad9a9533a610038fdac8cdc6c0bef34b0129e2f..0db4897713c532ed774c0bca2c4474c4182a7ab4 100644 --- a/godot/interface/debug/DebugInterface.tscn +++ b/godot/interface/debug/DebugInterface.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://interface/debug/DebugInterface.gd" type="Script" id=1] +[ext_resource path="res://core/save/GameSaver.tscn" type="PackedScene" id=2] [node name="DebugInterface" type="Panel"] margin_right = 400.0 @@ -45,5 +46,7 @@ margin_bottom = 154.0 rect_min_size = Vector2( 100, 40 ) text = "Load" +[node name="GameSaver" parent="." instance=ExtResource( 2 )] + [connection signal="pressed" from="Column/SaveButton" to="." method="_on_SaveButton_pressed"] [connection signal="pressed" from="Column/LoadButton" to="." method="_on_LoadButton_pressed"]