public LoginScreen(Game game, Texture2D background)
            : base(game)
        {
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));

            Components.Add(new BackgroundComponent(game, background));

            menu = new MenuComponent(game, Content.Load<SpriteFont>(@"font\Comic_Sans_18px"));

            // menu options
            menu.SetMenuItems(menuItems);
            menu.StartIndex = 0;
            menu.SelectedIndex = 1;
            menu.Position = new Vector2(610, 195);
            menu.NormalColor = Color.White;
            menu.HiliteColor = Color.Red;
            menu.EndIndex = 1;

            spriteFont = Content.Load<SpriteFont>(@"font\Arial_12px");
            keyboardiput = new KeyboardInput(game, spriteFont, new Vector2(450, 186));
            keyboardiput.outline = "left";

            phase = 0;
            keyboardiput.Activate(username);
        }
        public SkillScreen(Game game, Texture2D background)
            : base(game)
        {
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            graphics = (GraphicsDevice)Game.Services.GetService(typeof(GraphicsDevice));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));

            this.smallFont = Content.Load<SpriteFont>(@"font\Comic_Sans_15px");
            this.normalFont = Content.Load<SpriteFont>(@"font\Comic_Sans_18px");

            Components.Add(new BackgroundComponent(game, background));
            options = new MenuComponent(game, smallFont);
        }
Example #3
0
        public StartScreen()
        {
            string[] menuItems = { "Start Game", "End Game" };

            menuComponent = new MenuComponent(menuItems);
            Components.Add(menuComponent);

            imageRectangle = new Rectangle(
                0,
                0,
                Game.Window.ClientBounds.Width,
                Game.Window.ClientBounds.Height);
        }
        public CharacterSelectionScreen(Game game)
            : base(game)
        {
            // select Resource services
            spriteBatch = ResourceManager.GetInstance.spriteBatch;
            Content = ResourceManager.GetInstance.Content;

            // select spritefont
            playerNameFont = Content.Load<SpriteFont>(@"font\Arial_12px");

            // define components
            bgcomp1 = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\background1"));
            bgcomp2 = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\character_selection"));
            bgcomp3 = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\frame2"));
            menu = new MenuComponent(game, Content.Load<SpriteFont>(@"font\Comic_Sans_18px"));

            // add components
            Components.Add(bgcomp1);
            Components.Add(bgcomp2);
            Components.Add(bgcomp3);

            // menu options
            menu.SetMenuItems(menuItems);
            menu.StartIndex = 0;
            menu.Position = new Vector2(665, 230);
            menu.NormalColor = Color.White;
            menu.HiliteColor = Color.Red;
            menu.MenuItemSpace = 25;
            menu.Rotation[2] = 0.25f;
            menu.Offset[2] = new Vector2(0, -5);
            menu.Offset[3] = new Vector2(-8, 23);
            menu.Offset[4] = new Vector2(-526, -22);
            menu.EndIndex = 3;

            // player sprite
            playersprite = new PlayerSprite(100, 123);
            player = new PlayerInfo();
            playersprite.Player = this.player;

            // player offsets
            for (int i = 0; i < 6; i++)
                this.spriteOfset[i] = playersprite.getoffset(i);

            // options
            option_board = Content.Load<Texture2D>(@"gfx\screens\screenobjects\option_board");
            screen_board = Content.Load<Texture2D>(@"gfx\screens\screenobjects\next_board");

            // slots
            slot = Content.Load<Texture2D>(@"gfx\screens\screenobjects\empty_character_slot");
        }
        public MessagePopup(Game game, SpriteFont spriteFont)
            : base(game)
        {
            this.spriteFont = spriteFont;
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));
            gfxdevice = (GraphicsDevice)Game.Services.GetService(typeof(GraphicsDevice));

            menu = new MenuComponent(game, spriteFont);
            Components.Add(menu);
            balloon = new TextBalloon(game);

            LoadContent();
        }
        public InGameMainMenuScreen(Game game,SpriteFont spriteFont, Texture2D background)
            : base(game)
        {
            this.spriteFont = spriteFont;
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));
            gfxdevice = (GraphicsDevice)Game.Services.GetService(typeof(GraphicsDevice));

            menu = new MenuComponent(game, spriteFont);
            menu.StartIndex = 0;
            menu.SetMenuItems(menuItems);

            Components.Add(new BackgroundComponent(game, background));
            Components.Add(menu);

            LoadAssets();
        }
        public ItemMenuScreen(Game game, SpriteFont spriteFont, Texture2D background)
            : base(game)
        {
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            graphics = (GraphicsDevice)Game.Services.GetService(typeof(GraphicsDevice));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));

            this.spriteFont = spriteFont;
            itemlist = new ItemlistComponent(game);
            options = new MenuComponent(game, spriteFont);

            SetmenuCategories(categories);
            updateItemList();

            Components.Add(new BackgroundComponent(game, background));
            Components.Add(itemlist);
        }
        public ShopMenuScreen(Game game, SpriteFont spriteFont, Texture2D background)
            : base(game)
        {
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            graphics = (GraphicsDevice)Game.Services.GetService(typeof(GraphicsDevice));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));

            this.spriteFont = Content.Load<SpriteFont>(@"font\Comic_Sans_15px");

            itemlist = new ItemlistComponent(game);
            options = new ScreenPopup(game, Content.Load<SpriteFont>(@"font\Comic_Sans_18px"));

            updateItemList();
            SetShopItems(this.shopItems);

            Components.Add(new BackgroundComponent(game, background));
        }
Example #9
0
 public StartScreen(Game game,
 SpriteBatch spriteBatch,
 SpriteFont spriteFont,
 Texture2D image)
     : base(game, spriteBatch)
 {
     string[] menuItems = { "Start Game", "End Game" };
     menuComponent = new MenuComponent(game,
         spriteBatch,
         spriteFont,
         menuItems);
     Components.Add(menuComponent);
     this.image = image;
     imageRectangle = new Rectangle(
         0,
         0,
         Game.Window.ClientBounds.Width,
         Game.Window.ClientBounds.Height);
 }
Example #10
0
 public WaitressComposite(MenuComponent menus)
 {
     this._menus = menus;
 }
Example #11
0
        private static void OnEvadeModeChange(MenuComponent sender, ValueChangedArgs e)
        {
            var mode = e.GetNewValue <MenuList>().SelectedItem;

            switch (mode)
            {
            case "Fastest":
                Menu["FastMovementBlock"].As <MenuBool>().Value         = true;
                Menu["FastEvadeActivationTime"].As <MenuSlider>().Value = 120;
                Menu["RejectMinDistance"].As <MenuSlider>().Value       = 25;
                Menu["ExtraCPADistance"].As <MenuSlider>().Value        = 25;
                Menu["ExtraPingBuffer"].As <MenuSlider>().Value         = 80;
                Menu["TickLimiter"].As <MenuSlider>().Value             = 100;
                Menu["SpellDetectionTime"].As <MenuSlider>().Value      = 0;
                Menu["ReactionTime"].As <MenuSlider>().Value            = 0;
                Menu["DodgeInterval"].As <MenuSlider>().Value           = 0;
                break;

            case "Very Smooth":
                Menu["FastEvadeActivationTime"].As <MenuSlider>().Value = 0;
                Menu["RejectMinDistance"].As <MenuSlider>().Value       = 0;
                Menu["ExtraCPADistance"].As <MenuSlider>().Value        = 0;
                Menu["ExtraPingBuffer"].As <MenuSlider>().Value         = 40;
                break;

            case "Smooth":
                Menu["FastMovementBlock"].As <MenuBool>().Value         = true;
                Menu["FastEvadeActivationTime"].As <MenuSlider>().Value = 65;
                Menu["RejectMinDistance"].As <MenuSlider>().Value       = 10;
                Menu["ExtraCPADistance"].As <MenuSlider>().Value        = 10;
                Menu["ExtraPingBuffer"].As <MenuSlider>().Value         = 65;
                break;

            case "Hawk":
                Menu["DodgeDangerous"].As <MenuBool>().Value            = false;
                Menu["DodgeFOWSpells"].As <MenuBool>().Value            = false;
                Menu["DodgeCircularSpells"].As <MenuBool>().Value       = false;
                Menu["DodgeDangerousKeyEnabled"].As <MenuBool>().Value  = true;
                Menu["HigherPrecision"].As <MenuBool>().Value           = true;
                Menu["RecalculatePosition"].As <MenuBool>().Value       = true;
                Menu["ContinueMovement"].As <MenuBool>().Value          = true;
                Menu["CalculateWindupDelay"].As <MenuBool>().Value      = true;
                Menu["CheckSpellCollision"].As <MenuBool>().Value       = true;
                Menu["PreventDodgingUnderTower"].As <MenuBool>().Value  = false;
                Menu["PreventDodgingNearEnemy"].As <MenuBool>().Value   = true;
                Menu["AdvancedSpellDetection"].As <MenuBool>().Value    = true;
                Menu["ClickOnlyOnce"].As <MenuBool>().Value             = true;
                Menu["EnableEvadeDistance"].As <MenuBool>().Value       = true;
                Menu["TickLimiter"].As <MenuSlider>().Value             = 200;
                Menu["SpellDetectionTime"].As <MenuSlider>().Value      = 375;
                Menu["ReactionTime"].As <MenuSlider>().Value            = 285;
                Menu["DodgeInterval"].As <MenuSlider>().Value           = 235;
                Menu["FastEvadeActivationTime"].As <MenuSlider>().Value = 0;
                Menu["SpellActivationTime"].As <MenuSlider>().Value     = 200;
                Menu["RejectMinDistance"].As <MenuSlider>().Value       = 0;
                Menu["ExtraPingBuffer"].As <MenuSlider>().Value         = 65;
                Menu["ExtraCPADistance"].As <MenuSlider>().Value        = 0;
                Menu["ExtraSpellRadius"].As <MenuSlider>().Value        = 0;
                Menu["ExtraEvadeDistance"].As <MenuSlider>().Value      = 200;
                Menu["ExtraAvoidDistance"].As <MenuSlider>().Value      = 200;
                Menu["MinComfortZone"].As <MenuSlider>().Value          = 550;
                break;

            case "Kurisu":
                Menu["DodgeFOWSpells"].As <MenuBool>().Value           = false;
                Menu["DodgeDangerousKeyEnabled"].As <MenuBool>().Value = true;
                Menu["RecalculatePosition"].As <MenuBool>().Value      = true;
                Menu["ContinueMovement"].As <MenuBool>().Value         = true;
                Menu["CalculateWindupDelay"].As <MenuBool>().Value     = true;
                Menu["PreventDodgingUnderTower"].As <MenuBool>().Value = true;
                Menu["PreventDodgingNearEnemy"].As <MenuBool>().Value  = true;
                Menu["MinComfortZone"].As <MenuSlider>().Value         = 850;
                break;

            case "GuessWho":
                Menu["DodgeDangerousKeyEnabled"].As <MenuBool>().Value = true;
                Menu["HigherPrecision"].As <MenuBool>().Value          = true;
                Menu["CheckSpellCollision"].As <MenuBool>().Value      = true;
                Menu["PreventDodgingUnderTower"].As <MenuBool>().Value = true;
                Menu["ShowStatus"].As <MenuBool>().Value   = false;
                Menu["DrawSpellPos"].As <MenuBool>().Value = true;
                break;
            }
        }
Example #12
0
 public LoginView()
 {
     _loginComponent = new LoginComponent(WebDriver);
     _menuComponent  = new MenuComponent(WebDriver);
 }
Example #13
0
 public Waitress(MenuComponent allMenusParam)
 {
     this.allMenus = allMenusParam;
 }
 public virtual void remove(MenuComponent menuComponent)
 {
     throw new NotImplementedException();
 }
 public override void add(MenuComponent menuCoponent)
 {
     menuComponents.Add(menuCoponent);
 }
Example #16
0
 public void Add(MenuComponent menuComponent)
 {
 }
Example #17
0
 public Waitress(MenuComponent menu)
 {
     _menu = menu;
 }
Example #18
0
        /// <summary>
        /// Create the menu Panels from files
        /// </summary>
        /// <param name="pathName">Path to the file which define the panel</param>
        /// <param name="panelName">Name of the current panel to contstruct</param>
        /// <param name="setPanelActive">If true, set the panel to active</param>
        /// <param name="offsetWidth">Offset by which all components will be shifted (position)</param>
        /// <param name="idAssociatePlayerScreen">Index of associate player screen, Usefull for split screen menu</param>
        public void CreatePanel(string pathName, string panelName, bool setPanelActive = false, int offsetWidth = 0, int idAssociatePlayerScreen = 0)
        {
            MenuManager.Instance.MenuRect[panelName].active = setPanelActive;

            // General parse of the file
            List <MenuStruct> panelObjects = File.ReadMenuPanel(pathName);

            // Define menu components
            foreach (MenuStruct MS in panelObjects)
            {
                if (MS.menuType == MenuType.Button)
                {
                    if (MS.Name == "Alphabet")
                    {
                        CreateAlphabetButtons(panelName, offsetWidth, idAssociatePlayerScreen);
                    }
                    else
                    {
                        Button button = new Button(TexturesButtons[MS.TextureName], MS.Position + new Vector2(offsetWidth, 0));

                        if (MS.TextureInsideName != null)
                        {
                            button.InsideImage = TexturesButtons[MS.TextureInsideName];
                        }
                        if (MS.Text != null)
                        {
                            button.Text = MS.Text;
                        }
                        if (MS.NameToSwitchTo != null)
                        {
                            button.NameMenuToSwitchTo = MS.NameToSwitchTo;
                        }
                        if (MS.Name != null)
                        {
                            button.nameIdentifier = MS.Name;
                        }
                        if (MS.ScaleHeight != default(float))
                        {
                            button.ScaleHeight = MS.ScaleHeight;
                        }
                        if (MS.ScaleWidth != default(float))
                        {
                            button.ScaleWidth = MS.ScaleWidth;
                        }
                        if (MS.ScaleHeightInside != default(float))
                        {
                            button.ScaleHeightInside = MS.ScaleHeightInside;
                        }
                        if (MS.ScaleWidthInside != default(float))
                        {
                            button.ScaleWidthInside = MS.ScaleWidthInside;
                        }
                        //if (MS.Index != default(int)) button.Index = MS.Index;
                        if (MS.Color != default(Color))
                        {
                            button.ImageColor = MS.Color;
                        }
                        if (MS.ColorInside != default(Color))
                        {
                            button.InsideObjectColor = MS.ColorInside;
                        }
                        if (MS.transparency != default(int))
                        {
                            button.ImageColor.A = (byte)MS.transparency;
                        }

                        button.IsCurrentSelection          = MS.CurrentSelection;
                        button.IsClicked                   = MS.IsClicked;
                        button.IndexAssociatedPlayerScreen = idAssociatePlayerScreen;
                        button.Index          = MS.Index;
                        button.DeSelectOnMove = MS.deSelectOnMove;
                        button.Active         = MS.Active;

                        if (MS.UseBigFont)
                        {
                            button.Font = UserInterface.menuBigFont;
                        }

                        MenuManager.Instance.MenuRect[panelName].AddComponent(button);
                    }
                }
                else if (MS.menuType == MenuType.Text)
                {
                    if (MS.Name == "ModelsStats")
                    {
                        CreateTextModelsStats(panelName, offsetWidth, idAssociatePlayerScreen);
                    }
                    else
                    {
                        TextBox textBox = new TextBox();

                        if (MS.Name != null)
                        {
                            textBox.NameIdentifier = MS.Name;
                        }
                        if (MS.Position != null)
                        {
                            textBox.InitPos = MS.Position + new Vector2(offsetWidth, 0);
                        }
                        if (MS.Text != null)
                        {
                            textBox.Text = MS.Text;
                        }
                        else
                        {
                            textBox.Text = "";
                        }

                        MenuManager.Instance.MenuRect[panelName].AddComponent(textBox);
                    }
                }
                else if (MS.menuType == MenuType.Image)
                {
                    Image img = new Image(TexturesButtons[MS.TextureName]);

                    if (MS.Position != null)
                    {
                        img.Position = MS.Position + new Vector2(offsetWidth, 0);
                    }
                    if (MS.Name != null)
                    {
                        img.NameIdentifier = MS.Name;
                    }
                    if (MS.ScaleHeight != default(float))
                    {
                        img.ScaleHeight = MS.ScaleHeight;
                    }
                    if (MS.ScaleWidth != default(float))
                    {
                        img.ScaleWidth = MS.ScaleWidth;
                    }
                    if (MS.Color != default(Color))
                    {
                        img.colour = MS.Color;
                    }
                    if (MS.transparency != default(int))
                    {
                        img.colour.A = (byte)MS.transparency;
                    }

                    img.Active = MS.Active;

                    MenuManager.Instance.MenuRect[panelName].AddComponent(img);
                }
                else if (MS.menuType == MenuType.Slider)
                {
                    Slider slider = new Slider(MS.Position + new Vector2(offsetWidth, 0), TexturesButtons["slider"], TexturesButtons["button"]);

                    if (MS.Name != null)
                    {
                        slider.nameIdentifier = MS.Name;
                    }
                    if (MS.TextureName != null)
                    {
                        slider.Texture = TexturesButtons[MS.TextureName];
                    }

                    slider.IndexAssociatedPlayerScreen = idAssociatePlayerScreen;

                    MenuManager.Instance.MenuRect[panelName].AddComponent(slider);
                }
                else if (MS.menuType == MenuType.TickBox)
                {
                    TickBox tickBox = new TickBox(MS.Position + new Vector2(offsetWidth, 0), TexturesButtons["buttonCircle"], TexturesButtons["buttonCircle"]);

                    if (MS.Name != null)
                    {
                        tickBox.nameIdentifier = MS.Name;
                    }
                    if (MS.ScaleHeight != default(float))
                    {
                        tickBox.ScaleHeight = MS.ScaleHeight;
                    }
                    if (MS.ScaleWidth != default(float))
                    {
                        tickBox.ScaleWidth = MS.ScaleWidth;
                    }
                    if (MS.ScaleHeightInside != default(float))
                    {
                        tickBox.ScaleHeightClicked = MS.ScaleHeightInside;
                    }
                    if (MS.ScaleWidthInside != default(float))
                    {
                        tickBox.ScaleWidthClicked = MS.ScaleWidthInside;
                    }

                    tickBox.IsClicked = MS.IsClicked;
                    tickBox.IndexAssociatedPlayerScreen = idAssociatePlayerScreen;

                    MenuManager.Instance.MenuRect[panelName].AddComponent(tickBox);
                }
            }

            // dirty hack :(
            if (panelName == "play2Shared0" || panelName == "play2Shared1" || panelName == "play2Shared2" || panelName == "play2Shared3")
            {
                Button bu = ((Button)FindMenuComponentinPanelWithName("NamePlayer", panelName));
                bu.Text = "Player " + (idAssociatePlayerScreen + 1).ToString();
                bu.IndexAssociatedPlayerScreen = idAssociatePlayerScreen;

                switch (panelName)
                {
                case "play2Shared0":
                    bu.Text = "Louis";
                    break;

                case "play2Shared1":
                    bu.Text = "Ted";
                    break;
                }
            }

            // Set constraints
            foreach (MenuStruct MS in panelObjects)
            {
                // Up, Down, Left, Right selection change
                if (MS.Name != null && MS.NeighborsUpDownLeftRight != null)
                {
                    MenuComponent menuComp = FindMenuComponentinPanelWithName(MS.Name, panelName);

                    if (MS.NeighborsUpDownLeftRight[0] != "null")
                    {
                        menuComp.NeighborUp = FindMenuComponentinPanelWithName(MS.NeighborsUpDownLeftRight[0], panelName);
                    }
                    if (MS.NeighborsUpDownLeftRight[1] != "null")
                    {
                        menuComp.NeighborDown = FindMenuComponentinPanelWithName(MS.NeighborsUpDownLeftRight[1], panelName);
                    }
                    if (MS.NeighborsUpDownLeftRight[2] != "null")
                    {
                        menuComp.NeighborLeft = FindMenuComponentinPanelWithName(MS.NeighborsUpDownLeftRight[2], panelName);
                    }
                    if (MS.NeighborsUpDownLeftRight[3] != "null")
                    {
                        menuComp.NeighborRight = FindMenuComponentinPanelWithName(MS.NeighborsUpDownLeftRight[3], panelName);
                    }
                }

                // Set list of component with unique clicked possibility
                if (MS.Name != null && MS.UniqueChoiceButtonWith != null)
                {
                    Button bu = (Button)FindMenuComponentinPanelWithName(MS.Name, panelName);
                    foreach (string elem in MS.UniqueChoiceButtonWith)
                    {
                        bu.neighbors.Add((Button)FindMenuComponentinPanelWithName(elem, panelName));
                    }
                }

                // Set actions on pressed
                if (MS.menuType == MenuType.Button && MS.Name != null && MS.Functions != null)
                {
                    Button bu = (Button)FindMenuComponentinPanelWithName(MS.Name, panelName);
                    foreach (string elem in MS.Functions)
                    {
                        bu.Click += FunctionsMenu[elem];
                    }
                }
                else if (MS.menuType == MenuType.Slider && MS.Name != null && MS.Functions != null)
                {
                    Slider sl = (Slider)FindMenuComponentinPanelWithName(MS.Name, panelName);
                    foreach (string elem in MS.Functions)
                    {
                        sl.OnReleaseSlider += FunctionsMenu[elem];
                    }
                }
                else if (MS.menuType == MenuType.TickBox && MS.Name != null && MS.Functions != null)
                {
                    TickBox tc = (TickBox)FindMenuComponentinPanelWithName(MS.Name, panelName);
                    foreach (string elem in MS.Functions)
                    {
                        tc.Click += FunctionsMenu[elem];
                    }
                }
            }

            // Dirty hack
            // Create rankings
            if (panelName == "ranking")
            {
                LoadRankingsText();
            }
        }
Example #19
0
 public void Remove(MenuComponent menuComponent)
 {
 }
 protected void InitializeMenu(Grid menuGrid, int row, int column) => MenuComponent = new MenuComponent(menuGrid, new MenuSettings(menuGrid, column, row, MenuSlideOffset, MenuSlideSpeed));
Example #21
0
        /// <summary>
        ///     The minimum health needed to cast the Spell from the 'slot' SpellSlot.
        /// </summary>
        public static int GetNeededHealth(SpellSlot slot, MenuComponent value)
        {
            var cost = ChampionBase.GetSpellFromSlot(slot).Cost();

            return((int)(value.Value + cost / LocalPlayer.Instance.MaxHP * 100));
        }
 public void Remove(MenuComponent menuComponent) {
 }
Example #23
0
 public override void remove(MenuComponent menuCoponent)
 {
     menuComponents.Remove(menuCoponent);
 }
Example #24
0
 public Waitress(MenuComponent allMenus)
 {
     this.allMenus = allMenus;
 }
Example #25
0
        protected override void Initialize()
        {
            this.settings = new GameSettings();

            GameSettingsComponent settingsComponent = new GameSettingsComponent(this, settings, graphics);

            this.Components.Add(settingsComponent);

            LoadingScreenComponent loading = new LoadingScreenComponent(this, settings);

            this.Components.Add(loading);

            MenuItemsComponent menuItems = new MenuItemsComponent(
                this,
                settings,
                new Vector2(this.viewport.Width * 0.45f, this.viewport.Height * 0.75f),
                Color.Blue,
                Color.Yellow,
                72
                );

            menuItems.AddItem("Hrát", "new-game");
            menuItems.AddItem("Nastavení", "settings");
            menuItems.AddItem("O høe", "about");
            menuItems.AddItem("Odejít", "exit");

            MenuItemsComponent settingScreenItems = new MenuItemsComponent(
                this,
                settings,
                new Vector2(this.viewport.Width * 0.45f, this.viewport.Height * 0.75f),
                Color.Blue,
                Color.Yellow,
                72
                );

            settingScreenItems.AddItem("Postava", "player-sprite");
            settingScreenItems.AddItem("Hudba", "music-enabled");
            settingScreenItems.AddItem("Zpìt do menu", "back");

            ScrollingBackgroundComponent scrollingBackground = new ScrollingBackgroundComponent(this, settings);

            this.Components.Add(scrollingBackground);

            GameSettingsScreenComponent settingsScreenComponent = new GameSettingsScreenComponent(this, settings, settingScreenItems);

            this.Components.Add(settingsScreenComponent);

            AboutScreenComponent aboutScreenComponent = new AboutScreenComponent(this, settings);

            this.Components.Add(aboutScreenComponent);

            MenuComponent menu = new MenuComponent(this, settings, menuItems);

            this.Components.Add(menu);

            LevelComponent level = new LevelComponent(this, settings, scrollingBackground);

            this.Components.Add(level);

            this.loadingScreen  = new GameWindow(this, loading);
            this.menuWindow     = new GameWindow(this, menu, menuItems, settingsComponent, scrollingBackground);
            this.ingameWindow   = new GameWindow(this, level, settingsComponent, scrollingBackground);
            this.settingsScreen = new GameWindow(this, settingsScreenComponent, settingScreenItems, settingsComponent, scrollingBackground);
            this.aboutScreen    = new GameWindow(this, settingsComponent, scrollingBackground, aboutScreenComponent);

            foreach (GameComponent component in this.Components)
            {
                this.SwitchComponent(component, false);
            }

            // BASE GRAPHICS STUFF
            this.IsMouseVisible = false;
            //this.graphics.IsFullScreen = true;
            this.graphics.PreferredBackBufferHeight = 720;
            this.graphics.PreferredBackBufferWidth  = 1280;
            this.graphics.ApplyChanges();

            this.SwitchWindows(loadingScreen);

            base.Initialize();
        }
        public void Init()

        {
            //create menus

            pancakeHouseMenu = new Menu("PANCAKE HOUSE MENU", "Breakfast");

            dinnerMenu = new Menu("DINNER MENU", "Lunch");

            cafeMenu = new Menu("CAFE MENU", "Dinner");

            dessertMenu = new Menu("DESSERT MENU", "Dessert of course");



            //create the all menus to act as the container for the menus

            allMenus = new Menu("ALL MENUS", "All menus combined");



            //add the menus to the All Menus menu

            allMenus.Add(pancakeHouseMenu);

            allMenus.Add(dinnerMenu);

            allMenus.Add(cafeMenu);



            //breakfast menu

            pancakeHouseMenu.Add(new MenuItem("K&B's Pancake Breakfast",

                                              "Pancakes with scrambled eggs, and toast",

                                              true,

                                              2.99));

            pancakeHouseMenu.Add(new MenuItem("Regular Pancake Breakfast",

                                              "Pancakes with fried eggs, and sausage",

                                              false,

                                              2.99));

            pancakeHouseMenu.Add(new MenuItem("Blueberry Pancakes",

                                              "Pancakes made with fresh blueberries",

                                              true,

                                              3.49));

            pancakeHouseMenu.Add(new MenuItem("Waffles",

                                              "Waffles, with your choice of blueberries or strawberries",

                                              true,

                                              3.59));



            //dinner menu

            dinnerMenu.Add(new MenuItem("Vegetarian BLT",

                                        "(Fakin') Bacon with lettuce & tomato on whole wheat",

                                        true,

                                        2.99));

            dinnerMenu.Add(new MenuItem("Soup of the day",

                                        "Soup of the day, with a side of potato salad",

                                        false,

                                        3.29));

            dinnerMenu.Add(new MenuItem("Hotdog",

                                        "A hot dog with saurkraut, relish, onions, topped with cheese",

                                        false,

                                        3.05));

            dinnerMenu.Add(new MenuItem("Steamed Veggies and Brown Rice",

                                        "Steamed vegetables over brown rice",

                                        true,

                                        3.99));



            //cafe menu

            cafeMenu.Add(new MenuItem("Veggie Burger and Air Fries",

                                      "Veggie burger on a whole wheat bun, lettuce, tomato, and fries",

                                      true, 3.99));

            cafeMenu.Add(new MenuItem("Soup of the Day",

                                      "A cup of the soup of the day, with a side salad",

                                      false, 3.69));

            cafeMenu.Add(new MenuItem("Burrito",

                                      "A large burrito, with whole pinto beans, salsa, guacamole",

                                      true, 4.29));



            //add the dessert as a child node off the dinner menu

            dinnerMenu.Add(dessertMenu);



            //dinner menu

            dessertMenu.Add(new MenuItem("Apple Pie",

                                         "Apple pie with a flakey crust, topped with vanilla icecream",

                                         true, 1.59));

            dessertMenu.Add(new MenuItem("Chocolate Cake",

                                         "Creamy chololate cake with caramel icing",

                                         true, 2.59));

            dessertMenu.Add(new MenuItem("Icecream Pie",

                                         "Icecream pie with crunchy crust",

                                         true, 1.50));



            //instantiate the waitress passing in all the menus

            waitress = new Waitress(allMenus);
        }
