feat(text): hover texts come from translation files

What the stations, thralls, the ward and the hive show under the
crosshair now reads its text through ModText.Get, and hover.json holds
50 texts in English and Italian.

The Aswid thralls and the Race Menu Ward wrote the use key as a literal
E; they now use $KEY_Use, which shows the key the player actually bound.
For that to work, ModText.Get runs a second localization pass when a $
is left in the result: Valheim resolves tokens once and never looks
inside what it inserted, and hover texts go to the HUD without another
pass.

The Sverm hive stage names stay English for now: the compendium and the
hive's goods show them too, and those come with the merchants step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kanym 2026-09-28 13:55:14 +02:00
commit 99a1817eb0
16 changed files with 164 additions and 79 deletions

View file

@ -142,15 +142,15 @@ namespace RacesOfValheim
if (isEnslaved)
{
bool following = m_ai != null && m_ai.GetFollowTarget() != null;
return following ? "[<color=yellow><b>E</b></color>] Stay" : "[<color=yellow><b>E</b></color>] Follow";
return (following ? ModText.Get("rov_hover_aswid_stay") : ModText.Get("rov_hover_aswid_follow"));
}
else
{
if (BossProgressionManager.GetCurrentProgressionState() < 6) return "";
float cd = AswidRace.GetEnslaveCooldown();
if (cd > 0) return $"[<color=red>E</color>] Dominate (Cooldown: {Mathf.CeilToInt(cd / 60f)}m)";
return "[<color=yellow><b>E</b></color>] Dominate";
if (cd > 0) return ModText.Get("rov_hover_aswid_dominate_cooldown_m", Mathf.CeilToInt(cd / 60f));
return ModText.Get("rov_hover_aswid_dominate");
}
}

View file

@ -137,12 +137,11 @@ namespace RacesOfValheim
if (servant == null)
{
return m_title + "\nNo servant stands here.\n" +
"[<color=yellow><b>$KEY_Use</b></color>] Raise one";
return ModText.Get("rov_hover_butler_no_servant_stands_here_raise", m_title);
}
string status = servant.Status;
if (string.IsNullOrEmpty(status)) status = "Waiting.";
if (string.IsNullOrEmpty(status)) status = ModText.Get("rov_hover_butler_waiting");
return m_title + "\n" + status;
}

View file

@ -328,21 +328,20 @@ namespace RacesOfValheim
if (thrall.Kind == DraughSpawner.KindElite) aliveElite++; else aliveNormal++;
}
string body = $"flesh {Mathf.Floor(GetFlesh())}/{DraughSpawner.FleshPerThrall}, " +
$"risen {aliveNormal}/{AliveCap()}, waiting {GetReserve()}/{DraughSpawner.ReserveCap}";
string body = ModText.Get("rov_hover_draugh_flesh_risen_waiting", Mathf.Floor(GetFlesh()), DraughSpawner.FleshPerThrall, aliveNormal, AliveCap(), GetReserve(), DraughSpawner.ReserveCap);
if (IsUpgraded())
{
body += $"\nofficers {aliveElite}/{EliteCap()}, waiting {GetReserveElite()}/{DraughSpawner.ReserveCapElite}";
body += ModText.Get("rov_hover_draugh_officers_waiting", aliveElite, EliteCap(), GetReserveElite(), DraughSpawner.ReserveCapElite);
}
if (m_respawnTimer > 0f)
{
int left = Mathf.Max(1, Mathf.CeilToInt(DraughSpawner.RespawnSeconds - m_respawnTimer));
body += $"\nnext rises in {left}s";
body += ModText.Get("rov_hover_draugh_next_rises_s", left);
}
body += "\n[<color=yellow><b>$KEY_Use</b></color>] Feed it flesh, or a draugr's head";
body += ModText.Get("rov_hover_draugh_feed_flesh_or_draugr_s");
return Localization.instance.Localize($"{DraughSpawner.PieceDisplayName} ({body})");
}

View file

