diff options
author | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-18 03:03:02 +0200 |
---|---|---|
committer | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-18 20:10:54 +0200 |
commit | c945680d960ccd0fb4a0ef5058ddfdd48e150f2d (patch) | |
tree | 5bf6622bd220dc5e48a761365e9d871ffd3e4129 /game/src/GameSession/GameSpeedPanel.gd | |
parent | ea077c8a7c78477bd247c7fbd21de13bcf2285e9 (diff) |
Added game speed panel to GameSession
Diffstat (limited to 'game/src/GameSession/GameSpeedPanel.gd')
-rw-r--r-- | game/src/GameSession/GameSpeedPanel.gd | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/game/src/GameSession/GameSpeedPanel.gd b/game/src/GameSession/GameSpeedPanel.gd new file mode 100644 index 0000000..8dc35d7 --- /dev/null +++ b/game/src/GameSession/GameSpeedPanel.gd @@ -0,0 +1,33 @@ +extends PanelContainer + +#UI-74 UI-75 UI-76 UI-77 + +@export var _longform_date_button : Button +@export var _play_pause_display_button : Button +@export var _decrease_speed_button : Button +@export var _increase_speed_button : Button + +var is_game_paused : bool = true + +# Called when the node enters the scene tree for the first time. +func _ready(): + _update_playpause_button() + +func _update_playpause_button(): + _play_pause_display_button.text = "⏸️" if is_game_paused else "▶" + print("Game is paused" if is_game_paused else "Game is advancing") + + +func _on_decrease_speed_button_pressed(): + print("Decrease speed") + +func _on_increase_speed_button_pressed(): + print("Increase speed") + +func _on_play_pause_display_button_pressed(): + is_game_paused = !is_game_paused + _update_playpause_button() + +func _on_longform_date_label_pressed(): + is_game_paused = !is_game_paused + _update_playpause_button() |