Esempio n. 1
0
 public void DeleteLevel(bool Choice)
 {
     this.IsFinished = true;
     if (Choice)
     {
         Directory.Delete(Level.CurrentLevelButton.Path, true);
         MainMenu.Activate();
     }
 }
Esempio n. 2
0
 private static void BClick_MainMenu()
 {
     if ((ScreenManager.Ingame || ScreenManager.Editing) && !ScreenManager.Levelselect)
     {
         MainMethod.popupBox = new PopupBox(new string[] { "Are you sure?", "You will lose all unsaved progress!" }, PopupType.QUIT);
     }
     else
     {
         MainMenu.Activate();
     }
 }
Esempio n. 3
0
 public void QuitGame(bool Choice)
 {
     this.IsFinished = true;
     if (Choice)
     {
         MainMenu.Activate();
         Editor.CurrentBlock       = null;
         Editor.CurrentEntity      = null;
         Editor.CurrentCollectable = null;
     }
 }
Esempio n. 4
0
        protected override void Update(GameTime gameTime)
        {
            if (this.isAppStarting)
            {
                MainMenu.Activate();
                this.isAppStarting = false;
            }
            else
            {
                SteamIntegration.Update();
            }
            if (ScreenManager.GameClosing)
            {
                SteamAPI.Shutdown();
                base.Exit();
            }
            if (base.IsActive && !SteamIntegration.instance.IsPublishing)
            {
                MainMenu.Update();
                LevelSaver.Update();

                if (popupBox == null)
                {
                    InGame.Update();
                    Editor.Update();
                }
                else if (popupBox.IsFinished)
                {
                    popupBox = null;
                }
                InputManager.CheckInput();
            }
            else if (ScreenManager.Ingame)
            {
                PauseMenu.Pause();
            }
            if (LevelLoader.LevelComplete)
            {
                if (!ScreenManager.Custom)
                {
                    SaveFile.CompleteLevel();
                }
                if (Level.Current == Level.maxLevels)
                {
                    if (ScreenManager.Custom)
                    {
                        Level.Current = 0;
                        LevelLoader.NextLevel();
                    }
                    else
                    {
                        SteamIntegration.Achievements.GameComplete();
                        LevelLoader.LevelComplete = false;
                        ScreenManager.GameCompleteOn();
                    }
                }
                else
                {
                    LevelLoader.NextLevel();
                }
            }

            if (DebugMode)
            {
                debug.Update(gameTime);
            }

            TimeSinceLastUpdate = ((float)base.TargetElapsedTime.TotalMilliseconds) / 1000f;
            base.Update(gameTime);
        }