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
|
|
@ -108,7 +108,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (!IsUpgraded())
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "This pile cannot hold the rotten yet.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_this_pile_cannot_hold_rotten"));
|
||||
return false;
|
||||
}
|
||||
room = RancidCap() - GetSlots(SkeletonBonePile.KindRancid);
|
||||
|
|
@ -149,7 +149,7 @@ namespace RacesOfValheim
|
|||
List<RaisedThrall> bound = RaisedThrall.BoundTo(transform.position);
|
||||
if (bound.Count == 0)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "Nothing is standing yet. It wants bone.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_nothing_standing_yet_wants_bone"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -169,13 +169,11 @@ namespace RacesOfValheim
|
|||
if (moved == 0)
|
||||
{
|
||||
// Every one of them refused, which for these means the player is not a Skeleton.
|
||||
player.Message(MessageHud.MessageType.Center, "These bones answer only to their own kind.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_these_bones_answer_only_their"));
|
||||
return false;
|
||||
}
|
||||
|
||||
player.Message(MessageHud.MessageType.Center, anyFollowing
|
||||
? $"{moved} return to the pile."
|
||||
: $"{moved} rise and follow.");
|
||||
player.Message(MessageHud.MessageType.Center, (anyFollowing ? ModText.Get("rov_msg_skeleton_return_pile", moved) : ModText.Get("rov_msg_skeleton_rise_follow", moved)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -183,19 +181,19 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (IsUpgraded())
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "It has already had one.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_has_already_had_one"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BossProgressionManager.GetCurrentProgressionState() < SkeletonBonePile.UpgradeProgressionState)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "The skull will not wake. Something older has to fall first.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_skull_will_not_wake_something"));
|
||||
return false;
|
||||
}
|
||||
|
||||
inventory.RemoveItem(item, 1);
|
||||
m_nview.InvokeRPC("RoV_SkelUpgrade");
|
||||
player.Message(MessageHud.MessageType.Center, "The pile deepens. The rotten will stand here too.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_skeleton_pile_deepens_rotten_will_stand"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +330,7 @@ namespace RacesOfValheim
|
|||
if (bound.Count > 0 && Player.m_localPlayer != null)
|
||||
{
|
||||
Player.m_localPlayer.Message(MessageHud.MessageType.Center,
|
||||
$"The pile is broken. {bound.Count} fall where they stand.");
|
||||
ModText.Get("rov_msg_skeleton_pile_broken_fall_where_they", bound.Count));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue