예제 #1
0
 public override bool CanBuyItem(NPC vendor, Item[] shopInventory, Item item)
 {
     if (ClientConfig.Instance.ShopClick && Terraria.UI.ItemSlot.ShiftInUse)
     {
         var mod   = ModContent.GetInstance <InvTweaks>();
         var state = new ShopStackUI();
         state.Activate();
         state.ShopStack = item.maxStack;
         mod.userInterface.SetState(mod.shopStackState = state);
     }
     return(true);
 }
예제 #2
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int index = layers.FindIndex(x => x.Name == "Vanilla: Hotbar");

            layers.Insert((index == -1) ? layers.Count - 1 : index + 1,
                          new LegacyGameInterfaceLayer("InvTweaks: Hotbar", DrawExtraHotbarSlot,
                                                       InterfaceScaleType.UI));
            layers.Add(new LegacyGameInterfaceLayer("InvTweaks: Shop Stack Select", delegate
            {
                if (ShopStackUI.visible)
                {
                    if (Main.LocalPlayer.talkNPC == -1)
                    {
                        ShopStackUI.visible = false;
                        userInterface.SetState(shopStackState = null);
                    }
                    userInterface?.Draw(Main.spriteBatch, time);
                }
                return(true);
            }, InterfaceScaleType.UI));

/*            layers.Add(new LegacyGameInterfaceLayer("InvTweaks: Slope Hammer Wheel", delegate
 *          {
 *              if (SlopeHammerUI.visible)
 *              {
 *                  if (Main.mouseRightRelease)
 *                  {
 *                      SlopeHammerUI.visible = false;
 *                      (userInterface.CurrentState as SlopeHammerUI).Apply();
 *                      userInterface.SetState(slopeHammerState = null);
 *                  }
 *                  userInterface?.Draw(Main.spriteBatch, time);
 *              }
 *              return true;
 *          }, InterfaceScaleType.UI));*/
        }