Terraria.UI.ItemSlot.OverrideLeftClick C# (CSharp) Method

OverrideLeftClick() private static method

private static OverrideLeftClick ( System.Item inv, int context, int slot ) : bool
inv System.Item
context int
slot int
return bool
        private static bool OverrideLeftClick(Item[] inv, int context = 0, int slot = 0)
        {
            Item I = inv[slot];
            if (Main.cursorOverride == 2)
            {
                if (ChatManager.AddChatText(Main.fontMouseText, ItemTagHandler.GenerateTag(I), Vector2.One))
                    Main.PlaySound(12, -1, -1, 1);
                return true;
            }
            if (Main.cursorOverride == 3)
            {
                if (!ItemSlot.canFavoriteAt[context])
                    return false;
                I.favorited = !I.favorited;
                Main.PlaySound(12, -1, -1, 1);
                return true;
            }
            if (Main.cursorOverride == 7)
            {
                inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], false, true);
                Main.PlaySound(12, -1, -1, 1);
                return true;
            }
            if (Main.cursorOverride == 8)
            {
                inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], false, true);
                if (Main.player[Main.myPlayer].chest > -1)
                    NetMessage.SendData(32, -1, -1, "", Main.player[Main.myPlayer].chest, (float)slot, 0.0f, 0.0f, 0, 0, 0);
                return true;
            }
            if (Main.cursorOverride != 9)
                return false;
            ChestUI.TryPlacingInChest(inv[slot], false);
            return true;
        }