public static void OnSimUpdated(int simIndex) { try { CASPuck ths = CASPuck.gSingleton; if (ths == null) { return; } if (Responder.Instance.CASModel == null) { return; } if ((Responder.Instance.CASModel.CASMode == CASMode.Full) && !Responder.Instance.CASModel.EditingExistingSim()) { if (ths.mGotoGenetics) { ths.mGotoGenetics = false; if (CanCreateChild()) { CASController.Singleton.SetCurrentState(new CASState(CASTopState.Genetics, CASMidState.None, CASPhysicalState.None, CASClothingState.None)); } } } ths.OnSimUpdated(simIndex); } catch (Exception e) { Common.Exception("OnSimUpdated", e); } }
private static void AcceptHouseholdCallback(CASPuck ths) { if (!ths.AllSimsNamed()) { CASController.Singleton.ErrorMsg(CASErrorCode.AllSimsNeedName); } else { ICASModel cASModel = Responder.Instance.CASModel; if (cASModel.CASMode == CASMode.Full) { if (cASModel.HouseholdName == null) { cASModel.HouseholdName = Responder.Instance.CASModel.LastName; } //cASModel.RequestUpdateCurrentSim(true); CASLogic.CASOperationStack.Instance.Push(new UpdateCurrentSimOperationEx(true)); cASModel.SetHouseholdStartingFunds(); cASModel.RequestClearStack(); ths.mGotoCAF = true; } } }
private static void OnAcceptHousehold(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASPuck ths = CASPuck.Instance; Sims3.UI.Function f = null; if (!ths.mUiBusy && !ths.mAttemptingToAddSim) { ths.mUiBusy = true; if (f == null) { f = delegate { CASController.Singleton.SetCurrentState(CASState.Summary); if (ths.ShowRequiredItemsDialogTask()) { ths.AcceptHouseholdCallback(); } else { ths.mUiBusy = false; } }; } Simulator.AddObject(new Sims3.UI.OneShotFunctionTask(f)); } eventArgs.Handled = true; } catch (Exception e) { Common.Exception("OnAcceptHousehold", e); } }
public static void OnOptionsMouseUp(WindowBase sender, UIMouseEventArgs args) { try { CASPuck ths = CASPuck.gSingleton; if (ths == null) { return; } if (!ths.UiBusy) { if (args.MouseKey == MouseKeys.kMouseRight) { MenuTask.Perform(); } else { ths.ShowOptionsMenu(); } } } catch (Exception e) { Common.Exception("OnOptionsButtonMouseUp", e); } }
private static void AcceptSimCallback(CASPuck ths) { CASController.Singleton.AllowSimClicking(false); CASController.Singleton.AllowCameraMovement(false); //Responder.Instance.CASModel.RequestSaveSimToWorld(); CASLogic.CASOperationStack.Instance.Push(new SaveSimToWorldOperationEx()); ths.mLeaveCAS = true; }
public static void OnBackTopCam(CASTattoo ths) { try { CASController.Singleton.SetTopCam(true); CASPuck.TryRotateSimTowards(3.141593f); } catch (Exception e) { Common.Exception("OnBackTopCam", e); } }
public static void OnFootCam(CASTattoo ths) { try { CASController.Singleton.SetAnkleCam(true); CASPuck.TryRotateSimTowards(0f); } catch (Exception e) { Common.Exception("OnFootCam", e); } }
public static void OnRightPalmCam(CASTattoo ths) { try { CASController.Singleton.SetHandCam(true); CASPuck.TryRotateSimTowards(-2.55f); } catch (Exception e) { Common.Exception("OnRightPalmCam", e); } }
public static void OnAcceptHousehold(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASPuck ths = CASPuck.Instance; if (!ths.UiBusy && !ths.mAttemptingToAddSim) { Sims.CASBase.StoreChanges(); ths.UiBusy = true; Common.FunctionTask.Perform(delegate { if (Responder.Instance.CASModel.Species == CASAgeGenderFlags.Human) { CASController.Singleton.SetCurrentState(CASState.Summary); } else { CASController.Singleton.SetCurrentState(CASState.PetSummary); } if (ShowRequiredItemsDialogTask(ths)) { ths.AcceptHouseholdCallback(); } else { ths.UiBusy = false; } /* * // Custom * if (ShowRequiredItemsDialogTask(ths)) * { * AcceptHouseholdCallback(ths); * } * else * { * ths.UiBusy = false; * } */ }); } eventArgs.Handled = true; } catch (Exception exception) { Common.Exception("OnAcceptHousehold", exception); } }
private static void OnAcceptButtonClick(WindowBase sender, UIButtonClickEventArgs args) { try { CASGenetics ths = CASGenetics.gSingleton; if (ths == null) { return; } if (!ths.mHourglassVisible) { args.Handled = true; if (ths.mSelectedOffspring != null) { if (CASPuck.Instance != null) { ths.mReturnState = ths.mSelectedOffspring.IsPet ? CASState.PetSummary : CASState.Summary; CASPuck.Instance.AttemptingToAdd = true; CASPuck.ShowInputBlocker(); Responder.Instance.CASModel.RequestLoadSim(ths.mSelectedOffspring, false); Responder.Instance.CASModel.RequestAddSimToHousehold(false); Responder.Instance.CASModel.RequestClearStack(); CASController.Singleton.SetCurrentState(ths.mReturnState); } else { FacialBlends.CopyGenetics(ths.mSelectedOffspring as SimDescription, sChoice, false, false); new SavedOutfit.Cache(sChoice).PropagateGenetics(sChoice, CASParts.sPrimary); SimOutfit currentOutfit = sChoice.CreatedSim.CurrentOutfit; if (currentOutfit != null) { ThumbnailManager.GenerateHouseholdSimThumbnail(currentOutfit.Key, currentOutfit.Key.InstanceId, 0x0, ThumbnailSizeMask.Large | ThumbnailSizeMask.ExtraLarge | ThumbnailSizeMask.Medium | ThumbnailSizeMask.Small, ThumbnailTechnique.Default, true, false, sChoice.AgeGenderSpecies); } DestroyHousehold(); CASGenetics.Unload(); } } } } catch (Exception e) { Common.Exception("OnAcceptButtonClick", e); } }
public static void OnAcceptSim(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASPuck ths = CASPuck.Instance; if (!ths.UiBusy) { ths.UiBusy = true; CASExitLoadScreen.DisableQuit = true; // Custom if (CASLogic.Instance.OutfitCategory == OutfitCategories.Career) { CASLogic.Instance.OutfitCategory = OutfitCategories.Everyday; SpeedTrap.Sleep(); } if (Responder.Instance.CASModel.CASMode == CASMode.CreateABot) { Function f = delegate { CASController.Singleton.SetCurrentState(CASState.BotSummary); if (ths.ShowCABRequiredItemsDialogTask()) { // Custom AcceptSimCallback(ths); } else { ths.UiBusy = false; } }; Simulator.AddObject(new OneShotFunctionTask(f)); } else { // Custom AcceptSimCallback(ths); } } eventArgs.Handled = true; } catch (Exception exception) { Common.Exception("OnAcceptHousehold", exception); } }
public static void OnCloseClick(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASPuck ths = CASPuck.gSingleton; if (ths == null) { return; } //Common.DebugNotify(delegate { return "UiBusy: " + ths.mUiBusy + Common.NewLine + "LeaveCAS: " + ths.mLeaveCAS; }); //if (!ths.UiBusy && !ths.mLeaveCAS) { ths.UiBusy = true; Simulator.AddObject(new Sims3.UI.OneShotFunctionTask(delegate { string entryKey = (Responder.Instance.CASModel.CASMode == CASMode.Full) ? "Ui/Caption/CAS/ExitDialog:Prompt" : "Ui/Caption/CAS/ExitDialog:AlternatePrompt"; if (TwoButtonDialog.Show(Common.LocalizeEAString(entryKey), Common.LocalizeEAString("Ui/Caption/Global:Yes"), Common.LocalizeEAString("Ui/Caption/Global:No"))) { CASController singleton = CASController.Singleton; singleton.AllowCameraMovement(false); ICASModel cASModel = Responder.Instance.CASModel; while (cASModel.IsProcessing()) { SpeedTrap.Sleep(); } Sims.CASBase.sWasCanceled = true; sender.Enabled = false; cASModel.RequestClearChangeReport(); singleton.SetCurrentState(CASState.None); } else { ths.UiBusy = false; } })); eventArgs.Handled = true; } } catch (Exception e) { Common.Exception("OnCloseClick", e); } }
protected override bool OnPerform() { CASPuck puck = CASPuck.Instance; if (puck == null) { return(true); } if (puck.mAcceptButton != null) { ICASModel cASModel = Sims3.UI.Responder.Instance.CASModel; if ((cASModel.CASMode == CASMode.Full) && !cASModel.EditingExistingSim()) { puck.mAcceptButton.Click -= puck.OnAcceptHousehold; puck.mAcceptButton.Click -= OnAcceptHousehold; puck.mAcceptButton.Click += OnAcceptHousehold; } } CASFamilyScreen familyScreen = CASFamilyScreen.gSingleton; if (familyScreen != null) { Window topLevel = familyScreen.mFamilyTopLevelWin; uint index = 0; WindowBase child = topLevel.GetChildByIndex(index); while (child != null) { CAFThumb thumb = child as CAFThumb; if (thumb != null) { thumb.DragDrop -= familyScreen.OnCAFThumbDragDrop; thumb.DragDrop -= OnCAFThumbDragDrop; thumb.DragDrop += OnCAFThumbDragDrop; } index++; child = topLevel.GetChildByIndex(index); } } return(true); }
protected override bool OnPerform() { CASPuck puck = CASPuck.Instance; if (puck == null) { return(true); } if (puck.mAcceptButton != null) { puck.mAcceptButton.Click -= puck.OnAcceptHousehold; puck.mAcceptButton.Click -= OnAcceptHousehold; puck.mAcceptButton.Click += OnAcceptHousehold; } return(true); }
private static void CreateSimCallback(CASAgeGenderFlags species) { CASPuck ths = CASPuck.gSingleton; ICASModel cASModel = Responder.Instance.CASModel; CASController singleton = CASController.Singleton; /* * if ((species == (CASAgeGenderFlags.None | CASAgeGenderFlags.Human)) && (cASModel.NumSimsInHousehold >= CASPuck.kMaxSimsPerHousehold)) * { * singleton.ErrorMsg(CASErrorCode.TooManySims); * } * else if ((species != (CASAgeGenderFlags.None | CASAgeGenderFlags.Human)) && (cASModel.NumPetsInHousehold >= CASPuck.kMaxPetsPerHousehold)) * { * singleton.ErrorMsg(CASErrorCode.TooManyPets); * } */ if (cASModel.NumInHousehold >= CASPuck.kMaxPerHousehold) { singleton.ErrorMsg(CASErrorCode.TooMany); } else { ths.mAttemptingToAdd = true; if (species == CASAgeGenderFlags.Human) { CASController.Singleton.SetCurrentState(CASState.Summary); ths.mAttemptingToAddSim = true; cASModel.RequestCreateNewSim(); } else { CASController.Singleton.SetCurrentState(CASState.PetSummary); ths.mAttemptingToAddPet = true; cASModel.RequestCreateNewPet(species); } CASPuck.ShowInputBlocker(); } ths.UpdateAddSimButtons(); }
public static void OnCreateSimClick(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASPuck ths = CASPuck.gSingleton; Sims3.UI.Function f = null; if (ths.mAttemptingToAdd) { if (f == null) { f = delegate { while (ths.mAttemptingToAdd) { SpeedTrap.Sleep(); } // Custom CallCreateSimCallback((CASPuck.ControlIDs)sender.ID); }; } Simulator.AddObject(new Sims3.UI.OneShotFunctionTask(f)); } else { // Custom CallCreateSimCallback((CASPuck.ControlIDs)sender.ID); } ths.HideEditPopupMenu(); ths.HideAddPopupMenu(); eventArgs.Handled = true; } catch (Exception e) { Common.Exception("OnCreateSimClick", e); } }
public static void OnSimPreviewChange(int simIndex) { try { CASPuck ths = CASPuck.gSingleton; if (ths == null) { return; } ths.HideEditPopupMenu(); if ((simIndex >= 0) && (simIndex < ths.mSimButtons.Length)) { ths.OnSimPreviewChange(simIndex); } ths.ResetPanelCategories(); } catch (Exception e) { Common.Exception("OnSimPreviewChange", e); } }
protected override bool OnPerform() { Common.StringBuilder msg = new Common.StringBuilder("EditTownCASTask" + Common.NewLine); try { { EditTownLibraryPanel panel = EditTownLibraryPanel.Instance; if ((panel != null) && (panel.mCASButton != null)) { panel.mCASButton.Click -= panel.OnCASClick; panel.mCASButton.Click -= EditTownLibraryPanelEx.OnCASClick; panel.mCASButton.Click += EditTownLibraryPanelEx.OnCASClick; } } msg += "A"; { PlayFlowMenuPanel playFlow = PlayFlowMenuPanel.gSingleton; if ((playFlow != null) && (playFlow.mCASButton != null)) { playFlow.mCASButton.Click -= playFlow.OnMenuButtonClick; playFlow.mCASButton.Click -= PlayFlowMenuPanelEx.OnMenuButtonClick; playFlow.mCASButton.Click += PlayFlowMenuPanelEx.OnMenuButtonClick; } } msg += "C"; { CASClothingCategory category = CASClothingCategory.gSingleton; if (category != null) { category.mTopsButton.Click -= category.OnCategoryButtonClick; category.mBottomsButton.Click -= category.OnCategoryButtonClick; category.mShoesButton.Click -= category.OnCategoryButtonClick; category.mOutfitsButton.Click -= category.OnCategoryButtonClick; category.mAccessoriesButton.Click -= category.OnCategoryButtonClick; category.mHorseBridlesButton.Click -= category.OnCategoryButtonClick; category.mHorseSaddleButton.Click -= category.OnCategoryButtonClick; category.mTopsButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mTopsButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mBottomsButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mBottomsButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mShoesButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mShoesButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mOutfitsButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mOutfitsButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mAccessoriesButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mAccessoriesButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mHorseBridlesButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mHorseBridlesButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; category.mHorseSaddleButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown; category.mHorseSaddleButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown; } } msg += "D"; CASPuck puck = CASPuck.gSingleton; if (puck != null) { CASFamilyScreen familyScreen = CASFamilyScreen.gSingleton; if (familyScreen != null) { Window topLevel = familyScreen.mFamilyTopLevelWin; uint index = 0; WindowBase child = topLevel.GetChildByIndex(index); while (child != null) { CAFThumb thumb = child as CAFThumb; if (thumb != null) { thumb.DragDrop -= familyScreen.OnCAFThumbDragDrop; thumb.DragDrop -= CASFamilyScreenEx.OnCAFThumbDragDrop; thumb.DragDrop += CASFamilyScreenEx.OnCAFThumbDragDrop; } index++; child = topLevel.GetChildByIndex(index); } } if (puck.mGeneticsButton != null) { puck.mGeneticsButton.Enabled = CASPuckEx.CanCreateChild(); } ICASModel cASModel = Responder.Instance.CASModel; if (cASModel != null) { if ((MasterController.Settings.mAllowOverStuffed) && (cASModel.NumInHousehold < CASPuck.kMaxPerHousehold)) { if (puck.mCreateHorseButton != null) { puck.mCreateHorseButton.Enabled = true; puck.mCreateHorseButton.Click -= puck.OnCreateSimClick; puck.mCreateHorseButton.Click -= CASPuckEx.OnCreateSimClick; puck.mCreateHorseButton.Click += CASPuckEx.OnCreateSimClick; } if (puck.mCreateDogButton != null) { puck.mCreateDogButton.Enabled = true; puck.mCreateDogButton.Click -= puck.OnCreateSimClick; puck.mCreateDogButton.Click -= CASPuckEx.OnCreateSimClick; puck.mCreateDogButton.Click += CASPuckEx.OnCreateSimClick; } if (puck.mCreateCatButton != null) { puck.mCreateCatButton.Enabled = true; puck.mCreateCatButton.Click -= puck.OnCreateSimClick; puck.mCreateCatButton.Click -= CASPuckEx.OnCreateSimClick; puck.mCreateCatButton.Click += CASPuckEx.OnCreateSimClick; } if (puck.mCreateSimButton != null) { puck.mCreateSimButton.Enabled = true; puck.mCreateSimButton.Click -= puck.OnCreateSimClick; puck.mCreateSimButton.Click -= CASPuckEx.OnCreateSimClick; puck.mCreateSimButton.Click += CASPuckEx.OnCreateSimClick; } } cASModel.OnSimUpdated -= puck.OnSimUpdated; cASModel.OnSimUpdated -= CASPuckEx.OnSimUpdated; cASModel.OnSimUpdated += CASPuckEx.OnSimUpdated; cASModel.OnSimPreviewChange -= puck.OnSimPreviewChange; cASModel.OnSimPreviewChange -= CASPuckEx.OnSimPreviewChange; cASModel.OnSimPreviewChange += CASPuckEx.OnSimPreviewChange; } } msg += "E"; CASCompositorController controller = CASCompositorController.sController; if (controller != null) { if (controller.mColorsDragButton != null) { controller.mColorsDragButton.MouseDown -= controller.OnMaterialsColorDragMouseDown; controller.mColorsDragButton.MouseDown -= CASCompositorControllerEx.OnMaterialsColorDragMouseDown; controller.mColorsDragButton.MouseDown += CASCompositorControllerEx.OnMaterialsColorDragMouseDown; controller.mColorsDragButton.MouseUp -= controller.OnMaterialsColorDragMouseUp; controller.mColorsDragButton.MouseUp -= CASCompositorControllerEx.OnMaterialsColorDragMouseUp; controller.mColorsDragButton.MouseUp += CASCompositorControllerEx.OnMaterialsColorDragMouseUp; for (uint j = 0x0; j < 0x4; j++) { controller.mColorsPopupButton[j].MouseDown -= controller.OnMaterialsColorGridMouseDown; controller.mColorsPopupButton[j].MouseDown -= CASCompositorControllerEx.OnMaterialsColorGridMouseDown; controller.mColorsPopupButton[j].MouseDown += CASCompositorControllerEx.OnMaterialsColorGridMouseDown; controller.mColorsPopupButton[j].MouseUp -= controller.OnMaterialsColorGridMouseUp; controller.mColorsPopupButton[j].MouseUp -= CASCompositorControllerEx.OnMaterialsColorGridMouseUp; controller.mColorsPopupButton[j].MouseUp += CASCompositorControllerEx.OnMaterialsColorGridMouseUp; } } if (controller.mMaterialsSkewerPatternButton.Length == 4) { for (int i = 0; i < 4; i++) { if (controller.mMaterialsSkewerPatternButton[i] == null) { continue; } controller.mMaterialsSkewerPatternButton[i].MouseDown -= controller.OnMaterialsSkewerGridMouseDown; controller.mMaterialsSkewerPatternButton[i].MouseDown -= CASCompositorControllerEx.OnMaterialsSkewerGridMouseDown; controller.mMaterialsSkewerPatternButton[i].MouseDown += CASCompositorControllerEx.OnMaterialsSkewerGridMouseDown; controller.mMaterialsSkewerPatternButton[i].MouseUp -= controller.OnMaterialsSkewerGridMouseUp; controller.mMaterialsSkewerPatternButton[i].MouseUp -= CASCompositorControllerEx.OnMaterialsSkewerGridMouseUp; controller.mMaterialsSkewerPatternButton[i].MouseUp += CASCompositorControllerEx.OnMaterialsSkewerGridMouseUp; } } } } catch (Exception e) { Common.Exception(msg, e); } return(true); }
private static bool ShowRequiredItemsDialogTask(CASPuck ths) { int currentPreviewSim = ths.CurrentPreviewSim; ICASModel cASModel = Sims3.UI.Responder.Instance.CASModel; cASModel.OnSimUpdated -= ths.OnSimUpdated; cASModel.OnSimUpdated += ths.OnSimUpdatedRequiredItems; ths.mSimUpdated = false; //cASModel.RequestUpdateCurrentSim(true); CASLogic.CASOperationStack.Instance.Push(new UpdateCurrentSimOperationEx(true)); while (!ths.mSimUpdated) { SpeedTrap.Sleep(); } cASModel.OnSimUpdated -= ths.OnSimUpdatedRequiredItems; cASModel.OnSimUpdated += ths.OnSimUpdated; /* if (IsPetOnlyHousehold()) { if (!AcceptCancelDialog.Show(Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/CAS/Family:PetOnlyHousehold", new object[0x0]))) { return false; } } else */if (!IsHouseholdValid()) { SimpleMessageDialog.Show(null, Sims3.UI.Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/CAS/Family:InvalidHousehold", new object[0x0]), ModalDialog.PauseMode.PauseSimulator); return false; } cASModel.OnSimPreviewChange -= ths.OnSimPreviewChange; cASModel.OnSimPreviewChange += ths.OnSimPreviewChangeRequiredItems; ths.mInputBlocker.Visible = true; cASModel.RequestClearStack(); cASModel.OnUndoRedoStackChanged -= ths.OnUndoRedoStackChanged; ths.mUndoButton.Enabled = false; ths.mRedoButton.Enabled = false; bool flag = true; int index = 0x0; foreach (ISimDescription description in cASModel.GetSimsInHousehold()) { if (CASRequiredItemsDialog.ShouldShow(description)) { ths.mSimPreviewChanged = false; cASModel.RequestSetPreviewSim(index); ths.SelectSimButton(index); while (!ths.mSimPreviewChanged || cASModel.IsProcessing()) { SpeedTrap.Sleep(); } CASController.Singleton.SetFullbodyCam(true); ths.UiBusy = false; if (!CASRequiredItemsDialog.Show()) { flag = false; } ths.UiBusy = true; } if (description.TeenOrBelow) { description.SimLifetimeWish = 0x0; } index++; } ths.mInputBlocker.Visible = false; cASModel.OnSimPreviewChange -= ths.OnSimPreviewChangeRequiredItems; cASModel.OnSimPreviewChange += ths.OnSimPreviewChange; cASModel.OnUndoRedoStackChanged += ths.OnUndoRedoStackChanged; cASModel.RequestSetPreviewSim(currentPreviewSim); ths.SelectSimButton(currentPreviewSim); if (!flag) { string str; if (GameUtils.IsInstalled(ProductVersion.EP5)) { str = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Puck:RequiredItemsMissingEP5", new object[0x0]); } else { str = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Puck:RequiredItemsMissing", new object[0x0]); } SimpleMessageDialog.Show(null, str, ModalDialog.PauseMode.PauseSimulator, new Vector2(-1f, -1f), "ui_error", "ui_hardwindow_close"); } return flag; }
private static void CallCreateSimCallback(CASPuck.ControlIDs id) { switch (id) { case CASPuck.ControlIDs.CreateHorseButton: CreateSimCallback(CASAgeGenderFlags.Horse); return; case CASPuck.ControlIDs.CreateDogButton: CreateSimCallback(CASAgeGenderFlags.Dog); return; case CASPuck.ControlIDs.CreateCatButton: CreateSimCallback(CASAgeGenderFlags.Cat); return; case CASPuck.ControlIDs.CreateSimButton: CreateSimCallback(CASAgeGenderFlags.Human); return; } }
private static bool ShowRequiredItemsDialogTask(CASPuck ths) { int currentPreviewSim = ths.CurrentPreviewSim; ICASModel cASModel = Sims3.UI.Responder.Instance.CASModel; cASModel.OnSimUpdated -= ths.OnSimUpdated; cASModel.OnSimUpdated += ths.OnSimUpdatedRequiredItems; ths.mSimUpdated = false; //cASModel.RequestUpdateCurrentSim(true); CASLogic.CASOperationStack.Instance.Push(new UpdateCurrentSimOperationEx(true)); while (!ths.mSimUpdated) { SpeedTrap.Sleep(); } cASModel.OnSimUpdated -= ths.OnSimUpdatedRequiredItems; cASModel.OnSimUpdated += ths.OnSimUpdated; /* * if (IsPetOnlyHousehold()) * { * if (!AcceptCancelDialog.Show(Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/CAS/Family:PetOnlyHousehold", new object[0x0]))) * { * return false; * } * } * else */if (!IsHouseholdValid()) { SimpleMessageDialog.Show(null, Sims3.UI.Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/CAS/Family:InvalidHousehold", new object[0x0]), ModalDialog.PauseMode.PauseSimulator); return(false); } cASModel.OnSimPreviewChange -= ths.OnSimPreviewChange; cASModel.OnSimPreviewChange += ths.OnSimPreviewChangeRequiredItems; ths.mInputBlocker.Visible = true; cASModel.RequestClearStack(); cASModel.OnUndoRedoStackChanged -= ths.OnUndoRedoStackChanged; ths.mUndoButton.Enabled = false; ths.mRedoButton.Enabled = false; bool flag = true; int index = 0x0; foreach (ISimDescription description in cASModel.GetSimsInHousehold()) { if (CASRequiredItemsDialog.ShouldShow(description)) { ths.mSimPreviewChanged = false; cASModel.RequestSetPreviewSim(index); ths.SelectSimButton(index); while (!ths.mSimPreviewChanged || cASModel.IsProcessing()) { SpeedTrap.Sleep(); } CASController.Singleton.SetFullbodyCam(true); ths.UiBusy = false; if (!CASRequiredItemsDialog.Show()) { flag = false; } ths.UiBusy = true; } if (description.TeenOrBelow) { description.SimLifetimeWish = 0x0; } index++; } ths.mInputBlocker.Visible = false; cASModel.OnSimPreviewChange -= ths.OnSimPreviewChangeRequiredItems; cASModel.OnSimPreviewChange += ths.OnSimPreviewChange; cASModel.OnUndoRedoStackChanged += ths.OnUndoRedoStackChanged; cASModel.RequestSetPreviewSim(currentPreviewSim); ths.SelectSimButton(currentPreviewSim); if (!flag) { string str; if (GameUtils.IsInstalled(ProductVersion.EP5)) { str = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Puck:RequiredItemsMissingEP5", new object[0x0]); } else { str = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Puck:RequiredItemsMissing", new object[0x0]); } SimpleMessageDialog.Show(null, str, ModalDialog.PauseMode.PauseSimulator, new Vector2(-1f, -1f), "ui_error", "ui_hardwindow_close"); } return(flag); }