Example #27
0
        /// <summary>
        /// Initializes all the gameScenes.
        /// Sets the menuScene as the active scene.
        /// </summary>
        private void Initialize()
        {
            // creating background components
            PlanetBackgroundComponent        planetBackground        = new PlanetBackgroundComponent(game);
            PlanetExplodeBackgroundComponent planetExplodeBackground = new PlanetExplodeBackgroundComponent(game);
            PlanetRingsBackgroundCompnent    planetRingsBackground   = new PlanetRingsBackgroundCompnent(game);

            // creating window components
            TopTenComponent         topTen         = new TopTenComponent(game);
            GameWonComponent        gameWon        = new GameWonComponent(game);
            GameOverComponent       gameOver       = new GameOverComponent(game);
            PlayerSettingsComponent playerSettings = new PlayerSettingsComponent(game);
            MenuItemsComponent      menuItems      = new MenuItemsComponent(game, new Vector2(700, 250), Color.Red, Color.Yellow);

            // Listing menu options. Room to grow if we want more options.
            menuItems.AddItem("Play");
            menuItems.AddItem("Top Scores");
            menuItems.AddItem("Player Settings");
            menuItems.AddItem("Quit");
            MenuComponent menu = new MenuComponent(game, menuItems);

            // Assigns music
            soundManager.SetDeepSpaceMusic(game.Content.Load <Song>(@"Sounds\DeepSpace"));
            soundManager.SetMegalovaniaMusic(game.Content.Load <Song>(@"Sounds\Megalovania"));
            soundManager.SetSolarSystemMusic(game.Content.Load <Song>(@"Sounds\Solar System"));
            soundManager.SetMenuBGMusic(game.Content.Load <Song>(@"Sounds\MenuBG"));

            // Assigns sound effects
            soundManager.SetGunShotSound(game.Content.Load <SoundEffect>(@"Sounds\gunShot"));
            soundManager.SetExplosionSound(game.Content.Load <SoundEffect>(@"Sounds\explosion"));
            soundManager.SetExplosion1Sound(game.Content.Load <SoundEffect>(@"Sounds\explosion1"));
            soundManager.SetExplosion2Sound(game.Content.Load <SoundEffect>(@"Sounds\explosion2"));
            soundManager.SetExplosionAggressiveSound(game.Content.Load <SoundEffect>(@"Sounds\explosion_aggresive"));
            soundManager.SetExplosionTinySound(game.Content.Load <SoundEffect>(@"Sounds\explosion_tiny"));
            soundManager.SetExplosionUnderwaterSound(game.Content.Load <SoundEffect>(@"Sounds\explosion_underwater"));
            soundManager.SetLaserShotSound(game.Content.Load <SoundEffect>(@"Sounds\laserShot"));
            soundManager.SetLaserShot1Sound(game.Content.Load <SoundEffect>(@"Sounds\laserShot1"));
            soundManager.SetLosingSound(game.Content.Load <SoundEffect>(@"Sounds\losing1"));
            soundManager.SetWinningSound(game.Content.Load <SoundEffect>(@"Sounds\medievalWin"));
            soundManager.SetPickUpItemSound(game.Content.Load <SoundEffect>(@"Sounds\pickUpItem"));
            soundManager.SetStartUpSound(game.Content.Load <SoundEffect>(@"Sounds\startUpSound"));

            // Assigns fancy font.
            FontOriginTech      = game.Content.Load <SpriteFont>(@"Fonts\font_origin_tech");
            FontOriginTechSmall = game.Content.Load <SpriteFont>(@"Fonts\font_origin_tech_small");
            FontOriginTechTiny  = game.Content.Load <SpriteFont>(@"Fonts\font_origin_tech_tiny");

            // Putting together the GameScenes, each using a background component and a window component.
            MenuScene           = new GameScene(game, planetBackground, menu);
            TopTenScene         = new GameScene(game, planetBackground, topTen);
            GameWonScene        = new GameScene(game, planetRingsBackground, gameWon);
            GameOverScene       = new GameScene(game, planetExplodeBackground, gameOver);
            PlayerSettingsScene = new GameScene(game, planetRingsBackground, playerSettings);
            MenuScene           = new GameScene(game, planetBackground, menu, menuItems);

            // disabling components
            foreach (GameComponent component in game.Components)
            {
                ChangeComponentState(component, false);
            }

            ChangeMusic(this.sound.MenuBG);
        }
 public abstract void Add(MenuComponent menuComponent);
 public override void remove(MenuComponent menuCoponent)
 {
     menuComponents.Remove(menuCoponent);
 }
