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
|
|
@ -289,7 +289,7 @@ namespace RacesOfValheim
|
|||
if (item == null) item = FindAnyInput(inventory);
|
||||
if (item == null)
|
||||
{
|
||||
user.Message(MessageHud.MessageType.Center, "It wants meat. Any meat.");
|
||||
user.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_wants_meat_any_meat"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -342,19 +342,19 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (IsUpgraded())
|
||||
{
|
||||
user.Message(MessageHud.MessageType.Center, "It has already had one.");
|
||||
user.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_has_already_had_one"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BossProgressionManager.GetCurrentProgressionState() < FenrirMangiatoia.UpgradeProgressionState)
|
||||
{
|
||||
user.Message(MessageHud.MessageType.Center, "The blood will not take. Something in the plains has to fall first.");
|
||||
user.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_blood_will_not_take_something"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inventory.CountItems(YagluthDropName()) < 1)
|
||||
{
|
||||
user.Message(MessageHud.MessageType.Center, "It wants what Yagluth left behind.");
|
||||
user.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_wants_what_yagluth_left_behind"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -362,7 +362,7 @@ namespace RacesOfValheim
|
|||
inventory.RemoveItem(item, 1);
|
||||
m_nview.InvokeRPC("RoV_FenrirUpgrade");
|
||||
|
||||
user.Message(MessageHud.MessageType.Center, "The trough takes it. The line runs deeper now.");
|
||||
user.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_fenrir_trough_takes_line_runs_deeper"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ namespace RacesOfValheim
|
|||
if (bound.Count > 0 && Player.m_localPlayer != null)
|
||||
{
|
||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center,
|
||||
$"The trough is broken. {bound.Count} will not outlast it by long.");
|
||||
ModText.Get("rov_msg_fenrir_trough_broken_will_not_outlast", bound.Count));
|
||||
}
|
||||
|
||||
SetFeed(0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue