4 using Microsoft.Xna.Framework.Graphics;
8 namespace Loot.UI.Tabs.Cubing
10 internal class GuiCraftItemButton : GuiInteractableItemButton
12 public Action PostOnClickAction;
13 public Action PreOnClickAction;
14 public Func<Item, bool> CanTakeItemAction;
16 internal GuiCraftItemButton(ButtonType buttonType,
int netId = 0,
int stack = 0, Texture2D hintTexture = null,
string hintText = null,
string hintOnHover = null) : base(buttonType, netId, stack, hintTexture, hintText, hintOnHover)
18 RightClickFunctionalityEnabled =
false;
19 HintOnHover =
" (click to take item)";
22 public override bool CanTakeItem(Item givenItem) => base.CanTakeItem(givenItem) && givenItem.IsModifierRollableItem() && (CanTakeItemAction?.Invoke(givenItem) ??
true);
24 public override void PreOnClick(UIMouseEvent evt, UIElement e)
30 PreOnClickAction?.Invoke();
33 public override void PostOnClick(UIMouseEvent evt, UIElement e)
39 PostOnClickAction?.Invoke();
Defines an item that may be modified by modifiers from mods
static LootModItem GetInfo(Item item)