diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-09-20 00:45:42 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-09-20 00:50:05 +0200 |
| commit | 3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457 (patch) | |
| tree | 9608ff402d95ea927fb3b0c9dbddd7a927f9bf87 /client/game.gd | |
| parent | 2b2b1957b80c0743b455e3decba56d0551e69162 (diff) | |
| download | hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar.bz2 hurrycurry-3b3c7b900d4eeccb57eb983ce5bc41efa4d5f457.tar.zst | |
replace % operator with String.format()
Diffstat (limited to 'client/game.gd')
| -rw-r--r-- | client/game.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/game.gd b/client/game.gd index 407c1243..8cd648a6 100644 --- a/client/game.gd +++ b/client/game.gd @@ -263,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": @@ -308,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]" |