feat(skadi): add rebindable keybinds for abilities and special attacks
Adds a Skadi - Keybinds config section (bound first, ahead of the other Skadi sections) covering every ability/attack trigger: dragon primary attack, cold spell cast, breath attack, Fader spin, flight toggle, and the three transform keys (Drake/Moder/Fader). Defaults match the previous fixed inputs exactly. SkadiAttackPatch's kick-suppression check now reads the configured Cold Spell key instead of a hardcoded Middle Mouse, so it stays correct if that key is rebound. Entries within Keybinds carry an explicit Order (via the new ConfigurationManagerAttributes shim, per CONFIGURATION-MANAGER-HOWTO.md) so they list as attack -> cast -> breath -> spin -> flight -> the three transform keys, rather than alphabetically.
This commit is contained in:
parent
c088eb74f4
commit
7708599ff9
5 changed files with 108 additions and 22 deletions
37
JotunnModStub/ConfigurationManagerAttributes.cs
Normal file
37
JotunnModStub/ConfigurationManagerAttributes.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using BepInEx.Configuration;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
/// <summary>
|
||||
/// Duck-typed by Configuration Manager (matched by field name via reflection, not by type),
|
||||
/// so nothing here needs a reference to ConfigurationManager.dll and the mod works with or
|
||||
/// without that plugin installed - see CONFIGURATION-MANAGER-HOWTO.md, "Overriding default
|
||||
/// Configuration Manager behavior". Kept internal, not public, so this shape can never collide
|
||||
/// with another mod's copy of the same trick.
|
||||
///
|
||||
/// Only the fields RacesOfValheim actually sets (Order, CustomDrawer, HideDefaultButton,
|
||||
/// ReadOnly) need to be correct; the rest of Configuration Manager's documented set is kept
|
||||
/// alongside them so future config additions do not need a second copy of this file.
|
||||
/// </summary>
|
||||
internal sealed class ConfigurationManagerAttributes
|
||||
{
|
||||
// Most of these are read by Configuration Manager itself via reflection and are never
|
||||
// assigned from our own code, which is exactly what CS0649 is warning about here.
|
||||
#pragma warning disable 0649
|
||||
public Action<ConfigEntryBase> CustomDrawer;
|
||||
public bool? Browsable;
|
||||
public string Category;
|
||||
public object DefaultValue;
|
||||
public bool? HideDefaultButton;
|
||||
public bool? HideSettingName;
|
||||
public string Description;
|
||||
public string DispName;
|
||||
public int? Order;
|
||||
public bool? ReadOnly;
|
||||
public bool? IsAdvanced;
|
||||
public Func<object, string> ObjToStr;
|
||||
public Func<string, object> StrToObj;
|
||||
#pragma warning restore 0649
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue