protected static bool IsValidState() { if (VideoRecorder.Instance.Status == Status.Running) { return(false); } if (UIManager.GetModalWindow() != null) { return(false); } if (Sims3.SimIFace.Gameflow.SaveIsDisabled) { return(false); } if (GameStates.GetInWorldSubState() is LiveModeState) { return(true); } if ((GameStates.GetInWorldSubState() is BuildModeState) || (GameStates.GetInWorldSubState() is BuyModeState) || (GameStates.GetInWorldSubState() is BlueprintModeState)) { return(Settings.mPromptInBuildBuy); } return(false); }
public void OnPreSave() { sSaveWasPerformed = true; sSaveWasRequested = false; if (GameStates.GetInWorldSubState() is LiveModeState) { if (sTimer != null) { sTimer.Stop(); sTimer = null; } } }
public static void TriggerLesson(Lessons lesson, Sim sim) { if (!IntroTutorial.IsRunning && !Sims3.SimIFace.Environment.HasEditInGameModeSwitch && Tutorialette.AreTutorialTipsEnabled()) { InWorldSubState inWorldSubState = GameStates.GetInWorldSubState(); if (inWorldSubState != null) { string stateName = inWorldSubState.StateName; if (stateName != "Play Flow" && Tutorialette.IsValidLesson(lesson, sim)) { TutorialetteNotification.Show(Tutorialette.sLessonTnsKeys[lesson].LessonTnsKey, (int)lesson); } } } }
protected static void OnSave() { OptionsModel optionsModel = Sims3.Gameplay.UI.Responder.Instance.OptionsModel as OptionsModel; if (optionsModel == null) { return; } string saveName = optionsModel.SaveName; sOriginalSaveName = saveName; if (!string.IsNullOrEmpty(saveName)) { saveName = saveName.Replace(".sims3", ""); } if ((saveName != null) && (saveName != "")) { int i = 0; for (i = saveName.Length - 1; i >= 0; i--) { string value = saveName[i].ToString(); int test; if (!int.TryParse(value, out test)) { break; } } int.TryParse(saveName.Substring(i + 1), out sCount); saveName = saveName.Substring(0, i + 1); } sCount++; if (sCount > Settings.mSaveCycles) { sCount = 1; } bool saveAs = true; if (!string.IsNullOrEmpty(saveName)) { optionsModel.SaveName = saveName + sCount.ToString(); } else { saveAs = false; } sSaveWasRequested = true; sSaveWasPerformed = false; if (!optionsModel.SaveGame(true, true, saveAs)) { OnCheckForSave(); } else { if (GameStates.GetInWorldSubState() is LiveModeState) { new AlarmTask(2, TimeUnit.Minutes, OnCheckForSave); } else { sSaveWasRequested = false; } } }
protected static void Save() { if (sSaveWasRequested) { return; } try { /* * if (!AcceptCancelDialog.Show(Common.LocalizeEAString("Ui/Caption/PromptedSave:PromptEditTown"))) * { * sSaveWasRequested = false; * sSaveWasPerformed = false; * return; * } */ PuckController controller = null; Puck puck = Puck.Instance; if (puck != null) { controller = puck.mPuckController; } if (GameStates.GetInWorldSubState() is LiveModeState) { if (Settings.mSwitchToMapView) { if (!CameraController.IsMapViewModeEnabled()) { Sims3.Gameplay.Core.Camera.ToggleMapView(); SpeedTrap.Sleep(); } } if (Saver.Settings.mPauseOnSave) { GameflowEx.Pause(); } } /*else * { * if (controller != null) * { * controller.ChangeToMode(PuckController.Mode.Live); * } * * GameflowEx.Pause(); * * while ((GameStates.GetInWorldSubState() is BuyModeState) || (GameStates.GetInWorldSubState() is BuildModeState)) * { * SpeedTrap.Sleep(); * } * }*/ Common.FunctionTask.Perform(OnSave); } catch (Exception exception) { Common.Exception("Save", exception); } }