Example #1
0
 private void StartNewStoryMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         StartNewStory();
     }
 }
Example #2
0
 void Callback(MyGuiScreenMessageBoxCallbackEnum val)
 {
     if (m_callback != null)
     {
         m_callback(val);
     }
 }
        private void ClearAsteroid(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                var             voxelMap      = m_entity as MyVoxelMap;
                MyMwcVector3Int voxelCoordMin = new MyMwcVector3Int(0, 0, 0);
                MyMwcVector3Int voxelCoordMax = voxelMap.Size;

                //  Fix min and max cell coordinates so they don't overlap the voxelmap
                voxelMap.FixVoxelCoord(ref voxelCoordMin);
                voxelMap.FixVoxelCoord(ref voxelCoordMax);

                MyMwcVector3Int voxelCoord;
                for (voxelCoord.X = voxelCoordMin.X; voxelCoord.X <= voxelCoordMax.X; voxelCoord.X++)
                {
                    for (voxelCoord.Y = voxelCoordMin.Y; voxelCoord.Y <= voxelCoordMax.Y; voxelCoord.Y++)
                    {
                        for (voxelCoord.Z = voxelCoordMin.Z; voxelCoord.Z <= voxelCoordMax.Z; voxelCoord.Z++)
                        {
                            voxelMap.SetVoxelContent(0, ref voxelCoord);
                        }
                    }
                }
                voxelMap.InvalidateCache(voxelCoordMin, voxelCoordMax);
                OnOkClick(null);
            }
        }
 void DisconnectQuestion(MyGuiScreenMessageBoxCallbackEnum resultEnum)
 {
     if (resultEnum == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         OnCancelClick(null);
         MyGuiManager.BackToMainMenu();
     }
 }
Example #5
0
 void DisconnectQuestion(MyGuiScreenMessageBoxCallbackEnum resultEnum)
 {
     if (resultEnum == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         OnCancelClick(null);
         MyGuiManager.BackToMainMenu();
     }
 }
 private void ClearVoxelHands(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         var voxelMap = m_entity as MyVoxelMap;
         voxelMap.ClearVoxelHands();
         OnOkClick(null);
     }
 }
 public void OnLogoutMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         MyConfig.Username = "";
         MyConfig.Password = "";
         MyConfig.LastLoginWasSuccessful = false;
         MyConfig.Save();
         MyGuiManager.AddScreen(new MyGuiScreenLogoutProgress(OnLogoutProgressClosed));
     }
 }
 public void OnLogoutMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         MyConfig.Username = "";
         MyConfig.Password = "";
         MyConfig.LastLoginWasSuccessful = false;
         MyConfig.Save();
         MyGuiManager.AddScreen(new MyGuiScreenLogoutProgress(OnLogoutProgressClosed));
     }
 }
Example #9
0
 private void OnClick(MyGuiScreenMessageBoxCallbackEnum result)
 {
     if (CloseBeforeCallback)
     {
         CloseInternal();
         Callback(result);
     }
     else
     {
         Callback(result);
         CloseInternal();
     }
 }
