public override void Update(GameTime gameTime) { base.Update(gameTime); apply.Interact(); cancel.Interact(); musicVolumnControl.Update(); soundVolumnControl.Update(); playerSelector.Update(); mummySelector.Update(); scorpionSelector.Update(); zombieSelector.Update(); }
public void Update(GameTime gameTime) { bool closed = false; if (display) { if (charaSelector != null) { charaSelector.Update(gameTime); for (int i = 0; i < charaSelector.Buttons.Length; i++) { if (charaSelector.Buttons[i].Activated()) { switch (nextWindow) { case 0: game.OpenUIWindow(new StatusWindow(game, game.party.GetPlayerCharacter(game.party.ActiveCharacters[i]))); break; case 1: game.OpenUIWindow(new Spellbook(game, game.TextureLoader.RequestTexture("UI\\Battle\\BattleSpellbook"), game.party.GetPlayerCharacter(game.party.ActiveCharacters[i]), usages)); break; case 2: game.OpenUIWindow(new Inventory(game, game.TextureLoader.RequestTexture("UI\\World\\NameWindow"), game.party, game.party.GetPlayerCharacter(game.party.ActiveCharacters[i]), false)); break; } charaSelector = null; break; } } if (game.Input.IsMouseButtonReleased()) charaSelector = null; for (int b = 3; b < Buttons.Length; b++) { if (Buttons[b].Activated()) { charaSelector = null; closed = true; } } } for (int i = 0; i < Buttons.Length; i++) { if (i == 6 && game.gameFlags["bAccessPartyWindow"] == false) continue; Buttons[i].Update(gameTime); } if (!closed) { if (Buttons[0].Activated()) game.OpenUIWindow(new Calendar(game)); if (Buttons[1].Activated()) game.OpenUIWindow(new MapWindow(game)); if (Buttons[2].Activated()) game.OpenUIWindow(new OptionsMenu(game)); if (Buttons[3].Activated()) { if (game.party.ActiveCharacters.Count == 1) { game.OpenUIWindow(new StatusWindow(game, game.party.GetPlayerCharacter(game.party.ActiveCharacters[0]))); } else { charaSelector = new CharacterSelector(game, new Point(Buttons[3].Position.X - 290, Buttons[3].Position.Y)); nextWindow = 0; } } if (Buttons[4].Activated()) { if (game.party.ActiveCharacters.Count == 1) game.OpenUIWindow(new Spellbook(game, game.TextureLoader.RequestTexture("UI\\Battle\\BattleSpellbook"), game.party.GetPlayerCharacter(game.party.ActiveCharacters[0]), usages)); else { charaSelector = new CharacterSelector(game, new Point(Buttons[4].Position.X - 290, Buttons[4].Position.Y)); nextWindow = 1; } } if (Buttons[5].Activated()) { if (game.party.ActiveCharacters.Count == 1) game.OpenUIWindow(new Inventory(game, game.TextureLoader.RequestTexture("UI\\World\\NameWindow"), game.party, game.party.GetPlayerCharacter(game.party.ActiveCharacters[0]), false)); else { charaSelector = new CharacterSelector(game, new Point(Buttons[5].Position.X - 290, Buttons[5].Position.Y)); nextWindow = 2; } } if (Buttons[6].Activated() && game.gameFlags["bAccessPartyWindow"] == true) { charaSelector = null; game.OpenUIWindow(new PartyWindow(game)); } if (Buttons[7].Activated()) { charaSelector = null; game.OpenUIWindow(new QuestWindow(game)); } } } }