feat(text): on-screen messages come from translation files
Every message the mod puts in the middle or corner of the screen now reads its text through ModText.Get, and messages.json holds 191 texts in English and Italian. Values computed in code become $1, $2 in the text, so a translator can put them wherever the sentence needs them. Branching messages get one key per branch. A few messages travel through a field before they are shown: thralls' refusals and the building limits now hold a token or key there. Boss and form names inside messages use tokens too, the bosses the game's own, so "The Elder" arrives translated. ModText.Get now localizes each argument before inserting it. A token argument left for a later pass ran into the text after it: "$1's power" became the unknown token "enemy_eikthyr's". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b3641e5bf4
commit
b0d18b0654
61 changed files with 606 additions and 200 deletions
|
|
@ -306,21 +306,21 @@ namespace RacesOfValheim
|
|||
|
||||
if (!SkadiRace.IsLocalSkadi())
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "The stone does not answer to you.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skadi_stone_does_not_answer"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BossProgressionManager.GetCurrentProgressionState() < ModerProgressionState)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
"The tear is cold. Nothing wakes in the stone until the mountain's queen has fallen.");
|
||||
ModText.Get("rov_msg_skadi_tear_cold_nothing_wakes_stone"));
|
||||
return false;
|
||||
}
|
||||
|
||||
CraftingStation station = FindStonecutter(position);
|
||||
if (station == null)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "It needs a stonecutter to be cut at.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skadi_needs_stonecutter_cut_at"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ namespace RacesOfValheim
|
|||
if (bound >= MaxPerStation)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
$"That stonecutter already holds {bound}. It will not hold more.");
|
||||
ModText.Get("rov_msg_skadi_that_stonecutter_already_holds_will", bound));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ namespace RacesOfValheim
|
|||
if (nearby >= MaxInArea)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
$"There are already {nearby} of these within a day's walk. The stone is spent.");
|
||||
ModText.Get("rov_msg_skadi_there_are_already_these_within", nearby));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue