Exemplo n.º 1
0
        public Menu MenuGraphics()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);
            Menu.Add("Graphics.Text.Fullscreen", new SimpleText("MenuGraphics.Fullscreen", new Vector2(20, 20), Item.PosOnScreen.TopLeft,
                RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("Graphics.Checkbox.Fullscreen", new CheckBox(new Vector2(72, 20), "MSTheme", GameEngine.Config.FullScreen));
            Menu.Add("Graphics.Text.TextureHD", new SimpleText("MenuGraphics.TextureHD", new Vector2(20, 30), Item.PosOnScreen.TopLeft,
                RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("Graphics.Checkbox.TextureHD", new CheckBox(new Vector2(72, 30), "MSTheme", GameEngine.Config.PreferMultiSampling));
            Menu.Add("Graphics.ClassicList.Resolution", new ClassicList(new Rectangle(20, 40, 60, 30), CreateResolutions(),
                new Dictionary<string, int> { { "MenuGraphics.Resolution", 100 } }, RessourceProvider.Fonts["MenuLittle"], Color.White,
                Color.DarkOrange, "MSTheme"));
            Menu.Add("ApplyButton.Item", new MenuButton("MenuSettings.Apply", new Vector2(70, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, ApplyButtonGraphics));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(10, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));

            (Menu.Items["Graphics.ClassicList.Resolution"] as ClassicList).SetSelectedLine(new[]
                {
                    GameEngine.Config.ResolutionWidth + "x" + GameEngine.Config.ResolutionHeight
                });

            return Menu;
        }
Exemplo n.º 2
0
        public Menu MenuControls()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);

            var keys = RessourceProvider.InputKeys.ToDictionary(e => e.Key, e => e.Value);

            Menu.Add("Controls.ButtonsPlayer.Item", new ListButtons(new Vector2(10, 20), 0, new List<PartialButton>
                {
                    new PartialButton("Player.1",() => HideKeySelectorsPlayers(0)),
                    new PartialButton("Player.2",() => HideKeySelectorsPlayers(1)),
                    new PartialButton("Player.3",() => HideKeySelectorsPlayers(2)),
                    new PartialButton("Player.4",() => HideKeySelectorsPlayers(3)),
                }, RessourceProvider.Fonts["Menu"], Color.White, Color.DarkOrange, ListButtons.StatusListButtons.Horizontal, false));

            for (int i = 0; i < 4; i++)
                CreateKeySelectorList(i,keys);

            Menu.Add("ApplyButton.Item", new MenuButton("MenuSettings.Apply", new Vector2(70, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange,() => ApplyButtonControls(keys)));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(10, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));

            return Menu;
        }
Exemplo n.º 3
0
        public Menu Create()
        {
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);

            Menu.Add("WaitingRoom.Item", new SimpleText("Menu.WaitingRoom", new Vector2(15,80), Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"],Color.White,false));
            Menu.Add("NextButton.Item", new MenuButton("Menu.Next", new Vector2(70, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, NextButton));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(15, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));
            return Menu;
        }
Exemplo n.º 4
0
        public Menu Create(Stack<Character> characters)
        {
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"],false);

            Menu.Add("ListOfPlayer.Items", new ClassicList(new Rectangle(20,40,60,40),CreateLines(characters),new Dictionary<string, int>
                {
                    {"MenuGameOver.Rank",20},
                    {"MenuGameOver.Players",80}
                },RessourceProvider.Fonts["MenuLittle"],Color.White,Color.White,"MSTheme" ));
            Menu.Add("WinnerHead.Item", new ImageButton(characters.Peek().PlayerName,new Rectangle(40,7,characters.Peek().Face.Width/3,characters.Peek().Face.Height/3),
                characters.Peek().Face,RessourceProvider.Fonts["MenuLittle"],true));
            (Menu.Items["WinnerHead.Item"] as ImageButton).IsSelect = true;

            Menu.Add("NextButton.Item", new MenuButton("Menu.ReturnMainMenu", new Vector2(70, 90), RessourceProvider.Fonts["MenuLittle"], Color.White,
                Color.DarkOrange, ReturnMainMenu));
            return Menu;
        }
Exemplo n.º 5
0
        public Menu Create()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["MainMenu"],false);

            var buttons = new List<PartialButton>
                              {
                                  new PartialButton("Menu.Back", ReturnButton),
                                  new PartialButton("MainMenu.Settings", () => GameEngine.DisplayStack.Push(new SettingsMenu().MenuSettings())),
                                  new PartialButton("Menu.ReturnMainMenu", ReturnMainMenu)
                              };

            Menu.Add("Buttons.Item", new ListButtons(new Vector2(50, 44), 20, buttons, RessourceProvider.Fonts["Menu"],
                Color.White, Color.DarkOrange, ListButtons.StatusListButtons.Vertical));

            return Menu;
        }
Exemplo n.º 6
0
        public Menu CreateMainMenu()
        {
            var menu = new Menu(RessourceProvider.MenuBackgrounds["MainMenu"]);
            var buttons = new List<PartialButton>
                {
                    new PartialButton("MainMenu.SoloPlay", () => GameEngine.DisplayStack.Push(new LocalGameMenu(_spriteBatch).Create())),
                    new PartialButton("MainMenu.Multi", () => GameEngine.DisplayStack.Push(new CharacterSelector(_spriteBatch,_graphics).Create())),
                    new PartialButton("MainMenu.Settings", () => GameEngine.DisplayStack.Push(new SettingsMenu().MenuSettings())),
                    new PartialButton("MainMenu.Credits", () => GameEngine.DisplayStack.Push(new Cinematic(RessourceProvider.Videos["Credits"]))),
                    new PartialButton("MainMenu.Quit", () => Environment.Exit(0))
                };

            menu.Add("Buttons.Item", new ListButtons(new Vector2(50, 44), 20, buttons, RessourceProvider.Fonts["Menu"],
                Color.White, Color.DarkOrange, ListButtons.StatusListButtons.Vertical));
            Menu = menu;
            return menu;
        }
Exemplo n.º 7
0
        public Menu MenuSettings()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["MainMenu"]);
            var buttons = new List<PartialButton>
                              {
                                  new PartialButton("MenuSettings.Language", ChangeLanguage),
                                  new PartialButton("MenuSettings.Controls", () => GameEngine.DisplayStack.Push(MenuControls())),
                                  new PartialButton("MenuSettings.Graphics", () => GameEngine.DisplayStack.Push(MenuGraphics())),
                                  new PartialButton("MenuSettings.Sounds", () => GameEngine.DisplayStack.Push(MenuSounds())),
                                  new PartialButton("Menu.Back", MainMenu.Back)
                              };

            Menu.Add("Buttons.Item", new ListButtons(new Vector2(50, 44), 20, buttons, RessourceProvider.Fonts["Menu"],
                Color.White, Color.DarkOrange, ListButtons.StatusListButtons.Vertical));
            return Menu;
        }
Exemplo n.º 8
0
        public Menu Create()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);
            Menu.Add("CharacterSelector.Text", new SimpleText("Text.SelectPlayer", new Vector2(15, 15),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("CharacterSelector.Item", new ListImageButtons(new Rectangle(15, 22, 70, 45), RessourceProvider.CharacterFaces, "MSTheme",
                RessourceProvider.Fonts["HUDlittle"]));
            Menu.Add("PlayerName.Text", new SimpleText("Text.TextboxPlayer", new Vector2(15, 75),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("PlayerName.Item", new Textbox("",new Rectangle(15,82,300,0), "MSTheme",
                RessourceProvider.Fonts["Menu"], Color.White));

            Menu.Add("NextButton.Item", new MenuButton("Menu.Next", new Vector2(70, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, NextButton));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(15, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));

            return Menu;
        }
Exemplo n.º 9
0
        public Menu Create()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);

            Menu.Add("Text.NumberOfLives", new SimpleText("Text.Lives", new Vector2(60, 3), Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("Slider.NumberOfLives", new Slider(new Rectangle(70, 3, 200, 20), 5, 1, 99, "MSTheme", RessourceProvider.Fonts["MenuLittle"]));

            Menu.Add("CharacterSelector.Text", new SimpleText("Text.SelectPlayer", new Vector2(5, 17),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White));
            for (int i = 0; i < 4; i++)
                CreateCharacterSelector(i);

            Menu.Add("ButtonsPlayer.Item", new ListButtons(new Vector2(10, 12), 0, new List<PartialButton>
                {
                    new PartialButton("Player.1",() => HideElementsPlayers(0)),
                    new PartialButton("Player.2",() => HideElementsPlayers(1)),
                    new PartialButton("Player.3",() => HideElementsPlayers(2)),
                    new PartialButton("Player.4",() => HideElementsPlayers(3)),
                }, RessourceProvider.Fonts["MenuLittle"], Color.White, Color.DarkOrange, ListButtons.StatusListButtons.Horizontal, false));

            Menu.Add("PlayerName.Text", new SimpleText("Text.TextboxPlayer", new Vector2(55, 73),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White));

            Menu.Add("Text.Multiple.ActivatePl", new SimpleText("Text.ActivatePl", new Vector2(55, 23),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White, false));
            Menu.Add("Text.Multiple.ActivateAI", new SimpleText("Text.ActivateAI", new Vector2(55, 33),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White, false));
            Menu.Add("Text.Multiple.SliderHandicap", new SimpleText("Text.SliderHandicap", new Vector2(55, 45),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White, false));
            Menu.Add("Text.Multiple.SliderLevel", new SimpleText("Text.SliderLevel", new Vector2(55, 55),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["MenuLittle"], Color.White, false));

            Menu.Add("NextButton.Item", new MenuButton("Menu.Next", new Vector2(70, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, NextButtonCharacterSelector));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(15, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));

            return Menu;
        }
Exemplo n.º 10
0
        Menu MapSelector(List<PartialAICharacter> characters, int nbLives)
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);

            Menu.Add("MapSelector.Text", new SimpleText("Text.SelectMap", new Vector2(15, 15),
                Item.PosOnScreen.TopLeft, RessourceProvider.Fonts["Menu"], Color.White));
            Menu.Add("MapSelector.Item", new ListImageButtons(new Rectangle(15, 22, 70, 45), RessourceProvider.MapScreens, "MSTheme",
                RessourceProvider.Fonts["HUDlittle"], 4));

            Menu.Add("NextButton.Item", new MenuButton("Menu.Next", new Vector2(70, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, () => NextButtonMapSelector(characters, nbLives)));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(15, 90), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));

            return Menu;
        }
Exemplo n.º 11
0
        public Menu MenuSounds()
        {
            System.Threading.Thread.Sleep(200);
            Menu = new Menu(RessourceProvider.MenuBackgrounds["SimpleMenu"]);

            Menu.Add("Sounds.Text.Musics", new SimpleText("MenuSounds.Musics", new Vector2(10, 20), Item.PosOnScreen.TopLeft,
                RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("Sounds.Item.Musics", new Slider(new Rectangle(60, 21, 280, 20),
                GameEngine.Config.VolumeMusic, "MSTheme", RessourceProvider.Fonts["MenuLittle"]));
            Menu.Add("Sounds.Text.Effects", new SimpleText("MenuSounds.Effects", new Vector2(10, 40), Item.PosOnScreen.TopLeft,
                RessourceProvider.Fonts["MenuLittle"], Color.White));
            Menu.Add("Sounds.Item.Effects", new Slider(new Rectangle(60, 41, 280, 20),
                GameEngine.Config.VolumeEffect, "MSTheme", RessourceProvider.Fonts["MenuLittle"]));
            Menu.Add("ApplyButton.Item", new MenuButton("MenuSettings.Apply", new Vector2(70, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, ApplyButtonSounds));
            Menu.Add("ReturnButton.Item", new MenuButton("Menu.Back", new Vector2(10, 80), RessourceProvider.Fonts["Menu"], Color.White,
                Color.DarkOrange, MainMenu.Back));
            return Menu;
        }