@ -277,16 +277,16 @@ namespace RacesOfValheim
private string Hover()
{
string body = $"contracts {CountGroups()}/{DvergarBanco.MaxTroops}";
string body = ModText.Get("rov_hover_dvergar_contracts", CountGroups(), DvergarBanco.MaxTroops);
// Said in as many words: a player who cannot see their own discount will read the lower
// number in the window as a mistake.
float discount = Mathf.Clamp01(DvergarProgression.Current.TraderBuyDiscount);
if (discount > 0f) body += $"\nyour seal is worth {Mathf.RoundToInt(discount * 100f)}% off";
if (discount > 0f) body += ModText.Get("rov_hover_dvergar_seal_worth_off", Mathf.RoundToInt(discount * 100f));
if (!IsUpgraded()) body += "\n(what the Queen left behind buys two more crews)";
if (!IsUpgraded()) body += ModText.Get("rov_hover_dvergar_what_queen_left_behind_buys");
body += "\n[<color=yellow><b>$KEY_Use</b></color>] Read the ledger";
body += ModText.Get("rov_hover_dvergar_read_ledger");
return Localization.instance.Localize($"{DvergarBanco.PieceDisplayName} ({body})");
}

View file

@ -252,14 +252,12 @@ namespace RacesOfValheim
string body;
if (doses <= 0 || string.IsNullOrEmpty(brew))
{
body = "empty\n[<color=yellow><b>$KEY_Use</b></color>] Pour a brew in";
body = ModText.Get("rov_hover_dvergar_empty_pour_brew");
}
else
{
int waiting = InRange().Count;
body = $"{DvergarBotte.BrewDisplayName(brew)} {doses}/{DvergarBotte.MaxDoses}" +
$"\n{waiting} at the barrel" +
$"\n[<color=yellow><b>$KEY_Use</b></color>] Pour a round";
body = ModText.Get("rov_hover_dvergar_at_barrel_pour_round", DvergarBotte.BrewDisplayName(brew), doses, DvergarBotte.MaxDoses, waiting);
}
return Localization.instance.Localize($"{DvergarBotte.PieceDisplayName} ({body})");

View file

@ -440,13 +440,10 @@ namespace RacesOfValheim
{
Count(out int wolves, out int ulv, out int fenrir);
string body = $"meat {Mathf.Floor(GetFeed())}/{FenrirMangiatoia.TankCap}" +
$"\nwolves {wolves}/{WolfCap()}, ulv {ulv}/{UlvCap()}";
string body = ModText.Get("rov_hover_fenrir_meat_wolves_ulv", Mathf.Floor(GetFeed()), FenrirMangiatoia.TankCap, wolves, WolfCap(), ulv, UlvCap());
// Said in as many words, because the upgrade is deliberately invisible on the model.
body += IsUpgraded()
? $", fenrir {fenrir}/{FenrirCap()}"
: "\nthe blood is thin here - it raises no fenrir yet";
body += (IsUpgraded() ? ModText.Get("rov_hover_fenrir_fenrir", fenrir, FenrirCap()) : ModText.Get("rov_hover_fenrir_blood_thin_here_raises_no"));
if (m_waitingFor != null)
{
@ -458,16 +455,14 @@ namespace RacesOfValheim
: m_waitingFor == FenrirMangiatoia.KindUlv ? FenrirMangiatoia.UlvCost
: FenrirMangiatoia.FenrirCost;
body += GetFeed() < cost
? $"\nnot enough meat for the next one ({cost} needed)"
: $"\nnext in {Mathf.Max(1, Mathf.CeilToInt(wait - m_timer))}s";
body += (GetFeed() < cost ? ModText.Get("rov_hover_fenrir_not_enough_meat_next_one", cost) : ModText.Get("rov_hover_fenrir_next_s", Mathf.Max(1, Mathf.CeilToInt(wait - m_timer))));
}
else
{
body += "\nthe pack is whole";
body += ModText.Get("rov_hover_fenrir_pack_whole");
}
body += "\n[<color=yellow><b>$KEY_Use</b></color>] Fill it with meat";
body += ModText.Get("rov_hover_fenrir_fill_with_meat");
return Localization.instance.Localize($"{FenrirMangiatoia.PieceDisplayName} ({body})");
}

