Ejemplo n.º 1
0
        public static void Draw(TEStorageHeart heart)
        {
            Player        player    = Main.player[Main.myPlayer];
            StoragePlayer modPlayer = player.GetModPlayer <StoragePlayer>();

            Initialize();
            if (Main.mouseX > panelLeft && Main.mouseX < panelLeft + panelWidth && Main.mouseY > panelTop && Main.mouseY < panelTop + panelHeight)
            {
                player.mouseInterface = true;
                player.showItemIcon   = false;
                InterfaceHelper.HideItemIconCache();
            }
            basePanel.Draw(Main.spriteBatch);
            slotZone.DrawText();
            sortButtons.DrawText();
            filterButtons.DrawText();
        }
Ejemplo n.º 2
0
        public static void Draw(TEStorageHeart heart)
        {
            Player        player    = Main.player[Main.myPlayer];
            StoragePlayer modPlayer = player.GetModPlayer <StoragePlayer>(MagicStorage.Instance);

            Initialize();
            if (Main.mouseX > panelLeft && Main.mouseX < panelLeft + panelWidth && Main.mouseY > panelTop && Main.mouseY < panelTop + panelHeight)
            {
                player.mouseInterface = true;
                player.showItemIcon   = false;
                InterfaceHelper.HideItemIconCache();
            }
            basePanel.Draw(Main.spriteBatch);
            float   itemSlotWidth  = Main.inventoryBackTexture.Width * inventoryScale;
            float   itemSlotHeight = Main.inventoryBackTexture.Height * inventoryScale;
            Vector2 slotZonePos    = slotZone.GetDimensions().Position();
            float   oldScale       = Main.inventoryScale;

            Main.inventoryScale = inventoryScale;
            Item[] temp = new Item[11];
            for (int k = 0; k < numColumns * displayRows; k++)
            {
                int  index = k + numColumns * (int)Math.Round(scrollBar.ViewPosition);
                Item item  = index < items.Count ? items[index] : new Item();
                if (!item.IsAir && !didMatCheck[index])
                {
                    item.checkMat();
                    didMatCheck[index] = true;
                }
                Vector2 drawPos = slotZonePos + new Vector2((itemSlotWidth + padding) * (k % 10), (itemSlotHeight + padding) * (k / 10));
                temp[10] = item;
                ItemSlot.Draw(Main.spriteBatch, temp, 0, 10, drawPos);
            }
            if (hoverSlot >= 0 && hoverSlot < items.Count)
            {
                Main.HoverItem = items[hoverSlot].Clone();
                Main.instance.MouseText(string.Empty);
            }
            sortButtons.DrawText();
            filterButtons.DrawText();
            Main.inventoryScale = oldScale;
        }
Ejemplo n.º 3
0
        public static void Draw(TEStorageHeart heart)
        {
            Player        player    = Main.player[Main.myPlayer];
            StoragePlayer modPlayer = player.GetModPlayer <StoragePlayer>(MagicStorage.Instance);

            Initialize();
            if (Main.mouseX > panelLeft && Main.mouseX < panelLeft + panelWidth && Main.mouseY > panelTop && Main.mouseY < panelTop + panelHeight)
            {
                player.mouseInterface = true;
                player.showItemIcon   = false;
                InterfaceHelper.HideItemIconCache();
            }
            basePanel.Draw(Main.spriteBatch);
            float   itemSlotWidth  = Main.inventoryBackTexture.Width * inventoryScale;
            float   itemSlotHeight = Main.inventoryBackTexture.Height * inventoryScale;
            Vector2 slotZonePos    = slotZone.GetDimensions().Position();
            float   oldScale       = Main.inventoryScale;

            Main.inventoryScale = inventoryScale;
            Item[] temp             = new Item[11];
            Item[] craftingStations = GetCraftingStations();
            for (int k = 0; k < numColumns; k++)
            {
                temp[10] = craftingStations[k];
                Vector2 drawPos = GetSlotPosition(k);
                ItemSlot.Draw(Main.spriteBatch, temp, 0, 10, drawPos);
            }
            if (hoverSlot >= 0 && hoverSlot < items.Count)
            {
                Main.HoverItem = items[hoverSlot].Clone();
                Main.instance.MouseText(string.Empty);
            }
            sortButtons.DrawText();
            filterButtons.DrawText();
            Main.inventoryScale = oldScale;
        }