Exemplo n.º 1
0
        public override void draw(SpriteBatch spriteBatch)
        {
            drawBackground(spriteBatch);

            drawTextureBox(spriteBatch, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), base.xPositionOnScreen, base.yPositionOnScreen, base.width, base.height, Color.White, 4f, false);

            SpriteText.drawString(spriteBatch, FarmName, xPositionOnScreen + 50, yPositionOnScreen + 45);
            SpriteText.drawString(spriteBatch, "Server Mods", xPositionOnScreen - 195 - (ServerModsBox.width / 2) + width, yPositionOnScreen + 45);

            int color = !missingRequiredMod || Game1.currentGameTime.TotalGameTime.TotalMilliseconds % 1000 < 500 ? -1 : 2;

            SpriteText.drawString(spriteBatch, "Required Mods", xPositionOnScreen - 209 - (ServerModsBox.width / 2) + width, yPositionOnScreen + 17 + height / 2, color: color);

            spriteBatch.DrawString(Game1.smallFont, $"Online players: {PlayersOnline}", new Vector2(xPositionOnScreen + 50, yPositionOnScreen + 100), Color.Black);
            spriteBatch.DrawString(Game1.smallFont, $"Max players: {PlayerSlots}", new Vector2(xPositionOnScreen + 50, yPositionOnScreen + 130), Color.Black);
            spriteBatch.DrawString(Game1.smallFont, $"Free cabins: {CabinCountText}", new Vector2(xPositionOnScreen + 50, yPositionOnScreen + 160), Color.Black);

            #region Server message
            SpriteText.drawString(spriteBatch, "Server message", xPositionOnScreen + 50, yPositionOnScreen + 213);

            var bounds = new Rectangle(xPositionOnScreen + 76, yPositionOnScreen + 290, width / 2 - 70, height - yPositionOnScreen - 302);
            DrawTools.DrawBox(spriteBatch, bounds.X, bounds.Y, bounds.Width, bounds.Height);

            bounds.X     += 6;
            bounds.Y     += 10;
            bounds.Width -= 21;
            DrawWrappedText(spriteBatch, ServerDescription, bounds, Game1.smallFont, Color.SaddleBrown);
            #endregion

            ServerModsBox.Draw(spriteBatch);
            RequiredModsBox.Draw(spriteBatch);

            if (!missingRequiredMod)
            {
                connectButton.draw(spriteBatch);
            }

            base.draw(spriteBatch);
            drawMouse(spriteBatch);
        }
Exemplo n.º 2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            DrawTools.DrawBox(spriteBatch, x, y, width, height);

            int i = 0;

            foreach (var pair in VisibleItems)
            {
                spriteBatch.DrawString(Game1.smallFont, pair.Key, new Vector2(x + 15, y + 10 + i * rowHeight), pair.Value);
                i++;
            }

            if (currentIndex + rows < items.Count)
            {
                downButton.draw(spriteBatch);
            }

            if (currentIndex - 1 >= 0)
            {
                upButton.draw(spriteBatch);
            }
        }