/// <summary>Checks if the action can be performed and creates the split menu if it can.</summary> /// <param name="action">The action to perform.</param> private EInputHandled TryOpenSplitMenu(IShopAction action) { if (action?.CanPerformAction() == true) { this.SplitMenu = new StackSplitMenu(OnStackAmountReceived, this.CurrentShopAction.StackAmount, this.Helper.Input); return(EInputHandled.Consumed); } return(EInputHandled.NotHandled); }
/// <summary>Checks if the action can be performed and creates the split menu if it can.</summary> /// <param name="action">The action to perform.</param> private EInputHandled TryOpenSplitMenu(IShopAction action) { if (action?.CanPerformAction() == true) { Log.TraceIfD($"[{nameof(ShopMenuHandler)}.{nameof(TryOpenSplitMenu)}] Creating Split Menu"); this.SplitMenu = new StackSplitMenu(OnStackAmountReceived, this.CurrentShopAction.StackAmount); return(EInputHandled.Consumed); } return(EInputHandled.NotHandled); }
/// <summary>Main event that derived handlers use to setup necessary hooks and other things needed to take over how the stack is split.</summary> /// <returns>If the input was handled or consumed.</returns> protected override EInputHandled OpenSplitMenu() { Log.TraceIfD($"[{nameof(ShopMenuHandler)}.{nameof(OpenSplitMenu)}] Entered"); this.CurrentShopAction = BuyAction.Create(this.NativeMenu, this.ClickItemLocation); return(TryOpenSplitMenu(this.CurrentShopAction)); }
/// <summary>Alternative of OpenSplitMenu which is invoked when the generic inventory handler is clicked.</summary> /// <returns>If the input was handled or consumed.</returns> protected override EInputHandled InventoryClicked() { this.CurrentShopAction = SellAction.Create(this.NativeMenu, this.ClickItemLocation); return(TryOpenSplitMenu(this.CurrentShopAction)); }
/// <summary>Main event that derived handlers use to setup necessary hooks and other things needed to take over how the stack is split.</summary> /// <returns>If the input was handled or consumed.</returns> protected override EInputHandled OpenSplitMenu() { this.CurrentShopAction = BuyAction.Create(this.Helper.Reflection, this.Monitor, this.NativeMenu, this.ClickItemLocation); return(TryOpenSplitMenu(this.CurrentShopAction)); }