feat(text): status effect names and tooltips come from translation files

Every status effect the mod registers now carries a $rov_se_ token instead
of English, and status_effects.json holds the texts in English and Italian.
Valheim localizes both fields itself when it shows them. The blood
potion's tooltip has numbers in it, so SE_BloodPotion fills its $1 and $2
in GetTooltipString, at display time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kanym 2026-09-26 19:51:10 +02:00
commit 9bf144aedc
16 changed files with 203 additions and 66 deletions

View file

@ -58,7 +58,7 @@ namespace RacesOfValheim
var se = ScriptableObject.CreateInstance<SE_SkadiStats>();
se.name = "SE_SkadiStats";
se.m_name = "Skadi's Blessing";
se.m_name = "$rov_se_skadi_stats_name";
// Icon
GameObject drakeTrophy = PrefabManager.Cache.GetPrefab<ItemDrop>("TrophyHatchling")?.gameObject;
@ -81,14 +81,14 @@ namespace RacesOfValheim
skadiCdSE = ScriptableObject.CreateInstance<SE_FormCooldown>();
skadiCdSE.name = "SE_SkadiCooldown";
skadiCdSE.m_name = "Dragon Form Cooldown";
skadiCdSE.m_name = "$rov_se_skadi_formcd_name";
skadiCdSE.m_icon = dragonIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(skadiCdSE, fixReference: false));
skadiFormSE = ScriptableObject.CreateInstance<SE_SkadiForm>();
skadiFormSE.name = "SE_SkadiForm";
skadiFormSE.m_name = "Dragon Form";
skadiFormSE.m_tooltip = "Your dragon shape holds for a while longer.";
skadiFormSE.m_name = "$rov_se_skadi_form_name";
skadiFormSE.m_tooltip = "$rov_se_skadi_form_tooltip";
skadiFormSE.m_icon = dragonIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(skadiFormSE, fixReference: false));
@ -96,15 +96,15 @@ namespace RacesOfValheim
// differently from a dragon attack on cooldown at a glance.
var spellCd = ScriptableObject.CreateInstance<SE_SkadiAbilityCooldown>();
spellCd.name = SPELL_COOLDOWN_SE;
spellCd.m_name = "Cold Spell";
spellCd.m_tooltip = "The frost must gather again before you may cast.";
spellCd.m_name = "$rov_se_skadi_coldspellcd_name";
spellCd.m_tooltip = "$rov_se_skadi_coldspellcd_tooltip";
spellCd.m_icon = GetItemIcon("StaffIceShards") ?? dragonIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(spellCd, fixReference: false));
var attackCd = ScriptableObject.CreateInstance<SE_SkadiAbilityCooldown>();
attackCd.name = ATTACK_COOLDOWN_SE;
attackCd.m_name = "Dragon Attack";
attackCd.m_tooltip = "Your dragon shape must ready itself to strike again.";
attackCd.m_name = "$rov_se_skadi_dragonattackcd_name";
attackCd.m_tooltip = "$rov_se_skadi_dragonattackcd_tooltip";
attackCd.m_icon = GetItemIcon("TrophyHatchling") ?? dragonIcon;
ItemManager.Instance.AddStatusEffect(new CustomStatusEffect(attackCd, fixReference: false));
}

View file

@ -23,8 +23,8 @@ namespace RacesOfValheim
{
base.Setup(character);
name = "SE_SkadiStats";
m_name = "Skadi's Aura";
m_tooltip = "Empowered by the frost.";
m_name = "$rov_se_skadi_aura_name";
m_tooltip = "$rov_se_skadi_aura_tooltip";
}
// What the last UpdateStats call actually wrote. SEMan.AddStatusEffect stores a Clone() of