Example #30
0
 public Waitress(MenuComponent allMenu)
 {
     _allMenu = allMenu;
 }
 public WaitressComposite(MenuComponent menus)
 {
     this._menus = menus;
 }
Example #32
0
 public Waitress(MenuComponent menuComponent)
 {
     this.menuComponent = menuComponent;
 }
Example #33
0
 public Waitress(MenuComponent menuComponent)
 {
     _menuComponent = menuComponent;
 }
Example #34
0
 public Waitress(MenuComponent allMenus)
 {
     _allMenus = allMenus;
 }
 public override void Add(MenuComponent m)
 {
     menuComponents.Add(m);
 }
 public override void Add(MenuComponent menuComponent)
 {
     _menuComponents.Add(menuComponent);
 }
Example #37
0
 public virtual void remove(MenuComponent menuComponent)
 {
     throw new NotImplementedException();
 }
 public void Add(MenuComponent menuComponent) {
 }
Example #39
0
 public override void add(MenuComponent menuCoponent)
 {
     menuComponents.Add(menuCoponent);
 }
Example #40
0
 override protected void UnloadContent()
 {
     menu = null;
 }
 public CompositeWaitress(MenuComponent allMenus)
 {
     _allMenus = allMenus;
 }
Example #42
0
        public static bool TryParseNode(IParser parser, out MenuAttribute node, MenuComponent component)
        {
            node = null;
            bool result = false;

            switch (parser.PeekToken().Kind)
            {
            case TokenKind.AcceleratorKeyword:
            {
                if (component == MenuComponent.Command)
                {
                    parser.NextToken();
                    result          = true;
                    node            = new MenuAttribute();
                    node.StartIndex = parser.Token.Span.Start;

                    if (parser.PeekToken(TokenKind.Equals))
                    {
                        parser.NextToken();
                        VirtualKey vKey;
                        if (VirtualKey.TryGetKey(parser, out vKey))
                        {
                            node.Children.Add(vKey.StartIndex, vKey);
                            node.EndIndex = parser.Token.Span.End;
                        }
                        else
                        {
                            parser.ReportSyntaxError("Invalid accelerator key specified.");
                        }
                    }
                    else
                    {
                        parser.ReportSyntaxError("Expected equals token for menu attribute.");
                    }
                }
                else
                {
                    parser.ReportSyntaxError("Menu attribute \"ACCELERATOR\" is only allowed within a command block.");
                }
            }
            break;

            case TokenKind.StyleKeyword:
            case TokenKind.TagKeyword:
            {
                parser.NextToken();
                result          = true;
                node            = new MenuAttribute();
                node.StartIndex = parser.Token.Span.Start;

                if (parser.PeekToken(TokenKind.Equals))
                {
                    parser.NextToken();
                    if (parser.PeekToken(TokenCategory.StringLiteral))
                    {
                        parser.NextToken();
                        node.EndIndex = parser.Token.Span.End;
                    }
                    else
                    {
                        parser.ReportSyntaxError("Invalid option found. Expecting string literal.");
                    }
                }
                else
                {
                    parser.ReportSyntaxError("Expected equals token for menu attribute.");
                }
            }
            break;

            case TokenKind.CommentKeyword:
            case TokenKind.ImageKeyword:
            case TokenKind.TextKeyword:
            {
                if (component == MenuComponent.Group ||
                    component == MenuComponent.Command)
                {
                    parser.NextToken();
                    result          = true;
                    node            = new MenuAttribute();
                    node.StartIndex = parser.Token.Span.Start;

                    if (parser.PeekToken(TokenKind.Equals))
                    {
                        parser.NextToken();
                        if (parser.PeekToken(TokenCategory.StringLiteral))
                        {
                            parser.NextToken();
                            node.EndIndex = parser.Token.Span.End;
                        }
                        else
                        {
                            parser.ReportSyntaxError("Invalid option found. Expecting string literal.");
                        }
                    }
                    else
                    {
                        parser.ReportSyntaxError("Expected equals token for menu attribute.");
                    }
                }
                else
                {
                    parser.ReportSyntaxError("Menu attribute not allowed for this block.");
                }
            }
            break;

            case TokenKind.HiddenKeyword:
            {
                if (component == MenuComponent.Group ||
                    component == MenuComponent.Command ||
                    component == MenuComponent.Separator)
                {
                    parser.NextToken();
                    result          = true;
                    node            = new MenuAttribute();
                    node.StartIndex = parser.Token.Span.Start;

                    if (parser.PeekToken(TokenKind.Equals))
                    {
                        if (parser.PeekToken(TokenKind.UserKeyword))
                        {
                            parser.NextToken();
                        }
                        else
                        {
                            parser.ReportSyntaxError("Invalid token found. Expecting \"USER\".");
                        }
                    }

                    node.EndIndex = parser.Token.Span.End;
                }
                else
                {
                    parser.ReportSyntaxError("Menu attribute \"HIDDEN\" not allowed for the current menu block.");
                }
            }
            break;
            }

            return(result);
        }
Example #43
0
 private static void ERangeOnOnValueChanged(MenuComponent sender, ValueChangedArgs args)
 {
     SpellManager.UpdateERange();
 }
        public CharacterCreationScreen(Game game)
            : base(game)
        {
            spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            Content = (ContentManager)Game.Services.GetService(typeof(ContentManager));

            smallFont = Content.Load<SpriteFont>(@"font\Arial_10px");
            spriteFont = Content.Load<SpriteFont>(@"font\Arial_12px");

            keyboardiput = new KeyboardInput(game, spriteFont, new Vector2(580, 175));
            bgcomp[1] = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\background2"));
            bgcomp[2] = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\character_create"));
            bgcomp[3] = new BackgroundComponent(game, Content.Load<Texture2D>(@"gfx\background\frame2"));

            Components.Add(bgcomp[1]);
            Components.Add(bgcomp[2]);
            Components.Add(bgcomp[3]);

            for (int i = 0; i <= properties.Length -1; i++)
            {
                properties[i] = new MenuComponent(game, Content.Load<SpriteFont>(@"font\Arial_12px"));
                properties[i].StartIndex = 0;
                properties[i].Position = new Vector2(180, 140 + (i * 24));
                properties[i].HiliteColor = Color.Black;
                properties[i].Shade = false;
                properties[i].DisplaySingle = true;
                properties[i].ListDown = false;
            }

            properties[0].SetMenuItems(item0);
            properties[1].SetMenuItems(item1);
            properties[2].SetMenuItems(item2);
            properties[3].SetMenuItems(item3);
            properties[4].SetMenuItems(item4);
            properties[5].SetMenuItems(item5);

            nameboard = Content.Load<Texture2D>(@"gfx\screens\screenobjects\character_nameboard");
            propertyboard = Content.Load<Texture2D>(@"gfx\screens\screenobjects\character_properties");

            // Create player info instance
            // newPlayer = new PlayerInfo();

            // Activate Text Input Class (for PlayerName)
            // keyboardiput.Activate(newPlayer.Name.ToString());

            // Set Phase to Name
            phase = Phase.Name;

            // player sprite
            playersprite = new PlayerSprite(352, 188);
        }
Example #45
0
 public static void SetGUIColors()
 {
     MenuComponent.UpdateColors();
     Prefab.UpdateColors();
 }
Example #46
0
 public HomeView()
 {
     _menuComponent = new MenuComponent(WebDriver);
 }
 public override void Remove(MenuComponent menuComponent)
 {
     _menuComponents.Remove(menuComponent);
 }
Example #48
0
 public Client(MenuComponent menus)
 {
     _menus = menus;
 }