aboutsummaryrefslogtreecommitdiff
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
parent7a3587e137e88c23b07da075ff3ff2648e54c056 (diff)
downloadhurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar
hurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar.bz2
hurrycurry-734951e32adff68776ad9276d5e6b433b698eb48.tar.zst
translate ingame menu button tooltips; close #380
-rw-r--r--client/gui/menus/ingame.gd17
-rw-r--r--client/gui/menus/ingame.tscn4
2 files changed, 9 insertions, 12 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():
diff --git a/client/gui/menus/ingame.tscn b/client/gui/menus/ingame.tscn
index 0a77af14..2eb47b7d 100644
--- a/client/gui/menus/ingame.tscn
+++ b/client/gui/menus/ingame.tscn
@@ -106,7 +106,7 @@ layout_mode = 2
text = "c.menu.ingame.join"
alignment = 0
-[node name="Lobby" type="Button" parent="Side/Margin/Options"]
+[node name="Abort" type="Button" parent="Side/Margin/Options"]
layout_mode = 2
text = "c.menu.ingame.cancel"
alignment = 0
@@ -136,7 +136,7 @@ alignment = 0
[connection signal="pressed" from="Side/Margin/Options/Resume" to="." method="_on_resume_pressed"]
[connection signal="pressed" from="Side/Margin/Options/Leave" to="." method="_on_leave_pressed"]
-[connection signal="pressed" from="Side/Margin/Options/Lobby" to="." method="_on_lobby_pressed"]
+[connection signal="pressed" from="Side/Margin/Options/Abort" to="." method="_on_lobby_pressed"]
[connection signal="pressed" from="Side/Margin/Options/Reconnect" to="." method="_on_reconnect_pressed"]
[connection signal="pressed" from="Side/Margin/Options/Settings" to="." method="_on_settings_pressed"]
[connection signal="pressed" from="Side/Margin/Options/MainMenu" to="." method="_on_main_menu_pressed"]