private static void SwitchToClick() { if (!Sims3.UI.Responder.Instance.OptionsModel.SaveGameInProgress) { EditTownInfoPanel ths = EditTownInfoPanel.Instance; bool flag = true; if ((ths.mModel.ValidActiveHousehold) && (!Mover.Settings.mDreamCatcher)) { if (!AcceptCancelDialog.Show(Common.LocalizeEAString("Ui/Caption/GameEntry/EditTown:ChangeActiveHousehold"))) { flag = false; } else if (!AcceptCancelDialog.Show(Common.LocalizeEAString("Ui/Caption/GameEntry/EditTown:LoseWPWarning"))) { flag = false; } } if ((flag && (ths.mInfo != null)) && (!ths.mModel.IsPlaceLotsWizardFlow || AcceptCancelDialog.Show(Common.LocalizeEAString("Ui/Caption/GameEntry/PlaceEPLotsWizard:CancelPrompt")))) { EditTownPuck.Instance.UpdateBackButton(true); ulong householdId = ths.mInfo.HouseholdId; ths.Visible = false; try { ths.mModel.IsSwitchingHouseholds = true; if (!ths.mModel.ExitEditTown(false)) { ths.Visible = true; EditTownPuck.Instance.UpdateBackButton(false); } else { // Custom PlayFlowModelEx.ActivateSimScreenMaskedFunc(Sims3.UI.Responder.Instance.PlayFlowModel as PlayFlowModel, householdId); Audio.StartSound("ui_softwindow_close"); ths.mModel.IsPlaceLotsWizardFlow = false; } } finally { ths.mModel.IsSwitchingHouseholds = false; } } } }
public static void OnChangeTypeClick(WindowBase w, UIButtonClickEventArgs eventArgs) { try { EditTownInfoPanel ths = EditTownInfoPanel.Instance; if (ths.mInfo != null) { EditTownControllerEx.ChangeLotType(ths.mInfo); } } catch (Exception e) { Common.Exception("OnChangeTypeClick", e); } }
public static void OnMergeClick(WindowBase w, UIButtonClickEventArgs eventArgs) { try { EditTownInfoPanel ths = EditTownInfoPanel.Instance; if (!(EditTownMergeTool.sInstance is EditTownMergeToolEx)) { EditTownMergeTool.sInstance = new EditTownMergeToolEx(); } EditTownMergeTool.Instance.SetHouseholdToMergeFrom(ths.mInfo); EditTownTool.CurrentTool = EditTownMergeTool.Instance; } catch (Exception e) { Common.Exception("OnMergeClick", e); } }
public static void OnPlaceClick(WindowBase w, UIButtonClickEventArgs eventArgs) { try { EditTownInfoPanel ths = EditTownInfoPanel.Instance; if (ths.mInfo != null) { if (!(EditTownPlaceTool.sInstance is EditTownPlaceToolEx)) { EditTownPlaceTool.sInstance = new EditTownPlaceToolEx(); } UIBinInfo mInfo = ths.mInfo; InfoSource mSource = ths.mSource; EditTownPlaceTool.Instance.SetItemToPlace(ths.mInfo, ths.mSource); ths.mTriggerSound = false; try { EditTownTool.CurrentTool = EditTownPlaceTool.Instance; ths.mModel.SetCurrentSelection(mInfo, mSource); } finally { ths.mTriggerSound = true; } if (ths.Visible) { Audio.StartSound("ui_softwindow_close"); } ths.Visible = false; } } catch (Exception e) { Common.Exception("OnPlaceClick", 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); }