Help with Inventory Window control
Posted: Tue Feb 23, 2021 7:07 pm
Hi all, There was a bug report sent in for inventory filter. The user remapped Inventory from F6 to "I". Whenever he is typing in the filter, and presses "I", the inventory window closes. The filtertext box is using HotkeySequenceOverride but the closeBinding is not passing through any code that checks the value.
In my test environment, i was able to get it working by changing the DaggerfallInventoryWindow.Update method as follows:
I tried to place the logic into my UIWindow override but since I call base.Update() it didn't work. Am I looking at this correctly? Is the fix to update DaggerfallInvetoryWindow with a PR or is there a way to get my mod to handle the case?
thank you in advance for any assistance.
a
Code: Select all
public override void Update()
{
base.Update();
if (!DaggerfallUI.Instance.HotkeySequenceProcessed)
{
// Toggle window closed with same hotkey used to open it
if (InputManager.Instance.GetKeyUp(toggleClosedBinding))
CloseWindow();
}
// Close window immediately if inventory suppressed
if (suppressInventory)
{
CloseWindow();
if (!string.IsNullOrEmpty(suppressInventoryMessage))
DaggerfallUI.MessageBox(suppressInventoryMessage);
return;
}
}
In my test environment, i was able to get it working by changing the DaggerfallInventoryWindow.Update method as follows:
Code: Select all
public override void Update()
{
base.Update();
if (!DaggerfallUI.Instance.HotkeySequenceProcessed)
{
// Toggle window closed with same hotkey used to open it
if (InputManager.Instance.GetKeyUp(toggleClosedBinding))
if (uiManager.TopWindow.FocusControl != null)
{
if (!uiManager.TopWindow.FocusControl.OverridesHotkeySequences)
CloseWindow();
} else
{
CloseWindow();
}
}
// Close window immediately if inventory suppressed
if (suppressInventory)
{
CloseWindow();
if (!string.IsNullOrEmpty(suppressInventoryMessage))
DaggerfallUI.MessageBox(suppressInventoryMessage);
return;
}
}
thank you in advance for any assistance.
a