Example #10
0
        private void MessageBoxCallback(Exception exception, MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            m_retryScreen.CloseScreenNow();
            m_retryScreen = null;

            // retry
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                Retry();
            }
            // continue without saving
            else if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.NO)
            {
                RaiseActionFailed(exception);
                CloseScreen();
            }
        }
 private void MessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     // retry
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         var newSaveScreen = new MyGuiScreenEditorSaveProgress(m_sectorIdentifier, m_checkpoint, m_savePlayer, true, true);
         newSaveScreen.Saved      = this.Saved;
         newSaveScreen.SaveFailed = this.SaveFailed;
         MyGuiManager.AddScreen(newSaveScreen);
     }
     // continue without saving
     else if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.NO)
     {
         var handler = SaveFailed;
         if (handler != null)
         {
             handler(this);
         }
     }
 }
            private void AssignAlreadyAssignedCommand(MyGuiScreenMessageBoxCallbackEnum r, MyControl control)
            {
                if (r == MyGuiScreenMessageBoxCallbackEnum.YES)
                {
                    switch (m_deviceType)
                    {
                    case MyGuiInputDeviceEnum.Keyboard:
                        m_control.SetControl(control.GetKeyboardControl());
                        control.SetControl(Keys.None);
                        break;

                    case MyGuiInputDeviceEnum.Mouse:
                        m_control.SetControl(control.GetMouseControl());
                        control.SetControl(MyMouseButtonsEnum.None);
                        break;

                    case MyGuiInputDeviceEnum.Joystick:
                        m_control.SetControl(control.GetJoystickControl());
                        control.SetControl(MyJoystickButtonsEnum.None);
                        break;

                    case MyGuiInputDeviceEnum.JoystickAxis:
                        m_control.SetControl(control.GetJoystickAxisControl());
                        control.SetControl(MyJoystickAxesEnum.None);
                        break;
                    }
                    m_buttonsDictionary[m_control].SetText(new StringBuilder(m_control.GetControlButtonName(m_deviceType)));
                    if (m_buttonsDictionary.ContainsKey(control))
                    {
                        m_buttonsDictionary[control].SetText(new StringBuilder(control.GetControlButtonName(m_deviceType)));
                    }
                    CloseScreen();
                }
                else
                {
                    MyGuiManager.GetInput().GetListOfPressedKeys(m_oldPressedKeys);
                    MyGuiManager.GetInput().GetListOfPressedMouseButtons(m_oldPressedMouseButtons);
                    MyGuiManager.GetInput().GetListOfPressedJoystickButtons(m_oldPressedJoystickButtons);
                    MyGuiManager.GetInput().GetListOfPressedJoystickAxes(m_oldPressedJoystickAxes);
                }
            }
        public void OnMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                //  Save current video mode settings
                SaveSettings();
                MyConfig.Save();

                //  These are now OLD settings
                UpdateSettings(m_settingsOld);

                this.CloseScreenNow();
            }
            else
            {
                m_doRevert = true;
                //RevertChanges();
            }

            m_waitingForConfirmation = false;
        }
 private void Restart(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         MyGuiManager.CloseAllScreensExcept(MyGuiScreenGamePlay.Static);
         MySession.StartLastCheckpoint();
     }
 }
 private void ClearVoxelHands(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         var voxelMap = m_entity as MyVoxelMap;
         voxelMap.ClearVoxelHands();
         OnOkClick(null);
     }
 }
        private void ClearAsteroid(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                var voxelMap = m_entity as MyVoxelMap;
                MyMwcVector3Int voxelCoordMin = new MyMwcVector3Int(0, 0, 0);
                MyMwcVector3Int voxelCoordMax = voxelMap.Size;

                //  Fix min and max cell coordinates so they don't overlap the voxelmap
                voxelMap.FixVoxelCoord(ref voxelCoordMin);
                voxelMap.FixVoxelCoord(ref voxelCoordMax);

                MyMwcVector3Int voxelCoord;
                for (voxelCoord.X = voxelCoordMin.X; voxelCoord.X <= voxelCoordMax.X; voxelCoord.X++)
                {
                    for (voxelCoord.Y = voxelCoordMin.Y; voxelCoord.Y <= voxelCoordMax.Y; voxelCoord.Y++)
                    {
                        for (voxelCoord.Z = voxelCoordMin.Z; voxelCoord.Z <= voxelCoordMax.Z; voxelCoord.Z++)
                        {
                            voxelMap.SetVoxelContent(0, ref voxelCoord);
                        }
                    }
                }
                voxelMap.InvalidateCache(voxelCoordMin, voxelCoordMax);
                OnOkClick(null);
            }
        }
Example #17
0
 private static void OnErrorClick(MyGuiScreenMessageBoxCallbackEnum result)
 {
     MyGuiManager.BackToMainMenu();
 }
 static void OnErrorClose(MyGuiScreenMessageBoxCallbackEnum result)
 {
     MyGuiManager.BackToMainMenu();
 }
 void Callback(MyGuiScreenMessageBoxCallbackEnum val)
 {
     if (m_callback != null) m_callback(val);
 }
        private void MessageBoxCallback(Exception exception, MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            m_retryScreen.CloseScreenNow();
            m_retryScreen = null;

            // retry
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                Retry();
            }
            // continue without saving
            else if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.NO)
            {
                RaiseActionFailed(exception);
                CloseScreen();
            }
        }
 void MsgBoxCallback(MyGuiScreenMessageBoxCallbackEnum result)
 {
     RecreateControls();
 }
 private void OnClick(MyGuiScreenMessageBoxCallbackEnum result)
 {
     if (CloseBeforeCallback)
     {
         CloseInternal();
         Callback(result);
     }
     else
     {
         Callback(result);
         CloseInternal();
     }
 }
 private static void onMessageBox(MyGuiScreenMessageBoxCallbackEnum result)
 {
     MyGuiManager.BackToMainMenu();
 }
 private void AssignAlreadyAssignedCommand(MyGuiScreenMessageBoxCallbackEnum r, MyControl control)
 {
     if (r == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         switch (m_deviceType)
         {
             case MyGuiInputDeviceEnum.Keyboard:
                 m_control.SetControl(control.GetKeyboardControl());
                 control.SetControl(Keys.None);
                 break;
             case MyGuiInputDeviceEnum.Mouse:
                 m_control.SetControl(control.GetMouseControl());
                 control.SetControl(MyMouseButtonsEnum.None);
                 break;
             case MyGuiInputDeviceEnum.Joystick:
                 m_control.SetControl(control.GetJoystickControl());
                 control.SetControl(MyJoystickButtonsEnum.None);
                 break;
             case MyGuiInputDeviceEnum.JoystickAxis:
                 m_control.SetControl(control.GetJoystickAxisControl());
                 control.SetControl(MyJoystickAxesEnum.None);
                 break;
         }
         m_buttonsDictionary[m_control].SetText(new StringBuilder(m_control.GetControlButtonName(m_deviceType)));
         m_buttonsDictionary[control].SetText(new StringBuilder(control.GetControlButtonName(m_deviceType)));
         CloseScreen();
     }
     else
     {
         MyGuiManager.GetInput().GetListOfPressedKeys(m_oldPressedKeys);
         MyGuiManager.GetInput().GetListOfPressedMouseButtons(m_oldPressedMouseButtons);
         MyGuiManager.GetInput().GetListOfPressedJoystickButtons(m_oldPressedJoystickButtons);
         MyGuiManager.GetInput().GetListOfPressedJoystickAxes(m_oldPressedJoystickAxes);
     }
 }
 public void OnExitToWindowsMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         MyGuiManager.AddScreen(new MyGuiScreenLogoutProgress(OnLogoutProgressClosed));
     }
 }
 public static void OnExitToMainMenuMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         // No mission active...ask whether save or not
         if (MySession.Static != null && MyMissions.ActiveMission == null && MyGuiScreenGamePlay.Static.IsGameStoryActive() && MyClientServer.LoggedPlayer.GetCanSave())
         {
             var messageBox = new MyGuiScreenMessageBox(MyMessageBoxType.ERROR, MyTextsWrapperEnum.SaveCurrentProgress, MyTextsWrapperEnum.SaveCurrentProgressCaption, MyTextsWrapperEnum.Yes, MyTextsWrapperEnum.No, OnSaveGameResponse);
             messageBox.SkipTransition = true;
             messageBox.InstantClose = false;
             MyGuiManager.AddScreen(messageBox);
         }
         else
         {
             UnloadAndExitToMenu();
         }
     }
     else
     {
         MyGuiManager.GetMainMenuScreen().m_screenCanHide = true;
     }
 }
        public void OnMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
        {
            if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
            {
                //  Save current video mode settings
                SaveSettings();
                MyConfig.Save();

                //  These are now OLD settings
                UpdateSettings(m_settingsOld);

                this.CloseScreenNow();
            }
            else
            {
                m_doRevert = true;
                //RevertChanges();
            }

            m_waitingForConfirmation = false;
        }
 private static void OnSaveGameResponse(MyGuiScreenMessageBoxCallbackEnum result)
 {
     if (result == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         MySession.Static.SaveLastCheckpoint();
     }
     UnloadAndExitToMenu();
 }
 private void MessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     // retry
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         var newSaveScreen = new MyGuiScreenEditorSaveProgress(m_sectorIdentifier, m_checkpoint, m_savePlayer, true, true);
         newSaveScreen.Saved = this.Saved;
         newSaveScreen.SaveFailed = this.SaveFailed;
         MyGuiManager.AddScreen(newSaveScreen);
     }
     // continue without saving
     else if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.NO)
     {
         var handler = SaveFailed;
         if (handler != null)
         {
             handler(this);
         }
     }
 }
 private void StartNewStoryMessageBoxCallback(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     if (callbackReturn == MyGuiScreenMessageBoxCallbackEnum.YES)
     {
         StartNewStory();
     }
 }
 void Multiplayer_ShutdownOk(MyGuiScreenMessageBoxCallbackEnum callbackReturn)
 {
     MyGuiManager.BackToMainMenu();
 }
 private void YouDontHaveEnoughMoneyMessageBoxCallBack(MyGuiScreenMessageBoxCallbackEnum callbackReturn) 
 {
     this.UnhideScreen();
 }
 void MsgBoxCallback(MyGuiScreenMessageBoxCallbackEnum result)
 {
     RecreateControls();
 }