Ignore race ability input while a GUI has focus
UnityEngine.Input reads the device directly, so abilities bound to keys or mouse buttons kept firing with the map, the inventory, a chest, the chat or a menu open - clicking an item in a container also swung the transformed attack. Route that input through Player.TakeInput, which is what Valheim runs its own controls through and already reports false for those states (InventoryGui covers the backpack and chests alike). Aswid's transform keys were the only place already doing this; the shared helper replaces that one-off and covers Skadi's cold spell, form keys, flight toggle, form attacks and flight boost, Fenrir's form keys and the attacks of all four form behaviors, Trol's rock throw and true form, and Aswid's devour toggle. Cultist fire is a held button, so it is gated per read rather than around the block: opening a GUI mid-stream now falls through to StopFire() instead of leaving the flames running.
This commit is contained in:
parent
16275d6abc
commit
bca47beda6
9 changed files with 67 additions and 20 deletions
|
|
@ -119,14 +119,17 @@ namespace RacesOfValheim
|
|||
{
|
||||
if (!IsTrol()) return;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.G))
|
||||
if (RaceInput.Allowed)
|
||||
{
|
||||
TryThrowRock();
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.G))
|
||||
{
|
||||
TryThrowRock();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.H))
|
||||
{
|
||||
TryTrueForm();
|
||||
if (Input.GetKeyDown(KeyCode.H))
|
||||
{
|
||||
TryTrueForm();
|
||||
}
|
||||
}
|
||||
|
||||
// Check log durability
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue