feat(text): item, piece and creature names come from translation files

The mod's own items, build pieces and summoned creatures now carry
$rov_item_, $rov_piece_ and $rov_creature_ tokens for their names and
descriptions, and items.json holds the texts in English and Italian.
Valheim localizes these fields wherever it shows them: tooltips, hover
texts, messages, the build menu.

Where a name doubles as an identifier, both sides use the same constant,
so the comparisons still hold. The Aswid foods keep their prefix as a
constant for the refinery's check and now name the creature with its
vanilla token, so "Boar" translates too. The Furling crops get one whole
description per crop instead of an English sentence with the metal dropped
in. The Race Menu Ward's panel title is a mod UI Text, so it reads the
translation directly.

Saves are unaffected: items and eaten foods are stored by prefab name.
The Sverm hive's goods stay for the merchant step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kanym 2026-09-26 19:58:53 +02:00
commit b177c89c71
34 changed files with 405 additions and 142 deletions

View file

@ -22,7 +22,7 @@ namespace RacesOfValheim
public static class SvermBlisterTick
{
public const string PrefabName = "SvermBlisterTick";
public const string DisplayName = "Blister Tick";
public const string DisplayName = "$rov_creature_sverm_blistertick_name";
private const string SourcePrefab = "Tick";
/// <summary>How many slots this nest has bought. Permanent, and the respawn reads it.</summary>

View file

@ -42,7 +42,7 @@ namespace RacesOfValheim
/// longer resolve. The display name below is the only half a player ever reads.
/// </summary>
public const string ItemName = "SvermMaulclaws";
public const string ItemDisplayName = "Chitin Claws";
public const string ItemDisplayName = "$rov_item_sverm_claws_name";
/// <summary>Row in the reserved column the claws sit on. The other three await the carapace.</summary>
private const int ClawRow = 0;
@ -80,7 +80,7 @@ namespace RacesOfValheim
{
ItemDrop.ItemData.SharedData shared = drop.m_itemData.m_shared;
shared.m_name = ItemDisplayName;
shared.m_description = "Grown, not forged. They do not come off.";
shared.m_description = "$rov_item_sverm_claws_desc";
// Quest item: Valheim refuses to drop, trade or stack these. It is the cheapest
// honest way to say "this is part of your body" without a patch per verb.

View file

@ -444,7 +444,7 @@ namespace RacesOfValheim
public static readonly float MarketSize = 1.6f; // metres, the borrowed model's largest side
// ─── Seeker Worker ───────────────────────────────────────────────────
public const string WorkerDisplayName = "Seeker Worker";
public const string WorkerDisplayName = "$rov_creature_sverm_worker_name";
public static readonly float WorkerScale = 0.5f;
public static readonly float WorkerHealthFraction = 0.5f;
public static readonly float WorkerDamageFraction = 0.5f;

View file

@ -95,7 +95,7 @@ namespace RacesOfValheim
// station ends up unplaceable with no error.
Piece piece = prefab.GetComponent<Piece>() ?? prefab.AddComponent<Piece>();
piece.m_name = DisplayName;
piece.m_description = "The colony begins here. Everything else grows out of it.";
piece.m_description = "$rov_piece_sverm_broodmound_desc";
piece.m_groundPiece = true;
piece.m_groundOnly = true;
piece.m_cultivatedGroundOnly = false;

View file

@ -258,7 +258,7 @@ namespace RacesOfValheim
public static class SvermHiveMarketPiece
{
public const string PieceName = "SvermHiveMarket";
public const string DisplayName = "Hive Market";
public const string DisplayName = "$rov_piece_sverm_hivemarket_name";
/// <summary>Scenery only, and checked rather than trusted - see SvermHive.MouthCandidates.</summary>
private static readonly string[] SourceCandidates =
@ -325,7 +325,7 @@ namespace RacesOfValheim
piece.m_craftingStation = null;
piece.m_resources = new Piece.Requirement[0];
piece.m_name = DisplayName;
piece.m_description = "Where the colony trades. It spends the tank of the nest it stands in.";
piece.m_description = "$rov_piece_sverm_hivemarket_desc";
piece.m_groundPiece = true;
piece.m_groundOnly = true;
piece.m_canBeRemoved = true;

View file

@ -101,6 +101,6 @@ namespace RacesOfValheim
public static class SvermHiveNames
{
public const string PieceName = "SvermBroodMound";
public const string PieceDisplayName = "Brood Mound";
public const string PieceDisplayName = "$rov_piece_sverm_broodmound_name";
}
}