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
|
|
@ -113,13 +113,13 @@ namespace RacesOfValheim
|
|||
|
||||
if (!WarVultureConfig.RaceAllowed(race))
|
||||
{
|
||||
rider.Message(MessageHud.MessageType.Center, "The bird does not know you.");
|
||||
rider.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_warvulture_bird_does_not_know"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WarVultureVisual.Ready)
|
||||
{
|
||||
rider.Message(MessageHud.MessageType.Center, "The vulture does not answer.");
|
||||
rider.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_warvulture_vulture_does_not_answer"));
|
||||
Jotunn.Logger.LogWarning($"[{Label}] Call refused: the stripped model template was never built, " +
|
||||
"so there is no bird to show. The reason is logged at startup - and " +
|
||||
"refusing is deliberate, because the alternative is putting an unstripped " +
|
||||
|
|
@ -245,7 +245,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
landing = true;
|
||||
landingStartedAt = Time.time;
|
||||
player.Message(MessageHud.MessageType.Center, "The vulture spirals down.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_warvulture_vulture_spirals_down"));
|
||||
}
|
||||
|
||||
private void UpdateLanding()
|
||||
|
|
@ -304,7 +304,7 @@ namespace RacesOfValheim
|
|||
wind = Mathf.Max(0f, wind - dt);
|
||||
if (wind <= 0f)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "The vulture settles into a glide.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_warvulture_vulture_settles_into_glide"));
|
||||
}
|
||||
}
|
||||
else if (wind < WarVultureConfig.SprintSeconds.Value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue