aboutsummaryrefslogtreecommitdiff
path: root/client/gui/menus/ingame.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/gui/menus/ingame.gd')
-rw-r--r--client/gui/menus/ingame.gd17
1 files changed, 7 insertions, 10 deletions
diff --git a/client/gui/menus/ingame.gd b/client/gui/menus/ingame.gd
index 9d102c76..c9bbead9 100644
--- a/client/gui/menus/ingame.gd
+++ b/client/gui/menus/ingame.gd
@@ -18,7 +18,7 @@ extends Menu
@onready var anim = $AnimationPlayer
@onready var options = $Side/Margin/Options
@onready var game: Game = $"../Game"
-@onready var lobby_button: Button = $Side/Margin/Options/Lobby
+@onready var abort_button: Button = $Side/Margin/Options/Abort
@onready var leave_button: Button = $Side/Margin/Options/Leave
var opened
@@ -26,17 +26,14 @@ func _ready():
opened = Time.get_ticks_msec()
game.join_state_updated.connect(_on_game_join_state_changed)
_on_game_join_state_changed(game.join_state)
- update_lobby_button()
+ update_abort_button()
super()
-func update_lobby_button():
- lobby_button.disabled = game.in_lobby or game.join_state == Game.JoinState.SPECTATING
- if game.in_lobby:
- lobby_button.tooltip_text = "Cannot cancel game since no game is running."
- elif not game.join_state == Game.JoinState.JOINED:
- lobby_button.tooltip_text = "You must join in order to be able to cancel the current game."
- else:
- lobby_button.tooltip_text = ""
+func update_abort_button():
+ abort_button.disabled = game.in_lobby or game.join_state == Game.JoinState.SPECTATING
+ if game.in_lobby: abort_button.tooltip_text = tr("c.error.cannot_cancel_no_game")
+ elif game.join_state != Game.JoinState.JOINED: abort_button.tooltip_text = tr("c.error.must_join_to_cancel")
+ else: abort_button.tooltip_text = ""
func anim_setup(): pass
func _menu_open():