Summary
Functions
ScrC()client
Returns the coordinates of the center of the screen.
ServerLog(...)server
Detour of the engine function that prints an empty line to the console after each log entry.
Translates a phrase to the current language.
Functions
Returns the coordinates of the center of the screen. The values are computed once when the file loads.
Returns
- Number x
- Number y
Detour of the engine function that prints an empty line to the console after each log entry. The original function is kept as old_server_log.
Parameters
- ... Vararg text passed on to the original ServerLog
Translates a phrase to the current language. English is used if the language is not available or does not have the phrase, and the phrase itself is returned if it has no translation at all. Line breaks in the result are replaced with spaces.
local text = t'ui.char_create.unknown_error'
-- Replaces {name} in the translated phrase.
local message = t('ui.char_create.delete_confirm_msg', { name = self.char_data.name })
A phrase with plural forms is translated to the form that fits a number. The number is
the count argument, else the amount argument, else the only number among the
arguments; without one the most general form is used ('5', else '2', else '1').
-- 'RESPAWNING IN 1 SECOND.' or 'RESPAWNING IN 5 SECONDS.',
-- 'ВОЗРОЖДЕНИЕ ЧЕРЕЗ 2 СЕКУНДЫ' or 'ВОЗРОЖДЕНИЕ ЧЕРЕЗ 5 СЕКУНД' in Russian.
local text = t('ui.hud.player_message.respawn', { time = seconds })
Parameters
- phrase String phrase ID with its nesting separated by dots, or plain text
- args Map/Any optional, defaults to
nilvalues to replace the {key} placeholders with, by key; a single value replaces {1}. A value is inserted as it is, so text that a player has typed needs no escaping. A value made byFlux.Lang:durationis replaced with the duration as text - force_lang String optional, defaults to
nillanguage code to use instead of the current language
Returns
- String translated text; nothing else, so that a call like
list:AddColumn(t'id')never passes a second argument by accident