public override void Draw(CustomSpriteBatch g) { DrawBox(g, new Vector2(LeftPanelX, PanelY), PanelWidth, PanelHeight, Color.White); float DrawY = PanelY + 5; int CurrentIndex = 0; for (int G = 0; G < ArrayGametypeCategory.Length; ++G) { DrawGametypeCategory(g, ArrayGametypeCategory[G], ref CurrentIndex, ref DrawY); } int RightPanelX = Constants.Width - LeftPanelX - PanelWidth; int RightPanelContentOffset = (int)(PanelWidth * 0.05); int RightPanelContentX = RightPanelX + RightPanelContentOffset; int RightPanelContentWidth = PanelWidth - RightPanelContentOffset - RightPanelContentOffset; int PreviewBoxY = PanelY + 10; int PreviewBoxHeight = (int)(PanelHeight * 0.4); int DescriptionBoxY = PreviewBoxY + PreviewBoxHeight + 10; int DescriptionHeight = PanelHeight - (DescriptionBoxY - PanelY) - 10; int DescriptionBoxNameOffset = (int)(RightPanelContentWidth * 0.25); int DescriptionBoxNameX = RightPanelContentX + DescriptionBoxNameOffset; int DescriptionBoxNameWidth = RightPanelContentWidth - DescriptionBoxNameOffset - DescriptionBoxNameOffset; int DescriptionBoxNameHeight = 30; DrawBox(g, new Vector2(RightPanelX, PanelY), PanelWidth, PanelHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, PreviewBoxY), RightPanelContentWidth, PreviewBoxHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, DescriptionBoxY), RightPanelContentWidth, DescriptionHeight, Color.White); DrawBox(g, new Vector2(DescriptionBoxNameX, DescriptionBoxY), DescriptionBoxNameWidth, 30, Color.White); g.DrawStringCentered(fntText, SelectedGametype.Name, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, DescriptionBoxY + DescriptionBoxNameHeight / 2), Color.White); float DescriptionY = DescriptionBoxY + DescriptionBoxNameHeight; foreach (string ActiveLine in TextHelper.FitToWidth(fntText, SelectedGametype.Description, RightPanelContentWidth - 5)) { g.DrawString(fntText, ActiveLine, new Vector2(RightPanelContentX + 5, DescriptionY), Color.White); DescriptionY += 20; } GametypeScrollbar.Draw(g); }
public override void Draw(CustomSpriteBatch g) { DrawBox(g, new Vector2(LeftPanelX, PanelY), PanelWidth, PanelHeight, Color.White); MapScrollbar.Draw(g); float DrawY = PanelY + 5; int CurrentIndex = 0; foreach (MapInfo ActiveMap in DicMapInfoByPath.Values) { if (CurrentIndex >= MapScrollbarValue) { g.DrawString(fntText, ActiveMap.MapName, new Vector2(LeftPanelX + 5, DrawY), Color.White); if (MouseHelper.MouseStateCurrent.X >= LeftPanelX && MouseHelper.MouseStateCurrent.X < LeftPanelX + PanelWidth && MouseHelper.MouseStateCurrent.Y >= DrawY && MouseHelper.MouseStateCurrent.Y < DrawY + 20) { g.Draw(sprPixel, new Rectangle(LeftPanelX, (int)DrawY, PanelWidth, 20), Color.FromNonPremultiplied(255, 255, 255, 127)); } DrawY += 20; } ++CurrentIndex; } int RightPanelX = Constants.Width - LeftPanelX - PanelWidth; int RightPanelContentOffset = (int)(PanelWidth * 0.05); int RightPanelContentX = RightPanelX + RightPanelContentOffset; int RightPanelContentWidth = PanelWidth - RightPanelContentOffset - RightPanelContentOffset; int PreviewBoxY = PanelY + 10; int PreviewBoxHeight = (int)(PanelHeight * 0.4); int DescriptionBoxY = PreviewBoxY + PreviewBoxHeight + 50; int DescriptionHeight = PanelHeight - (DescriptionBoxY - PanelY) - 10; int DescriptionBoxNameOffset = (int)(RightPanelContentWidth * 0.25); int DescriptionBoxNameX = RightPanelContentX + DescriptionBoxNameOffset; int DescriptionBoxNameWidth = RightPanelContentWidth - DescriptionBoxNameOffset - DescriptionBoxNameOffset; int DescriptionBoxNameHeight = 30; DrawBox(g, new Vector2(RightPanelX, PanelY), PanelWidth, PanelHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, PreviewBoxY), RightPanelContentWidth, PreviewBoxHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, DescriptionBoxY), RightPanelContentWidth, DescriptionHeight, Color.White); DrawBox(g, new Vector2(DescriptionBoxNameX, DescriptionBoxY), DescriptionBoxNameWidth, 30, Color.White); if (ActiveMapInfo.MapName != null) { g.DrawStringCentered(fntText, ActiveMapInfo.MapPlayers, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, PreviewBoxY + PreviewBoxHeight + DescriptionBoxNameHeight / 2), Color.White); g.DrawStringCentered(fntText, "Size: " + ActiveMapInfo.NewMapSize.X + " x " + ActiveMapInfo.NewMapSize.Y, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, PreviewBoxY + PreviewBoxHeight + 20 + DescriptionBoxNameHeight / 2), Color.White); g.DrawStringCentered(fntText, ActiveMapInfo.MapName, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, DescriptionBoxY + DescriptionBoxNameHeight / 2), Color.White); float DescriptionY = DescriptionBoxY + DescriptionBoxNameHeight; foreach (string ActiveLine in TextHelper.FitToWidth(fntText, ActiveMapInfo.MapDescription, RightPanelContentWidth - 5)) { g.DrawString(fntText, ActiveLine, new Vector2(RightPanelContentX + 5, DescriptionY), Color.White); DescriptionY += 20; } } }