Make the Welcome message translatable
It fixes #2217 (closed)
Welcome message is made of different parts:
- Version / warning if version is outdated
- Gametype
- Active modifications
- Special gameplay tips
- Custom server MOTD (untranslatable)
All of them are now translatable except the motd set by the server admin in the sv_motd cvar (empty by default).
Extra changes:
- Show current binds in gameplay tips
- Show "No weapons" if no valid weapon can be found in g_weaponarena
- improve client side weapon arena options parsing
Implementation details:
Client parses the list of active modifications/mutators sent by the server in the Welcome message and prints the corresponding translated names. While at it it stores the list of active mutators as flags in a couple ints (with mut_set_active
) so client mutator hooks can check them really fast.
Gameplay tips are no longer sent by the server but built in the BuildGameplayTipsString
client hook which previously was in the server. Currently only 3 mutators show a gameplay tip.
Other notes:
A similar change could be made to build the mutator name list in client code but it'd require registering client mutators before calling BuildMutatorsPrettyString
as client hook and it isn't possible because many modifications/mutators aren't even proper mutators.
If you wonder why there are so many duplicated string in the code, it's because currently it isn't possible to make translatable a variable string (print(_(s));
prints s untraslated), so we have to duplicate strings.