private static void OnReturnToLive(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { EditTownPuck ths = EditTownPuck.Instance; eventArgs.Handled = true; if (!ths.mExitingGameEntry) { ths.mExitingGameEntry = true; Common.FunctionTask.Perform(ReturnToLive); } } catch (Exception e) { Common.Exception("OnReturnToLive", e); } }
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); }