summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/game.gd13
-rw-r--r--client/menu/hairstyle_preview.gd2
-rw-r--r--client/menu/lobby.gd2
-rw-r--r--client/menu/popup_message/popup_message.gd20
-rw-r--r--client/menu/rating/rating.gd10
-rw-r--r--client/menu/settings/input/input_manager.gd8
-rw-r--r--client/multiplayer.gd4
7 files changed, 30 insertions, 29 deletions
diff --git a/client/game.gd b/client/game.gd
index de1024ed..8cd648a6 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -211,7 +211,9 @@ func handle_packet(p):
players[p.player].effect_message(p.name)
"set_ingame":
in_lobby = p.lobby
- in_lobby_updated.emit(in_lobby)
+ overlay.set_ingame(p.state, p.lobby)
+ follow_camera.set_ingame(p.state, p.lobby)
+
if p.state:
map.gi_bake()
await get_parent()._menu_open()
@@ -227,8 +229,7 @@ func handle_packet(p):
if lobby and not join_sent:
join()
- overlay.set_ingame(p.state, p.lobby)
- follow_camera.set_ingame(p.state, p.lobby)
+ in_lobby_updated.emit(in_lobby)
"score":
if p.time_remaining != null:
overlay.update(p.demands_failed, p.demands_completed, p.points, p.time_remaining)
@@ -262,8 +263,8 @@ func handle_packet(p):
"server_message":
var mstr := get_message_str(p.message)
if p.error:
- popup_message.display_server_msg(tr("c.error.server") % mstr)
- push_error(tr("c.error.server") % mstr)
+ popup_message.display_server_msg(tr("c.error.server").format([mstr]))
+ push_error(tr("c.error.server").format([mstr]))
else:
popup_message.display_server_msg(mstr)
"server_hint":
@@ -307,7 +308,7 @@ func _process(delta):
func get_message_str(m: Dictionary) -> String:
if "text" in m: return m.text
- if "translation" in m: return tr(m.translation.id) % m.translation.params.map(get_message_str)
+ if "translation" in m: return tr(m.translation.id).format(m.translation.params.map(get_message_str))
if "tile" in m: return tile_names[m.tile]
if "item" in m: return item_names[m.item]
return "[unknown message type]"
diff --git a/client/menu/hairstyle_preview.gd b/client/menu/hairstyle_preview.gd
index 324f7de1..5a9cce68 100644
--- a/client/menu/hairstyle_preview.gd
+++ b/client/menu/hairstyle_preview.gd
@@ -21,5 +21,5 @@ signal selected(character: int)
func setup(character: int, group: ButtonGroup):
$HairViewport/Node3D/Character.select_hairstyle(character)
$Select.button_group = group
- $Select.text = tr("Hairstyle %d") % (character + 1)
+ $Select.text = tr("c.setup.uniform.value").format([character + 1])
$Select.pressed.connect(func(): selected.emit(character))
diff --git a/client/menu/lobby.gd b/client/menu/lobby.gd
index 39199d59..0dca6f4c 100644
--- a/client/menu/lobby.gd
+++ b/client/menu/lobby.gd
@@ -105,7 +105,7 @@ func select_map(i: int):
selected_map = i
var map_data: Dictionary = game.maps[i][1]
map_name_label.text = map_data["name"]
- map_player_label.text = tr("c.map.players_recommended") % map_data["players"]
+ map_player_label.text = tr("c.map.players_recommended").format([map_data["players"]])
map_difficulty_label.text = tr("c.map.difficulty.%d" % (map_data["difficulty"] - 1))
selected_map_name = game.maps[i][0]
if not game.menu.covered:
diff --git a/client/menu/popup_message/popup_message.gd b/client/menu/popup_message/popup_message.gd
index ead11977..3e479b17 100644
--- a/client/menu/popup_message/popup_message.gd
+++ b/client/menu/popup_message/popup_message.gd
@@ -153,35 +153,35 @@ func _input(_event):
func _on_boost_timeout():
if not Global.get_hint("has_boosted") and not Global.using_touch:
- display_hint_msg(tr("c.hint.boost") % display_keybind("boost"))
+ display_hint_msg(tr("c.hint.boost").format([display_keybind("boost")]))
func _on_move_timeout():
if not Global.get_hint("has_moved") and not Global.using_touch:
- display_hint_msg(tr("c.hint.movement") % ", ".join(
+ display_hint_msg(tr("c.hint.movement").format([", ".join(
[
display_keybind("forwards"),
display_keybind("left"),
display_keybind("backwards"),
display_keybind("right")
]
- ))
+ )]))
func _on_interact_timeout():
if not Global.get_hint("has_interacted") and not Global.using_touch:
- display_hint_msg(tr("c.hint.interact") % display_keybind("interact"))
+ display_hint_msg(tr("c.hint.interact").format([display_keybind("interact")]))
func _on_reset_timeout():
if not Global.get_hint("has_reset") and not Global.using_touch:
- display_hint_msg(tr("c.hint.reset_camera") % display_keybind("reset"))
+ display_hint_msg(tr("c.hint.reset_camera").format([display_keybind("reset")]))
func _on_zoom_timeout():
if not Global.get_hint("has_zoomed") and not Global.using_touch:
- display_hint_msg(tr("c.hint.zoom_camera") % ", ".join(
+ display_hint_msg(tr("c.hint.zoom_camera").format([", ".join(
[
display_keybind("zoom_in"),
display_keybind("zoom_out")
]
- ))
+ )]))
func display_keybind(action_name: String) -> String:
var events := InputManager.get_events(action_name)
@@ -210,14 +210,14 @@ func any_action_just_pressed(actions: Array) -> bool:
func _on_rotate_camera_timeout():
if not Global.get_hint("has_rotated") and not Global.using_touch:
- display_hint_msg(tr("c.hint.rotate") % ", ".join(
+ display_hint_msg(tr("c.hint.rotate").format([", ".join(
[
display_keybind("rotate_up"),
display_keybind("rotate_left"),
display_keybind("rotate_down"),
display_keybind("rotate_right")
]
- ))
+ )]))
func _on_nametags_timeout():
if not Global.get_hint("has_seen_nametags") and not Global.get_setting("gameplay.usernames"):
@@ -227,7 +227,7 @@ func _on_nametags_timeout():
func _on_join_while_running_timeout():
if not game.is_joined and not Global.get_hint("has_seen_join_while_running"):
Global.set_hint("has_seen_join_while_running", true)
- display_hint_msg(tr("c.hint.join_while_running") % display_keybind("menu"))
+ display_hint_msg(tr("c.hint.join_while_running").format([display_keybind("menu")]))
func _on_performance_timeout() -> void:
if not Global.get_hint("has_seen_performance") and Engine.get_frames_per_second() < DisplayServer.screen_get_refresh_rate() * 0.75:
diff --git a/client/menu/rating/rating.gd b/client/menu/rating/rating.gd
index 1669e5fc..5e7d9478 100644
--- a/client/menu/rating/rating.gd
+++ b/client/menu/rating/rating.gd
@@ -33,12 +33,12 @@ func _process(_delta):
func show_rating(stars_: int, points: int):
match stars_:
- 0: title.text = tr("Poor service")
- 1: title.text = tr("Acceptable service")
- 2: title.text = tr("Good service")
- 3: title.text = tr("Excellent service")
+ 0: title.text = tr("c.score.poor")
+ 1: title.text = tr("c.score.acceptable")
+ 2: title.text = tr("c.score.good")
+ 3: title.text = tr("c.score.excellent")
- subtitle.text = tr("You collected %s points") % points
+ subtitle.text = tr("c.score.points_par") % points
for i in range(0, stars_):
var star: TextureRect = stars[i]
diff --git a/client/menu/settings/input/input_manager.gd b/client/menu/settings/input/input_manager.gd
index 640410d0..b612bde3 100644
--- a/client/menu/settings/input/input_manager.gd
+++ b/client/menu/settings/input/input_manager.gd
@@ -93,12 +93,12 @@ func get_event_type(input_event: InputEvent) -> EventType:
func display_input_event(input_event: InputEvent) -> String:
if input_event is InputEventKey:
- return tr("c.settings.input.keyboard") % OS.get_keycode_string(input_event.physical_keycode)
+ return tr("c.settings.input.keyboard").format([OS.get_keycode_string(input_event.physical_keycode)])
elif input_event is InputEventMouseButton:
- return tr("c.settings.input.mouse_button") % input_event.button_index
+ return tr("c.settings.input.mouse_button").format([input_event.button_index])
elif input_event is InputEventJoypadButton:
- return tr("c.settings.input.joypad") % input_event.button_index
+ return tr("c.settings.input.joypad").format([input_event.button_index])
elif input_event is InputEventJoypadMotion:
- return tr("c.settings.input.joypad_axis") % [input_event.axis]
+ return tr("c.settings.input.joypad_axis").format([input_event.axis])
else:
return tr("c.settings.input.other_event")
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index 44e900af..e9b2a4ec 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -49,7 +49,7 @@ func _process(_delta):
elif state == WebSocketPeer.STATE_CLOSED:
var code = socket.get_close_code()
var reason = socket.get_close_reason() if code == socket.STATE_CLOSED else tr("c.error.websocket.unavailable")
- connection_closed.emit(tr("c.error.websocket") % [code, reason, code != -1])
+ connection_closed.emit(tr("c.error.websocket").format([code, reason, code != -1]))
self.queue_free()
func fix_packet_types(val):
@@ -85,7 +85,7 @@ func handle_packet(coded):
if major != VERSION_MAJOR and minor >= VERSION_MINOR:
socket.close()
connected = false
- connection_closed.emit(tr("c.error.version_mismatch") % [major, minor, VERSION_MAJOR, VERSION_MINOR])
+ connection_closed.emit(tr("c.error.version_mismatch").format([major, minor, VERSION_MAJOR, VERSION_MINOR]))
_: packet.emit(p)
func send_join(player_name: String, character: int):