Exemple #1
0
        public override void draw(SpriteBatch b)
        {
            b.End();
            b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
            header.draw(b, headerBounds.X, headerBounds.Y);

            if (Items.Count > 0)
            {
                b.End();
                b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null);
                for (int i = 0; i < NUM_VIEWABLE && currentItemIndex + i < Items.Count; ++i)
                {
                    Items[currentItemIndex + i].draw(b, ViewableItems[i].bounds.X, ViewableItems[i].bounds.Y, xPositionOnScreen);
                }
                if (!GameMenu.forcePreventClose)
                {
                    upArrow.draw(b);
                    downArrow.draw(b);
                    if (Items.Count > NUM_VIEWABLE)
                    {
                        drawTextureBox(b, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), scrollBarRunner.X, scrollBarRunner.Y, scrollBarRunner.Width, scrollBarRunner.Height, Color.White, Game1.pixelZoom, false);
                        scrollBar.draw(b);
                    }
                }
            }
            else
            {
                DrawEmptyListMessage(b);
            }
        }
        /***
         * Override Methods
         ***/

        public override void draw(SpriteBatch b)
        {
            b.End();
            b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
            headerText.draw(b, headerBounds.X, headerBounds.Y);

            b.End();
            b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);

            searchBox.Draw(b);

            for (int index = 0; index < this.visibleSearchResults.Count; ++index)
            {
                if (this.currentItemIndex >= 0 && this.currentItemIndex + index < this.searchResults.Count)
                {
                    this.searchResults[this.currentItemIndex + index].draw(b, this.visibleSearchResults[index].bounds.X, this.visibleSearchResults[index].bounds.Y);
                }
            }

            if (!GameMenu.forcePreventClose)
            {
                this.upArrow.draw(b);
                this.downArrow.draw(b);
                if (this.searchResults.Count > NUM_ITEMS)
                {
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(403, 383, 6, 6), this.scrollBarRunner.X, this.scrollBarRunner.Y, this.scrollBarRunner.Width, this.scrollBarRunner.Height, Color.White, (float)Game1.pixelZoom, false);
                    this.scrollBar.draw(b);
                }
            }
            if (this.hoverText.Equals(""))
            {
                return;
            }
            IClickableMenu.drawHoverText(b, this.hoverText, Game1.smallFont, 0, 0, -1, (string)null, -1, (string[])null, (Item)null, 0, -1, -1, -1, -1, 1f, (CraftingRecipe)null);
        }
 public void draw(SpriteBatch spriteBatch, int x, int y)
 {
     _label.draw(spriteBatch, x, y);
     _rename.draw(spriteBatch, x, y);
     _warp.draw(spriteBatch, x, y);
 }