コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }