Пример #1
0
        public override void draw(SpriteBatch b)
        {
            b.End();
            b.Begin(SpriteSortMode.FrontToBack, BlendState.NonPremultiplied, SamplerState.PointClamp,
                    null, null, null, new Matrix?());
            for (var index = 0; index < _optionSlots.Count; ++index)
            {
                if (_currentItemIndex >= 0 && _currentItemIndex + index < Options.Count)
                {
                    Options[_currentItemIndex + index].Draw(b, _optionSlots[index].bounds.X,
                                                            _optionSlots[index].bounds.Y);
                }
            }

            b.End();
            b.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null,
                    null, null, new Matrix?());
            if (!GameMenu.forcePreventClose)
            {
                _upArrow.draw(b);
                FilterTextBox.Draw(b);
                _downArrow.draw(b);
                if (Options.Count > ItemsPerPage)
                {
                    drawTextureBox(b, Game1.mouseCursors, new Rectangle(403, 383, 6, 6),
                                   _scrollBarRunner.X, _scrollBarRunner.Y, _scrollBarRunner.Width,
                                   _scrollBarRunner.Height, Color.White, 4f, false);
                    _scrollBar.draw(b);
                }
            }

            if (_hoverText.Equals(""))
            {
                return;
            }
            if (_hoverTitle.Equals(""))
            {
                drawHoverText(b, _hoverText, Game1.smallFont);
            }
            else
            {
                drawHoverText(b, _hoverText, Game1.smallFont, boldTitleText: _hoverTitle);
            }
        }