View file

@ -28,7 +28,14 @@ namespace RacesOfValheim
string[] words = args
.Select(a => Localization.instance.Localize(a?.ToString() ?? ""))
.ToArray();
return Localization.instance.Localize("$" + key, words);
string text = Localization.instance.Localize("$" + key, words);
// Valheim resolves tokens in one pass and never looks inside what it put in, so a
// "$KEY_Use" written in a translation came out as it was. Places that localize the
// result again (MessageHud, the stations' own Localize) hid that; hover texts returned
// straight to the HUD did not. A second pass costs nothing when there is no $ left.
if (text.IndexOf('$') >= 0) text = Localization.instance.Localize(text);
return text;
}
/// <summary>

View file

@ -171,13 +171,11 @@ namespace RacesOfValheim
public string GetHoverText()
{
string mode = BossProgressionManager.UsePersonalProgression ? "Personal" : "World";
string mode = (BossProgressionManager.UsePersonalProgression ? ModText.Get("rov_hover_ward_personal") : ModText.Get("rov_hover_ward_world"));
int state = BossProgressionManager.GetCurrentProgressionState();
string boss = BossProgressionManager.GetBossNameForState(state);
string boss = BossProgressionManager.GetBossTokenForState(state);
return $"Race Menu Ward\n{mode} progression - {boss} ({state}/{BossProgressionManager.MaxState})\n" +
"[<color=yellow><b>E</b></color>] Open\n" +
"[<color=yellow><b>Use item</b></color>] Offer a boss relic";
return ModText.Get("rov_hover_ward_race_menu_ward_progression_open", mode, boss, state, BossProgressionManager.MaxState);
}
public bool Interact(Humanoid user, bool hold, bool alt)

View file

@ -362,25 +362,21 @@ namespace RacesOfValheim
// upgraded, so there was no way to know the cap was two until ten trophies had gone in.
// Every shelf is now visible whether or not it can be used yet, and says why when it cannot.
string body =
$"\nmelee {alive[SkeletonBonePile.KindMelee]}/{GetSlots(SkeletonBonePile.KindMelee)} of {MeleeCap()}" +
$"\narchers {alive[SkeletonBonePile.KindRanged]}/{GetSlots(SkeletonBonePile.KindRanged)} of {RangedCap()}" +
$"\nrotten {alive[SkeletonBonePile.KindRancid]}/{GetSlots(SkeletonBonePile.KindRancid)} of {RancidCap()}";
ModText.Get("rov_hover_skeleton_melee_archers_rotten", alive[SkeletonBonePile.KindMelee], GetSlots(SkeletonBonePile.KindMelee), MeleeCap(), alive[SkeletonBonePile.KindRanged], GetSlots(SkeletonBonePile.KindRanged), RangedCap(), alive[SkeletonBonePile.KindRancid], GetSlots(SkeletonBonePile.KindRancid), RancidCap());
if (!IsUpgraded()) body += " (needs a Greater Cursed Skull)";
if (!IsUpgraded()) body += ModText.Get("rov_hover_skeleton_needs_greater_cursed_skull");
int bonesToward = m_nview.GetZDO().GetInt(KeyBones);
int placesLeft = TotalCap() - PaidSlots();
body += placesLeft > 0
? $"\nbone {bonesToward}/{SkeletonBonePile.BonesPerSlot} toward the next of {placesLeft} places"
: "\nevery place is bought";
body += (placesLeft > 0 ? ModText.Get("rov_hover_skeleton_bone_toward_next_places", bonesToward, SkeletonBonePile.BonesPerSlot, placesLeft) : ModText.Get("rov_hover_skeleton_every_place_bought"));
if (m_respawnTimer > 0f)
{
int left = Mathf.Max(1, Mathf.CeilToInt(RespawnSeconds() - m_respawnTimer));
body += $"\nnext rises in {left}s";
body += ModText.Get("rov_hover_skeleton_next_rises_s", left);
}
body += "\n[<color=yellow><b>$KEY_Use</b></color>] Bone in hand to buy a place, empty hands to move the line";
body += ModText.Get("rov_hover_skeleton_bone_hand_buy_place_empty");
return Localization.instance.Localize($"{SkeletonBonePile.PieceDisplayName} ({body})");
}

