aboutsummaryrefslogtreecommitdiff
path: root/client/gui/menus/ingame.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-17 15:19:22 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-17 15:19:22 +0200
commit734951e32adff68776ad9276d5e6b433b698eb48 (patch)
tree518bb0b0599c5f9d988a52199228ed77c8a0a387 /client/gui/menus/ingame.gd
parent7a3587e137e88c23b07da075ff3ff2648e54c056 (diff)
downloadhurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar
hurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar.bz2
hurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar.zst
translate ingame menu button tooltips; close #380
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():