feat(trenta): make ability numbers and keybinds BepInEx-configurable

Adds TrentaConfigManagement.cs rather than reusing the TrentaConfig name,
same reasoning as DvergarConfigManagement: that existing class holds
identity constants that must never change (RaceId, status effect and
prefab names), hand-tuned cosmetic placement numbers (skin colour, crown
position), and design-time tables (HealthBonusByState, the per-biome
AwakenedSeedFoods list) left alone under the same boundary drawn for
every other race's progression table.

Only the genuine ability knobs move: Photosynthesis, Purple Rain, Last
Stand/Thorns, Homecoming Portal, Hornet's Nest, Muspell, and the vegan
food duration bonus each get a Configuration Manager section, plus the
three transform/ability keybinds (Purple Rain, Portal, Muspell).
TrentaConfig's fields for those now forward to TrentaConfigManagement
(same const-to-property trick used for Skadi and Dvergar), so every
existing call site kept working unchanged except the three keybind
consumers in TrentaAbilities, which now read the live configured key.

Fixes a BepInEx startup crash caught while testing: the Hornet's Nest
section name used a straight ASCII apostrophe, which
ConfigDefinition.CheckInvalidConfigChars rejects outright (section/key
names may not contain = \n \t \ " ' [ ]). Switched to the typographic
apostrophe (U+2019), which reads the same and isn't on the forbidden list.

Config sections stay bound alphabetically by race (Aswid, Draugh,
Dvergar, Fenrir, Furling, Skadi, Skeleton, Trenta) in
RacesOfValheim.Awake().
This commit is contained in:
kanym 2026-08-06 15:20:10 +02:00
commit 14648aaf62
4 changed files with 206 additions and 38 deletions

View file

@ -23,17 +23,17 @@ namespace RacesOfValheim
// Player.TakeInput, so nothing fires while a map, chest or chat window has focus.
if (!RaceInput.Allowed) return;
if (state >= TrentaConfig.PurpleRainUnlockState && Input.GetKeyDown(TrentaConfig.PurpleRainKey))
if (state >= TrentaConfig.PurpleRainUnlockState && TrentaConfigManagement.PurpleRainKey.Value.IsDown())
{
TryPurpleRain(player);
}
if (state >= TrentaConfig.PortalUnlockState && Input.GetKeyDown(TrentaConfig.PortalKey))
if (state >= TrentaConfig.PortalUnlockState && TrentaConfigManagement.PortalKey.Value.IsDown())
{
TryOpenPortal(player);
}
if (state >= TrentaConfig.MuspellUnlockState && Input.GetKeyDown(TrentaConfig.MuspellKey))
if (state >= TrentaConfig.MuspellUnlockState && TrentaConfigManagement.MuspellKey.Value.IsDown())
{
TrentaMuspell.Toggle(player);
}