private void DrawGametypeCategory(CustomSpriteBatch g, GametypeCategory ActiveCategory, ref int CurrentIndex, ref float DrawY) { if (CurrentIndex >= GametypeScrollbarValue) { g.DrawStringMiddleAligned(fntText, ActiveCategory.Category, new Vector2(LeftPanelX + PanelWidth / 2, DrawY), Color.White); DrawY += 20; } ++CurrentIndex; for (int G = 0; G < ActiveCategory.ArrayGametype.Length; ++G) { if (CurrentIndex >= GametypeScrollbarValue) { g.DrawString(fntText, ActiveCategory.ArrayGametype[G].Name, 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; } }
private bool SelectGametype(GametypeCategory ActiveCategory, ref int CurrentIndex, ref float DrawY) { if (CurrentIndex >= GametypeScrollbarValue) { DrawY += 20; } ++CurrentIndex; for (int G = 0; G < ActiveCategory.ArrayGametype.Length; ++G) { if (CurrentIndex >= GametypeScrollbarValue) { if (MouseHelper.MouseStateCurrent.X >= LeftPanelX && MouseHelper.MouseStateCurrent.X < LeftPanelX + PanelWidth && MouseHelper.MouseStateCurrent.Y >= DrawY && MouseHelper.MouseStateCurrent.Y < DrawY + 20 && InputHelper.InputConfirmPressed()) { SelectedGametype = ActiveCategory.ArrayGametype[G]; Room.RoomType = SelectedGametype.Name; Owner.OnGametypeUpdate(); return(true); } DrawY += 20; } ++CurrentIndex; } return(false); }
public override void Load() { fntText = Content.Load <SpriteFont>("Fonts/Arial10"); Gametype GametypeCampaign = new Gametype("Campaign", "Classic mission based mode, no respawn.", null); Gametype GametypeHorde = new Gametype("Horde", "Wave survival mode, respawn at the start of each wave.", null); Gametype GametypeBaseDefense = new Gametype("Base Defense", "Wave survival mode, respawn at the start of each wave. Must defend a base by building turrets.", null); Gametype GametypeDeathmatch = new Gametype("Deathmatch", "Gain points for kills and assists, respawn on death.", null); Gametype GametypeObjective = new Gametype("Objective", "One team must complete objectives while another prevent them.", null); Gametype GametypeAssault = new Gametype("Assault", "Team deathmatch with limited respawns.", null); Gametype GametypeConquest = new Gametype("Conquest", "Teams must fight to capture respawn bases that give them points. The starting base may or may not be capturable.", null); Gametype GametypeOnslaught = new Gametype("Onslaught", "Teams must fight to capture respawn bases that give them access to the enemy base's core. Last team with a core win.", null); Gametype GametypeKingOfTheHill = new Gametype("King Of The Hill", "Hold a position without enemies to win points.", null); Gametype GametypeBunny = new Gametype("Bunny", "Unit that holds the flag become the bunny and gets points for kills, everyone else try to kill the bunny.", null); Gametype GametypeFreezeTag = new Gametype("Freeze Tag", "Killing an enemy freeze him, when every enemies are frozen you win. Teamates can unfreeze allie by staying next to them for 2 turns.", null); Gametype GametypeJailbreak = new Gametype("Jailbreak", "Killing an enemy send him to your prison, capture everyone to win. Teamates can be freed by standing on a switch.", null); Gametype GametypeMutant = new Gametype("Mutant", "First kill transform you into the mutant, a unit with overpowered stats and attacks. Only the Mutant can kill or be killed.", null); Gametype GametypeKaiju = new Gametype("Kaiju", "One player controls giant monsters while the other players use their units.", null); SelectedGametype = GametypeCampaign; ArrayGametypeCategory = new GametypeCategory[2]; ArrayGametypeCategory[0] = new GametypeCategory("PVE", new Gametype[] { GametypeCampaign, GametypeHorde }); ArrayGametypeCategory[1] = new GametypeCategory("PVP", new Gametype[] { GametypeDeathmatch, GametypeObjective, GametypeAssault, GametypeConquest, GametypeOnslaught, GametypeKingOfTheHill, GametypeBunny, GametypeFreezeTag, GametypeJailbreak, GametypeMutant, GametypeKaiju, }); int PanelY = (int)(Constants.Height * 0.15); int PanelWidth = (int)(Constants.Width * 0.4); int PanelHeight = (int)(Constants.Height * 0.75); int LeftPanelX = (int)(Constants.Width * 0.03); GametypeScrollbar = new BoxScrollbar(new Vector2(LeftPanelX + PanelWidth - 20, PanelY), PanelHeight, 10, OnGametypeScrollbarChange); }