View file

@ -461,11 +461,7 @@ namespace RacesOfValheim
// Both numbers, always, even when nothing is going down. A line that appears and
// disappears is one the player has to notice twice before they believe it.
return $"{SvermHiveStage.NameOf(SvermHiveStage.Of(transform))}\n" +
SvermHiveReadout.Tank(transform) +
$"Beehives {infected} taken of {SvermConfigManagement.Beehives} allowed, {beehives} in range\n" +
SvermWorker.Readout(transform.position) +
"[<color=yellow><b>$KEY_Use</b></color>] Feed it a stack";
return ModText.Get("rov_hover_sverm_beehives_taken_allowed_range_feed", SvermHiveStage.NameOf(SvermHiveStage.Of(transform)), SvermHiveReadout.Tank(transform), infected, SvermConfigManagement.Beehives, beehives, SvermWorker.Readout(transform.position));
}
// New in Valheim 1.0: Hoverable gained this. Every vanilla implementation returns a

View file

@ -222,17 +222,15 @@ namespace RacesOfValheim
SvermHiveBehaviour hive = Hive;
if (hive == null) return Title;
return $"{Title}\n" +
SvermHiveReadout.Tank(hive.transform) +
$"[<color=yellow><b>$KEY_Use</b></color>] {Prompt}";
return ModText.Get("rov_hover_sverm_msg", Title, SvermHiveReadout.Tank(hive.transform), Prompt);
}
}
/// <summary>The hive at the foot of the nest. Press E, a stack goes in.</summary>
public class SvermHiveStomach : SvermHiveMouth
{
protected override string Title => "Hive Stomach";
protected override string Prompt => "Feed it a stack";
protected override string Title => "$rov_hover_sverm_stomach_title";
protected override string Prompt => "$rov_hover_sverm_stomach_prompt";
protected override bool Use(SvermHiveBehaviour hive, Player player)
{
@ -459,13 +457,11 @@ namespace RacesOfValheim
SvermHiveBehaviour nest = Nest;
if (nest == null)
{
return $"{SvermHiveMarketPiece.DisplayName}\n" +
$"No hive within {SvermConfigManagement.AuraRadius:0} metres.";
return ModText.Get("rov_hover_sverm_market_no_hive", SvermHiveMarketPiece.DisplayName,
SvermConfigManagement.AuraRadius.ToString("0"));
}
return $"{SvermHiveMarketPiece.DisplayName}\n" +
SvermHiveReadout.Tank(nest.transform) +
"[<color=yellow><b>$KEY_Use</b></color>] Trade with the hive";
return ModText.Get("rov_hover_sverm_trade_with_hive", SvermHiveMarketPiece.DisplayName, SvermHiveReadout.Tank(nest.transform));
}
}
@ -474,9 +470,10 @@ namespace RacesOfValheim
{
public static string Tank(Transform nest)
{
return $"Biomass {SvermBiomass.Bank(nest):0} / {SvermBiomass.Capacity(nest):0}\n" +
$"Digesting {SvermBiomass.Digesting(nest):0}\n" +
$"Brood eggs {SvermBroodEggs.Count(nest)} / {SvermBroodEggs.Cap(nest)}\n";
return ModText.Get("rov_hover_sverm_tank",
SvermBiomass.Bank(nest).ToString("0"), SvermBiomass.Capacity(nest).ToString("0"),
SvermBiomass.Digesting(nest).ToString("0"),
SvermBroodEggs.Count(nest), SvermBroodEggs.Cap(nest));
}
}

View file

