예제 #1
0
 public override bool OverrideItemSlotLeftClick(Item[] inv, int context = 0, int slot = 0)
 {
     if (!ItemSlot.ShiftInUse)
     {
         return(false);
     }
     if (Main.cursorOverride == 9 && context == 0)
     {
         Item obj = inv[slot];
         if (!obj.IsAir && !obj.favorited && TEDisplayDoll.FitsDisplayDoll(obj))
         {
             return(this.TryFitting(inv, context, slot, false));
         }
     }
     if ((Main.cursorOverride != 8 || context != 23) && (context != 24 && context != 25))
     {
         return(false);
     }
     inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], GetItemSettings.InventoryEntityToPlayerInventorySettings);
     if (Main.netMode == 1)
     {
         if (context == 25)
         {
             NetMessage.SendData(121, -1, -1, (NetworkText)null, Main.myPlayer, (float)this.ID, (float)slot, 1f, 0, 0, 0);
         }
         else
         {
             NetMessage.SendData(121, -1, -1, (NetworkText)null, Main.myPlayer, (float)this.ID, (float)slot, 0.0f, 0, 0, 0);
         }
     }
     return(true);
 }
예제 #2
0
        public override bool TryGetItemGamepadOverrideInstructions(
            Item[] inv,
            int context,
            int slot,
            out string instruction)
        {
            instruction = "";
            Item newItem = inv[slot];

            if (newItem.IsAir || newItem.favorited)
            {
                return(false);
            }
            switch (context)
            {
            case 0:
                if (TEDisplayDoll.FitsDisplayDoll(newItem))
                {
                    instruction = Lang.misc[76].Value;
                    return(true);
                }
                break;

            case 23:
            case 24:
            case 25:
                if (Main.player[Main.myPlayer].ItemSpace(newItem).CanTakeItemToPersonalInventory)
                {
                    instruction = Lang.misc[68].Value;
                    return(true);
                }
                break;
            }
            return(false);
        }
예제 #3
0
        public override bool OverrideItemSlotHover(Item[] inv, int context = 0, int slot = 0)
        {
            Item obj = inv[slot];

            if (!obj.IsAir && !inv[slot].favorited && (context == 0 && TEDisplayDoll.FitsDisplayDoll(obj)))
            {
                Main.cursorOverride = 9;
                return(true);
            }
            if (obj.IsAir || context != 23 && context != 24 && context != 25 || !Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory)
            {
                return(false);
            }
            Main.cursorOverride = 8;
            return(true);
        }