protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } FutureDescendantServiceEx.RegenerateDescendants(); return(OptionResult.SuccessClose); }
private void HandleDescendants(bool fromWorldLoadFinished) { bool disabled = Traveler.Settings.mDisableDescendants; if (!disabled && !fromWorldLoadFinished && !GameUtils.IsFutureWorld()) { // originally had this GameUtils.IsFutureWorld and a call to RegenerateDescendants here but it // creates problems when all the progninators don't travel to the future. It's a solvable issue // but not right now FutureDescendantServiceEx.AddListeners(); } else if (disabled && !fromWorldLoadFinished) { FutureDescendantServiceEx.WipeDescendants(); FutureDescendantServiceEx.ClearListeners(); } else if (disabled && fromWorldLoadFinished) { FutureDescendantServiceEx.ClearListeners(); } }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { Common.StringBuilder results = new Common.StringBuilder("BuildDescendantHouseholdSpecs"); FutureDescendantService instance = FutureDescendantService.GetInstance(); instance.CleanUpFutureDescendantService(true); instance.InitializeFutureDescendantService(); FutureDescendantServiceEx.BuildDescendantHouseholdSpecs(instance); foreach (FutureDescendantService.FutureDescendantHouseholdInfo info in FutureDescendantService.sPersistableData.ActiveDescendantHouseholdsInfo) { if (info.HasAncestorFromHousehold(Household.ActiveHousehold)) { FutureDescendantHouseholdInfoEx.CalculateHouseholdFamilyScore(info, results); } } Common.DebugWriteLog(results); return(OptionResult.SuccessClose); }
protected override bool OnPerform() { if ((HudController.Instance != null) && (GameUtils.IsOnVacation())) { HudModel model = HudController.Instance.mHudModel as HudModel; if (model != null) { if (model.MinuteChanged != null) { foreach (Delegate del in model.MinuteChanged.GetInvocationList()) { TimeControl control = del.Target as TimeControl; if (control != null) { TimeControlEx.sThs = control; model.MinuteChanged -= TimeControlEx.sThs.OnMinuteChanged; model.MinuteChanged -= TimeControlEx.OnMinuteChanged; model.MinuteChanged += TimeControlEx.OnMinuteChanged; break; } } } } } InventoryPanel inventory = InventoryPanel.sInstance; if ((inventory != null) && (inventory.Visible)) { if (inventory.mTimeAlmanacButton != null) { if (GameUtils.IsFutureWorld()) { inventory.mTimeAlmanacButton.Visible = (GameStates.TravelHousehold == Household.ActiveHousehold); } if (inventory.mTimeAlmanacButton.Visible) { inventory.mTimeAlmanacButton.Click -= inventory.OnClickTimeAlmanac; inventory.mTimeAlmanacButton.Click -= FutureDescendantServiceEx.OnClickTimeAlmanac; inventory.mTimeAlmanacButton.Click += FutureDescendantServiceEx.OnClickTimeAlmanac; } } } EditTownPuck puck = EditTownPuck.Instance; if (puck != null) { if (puck.mReturnToLiveButton != null) { puck.mReturnToLiveButton.Click -= puck.OnReturnToLive; puck.mReturnToLiveButton.Click -= OnReturnToLive; puck.mReturnToLiveButton.Click += OnReturnToLive; } } EditTownInfoPanel panel = EditTownInfoPanel.Instance; if (panel != null) { if ((panel.mActionButtons != null) && (panel.mActionButtons.Length > 8) && (panel.mActionButtons[0x8] != null)) { panel.mActionButtons[0x8].Click -= panel.OnChangeTypeClick; panel.mActionButtons[0x8].Click -= OnChangeTypeClick; panel.mActionButtons[0x8].Click += OnChangeTypeClick; } } OptionsDialog options = OptionsDialog.sDialog; if (options != null) { if (GameUtils.IsInstalled(ProductVersion.EP8)) { Button testButton = options.mSeasonWindow.GetChildByID(0xdf085c3, true) as Button; if ((testButton != null) && (!testButton.Enabled)) { using (BaseWorldReversion reversion = new BaseWorldReversion()) { foreach (Button weather in options.mEnabledWeatherButtons.Values) { weather.Enabled = true; } if (options.mFahrenheitRadio != null) { options.mFahrenheitRadio.Enabled = true; } if (options.mCelciusRadio != null) { options.mCelciusRadio.Enabled = true; } options.SetupSeasonControls(false, ref options.mOldSeasonData); } } } } FutureDescendantService instance = FutureDescendantServiceEx.GetInstance(); if (Sims3.UI.Responder.Instance.InLiveMode && Traveler.Settings.mDisableDescendants && instance.mEventListeners.Count > 0) { instance.CleanUpEventListeners(); } return(true); }