public StartingPathMenu(Simulator simulator, double visualPriority) { Simulator = simulator; VisualPriority = visualPriority; //RemainingWavesChoice = new ColoredTextContextualMenuChoice("RemainingWaves", new ColoredText(new List<string>() { "", "", "" }, new Color[] { Color.White, Color.White, Color.White }, @"Pixelite", Vector3.Zero) { SizeX = 2 }); RemainingEnemiesChoice = new ColoredTextContextualMenuChoice("RemainingEnemies", new ColoredText(new List<string>() { "", "" }, new Color[] { Color.White, Color.White }, @"Pixelite", Vector3.Zero) { SizeX = 2 }); //NextWaveCompositionChoice = new NextWaveContextualMenuChoice("NextWaveComposition"); //TimeNextWaveChoice = new ColoredTextContextualMenuChoice("TimeRemainingChoice", new ColoredText(new List<string>() { "", "", "" }, new Color[] { Color.White, Color.White, Color.White }, @"Pixelite", Vector3.Zero) { SizeX = 2 }); CallTheNextWave = new TextContextualMenuChoice("CallTheNextWave", new Text("I'm ready! Bring it on!", @"Pixelite") { SizeX = 2 }); var choices = new List<ContextualMenuChoice>(); //choices.Add(RemainingWavesChoice); //choices.Add(TimeNextWaveChoice); //choices.Add(RemainingEnemiesChoice); //choices.Add(NextWaveCompositionChoice); choices.Add(CallTheNextWave); Menu = new ContextualMenu(Simulator, VisualPriority, Color.White, choices, 5) { SelectedIndex = 0 }; remainingWaves = 0; timeNextWave = 0; activeWaves = 0; CheckedIn = null; }
public void Initialize() { Choices = new List<ContextualMenuChoice>(); Dictionary<TurretType, Turret> availableTurrets = Simulator.TurretsFactory.Availables; foreach (var t in availableTurrets.Values) { Image image = t.BaseImage.Clone(); image.SizeX = 3; image.Origin = Vector2.Zero; Choices.Add(new LogoTextContextualMenuChoice("Buy", new Text(t.BuyPrice + "$", @"Pixelite") { SizeX = 2 }, image) { LogoOffet = new Vector3(0, -2, 0) }); } Menu = new ContextualMenu(Simulator, VisualPriority, Color, Choices, 5); }
public WorldMenu(Simulator simulator, double visualPriority, Dictionary<string, LevelDescriptor> availableLevels, Color color) { Simulator = simulator; VisualPriority = visualPriority; AvailableLevels = availableLevels; AlternateSelectedText = color == Colors.Spaceship.Yellow; PausedGameChoices = new List<ContextualMenuChoice>() { new TextContextualMenuChoice("resume", new Text("resume game", @"Pixelite") { SizeX = 2 }), new TextContextualMenuChoice("new", new Text("new game", @"Pixelite") { SizeX = 2 }) }; PausedGameMenu = new ContextualMenu(simulator, visualPriority, color, PausedGameChoices, 15); Title = new Text(@"Pixelite") { SizeX = 3, VisualPriority = VisualPriorities.Default.LevelNumber, Alpha = 200 }; Difficulty = new Text(@"Pixelite") { SizeX = 3, VisualPriority = VisualPriorities.Default.LevelNumber, Alpha = 200 }; Highscore = new Text(@"Pixelite") { SizeX = 2, VisualPriority = VisualPriorities.Default.LevelHighScore, Alpha = 200 }; Stars = new ScoreStars(Simulator.Scene, 0, VisualPriorities.Default.LevelHighScore).CenterIt(); PausedGameMenuCheckedIn = false; }
public TurretMenu(Simulator simulator, double visualPriority, Color color, InputType inputType) { Simulator = simulator; float textSize = 2f; AlternateSelectedCannotDo = color == Colors.Spaceship.Pink; AlternateSelectedText = color == Colors.Spaceship.Yellow; Choices = new List<ContextualMenuChoice>() { new UpgradeTurretContextualMenuChoice("upgrade", new Text(@"Pixelite") { SizeX = textSize }, new Text(@"Pixelite") { SizeX = textSize }, new Image("upgrade") { SizeX = 3, Origin = Vector2.Zero }), new LogoTextContextualMenuChoice("sell", new Text(@"Pixelite") { SizeX = textSize }, new Image("sell") { SizeX = 3, Origin = Vector2.Zero }) { LogoOffet = new Vector3(3, 3, 0), DistanceBetweenNameAndLogo = new Vector2(60, 0) } }; Menu = new ContextualMenu(simulator, visualPriority, color, Choices, 15); InitializeHelpBarMessages(inputType); }
public EditorCelestialBodyMenu(Simulator simulator, Color color) { Simulator = simulator; Choices = new List<ContextualMenuChoice>() { new EditorTextContextualMenuChoice("Move", "Move", 1, new EditorCelestialBodyCommand("Move")), new EditorTextContextualMenuChoice("Rotate", "Rotate", 1, new EditorCelestialBodyCommand("Rotate")), new EditorTextContextualMenuChoice("Shrink", "Shrink", 1, new EditorCelestialBodyCommand("Shrink")), new EditorTextContextualMenuChoice("Remove", "Remove", 1, new EditorCelestialBodyCommand("Remove")), new EditorToggleContextualMenuChoice("Speed", new List<string>() { "Speed: 0", "Speed: 1", "Speed: 2", "Speed: 3", "Speed: 4", "Speed: 5", "Speed: 6", "Speed: 7", "Speed: 8", "Speed: 9", "Speed: 10" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[1] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[2] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[3] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[4] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[5] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[6] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[7] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[8] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[9] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[10] }, new EditorCelestialBodyCommand("ToggleSpeed") { Speed = EditorLevelGenerator.PossibleRotationTimes[0] } }), new EditorTextContextualMenuChoice("PushFirst", "Push first on path", 1, new EditorCelestialBodyCommand("PushFirst")), new EditorTextContextualMenuChoice("PushLast", "Push last on path", 1, new EditorCelestialBodyCommand("PushLast")), new EditorToggleContextualMenuChoice("AddToPath", new List<string>() { "Add to starting path", "Remove from starting path" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("AddGravitationalTurret"), new EditorCelestialBodyCommand("RemoveGravitationalTurret") }), new EditorToggleContextualMenuChoice("Size", new List<string>() { "Size: small", "Size: medium", "Size: big" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("ToggleSize") { Size = Size.Normal }, new EditorCelestialBodyCommand("ToggleSize") { Size = Size.Big }, new EditorCelestialBodyCommand("ToggleSize") { Size = Size.Small }, }), GetToggleAssets(), new EditorTextContextualMenuChoice("Verify", "Verify", 1, new EditorCelestialBodyCommand("Verify")), new EditorTextContextualMenuChoice("StartingPosition", "Starting Position", 1, new EditorCelestialBodyCommand("StartingPosition")), new EditorToggleContextualMenuChoice("ShowPath", new List<string>() { "Show path", "Hide path" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("ShowPathPreview"), new EditorCelestialBodyCommand("HidePathPreview") }), new EditorToggleContextualMenuChoice("HasMoons", new List<string>() { "Has moons: true", "Has moons: false" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("HasMoons") { HasMoons = false }, new EditorCelestialBodyCommand("HasMoons") { HasMoons = true } }), new EditorToggleContextualMenuChoice("FollowPath", new List<string>() { "Follow path: true", "Follow path: false" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("FollowPath") { FollowPath = false }, new EditorCelestialBodyCommand("FollowPath") { FollowPath = true } }), new EditorToggleContextualMenuChoice("CanSelect", new List<string>() { "Can select: true", "Can select: false" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("CanSelect") { CanSelect = false }, new EditorCelestialBodyCommand("CanSelect") { CanSelect = true } }), new EditorToggleContextualMenuChoice("StraightLine", new List<string>() { "Straight line: true", "Straight line: false" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("StraightLine") { StraightLine = false }, new EditorCelestialBodyCommand("StraightLine") { StraightLine = true } }), new EditorToggleContextualMenuChoice("Invincible", new List<string>() { "Invincible: true", "Invincible: false" }, 1, new List<EditorCommand>() { new EditorCelestialBodyCommand("Invincible") { Invincible = false }, new EditorCelestialBodyCommand("Invincible") { Invincible = true } }) }; NumberOfChoices = Choices.Count; Menu = new ContextualMenu(Simulator, Preferences.PrioriteGUIPanneauGeneral - 0.001, color, Choices, 5); }
public EditorGeneralMenu(Simulator simulator, Vector3 position, double visualPriority) { Simulator = simulator; Position = position; VisualPriority = visualPriority; Menus = new Dictionary<EditorGeneralMenuChoice, Image>(EditorGeneralMenuChoiceComparer.Default); Menus.Add(EditorGeneralMenuChoice.File, new Image("EditorFile", position) { SizeX = 4, VisualPriority = visualPriority }); Menus.Add(EditorGeneralMenuChoice.Gameplay, new Image("EditorGameplay", position + new Vector3(50, 0, 0)) { SizeX = 4, VisualPriority = visualPriority }); Menus.Add(EditorGeneralMenuChoice.Waves, new Image("EditorWaves", position + new Vector3(100, 0, 0)) { SizeX = 4, VisualPriority = visualPriority }); Menus.Add(EditorGeneralMenuChoice.Battlefield, new Image("EditorBattlefield", position + new Vector3(150, 0, 0)) { SizeX = 4, VisualPriority = visualPriority }); SubMenus = new Dictionary<EditorGeneralMenuChoice, ContextualMenu>(EditorGeneralMenuChoiceComparer.Default); //================================================================= var choices = new List<ContextualMenuChoice>() { new EditorTextContextualMenuChoice("New", "New", 2, new EditorCommand("NewLevel")), new EditorTextContextualMenuChoice("Load", "Load", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Load, true)), new EditorTextContextualMenuChoice("Save", "Save", 2, new EditorCommand("SaveLevel")), new EditorTextContextualMenuChoice("Delete", "Delete", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Delete, true)), new EditorToggleContextualMenuChoice("Playtest", new List<string>() { "Playtest", "Edit" }, 2, new List<EditorCommand>() { new EditorCommand("PlaytestState"), new EditorCommand("EditState") }), new EditorTextContextualMenuChoice("Restart", "Restart", 2, new EditorCommand("RestartSimulation")), new EditorToggleContextualMenuChoice("Pause", new List<string>() { "Pause", "Resume" }, 2, new List<EditorCommand>() { new EditorCommand("PauseSimulation"), new EditorCommand("ResumeSimulation") }), }; var menu = new ContextualMenu(simulator, Preferences.PrioriteGUIPanneauGeneral - 0.001, Color.White, choices, 5); menu.SetTitle("File"); SubMenus.Add(EditorGeneralMenuChoice.File, menu); //================================================================= choices = new List<ContextualMenuChoice>() { new EditorTextContextualMenuChoice("Background", "Background", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Background, true)), new EditorTextContextualMenuChoice("General", "General", 2, new EditorPanelCommand("ShowPanel", EditorPanel.General, true)), new EditorTextContextualMenuChoice("Turrets", "Turrets", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Turrets, true)), new EditorTextContextualMenuChoice("PowerUps", "Power-ups", 2, new EditorPanelCommand("ShowPanel", EditorPanel.PowerUps, true)), new EditorTextContextualMenuChoice("Player", "Player", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Player, true)) }; menu = new ContextualMenu(simulator, Preferences.PrioriteGUIPanneauGeneral - 0.001, Color.White, choices, 5); menu.SetTitle("Gameplay"); SubMenus.Add(EditorGeneralMenuChoice.Gameplay, menu); //================================================================= choices = new List<ContextualMenuChoice>() { new EditorTextContextualMenuChoice("AddPlanet", "Add a planet", 2, new EditorCelestialBodyCommand("AddPlanet")), new EditorToggleContextualMenuChoice("ShowPaths", new List<string>() { "Show paths", "Hide paths" }, 2, new List<EditorCommand>() { new EditorCommand("ShowCelestialBodiesPaths"), new EditorCommand("HideCelestialBodiesPaths") }), new EditorTextContextualMenuChoice("Clear", "Clear", 2, new EditorCelestialBodyCommand("Clear")), }; menu = new ContextualMenu(simulator, Preferences.PrioriteGUIPanneauGeneral - 0.001, Color.White, choices, 5); menu.SetTitle("Battlefield"); SubMenus.Add(EditorGeneralMenuChoice.Battlefield, menu); //================================================================= choices = new List<ContextualMenuChoice>() { new EditorTextContextualMenuChoice("Edit", "Edit...", 2, new EditorPanelCommand("ShowPanel", EditorPanel.Waves, true)), }; menu = new ContextualMenu(simulator, Preferences.PrioriteGUIPanneauGeneral - 0.001, Color.White, choices, 5); menu.SetTitle("Waves"); SubMenus.Add(EditorGeneralMenuChoice.Waves, menu); //================================================================= SubMenuToFadeOut = EditorGeneralMenuChoice.None; }