@ -0,0 +1,52 @@
{
"rov_hover_aswid_dominate": "[<color=yellow><b>$KEY_Use</b></color>] Dominate",
"rov_hover_aswid_dominate_cooldown_m": "[<color=red>$KEY_Use</color>] Dominate (Cooldown: $1m)",
"rov_hover_aswid_follow": "[<color=yellow><b>$KEY_Use</b></color>] Follow",
"rov_hover_aswid_stay": "[<color=yellow><b>$KEY_Use</b></color>] Stay",
"rov_hover_butler_no_servant_stands_here_raise": "$1\nNo servant stands here.\n[<color=yellow><b>$KEY_Use</b></color>] Raise one",
"rov_hover_butler_waiting": "Waiting.",
"rov_hover_draugh_feed_flesh_or_draugr_s": "\n[<color=yellow><b>$KEY_Use</b></color>] Feed it flesh, or a draugr's head",
"rov_hover_draugh_flesh_risen_waiting": "flesh $1/$2, risen $3/$4, waiting $5/$6",
"rov_hover_draugh_next_rises_s": "\nnext rises in $1s",
"rov_hover_draugh_officers_waiting": "\nofficers $1/$2, waiting $3/$4",
"rov_hover_dvergar_at_barrel_pour_round": "$1 $2/$3\n$4 at the barrel\n[<color=yellow><b>$KEY_Use</b></color>] Pour a round",
"rov_hover_dvergar_contracts": "contracts $1/$2",
"rov_hover_dvergar_empty_pour_brew": "empty\n[<color=yellow><b>$KEY_Use</b></color>] Pour a brew in",
"rov_hover_dvergar_read_ledger": "\n[<color=yellow><b>$KEY_Use</b></color>] Read the ledger",
"rov_hover_dvergar_seal_worth_off": "\nyour seal is worth $1% off",
"rov_hover_dvergar_what_queen_left_behind_buys": "\n(what the Queen left behind buys two more crews)",
"rov_hover_fenrir_blood_thin_here_raises_no": "\nthe blood is thin here - it raises no fenrir yet",
"rov_hover_fenrir_fenrir": ", fenrir $1/$2",
"rov_hover_fenrir_fill_with_meat": "\n[<color=yellow><b>$KEY_Use</b></color>] Fill it with meat",
"rov_hover_fenrir_meat_wolves_ulv": "meat $1/$2\nwolves $3/$4, ulv $5/$6",
"rov_hover_fenrir_next_s": "\nnext in $1s",
"rov_hover_fenrir_not_enough_meat_next_one": "\nnot enough meat for the next one ($1 needed)",
"rov_hover_fenrir_pack_whole": "\nthe pack is whole",
"rov_hover_skeleton_bone_hand_buy_place_empty": "\n[<color=yellow><b>$KEY_Use</b></color>] Bone in hand to buy a place, empty hands to move the line",
"rov_hover_skeleton_bone_toward_next_places": "\nbone $1/$2 toward the next of $3 places",
"rov_hover_skeleton_every_place_bought": "\nevery place is bought",
"rov_hover_skeleton_melee_archers_rotten": "\nmelee $1/$2 of $3\narchers $4/$5 of $6\nrotten $7/$8 of $9",
"rov_hover_skeleton_needs_greater_cursed_skull": " (needs a Greater Cursed Skull)",
"rov_hover_skeleton_next_rises_s": "\nnext rises in $1s",
"rov_hover_sverm_beehives_taken_allowed_range_feed": "$1\n$2Beehives $3 taken of $4 allowed, $5 in range\n$6[<color=yellow><b>$KEY_Use</b></color>] Feed it a stack",
"rov_hover_sverm_market_no_hive": "$1\nNo hive within $2 metres.",
"rov_hover_sverm_msg": "$1\n$2[<color=yellow><b>$KEY_Use</b></color>] $3",
"rov_hover_sverm_stomach_prompt": "Feed it a stack",
"rov_hover_sverm_stomach_title": "Hive Stomach",
"rov_hover_sverm_tank": "Biomass $1 / $2\nDigesting $3\nBrood eggs $4 / $5\n",
"rov_hover_sverm_trade_with_hive": "$1\n$2[<color=yellow><b>$KEY_Use</b></color>] Trade with the hive",
"rov_hover_trenta_flesh_feed_raw_flesh": "flesh $1/$2\n[<color=yellow><b>$KEY_Use</b></color>] Feed it raw flesh",
"rov_hover_trenta_grove_growing": "$1 (growing, $2 minutes left)",
"rov_hover_trenta_grove_grown": "$1 ($2 $3/$4, honey $5)\n[<color=yellow><b>$KEY_Use</b></color>] Feed it Fertilizer",
"rov_hover_trenta_honey_full": "$1, full",
"rov_hover_trenta_honey_next": "$1, next in $2 min",
"rov_hover_trenta_honey_none": "none (no honey item found)",
"rov_hover_trenta_ready_empty": "ready: $1 $2\n[<color=yellow><b>$KEY_Use</b></color>] Empty it",
"rov_hover_trenta_rotting_minutes_left": "rotting, $1 minutes left",
"rov_hover_trol_call_warbands": "\n[<color=yellow><b>$KEY_Use</b></color>] Call the warbands",
"rov_hover_trol_warbands": "warbands $1/$2",
"rov_hover_trol_yagluth_drop_hand_buys_king": "\n(a Yagluth drop in hand buys a king's head, and two more bands)",
"rov_hover_ward_personal": "Personal",
"rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\n$1 progression - $2 ($3/$4)\n[<color=yellow><b>$KEY_Use</b></color>] Open\n[<color=yellow><b>Use item</b></color>] Offer a boss relic",
"rov_hover_ward_world": "World"
}

