public static void OnSimOutfitCategoryChanged(OutfitCategories outfitCategory) { try { CASClothingState state = CASClothing.CASClothingStateFromOutfitCategory(outfitCategory); if (CASPuck.Instance != null) { CASPuck.Instance.OnDynamicUpdateCurrentSimThumbnail(); } CASController controller = CASController.Singleton; if (controller != null) { controller.SetCurrentState(new CASState(CASTopState.CreateASim, CASMidState.Clothing, CASPhysicalState.None, state)); controller.Activate(true); } CASClothing ths = CASClothing.gSingleton; if (ths != null) { ths.UpdateState(state); } } catch (Exception e) { Common.Exception("OnSimOutfitCategoryChanged", e); } }
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); } }