コード例 #1
0
 public AlarmTask(float hourOfDay,
                  DaysOfTheWeek days,
                  Sims3.Gameplay.Function func) : this(func){
     handle = AlarmManager.Global.AddAlarmDay(hourOfDay,
                                              days,
                                              OnTimer, "ArthurGibraltarSims3Mod_Daily", AlarmType.NeverPersisted, null);
 }
コード例 #2
0
 protected AlarmTask(Sims3.Gameplay.Function func)
 {
     AllScheduledTasks.Add(this);
     if (func == null)
     {
         func = OnPerform;
     }
     AlarmFunction = func;
 }
コード例 #3
0
 public AlarmTask(float time,
                  TimeUnit timeUnit,
                  Sims3.Gameplay.Function func) : this(func){
     handle = AlarmManager.Global.AddAlarm(mTime = time,
                                           mTimeUnit = timeUnit,
                                           OnTimer,
                                           "ArthurGibraltarSims3Mod_Once", AlarmType.NeverPersisted, null);
     disposeOnTimer = true;
 }
コード例 #4
0
 public AlarmTask(float time,
                  TimeUnit timeUnit,
                  Sims3.Gameplay.Function func,
                  float repeatTime,
                  TimeUnit repeatTimeUnit) : this(func){
     handle = AlarmManager.Global.AddAlarmRepeating(time,
                                                    timeUnit,
                                                    OnTimer,
                                                    repeatTime,
                                                    repeatTimeUnit,
                                                    "ArthurGibraltarSims3Mod_Repeat", AlarmType.NeverPersisted, null);
 }
コード例 #5
0
ファイル: CASGeneticsEx.cs プロジェクト: yakoder/NRaas
        private static void OnThumbnailMouseUp(WindowBase sender, UIMouseEventArgs args, CASAgeGenderFlags gender)
        {
            try
            {
                CASGenetics ths = CASGenetics.gSingleton;
                if (ths == null)
                {
                    return;
                }

                if (!ths.mHourglassVisible)
                {
                    CASAgeGenderFlags otherGender = CASAgeGenderFlags.Female;

                    Sims3.Gameplay.Function func    = ths.UpdateFatherPreviewTask;
                    Sims3.Gameplay.Function altFunc = ths.UpdateMotherPreviewTask;

                    int index = 0, altIndex = 1;
                    if (gender == CASAgeGenderFlags.Female)
                    {
                        index       = 1;
                        altIndex    = 0;
                        otherGender = CASAgeGenderFlags.Male;

                        func    = ths.UpdateMotherPreviewTask;
                        altFunc = ths.UpdateFatherPreviewTask;
                    }

                    ISimDescription tag = sender.Tag as ISimDescription;

                    if (args.MouseKey == MouseKeys.kMouseLeft)
                    {
                        sAlternate = !sAlternate;
                        if ((!HasGender(otherGender)) && (sAlternate))
                        {
                            ths.mSelectedParents[altIndex] = tag;
                            if (tag != null)
                            {
                                ths.CheckSpecies();

                                Common.FunctionTask.Perform(altFunc);
                            }
                        }
                        else
                        {
                            // Elements are intentionally reversed
                            ths.mSelectedParents[index] = tag;
                            if (tag != null)
                            {
                                ths.CheckSpecies();

                                Common.FunctionTask.Perform(func);
                            }
                        }
                    }
                    else if (args.MouseKey == MouseKeys.kMouseRight)
                    {
                        // Elements are intentionally reversed
                        ths.mSelectedParents[altIndex] = tag;
                        if (tag != null)
                        {
                            ths.CheckSpecies();

                            Common.FunctionTask.Perform(altFunc);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnThumbnailMouseUp", e);
            }
        }
コード例 #6
0
 protected ModTask(Sims3.Gameplay.Function func)
 {
     ModTaskFunction = func;
 }