Esempio n. 1
0
        public JsonResult addOrEditMenu(MainMenu menu)
        {
            ResponseModel result = new ResponseModel();

            if (menu.ID > 0)
            {
                result = _menuM.UpdateMenu(menu);
            }
            else
            {
                menu.IsActive = true;
                result        = _menuM.AddMenu(menu);
            }
            return(Json(result));
        }
Esempio n. 2
0
        public JsonResult addOrEditMenu(MainMenu menu)
        {
            ResponseModel result = new ResponseModel();

            menu.Url      = _postM.GenerateUriFormat(menu.Title);
            menu.IsActive = true;
            if (menu.ID > 0)
            {
                result = _menuM.UpdateMenu(menu);
            }
            else
            {
                menu.IsActive = true;
                result        = _menuM.AddMenu(menu);
            }
            return(Json(result));
        }
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            FrameworkCore.campaignTimer += (int)gameTime.ElapsedGameTime.TotalMilliseconds;

#if XBOX
            if (Helpers.GuideVisible)
            {
                base.Update(gameTime);
                return;
            }
#endif



#if DEBUG
            if (FrameworkCore.players[0].inputmanager.debugF1Pressed)
            {
                MainMenuManager.AddMenu(new DebugEventsMenu());
            }

            if (FrameworkCore.players[0].inputmanager.debugF2Pressed)
            {
                if (isAutotesting)
                {
                    FrameworkCore.PlayCue(sounds.Fanfare.klaxon);
                }
                else
                {
                    FrameworkCore.PlayCue(sounds.Fanfare.timer);
                }

                isAutotesting = !isAutotesting;
            }



            if (isAutotesting)
            {
                RunAdventureTest(gameTime);
            }

            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.OemTilde))
            {
                this.Exit();
            }
#endif


            foreach (PlayerCommander player in FrameworkCore.players)
            {
                player.UpdateControls(gameTime, (FrameworkCore.gameState != GameState.WorldMap));
            }


            if (FrameworkCore.gameState == GameState.Logos)
            {
                //make sure the demoThink happens before the menus, because
                // we want the menu to have priority over the demoThink routines.

                DemoThink(gameTime);

                if (!FrameworkCore.sysMenuManager.Update(gameTime, FrameworkCore.controllingInputManager))
                {
                    FrameworkCore.MainMenuManager.Update(gameTime, FrameworkCore.controllingInputManager);
                    UpdatePlayer2Controls(gameTime);
                }
            }
            else if (FrameworkCore.gameState == GameState.Play)
            {
                level.Update(gameTime);
            }
            else
            {
                worldMap.Update(gameTime);
            }



            base.Update(gameTime);
        }