Talk:Override inventory clicks/@comment-188.117.216.2-20180319082154

Great Script

It works but I set the bellow {                 menuInventoryBox.HandleDefaultClick (MouseState.SingleClick, _slot, AC_InteractionMethod.ContextSensitive); }             else {                 menuInventoryBox.HandleDefaultClick (MouseState.RightClick, _slot, AC_InteractionMethod.ChooseHotspotThenInteraction); }

When I click on an empty slot I get this:

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[AC.InvItem].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) AC.MenuInventoryBox.HandleDefaultClick (MouseState _mouseState, Int32 _slot, AC_InteractionMethod interactionMethod) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:733) OverrideInventory.ElementClick (AC.Menu _menu, AC.MenuElement _element, Int32 _slot, Int32 _buttonPressed) (at Assets/MyGame/Scripts/OverrideInventory.cs:27) AC.EventManager.Call_OnMenuElementClick (AC.Menu _menu, AC.MenuElement _element, Int32 _slot, Int32 _buttonPressed) (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:346) AC.MenuElement.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuElement.cs:262) AC.MenuInventoryBox.ProcessClick (AC.Menu _menu, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:1243) AC.PlayerMenus.CheckClick (AC.Menu _menu, AC.MenuElement _element, Int32 _slot, MouseState _mouseState) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:2163) AC.PlayerMenus.CheckClicks (AC.Menu menu) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1862) AC.PlayerMenus.CheckForInput (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1944) AC.StateHandler.Update (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:299)

Is any way to bypass it?

Thank you in advance