diff --git a/scenes/combatUIScene.tscn b/scenes/combatUIScene.tscn index f9d70f0..f0d0241 100644 --- a/scenes/combatUIScene.tscn +++ b/scenes/combatUIScene.tscn @@ -69,7 +69,7 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 -[node name="AutoCheck" type="CheckButton" parent="MarginContainer/UITop"] +[node name="AutoProgressToggle" type="CheckButton" parent="MarginContainer/UITop"] layout_mode = 2 text = "Auto Progress" diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn index 77d3cec..daecc91 100644 --- a/scenes/main_menu.tscn +++ b/scenes/main_menu.tscn @@ -49,8 +49,14 @@ layout_mode = 2 text = "Test " +[node name="AutostartToggle" type="CheckButton" parent="MenuButtons"] +visible = false +layout_mode = 2 +text = "Auto Play" + [connection signal="pressed" from="MenuButtons/PlayButton" to="." method="_on_play_button_pressed"] [connection signal="pressed" from="MenuButtons/SaveButton" to="." method="_on_save_button_pressed"] [connection signal="pressed" from="MenuButtons/LoadButton" to="." method="_on_load_button_pressed"] [connection signal="pressed" from="MenuButtons/ExitButton" to="." method="_on_exit_button_pressed"] [connection signal="pressed" from="MenuButtons/TestButton" to="." method="_on_test_button_pressed"] +[connection signal="toggled" from="MenuButtons/AutostartToggle" to="." method="_on_autostart_toggle_toggled"] diff --git a/scripts/Globals.gd b/scripts/Globals.gd index 2274aa7..0124763 100644 --- a/scripts/Globals.gd +++ b/scripts/Globals.gd @@ -3,6 +3,7 @@ extends Node var debugSpeedEnabled: bool +var debugAutoPlayEnabled: bool var player_save := ConfigFile.new() diff --git a/scripts/combat_ui_scene.gd b/scripts/combat_ui_scene.gd index 0705195..2eed041 100644 --- a/scripts/combat_ui_scene.gd +++ b/scripts/combat_ui_scene.gd @@ -23,6 +23,7 @@ func _ready() -> void: _create_area() current_area_duration = 0 + %UITop/AutoProgressToggle.button_pressed = true # func _process(_delta: float) -> void: @@ -76,7 +77,7 @@ func _on_quest_generated(quest) -> void: func _on_quest_completed() -> void: - if %UITop/AutoCheck.button_pressed: + if %UITop/AutoProgressToggle.button_pressed: _go_next_area() else: # Globals.fade_node(%UITop/ContinueButton, "in", 0.25) diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index 489ee06..d30e500 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -2,11 +2,21 @@ extends Control func _ready() -> void: + Engine.time_scale = 1.0 if OS.is_debug_build(): $MenuButtons/TestButton.show() + $MenuButtons/AutostartToggle.show() + $MenuButtons/AutostartToggle.button_pressed = Globals.debugAutoPlayEnabled + await get_tree().create_timer(5).timeout + if Globals.debugAutoPlayEnabled: + _enter_loaded_save() func _on_play_button_pressed() -> void: + _enter_loaded_save() + + +func _enter_loaded_save() -> void: get_tree().change_scene_to_file("res://scenes/combatUIScene.tscn") @@ -25,3 +35,7 @@ func _on_save_button_pressed() -> void: func _on_test_button_pressed() -> void: pass # Replace with function body. + + +func _on_autostart_toggle_toggled(toggled_on: bool) -> void: + Globals.debugAutoPlayEnabled = toggled_on