View file

@ -0,0 +1,52 @@
{
"rov_hover_aswid_dominate": "[<color=yellow><b>$KEY_Use</b></color>] Domina",
"rov_hover_aswid_dominate_cooldown_m": "[<color=red>$KEY_Use</color>] Domina (ricarica: $1m)",
"rov_hover_aswid_follow": "[<color=yellow><b>$KEY_Use</b></color>] Segui",
"rov_hover_aswid_stay": "[<color=yellow><b>$KEY_Use</b></color>] Resta",
"rov_hover_butler_no_servant_stands_here_raise": "$1\nQui non c'è nessun servitore.\n[<color=yellow><b>$KEY_Use</b></color>] Fanne alzare uno",
"rov_hover_butler_waiting": "In attesa.",
"rov_hover_draugh_feed_flesh_or_draugr_s": "\n[<color=yellow><b>$KEY_Use</b></color>] Nutrilo di carne, o della testa di un draugr",
"rov_hover_draugh_flesh_risen_waiting": "carne $1/$2, risorti $3/$4, in attesa $5/$6",
"rov_hover_draugh_next_rises_s": "\nil prossimo si alza tra $1s",
"rov_hover_draugh_officers_waiting": "\nufficiali $1/$2, in attesa $3/$4",
"rov_hover_dvergar_at_barrel_pour_round": "$1 $2/$3\n$4 al barile\n[<color=yellow><b>$KEY_Use</b></color>] Versa un giro",
"rov_hover_dvergar_contracts": "contratti $1/$2",
"rov_hover_dvergar_empty_pour_brew": "vuoto\n[<color=yellow><b>$KEY_Use</b></color>] Versaci una bevanda",
"rov_hover_dvergar_read_ledger": "\n[<color=yellow><b>$KEY_Use</b></color>] Leggi il registro",
"rov_hover_dvergar_seal_worth_off": "\nil tuo sigillo vale uno sconto del $1%",
"rov_hover_dvergar_what_queen_left_behind_buys": "\n(ciò che la Regina ha lasciato compra altre due squadre)",
"rov_hover_fenrir_blood_thin_here_raises_no": "\nqui il sangue è debole: non fa ancora nascere fenrir",
"rov_hover_fenrir_fenrir": ", fenrir $1/$2",
"rov_hover_fenrir_fill_with_meat": "\n[<color=yellow><b>$KEY_Use</b></color>] Riempila di carne",
"rov_hover_fenrir_meat_wolves_ulv": "carne $1/$2\nlupi $3/$4, ulv $5/$6",
"rov_hover_fenrir_next_s": "\nil prossimo tra $1s",
"rov_hover_fenrir_not_enough_meat_next_one": "\nnon c'è abbastanza carne per il prossimo (ne serve $1)",
"rov_hover_fenrir_pack_whole": "\nil branco è al completo",
"rov_hover_skeleton_bone_hand_buy_place_empty": "\n[<color=yellow><b>$KEY_Use</b></color>] Osso in mano per comprare un posto, mani vuote per muovere la fila",
"rov_hover_skeleton_bone_toward_next_places": "\nossa $1/$2 per il prossimo dei $3 posti",
"rov_hover_skeleton_every_place_bought": "\nogni posto è comprato",
"rov_hover_skeleton_melee_archers_rotten": "\nmischia $1/$2 di $3\narcieri $4/$5 di $6\nrancidi $7/$8 di $9",
"rov_hover_skeleton_needs_greater_cursed_skull": " (serve un teschio maledetto superiore)",
"rov_hover_skeleton_next_rises_s": "\nil prossimo si alza tra $1s",
"rov_hover_sverm_beehives_taken_allowed_range_feed": "$1\n$2Alveari $3 occupati su $4 consentiti, $5 nel raggio\n$6[<color=yellow><b>$KEY_Use</b></color>] Dagli da mangiare una pila",
"rov_hover_sverm_market_no_hive": "$1\nNessun alveare entro $2 metri.",
"rov_hover_sverm_msg": "$1\n$2[<color=yellow><b>$KEY_Use</b></color>] $3",
"rov_hover_sverm_stomach_prompt": "Dagli da mangiare una pila",
"rov_hover_sverm_stomach_title": "Stomaco dell'alveare",
"rov_hover_sverm_tank": "Biomassa $1 / $2\nIn digestione $3\nUova della covata $4 / $5\n",
"rov_hover_sverm_trade_with_hive": "$1\n$2[<color=yellow><b>$KEY_Use</b></color>] Commercia con l'alveare",
"rov_hover_trenta_flesh_feed_raw_flesh": "carne $1/$2\n[<color=yellow><b>$KEY_Use</b></color>] Nutrila di carne cruda",
"rov_hover_trenta_grove_growing": "$1 (in crescita, mancano $2 minuti)",
"rov_hover_trenta_grove_grown": "$1 ($2 $3/$4, miele $5)\n[<color=yellow><b>$KEY_Use</b></color>] Nutrilo di fertilizzante",
"rov_hover_trenta_honey_full": "$1, pieno",
"rov_hover_trenta_honey_next": "$1, il prossimo tra $2 min",
"rov_hover_trenta_honey_none": "nessuno (oggetto miele non trovato)",
"rov_hover_trenta_ready_empty": "pronto: $1 $2\n[<color=yellow><b>$KEY_Use</b></color>] Svuotala",
"rov_hover_trenta_rotting_minutes_left": "sta marcendo, mancano $1 minuti",
"rov_hover_trol_call_warbands": "\n[<color=yellow><b>$KEY_Use</b></color>] Chiama le bande da guerra",
"rov_hover_trol_warbands": "bande da guerra $1/$2",
"rov_hover_trol_yagluth_drop_hand_buys_king": "\n(un bottino di Yagluth in mano compra la testa di un re, e altre due bande)",
"rov_hover_ward_personal": "Personale",
"rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\nProgressione $1 - $2 ($3/$4)\n[<color=yellow><b>$KEY_Use</b></color>] Apri\n[<color=yellow><b>Usa oggetto</b></color>] Offri una reliquia di boss",
"rov_hover_ward_world": "del mondo"
}

