public override void Draw(CustomSpriteBatch g) { g.Draw(sprBackground, Vector2.Zero, Color.White); if (RoomType == RoomInformations.RoomTypeMission) { g.Draw(sprLicenseAll, new Rectangle(572, 16, 24, 24), new Rectangle(1 * 24, 0, 24, 24), Color.White); } else { g.Draw(sprTitleBattle, new Vector2(160, 16), Color.White); g.Draw(sprLicenseAll, new Rectangle(572, 16, 24, 24), new Rectangle(2 * 24, 0, 24, 24), Color.White); } g.DrawString(fntArial12, "Lv." + PlayerManager.OnlinePlayerLevel, new Vector2(610, 17), Color.White); g.DrawString(fntArial12, PlayerManager.OnlinePlayerName, new Vector2(670, 15), Color.White); g.End(); g.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); DrawRooms(g); if (OnlineCommunicationClient != null) { ChatHelper.DrawChat(g, sprTabChat, fntArial12, OnlineCommunicationClient.Chat, ChatInput); } DrawPlayers(g); foreach (IUIElement ActiveButton in ArrayMenuButton) { ActiveButton.Draw(g); } }
public override void Draw(CustomSpriteBatch g) { g.Draw(sprBackground, Vector2.Zero, Color.White); g.Draw(sprTeamSeparatorBlue, new Vector2(285, 220), Color.White); g.Draw(sprTeamSeparatorRed, new Vector2(55, 220), Color.White); g.Draw(sprActivePlayerIcon, new Vector2(570, 11), Color.White); DrawNumberRightAligned(g, fntTest, Room.MaxKill, new Vector2(700, 294)); DrawNumberRightAligned(g, fntTest, Room.MaxGameLengthInMinutes, new Vector2(700, 318)); g.DrawString(fntText, "Off", new Vector2(643, 355), Color.White); DrawNumberRightAligned(g, fntTest, Room.MaxNumberOfPlayer, new Vector2(753, 356)); g.Draw(sprMapImage, new Vector2(579, 437), Color.White); if (Room.MapPath != "Random") { g.Draw(MapTextOverlay, new Vector2(595, 486), Color.White); g.Draw(MapStar, new Vector2(616, 503), Color.White); MapLevelCategory.Draw(g, new Vector2(680, 513), Color.White); g.Draw(MapStar, new Vector2(740, 503), Color.White); } foreach (InteractiveButton ActiveButton in ArrayMenuButton) { ActiveButton.Draw(g); } if (OnlineCommunicationClient != null) { ChatHelper.DrawChat(g, sprTabChat, fntText, OnlineCommunicationClient.Chat, ChatInput); } ModeSelectTextButton.Draw(g); g.DrawString(fntText, Room.RoomName, new Vector2(75, 7), Color.White); int RedPlayerCount = 0; int BluePlayerCount = 0; for (int P = 0; P < Room.ListRoomPlayer.Count; ++P) { int DrawX = 0; int DrawY = 0; if (Room.ListRoomPlayer[P].Team == 0) { DrawX = 155 + (PlayerInfo.SpriteWidth + 40) * (RedPlayerCount % 2); DrawY = 125 + (RedPlayerCount / 2) * 64; ++RedPlayerCount; } else if (Room.ListRoomPlayer[P].Team == 1) { DrawX = 155 + (PlayerInfo.SpriteWidth + 40) * (BluePlayerCount % 2); DrawY = 275 + (BluePlayerCount / 2) * 64; ++BluePlayerCount; } DrawPlayerBox(g, DrawX, DrawY, Room.ListRoomPlayer[P], Room.ListRoomPlayer[P].Team == 1 || !Room.UseTeams); } }
public override void Draw(CustomSpriteBatch g) { g.Draw(sprBackground, Vector2.Zero, Color.White); g.Draw(sprActivePlayerIcon, new Vector2(570, 11), Color.White); foreach (InteractiveButton ActiveButton in ArrayMenuButton) { ActiveButton.Draw(g); } if (OnlineCommunicationClient != null) { ChatHelper.DrawChat(g, sprTabChat, fntText, OnlineCommunicationClient.Chat, ChatInput); } MissionScrollbar.Draw(g); g.DrawString(fntText, Room.RoomName, new Vector2(68, 7), Color.White); g.DrawStringMiddleAligned(fntText, CurrentMissionName, new Vector2(170, 114), Color.White); g.DrawStringMiddleAligned(fntText, CurrentMissionDescription, new Vector2(170, 270), Color.White); if (sprCurrentMissionImage != null) { g.Draw(sprCurrentMissionImage, new Vector2(57, 139), Color.White); } for (int P = 0; P < Room.ListRoomPlayer.Count; ++P) { int DrawX = 678; int DrawY = 310 + P * 64; DrawPlayerBox(g, DrawX, DrawY, Room.ListRoomPlayer[P], true); } for (int M = MissionInfoStartIndex, i = 0; M < ListMissionInfo.Count && i < 4; ++M, ++i) { QuestButton.Draw(g, new Vector2(405, 140 + i * 64), Color.White); g.DrawString(fntText, (M + 1).ToString().PadLeft(2, '0'), new Vector2(395, 120 + i * 64), Color.FromNonPremultiplied(0, 255, 0, 255)); g.DrawString(fntText, "1", new Vector2(485, 120 + i * 64), Color.White); g.DrawString(fntText, ListMissionInfo[M].MissionName, new Vector2(328, 145 + i * 64), Color.FromNonPremultiplied(0, 255, 0, 255)); Rectangle QuestButtonCollisionBox = new Rectangle(405 - (int)QuestButton.Origin.X, 140 - (int)QuestButton.Origin.Y + i * 64, QuestButton.SpriteWidth, QuestButton.SpriteHeight); if (QuestButtonCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y)) { PlayerInfoOutline.Draw(g, new Vector2(405, 140 + i * 64), Color.White); } } }
public override void Update(GameTime gameTime) { if (OnlineGameClient != null) { OnlineGameClient.ExecuteDelayedScripts(); OnlineCommunicationClient.ExecuteDelayedScripts(); ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput); } if (FMODSystem.sndActiveBGM != sndBGM) { sndBGM.PlayAsBGM(); } Rectangle LicenseBox = new Rectangle(572, 16, 24, 24); if (LicenseBox.Intersects(new Rectangle(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y, 1, 1))) { if (MouseHelper.InputLeftButtonPressed()) { if (RoomType == RoomInformations.RoomTypeMission) { RoomType = RoomInformations.RoomTypeBattle; } else { RoomType = RoomInformations.RoomTypeMission; } } } UpdateRooms(); UpdatePlayers(); foreach (IUIElement ActiveButton in ArrayMenuButton) { ActiveButton.Update(gameTime); } }
public override void Update(GameTime gameTime) { if (OnlineGameClient != null) { OnlineGameClient.ExecuteDelayedScripts(); } if (OnlineCommunicationClient != null) { OnlineCommunicationClient.ExecuteDelayedScripts(); ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput); } if (FMODSystem.sndActiveBGM != sndBGM) { sndBGM.PlayAsBGM(); } foreach (InteractiveButton ActiveButton in ArrayMenuButton) { ActiveButton.Update(gameTime); } MissionScrollbar.Update(gameTime); foreach (Player ActiveRobot in Room.ListRoomPlayer) { if (ActiveRobot.CharacterPreview != null) { ActiveRobot.CharacterPreview.Update(gameTime); ActiveRobot.CharacterPreview.UpdateAllWeaponsAngle(new Vector2(5, 0)); } } if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F1)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller1; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F2)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller2; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F3)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller3; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F4)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller4; } if (MouseHelper.InputLeftButtonPressed() && IsHost) { for (int M = MissionInfoStartIndex, i = 0; M < ListMissionInfo.Count && i < 4; ++M, ++i) { Rectangle QuestButtonCollisionBox = new Rectangle(405 - (int)QuestButton.Origin.X, 140 - (int)QuestButton.Origin.Y + i * 64, QuestButton.SpriteWidth, QuestButton.SpriteHeight); if (QuestButtonCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y)) { UpdateSelectedMission(ListMissionInfo[M]); break; } } } }
public override void Update(GameTime gameTime) { if (OnlineGameClient != null) { OnlineGameClient.ExecuteDelayedScripts(); } if (OnlineCommunicationClient != null) { OnlineCommunicationClient.ExecuteDelayedScripts(); } if (FMODSystem.sndActiveBGM != sndBGM) { sndBGM.PlayAsBGM(); } foreach (InteractiveButton ActiveButton in ArrayMenuButton) { ActiveButton.Update(gameTime); } if (OnlineCommunicationClient != null) { ChatHelper.UpdateChat(gameTime, OnlineCommunicationClient.Chat, ChatInput); } foreach (Player ActiveRobot in Room.ListRoomPlayer) { if (ActiveRobot.CharacterPreview != null) { ActiveRobot.CharacterPreview.Update(gameTime); ActiveRobot.CharacterPreview.UpdateAllWeaponsAngle(new Vector2(5, 0)); } } if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F1)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller1; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F2)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller2; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F3)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller3; } else if (KeyboardHelper.KeyPressed(Microsoft.Xna.Framework.Input.Keys.F4)) { Player NewPlayer = new Player("", "", Player.PlayerTypes.Player, 0); Room.AddLocalPlayer(NewPlayer); NewPlayer.GameplayType = GameplayTypes.Controller4; } }