add debug auto play to automatically press play and continue farming for testing purposes

This commit is contained in:
tonydero 2024-10-30 06:35:55 -06:00
parent 6013c08892
commit f8e46af129
5 changed files with 24 additions and 2 deletions

View File

@ -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"

View File

@ -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"]

View File

@ -3,6 +3,7 @@ extends Node
var debugSpeedEnabled: bool
var debugAutoPlayEnabled: bool
var player_save := ConfigFile.new()

View File

@ -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)

View File

@ -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