View file

@ -243,17 +243,15 @@ namespace RacesOfValheim
switch (GetState())
{
case State.Ready:
body = $"ready: {m_yield} {TrentaConfig.FertilizerDisplayName}\n" +
"[<color=yellow><b>$KEY_Use</b></color>] Empty it";
body = ModText.Get("rov_hover_trenta_ready_empty", m_yield, TrentaConfig.FertilizerDisplayName);
break;
case State.Composting:
body = $"rotting, {MinutesLeft()} minutes left";
body = ModText.Get("rov_hover_trenta_rotting_minutes_left", MinutesLeft());
break;
default:
body = $"flesh {Mathf.Floor(GetFlesh())}/{m_capacity}\n" +
"[<color=yellow><b>$KEY_Use</b></color>] Feed it raw flesh";
body = ModText.Get("rov_hover_trenta_flesh_feed_raw_flesh", Mathf.Floor(GetFlesh()), m_capacity);
break;
}

View file

@ -318,34 +318,32 @@ namespace RacesOfValheim
{
if (!IsGrown())
{
return Localization.instance.Localize(
$"{TrentaConfig.GroveDisplayName} (growing, {MinutesLeft()} minutes left)");
return ModText.Get("rov_hover_trenta_grove_growing", TrentaConfig.GroveDisplayName, MinutesLeft());
}
// The honey line is here because it was missing, and its absence is why a grove that
// was quietly producing nothing looked exactly like one that was working.
return Localization.instance.Localize(
$"{TrentaConfig.GroveDisplayName} ({TrentaConfig.FertilizerDisplayName} " +
$"{GetFertilizer()}/{TrentaConfig.GroveFertilizerCapacity}, honey {HoneyStatus()})\n" +
"[<color=yellow><b>$KEY_Use</b></color>] Feed it Fertilizer");
return ModText.Get("rov_hover_trenta_grove_grown", TrentaConfig.GroveDisplayName,
TrentaConfig.FertilizerDisplayName, GetFertilizer(), TrentaConfig.GroveFertilizerCapacity,
HoneyStatus());
}
/// <summary>How much honey is in the crate and how long until the next drop of it.</summary>
private string HoneyStatus()
{
if (m_honeyPrefab == null) return "none (no honey item found)";
if (m_honeyPrefab == null) return ModText.Get("rov_hover_trenta_honey_none");
Inventory inventory = m_container != null ? m_container.GetInventory() : null;
int stored = inventory != null ? CountHoney(inventory) : 0;
string status = $"{stored}/{m_honeyCapacity}";
if (stored >= m_honeyCapacity) return status + ", full";
if (stored >= m_honeyCapacity) return ModText.Get("rov_hover_trenta_honey_full", status);
long stamp = m_nview.GetZDO().GetLong(KeyHoneyTime, 0L);
if (stamp == 0L || ZNet.instance == null) return status;
double left = m_secPerHoney - (ZNet.instance.GetTime() - new DateTime(stamp)).TotalSeconds;
return status + $", next in {Mathf.Max(1, Mathf.CeilToInt((float)left / 60f))} min";
return ModText.Get("rov_hover_trenta_honey_next", status, Mathf.Max(1, Mathf.CeilToInt((float)left / 60f)));
}
// ---------------------------------------------------------------- state

View file

@ -276,14 +276,14 @@ namespace RacesOfValheim
private string Hover()
{
string body = $"warbands {CountGroups()}/{TrolTotem.MaxTroops}";
string body = ModText.Get("rov_hover_trol_warbands", CountGroups(), TrolTotem.MaxTroops);
if (!IsUpgraded()) body += "\n(a Yagluth drop in hand buys a king's head, and two more bands)";
if (!IsUpgraded()) body += ModText.Get("rov_hover_trol_yagluth_drop_hand_buys_king");
// The roster lives in the window now, not in the hover - so this only has to get the player
// to open it. The hold gesture it used to advertise was unreadable: it cycled faster than
// anyone could see what was selected.
body += "\n[<color=yellow><b>$KEY_Use</b></color>] Call the warbands";
body += ModText.Get("rov_hover_trol_call_warbands");
return Localization.instance.Localize($"{TrolTotem.PieceDisplayName} ({body})");
}