Exemple #1
0
 public static void SetWorkId(ScheduleMgr.ScheduleTime workTime, int taskId, int slotId)
 {
     if (ScheduleCSVData.AllData.ContainsKey(taskId))
     {
         ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[taskId];
         //int slotId = 0;
         //for (int i = 0; i < 40; i++)
         //{
         //    Maid scheduleSlot = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(i);
         //    if (scheduleSlot != null && scheduleSlot == this.m_scheduleCtrl.SelectedMaid)
         //    {
         //        slotId = i;
         //    }
         //}
         ScheduleTaskCtrl.TaskType type = scheduleBase.type;
         if (type != ScheduleTaskCtrl.TaskType.Training && type != ScheduleTaskCtrl.TaskType.Work)
         {
             if (type == ScheduleTaskCtrl.TaskType.Yotogi)
             {
                 ScheduleMgrPatch.m_scheduleApi.SetNightWorkSlot_Safe(workTime, slotId, taskId);
             }
         }
         else
         {
             ScheduleMgrPatch.m_scheduleApi.SetNoonWorkSlot_Safe(workTime, slotId, taskId);
         }
     }
     if (!DailyMgr.IsLegacy)
     {
         GameMain.Instance.FacilityMgr.UpdateFacilityAssignedMaidData();
     }
     ScheduleAPI.MaidWorkIdErrorCheck(true);
 }
Exemple #2
0
        public static void FacilitySlotActive(
            string maidGuid, Facility facility, ScheduleMgr.ScheduleTime time)
        {
            if (configEntryUtill["FacilitySlotActive", false])
            {
                MyLog.LogMessage("ScheduleAPI.FacilitySlotActive"
                                 , maidGuid
                                 , facility.facilityName
                                 , time
                                 );
            }
            Maid maid = IsSlotInMaid(maidGuid);

            if (maid == null)
            {
                return;
            }

            int key = 0;

            if (time == ScheduleMgr.ScheduleTime.DayTime)
            {
                key = maid.status.noonWorkId;
            }
            if (time == ScheduleMgr.ScheduleTime.Night)
            {
                key = maid.status.nightWorkId;
            }
            if (configEntryUtill["FacilitySlotActive", false])
            {
                MyLog.LogMessage("ScheduleAPI.FacilitySlotActive1"
                                 , MyUtill.GetMaidFullName(maid)
                                 , key
                                 );
            }
            if (ScheduleCSVData.AllData.ContainsKey(key))
            {
                ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[key];
                if (scheduleBase.type == ScheduleTaskCtrl.TaskType.Work)
                {
                    ScheduleCSVData.Work work = (ScheduleCSVData.Work)scheduleBase;
                    if (configEntryUtill["FacilitySlotActive", false])
                    {
                        MyLog.LogMessage("ScheduleAPI.FacilitySlotActive2"
                                         , work.facilityId
                                         , work.facility.ID
                                         , work.facility.name
                                         );
                    }
                    if (configEntryUtill["FacilitySlotActive", false])
                    {
                        MyLog.LogMessage("ScheduleAPI.FacilitySlotActive3"
                                         , ScheduleCSVData.faclilityPowerUpWorkId
                                         , facility.defaultData.ID
                                         , facility.defaultData.name
                                         );
                    }
                    if (work.facility == facility.defaultData && work.facilityId != ScheduleCSVData.faclilityPowerUpWorkId)
                    {
                        return;
                    }
                }
                else if (scheduleBase.type == ScheduleTaskCtrl.TaskType.Training)
                {
                    ScheduleCSVData.Training training = (ScheduleCSVData.Training)scheduleBase;
                    if (training.facilityId == facility.defaultData.ID)
                    {
                        return;
                    }
                }
            }

            //SetRandomCommu(isDaytime);
        }
Exemple #3
0
        public void Call(Maid maid, ScheduleMgr.ScheduleTime scheduleTime, Dictionary <ScheduleTaskCtrl.TaskType, List <ScheduleTaskViewer.ViewData> > viewDic, Dictionary <ScheduleMgr.ScheduleTime, ScheduleCSVData.ScheduleBase> currentSetWorkDic)
        {
            if (this.category_button_dic_ == null)
            {
                this.Awake();
            }
            ScheduleTaskViewer.scheduleTime = scheduleTime;
            HashSet <int> hashSet        = new HashSet <int>();
            int           maxValue       = int.MaxValue;
            UIWFTabButton uiwftabButton  = null;
            UIWFTabButton uiwftabButton2 = null;

            foreach (KeyValuePair <ScheduleTaskCtrl.TaskType, List <ScheduleTaskViewer.ViewData> > keyValuePair in viewDic)
            {
                this.CallEnableButton(maid, keyValuePair.Key, keyValuePair.Value, ref hashSet, ref maxValue);
            }
            this.currentWorkDic = currentSetWorkDic;
            int num = maxValue;

            ScheduleCSVData.ScheduleBase work_data = null;
            foreach (KeyValuePair <int, UIButton> keyValuePair2 in this.category_button_dic_)
            {
                keyValuePair2.Value.onClick.Clear();
                bool flag = hashSet.Contains(keyValuePair2.Key);
                keyValuePair2.Value.transform.parent.gameObject.SetActive(flag);
                if (flag)
                {
                    EventDelegate.Add(keyValuePair2.Value.onClick, new EventDelegate.Callback(this.OnClickFromMainCategoryButton));
                    if (uiwftabButton2 == null && num == keyValuePair2.Key)
                    {
                        uiwftabButton2 = keyValuePair2.Value.gameObject.GetComponent <UIWFTabButton>();
                    }
                    ScheduleCSVData.ScheduleBase scheduleBase = currentSetWorkDic[scheduleTime];
                    if (uiwftabButton == null && scheduleBase != null && scheduleBase.categoryID == keyValuePair2.Key)
                    {
                        work_data     = scheduleBase;
                        uiwftabButton = keyValuePair2.Value.gameObject.GetComponent <UIWFTabButton>();
                    }
                }
            }
            if (uiwftabButton == null)
            {
                uiwftabButton = uiwftabButton2;
            }
            Utility.ResetNGUI(this.CategoryGrid);
            Utility.ResetNGUI(this.CategoryScrollView);
            UIWFTabPanel componentInChildren = this.CategoryGrid.GetComponentInChildren <UIWFTabPanel>();

            componentInChildren.ResetSelect();
            componentInChildren.UpdateChildren();
            if (uiwftabButton != null)
            {
                componentInChildren.Select(uiwftabButton);
            }
            if (this.descDic == null)
            {
                DescScheduleYotogi component = UTY.GetChildObject(base.gameObject, "DescScheduleYotogi", false).GetComponent <DescScheduleYotogi>();
                component.Init(this.taskCtrl);
                DescScheduleTraining component2 = UTY.GetChildObject(base.gameObject, "DescScheduleTraining", false).GetComponent <DescScheduleTraining>();
                component2.Init(this.taskCtrl);
                DescScheduleWork component3 = UTY.GetChildObject(base.gameObject, "DescScheduleWork", false).GetComponent <DescScheduleWork>();
                component3.Init(this.taskCtrl);
                this.descDic = new Dictionary <ScheduleTaskCtrl.TaskType, DescScheduleBase>();
                this.descDic.Add(ScheduleTaskCtrl.TaskType.Yotogi, component);
                this.descDic.Add(ScheduleTaskCtrl.TaskType.Training, component2);
                this.descDic.Add(ScheduleTaskCtrl.TaskType.Work, component3);
            }
            this.UpdateForDescriptionViewer(work_data);
        }