Even More Modifiers  1.0.0.0
A mod for rolling various bonus stats on items
GuiEssenceItemButton.cs
Go to the documentation of this file.
1 using Loot.Api.Ext;
3 using Microsoft.Xna.Framework.Graphics;
4 using Terraria;
5 using Terraria.UI;
6 
7 namespace Loot.UI.Tabs.EssenceCrafting
8 {
9  class GuiEssenceItemButton : GuiInteractableItemButton
10  {
11  internal GuiEssenceItemButton(GuiButton.ButtonType buttonType, int netId = 0, int stack = 0, Texture2D hintTexture = null, string hintText = null, string hintOnHover = null) : base(buttonType, netId, stack, hintTexture, hintText, hintOnHover)
12  {
13  RightClickFunctionalityEnabled = false;
14  HintOnHover = " (click to take item)";
15  }
16 
17  public override bool CanTakeItem(Item givenItem) => base.CanTakeItem(givenItem) && givenItem.IsModifierRollableItem();
18 
19  public override void PreOnClick(UIMouseEvent evt, UIElement e)
20  {
21  if (!Item.IsAir)
22  {
23  //LootModItem.GetInfo(Item).SlottedInCubeUI = false;
24  }
25  }
26 
27  public override void PostOnClick(UIMouseEvent evt, UIElement e)
28  {
29  if (!Item.IsAir)
30  {
31  //LootModItem.GetInfo(Item).SlottedInCubeUI = true;
32  }
33  }
34  }
35 }
override void PreOnClick(UIMouseEvent evt, UIElement e)
override void PostOnClick(UIMouseEvent evt, UIElement e)