fix(input): abilities no longer die while a movement key is held
BepInEx's KeyboardShortcut.IsDown() ends in ModifierKeyTest, which requires that no key outside the shortcut is currently held - it only exempts the mouse buttons. That is right for a config-menu hotkey and wrong for a game ability: holding W (or any other movement key) made every bound ability in the mod stop responding, for every race, mouse bindings included. Vanilla attacks kept working because they go through ZInput, which is what made it look like a Skadi/dragon bug. Adds RaceInput.IsDownIgnoringHeldKeys / IsPressedIgnoringHeldKeys - main key down plus every modifier held, without the blocking rule - and switches all 27 call sites across Aswid, Dvergar, Fenrir, Skadi, Trenta and Trol over to them. Arrived with the rebindable-keybind work that shipped in 1.4.0.
This commit is contained in:
parent
a38d1ec4b7
commit
25795a05e9
9 changed files with 62 additions and 22 deletions
|
|
@ -529,7 +529,7 @@ namespace RacesOfValheim
|
|||
ZNetView nview = __instance.GetComponent<ZNetView>();
|
||||
if (nview != null && nview.IsValid() && nview.GetZDO().GetString("RacesOfValheim_Race", "Human") == "Aswid")
|
||||
{
|
||||
if (__instance == Player.m_localPlayer && RaceInput.Allowed && AswidConfig.ToggleDevourKey.Value.IsDown())
|
||||
if (__instance == Player.m_localPlayer && RaceInput.Allowed && AswidConfig.ToggleDevourKey.Value.IsDownIgnoringHeldKeys())
|
||||
{
|
||||
AswidRace.DevourEnabled = !AswidRace.DevourEnabled;
|
||||
string msg = AswidRace.DevourEnabled ? "Devour Ability: ENABLED" : "Devour Ability: DISABLED";
|
||||
|
|
|
|||
|
|
@ -387,14 +387,14 @@ namespace RacesOfValheim
|
|||
|
||||
if (RaceInput.Allowed)
|
||||
{
|
||||
if (AswidConfig.BatFormKey.Value.IsDown()) { TryTransformWithRules(AswidProgression.GetGKeyRules(state)); return; }
|
||||
if (AswidConfig.MistFormKey.Value.IsDown()) { TryToggleMistForm(); return; }
|
||||
if (AswidConfig.EclipseKey.Value.IsDown())
|
||||
if (AswidConfig.BatFormKey.Value.IsDownIgnoringHeldKeys()) { TryTransformWithRules(AswidProgression.GetGKeyRules(state)); return; }
|
||||
if (AswidConfig.MistFormKey.Value.IsDownIgnoringHeldKeys()) { TryToggleMistForm(); return; }
|
||||
if (AswidConfig.EclipseKey.Value.IsDownIgnoringHeldKeys())
|
||||
{
|
||||
TryCastEclipse(state);
|
||||
return;
|
||||
}
|
||||
if (AswidConfig.TameKey.Value.IsDown())
|
||||
if (AswidConfig.TameKey.Value.IsDownIgnoringHeldKeys())
|
||||
{
|
||||
TryTameHoverObject(state);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue