123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using MaidStatus;
- using Schedule;
- using UnityEngine;
- public class ScheduleTaskCtrl : BaseCreateViewerCtrl
- {
- public ScheduleScene ScheduleApi
- {
- get
- {
- return this.m_scheduleApi;
- }
- }
- public ScheduleMgr ScheduleMgr
- {
- get
- {
- return this.m_scheduleMgr;
- }
- }
- public ScheduleCtrl ScheduleCtrl
- {
- get
- {
- return this.m_scheduleCtrl;
- }
- }
- public ScheduleTaskViewer TaskViewer
- {
- get
- {
- return this.m_taskViewer;
- }
- }
- public List<ScheduleBase> GetWorksData(ScheduleTaskCtrl.TaskType type)
- {
- return this.m_listWorksData[type];
- }
- public int CurrentActiveSlotNo
- {
- get
- {
- return this.m_currentActiveSlotNo;
- }
- }
- public void Init(ScheduleMgr scheduleMgr, ScheduleCtrl scheduleCtrl, GameObject goPanel)
- {
- this.m_scheduleMgr = scheduleMgr;
- this.m_scheduleCtrl = scheduleCtrl;
- this.m_goScheduleTaskViewer = UTY.GetChildObject(goPanel, "ScheduleTaskViewer", false);
- this.m_taskViewer = UTY.GetChildObject(goPanel, "ScheduleTaskViewer", false).GetComponent<ScheduleTaskViewer>();
- this.m_taskViewer.taskCtrl = this;
- }
- private void InitViewer()
- {
- this.m_unitPrefabPath = "SceneDaily/Schedule/Prefab/NightTaskUnit";
- GameObject childObject = UTY.GetChildObject(this.m_goScheduleTaskViewer, "TaskViewer", false);
- this.m_goUnitParent = UTY.GetChildObject(childObject, "Contents/TaskUnitParent", false);
- this.m_content = UTY.GetChildObject(childObject, "Contents", false);
- this.m_contentPosY = this.m_content.transform.localPosition.y;
- this.m_taskScrollView = UTY.GetChildObject(childObject, "Contents", false).GetComponent<UIScrollView>();
- GameObject childObject2 = UTY.GetChildObject(this.m_goScheduleTaskViewer, "DescScheduleYotogi", false);
- this.m_lDescription = UTY.GetChildObject(childObject2, "Description/Message", false).GetComponent<UILabel>();
- this.m_goConditionParent = UTY.GetChildObject(childObject2, "Condition/ConditionParent", false);
- this.m_goTitleOfConditiont = UTY.GetChildObject(childObject2, "Condition/Title", false);
- this.m_goConditionUnit = (Resources.Load("SceneDaily/Schedule/Prefab/ConditionUnit") as GameObject);
- this.m_taskScrollBar = UTY.GetChildObject(childObject, "Scroll Bar", false).GetComponent<UIScrollBar>();
- this.m_spBGOfDescriptionViewer = UTY.GetChildObject(childObject2, "BG", false).GetComponent<UISprite>();
- this.m_heightOfconditionTitle = this.m_goTitleOfConditiont.GetComponent<UISprite>().height;
- childObject2.SetActive(false);
- childObject.SetActive(false);
- }
- public void CreateTaskViewer(string buttonName)
- {
- this.CreateTaskViewer(buttonName, ScheduleTaskViewer.ScheduleTime);
- }
- public void CreateTaskViewer(string buttonName, ScheduleMgr.ScheduleTime scheduleTime)
- {
- if (!this.m_bInit)
- {
- this.InitViewer();
- this.m_bInit = true;
- }
- ScheduleTaskViewer.ScheduleTime = scheduleTime;
- this.m_scheduleCtrl.SetMaidIdByButtonName(buttonName);
- this.m_scheduleCtrl.SetViewerActive(ScheduleCtrl.ExclusiveViewer.Task);
- this.m_scheduleCtrl.SetSelectedRowActive(buttonName);
- this.m_currentActiveSlotNo = ScheduleCtrl.GetSlotNoByButtonName(buttonName);
- this.m_listTaskButton = new Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleTaskCtrl.TaskButton>>();
- this.m_listWorksData = new Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleBase>>();
- if (!DailyMgr.IsLegacy)
- {
- GameMain.Instance.FacilityMgr.UpdateFacilityAssignedMaidData();
- }
- this.m_scheduleMgr.GetScheduleApi().Update(this.CurrentActiveSlotNo);
- List<ScheduleTaskCtrl.TaskButton> list = this.LoadYotogiData(this.m_currentActiveSlotNo);
- this.m_listTaskButton.Add(ScheduleTaskCtrl.TaskType.Yotogi, list);
- List<ScheduleTaskViewer.ViewData> list2 = new List<ScheduleTaskViewer.ViewData>();
- for (int i = 0; i < list.Count; i++)
- {
- ScheduleTaskViewer.ViewData item = default(ScheduleTaskViewer.ViewData);
- ScheduleTaskCtrl.YotogiTaskButton yotogiTaskButton = (ScheduleTaskCtrl.YotogiTaskButton)list[i];
- item.taskButton = yotogiTaskButton;
- item.schedule = ScheduleCSVData.AllData[yotogiTaskButton.data.id];
- item.is_enabled = list[i].enableTask;
- if (!GameMain.Instance.CharacterMgr.status.lockNTRPlay || !ScheduleCSVData.NetorareFlag.Contains(item.schedule.id))
- {
- list2.Add(item);
- }
- }
- List<ScheduleTaskCtrl.TaskButton> list3 = this.LoadTrainingData(this.m_currentActiveSlotNo);
- this.m_listTaskButton.Add(ScheduleTaskCtrl.TaskType.Training, list3);
- List<ScheduleTaskViewer.ViewData> list4 = new List<ScheduleTaskViewer.ViewData>();
- for (int j = 0; j < list3.Count; j++)
- {
- ScheduleTaskViewer.ViewData item2 = default(ScheduleTaskViewer.ViewData);
- ScheduleTaskCtrl.TrainingTaskButton trainingTaskButton = (ScheduleTaskCtrl.TrainingTaskButton)list3[j];
- item2.taskButton = trainingTaskButton;
- item2.schedule = ScheduleCSVData.AllData[int.Parse(trainingTaskButton.id)];
- item2.is_enabled = list3[j].enableTask;
- list4.Add(item2);
- }
- List<ScheduleTaskCtrl.TaskButton> list5 = this.LoadWorkData(this.m_currentActiveSlotNo);
- this.m_listTaskButton.Add(ScheduleTaskCtrl.TaskType.Work, list5);
- List<ScheduleTaskViewer.ViewData> list6 = new List<ScheduleTaskViewer.ViewData>();
- for (int k = 0; k < list5.Count; k++)
- {
- ScheduleTaskViewer.ViewData item3 = default(ScheduleTaskViewer.ViewData);
- ScheduleTaskCtrl.WorkTaskButton workTaskButton = (ScheduleTaskCtrl.WorkTaskButton)list5[k];
- item3.taskButton = workTaskButton;
- item3.schedule = ScheduleCSVData.AllData[int.Parse(workTaskButton.id)];
- item3.is_enabled = list5[k].enableTask;
- list6.Add(item3);
- }
- Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleTaskViewer.ViewData>> dictionary = new Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleTaskViewer.ViewData>>();
- dictionary.Add(ScheduleTaskCtrl.TaskType.Yotogi, list2);
- dictionary.Add(ScheduleTaskCtrl.TaskType.Training, list4);
- dictionary.Add(ScheduleTaskCtrl.TaskType.Work, list6);
- Dictionary<ScheduleMgr.ScheduleTime, ScheduleCSVData.ScheduleBase> dictionary2 = new Dictionary<ScheduleMgr.ScheduleTime, ScheduleCSVData.ScheduleBase>();
- dictionary2.Add(ScheduleMgr.ScheduleTime.Night, ScheduleCSVData.AllData[int.Parse(this.GetTaskId(ScheduleMgr.ScheduleTime.Night))]);
- dictionary2.Add(ScheduleMgr.ScheduleTime.DayTime, ScheduleCSVData.AllData[int.Parse(this.GetTaskId(ScheduleMgr.ScheduleTime.DayTime))]);
- this.m_taskViewer.Call(this.m_scheduleCtrl.SelectedMaid, scheduleTime, dictionary, dictionary2);
- Action<ScheduleCSVData.ScheduleBase> onClickWorkUnitEvent = delegate(ScheduleCSVData.ScheduleBase click_unit)
- {
- this.SetWorkId(ScheduleTaskViewer.ScheduleTime, click_unit.id);
- string currentActiveButton = this.m_scheduleMgr.CurrentActiveButton;
- this.m_scheduleMgr.UpdateMaidStatus();
- this.m_scheduleCtrl.SetViewerActive(ScheduleCtrl.ExclusiveViewer.Task);
- this.m_scheduleCtrl.SetMaidIdByButtonName(currentActiveButton);
- this.m_scheduleCtrl.SetSelectedRowActive(currentActiveButton);
- this.m_scheduleMgr.CurrentActiveButton = currentActiveButton;
- };
- this.m_taskViewer.onClickWorkUnitEvent = onClickWorkUnitEvent;
- }
- private void ResetPosition()
- {
- this.m_taskScrollView.ResetPosition();
- this.m_content.transform.localPosition = new Vector2(this.m_content.transform.localPosition.x, this.m_contentPosY);
- }
- protected override void SetDataForViewer()
- {
- this.m_dicTask = new Dictionary<ScheduleTaskCtrl.TaskType, Dictionary<string, ScheduleTaskCtrl.TaskButton>>();
- this.m_dicTask.Add(ScheduleTaskCtrl.TaskType.Yotogi, this.AddYotogiTaskButton(ScheduleTaskCtrl.TaskType.Yotogi));
- this.m_dicTask.Add(ScheduleTaskCtrl.TaskType.Training, this.AddTrainingTaskButton(ScheduleTaskCtrl.TaskType.Training));
- }
- private Dictionary<string, ScheduleTaskCtrl.TaskButton> AddTrainingTaskButton(ScheduleTaskCtrl.TaskType taskType)
- {
- Dictionary<string, ScheduleTaskCtrl.TaskButton> dictionary = new Dictionary<string, ScheduleTaskCtrl.TaskButton>();
- int num = 0;
- foreach (ScheduleTaskCtrl.TaskButton taskButton in this.m_listTaskButton[taskType])
- {
- ScheduleTaskCtrl.TrainingTaskButton trainingTaskButton = (ScheduleTaskCtrl.TrainingTaskButton)taskButton;
- GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goUnitPrefab);
- gameObject.name = trainingTaskButton.id;
- GameObject childObject = UTY.GetChildObject(gameObject, "Main", false);
- childObject.name = trainingTaskButton.id;
- base.SetTransformInfo(gameObject);
- UILabel component = UTY.GetChildObject(gameObject, "Title", false).GetComponent<UILabel>();
- component.text = trainingTaskButton.name;
- UITexture component2 = childObject.GetComponent<UITexture>();
- component2.mainTexture = trainingTaskButton.txtTaskIcon;
- this.SetDaytimeTaskRank(gameObject, trainingTaskButton.rank);
- this.SetExpRatio(gameObject, trainingTaskButton.expRatio);
- if (trainingTaskButton.type == ScheduleCSVData.TrainingType.Travel)
- {
- UTY.GetChildObject(gameObject, "Stars", false).SetActive(false);
- UTY.GetChildObject(gameObject, "ExpRatio", false).SetActive(false);
- Transform transform = UTY.GetChildObject(gameObject, "Title", false).transform;
- Vector3 localPosition = transform.localPosition;
- localPosition.y = -55f;
- transform.localPosition = localPosition;
- }
- GameObject childObject2 = UTY.GetChildObject(childObject, "SelectCursor", false);
- childObject2.SetActive(false);
- trainingTaskButton.selectCursor = childObject2;
- trainingTaskButton.order = num;
- UIButton component3 = childObject.GetComponent<UIButton>();
- trainingTaskButton.btnTask = component3;
- EventDelegate eventDelegate = new EventDelegate(this.m_scheduleMgr, "ClickTask");
- eventDelegate.parameters[0].value = ScheduleMgr.ScheduleTime.DayTime;
- EventDelegate.Add(component3.onClick, eventDelegate);
- if (!trainingTaskButton.enableTask)
- {
- Debug.Log(string.Format("選択できないタスクです。タスクID={0}, タスク名={1}", trainingTaskButton.id, trainingTaskButton.name));
- }
- dictionary.Add(trainingTaskButton.id, trainingTaskButton);
- num++;
- }
- return dictionary;
- }
- private void SetDaytimeTaskRank(GameObject go, int rank)
- {
- List<GameObject> list = new List<GameObject>();
- GameObject childObject = UTY.GetChildObject(go, "Stars/Icon", false);
- IEnumerator enumerator = childObject.transform.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform = (Transform)obj;
- list.Add(transform.gameObject);
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- int count = list.Count;
- for (int i = 0; i < count; i++)
- {
- if (rank > i)
- {
- list[i].SetActive(true);
- }
- else
- {
- list[i].SetActive(false);
- }
- }
- }
- private void SetExpRatio(GameObject go, int expRatio)
- {
- List<GameObject> list = new List<GameObject>();
- GameObject childObject = UTY.GetChildObject(go, "ExpRatio/ValueGroup", false);
- IEnumerator enumerator = childObject.transform.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform = (Transform)obj;
- list.Add(transform.gameObject);
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- int count = list.Count;
- for (int i = 0; i < count; i++)
- {
- if (expRatio > i)
- {
- list[i].SetActive(true);
- }
- else
- {
- list[i].SetActive(false);
- }
- }
- }
- private Dictionary<string, ScheduleTaskCtrl.TaskButton> AddYotogiTaskButton(ScheduleTaskCtrl.TaskType taskType)
- {
- Dictionary<string, ScheduleTaskCtrl.TaskButton> dictionary = new Dictionary<string, ScheduleTaskCtrl.TaskButton>();
- int num = 0;
- foreach (ScheduleTaskCtrl.TaskButton taskButton in this.m_listTaskButton[taskType])
- {
- GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goUnitPrefab);
- gameObject.name = taskButton.id;
- GameObject childObject = UTY.GetChildObject(gameObject, "Main", false);
- childObject.name = taskButton.id;
- base.SetTransformInfo(gameObject);
- UILabel component = UTY.GetChildObject(gameObject, "Title", false).GetComponent<UILabel>();
- component.text = taskButton.name;
- UITexture component2 = childObject.GetComponent<UITexture>();
- component2.mainTexture = taskButton.txtTaskIcon;
- GameObject childObject2 = UTY.GetChildObject(childObject, "SelectCursor", false);
- childObject2.SetActive(false);
- taskButton.selectCursor = childObject2;
- taskButton.order = num;
- UIButton component3 = childObject.GetComponent<UIButton>();
- taskButton.btnTask = component3;
- EventDelegate eventDelegate = new EventDelegate(this.m_scheduleMgr, "ClickTask");
- eventDelegate.parameters[0].value = ScheduleMgr.ScheduleTime.Night;
- EventDelegate.Add(component3.onClick, eventDelegate);
- if (!taskButton.enableTask)
- {
- Debug.Log(string.Format("選択できないタスクです。タスクID={0}, タスク名={1}", taskButton.id, taskButton.name));
- }
- dictionary.Add(taskButton.id, taskButton);
- num++;
- }
- return dictionary;
- }
- public void UpdateTaskViewer(string taskId)
- {
- this.LoadYotogiTaskData(taskId);
- this.SetTaskButtonActive(ScheduleTaskCtrl.TaskType.Yotogi, taskId);
- }
- private string GetTaskId(ScheduleMgr.ScheduleTime workTime)
- {
- ScheduleCtrl.MaidStatusAndTaskUnit maidStatusAndTaskUnit = null;
- Dictionary<string, ScheduleCtrl.MaidStatusAndTaskUnit> dicMaidStatusAndTask = this.m_scheduleCtrl.GetDicMaidStatusAndTask();
- if (dicMaidStatusAndTask.TryGetValue(this.m_scheduleCtrl.GetActiveSlotNo(), out maidStatusAndTaskUnit))
- {
- if (workTime == ScheduleMgr.ScheduleTime.Night)
- {
- return maidStatusAndTaskUnit.nightTaskId;
- }
- if (workTime == ScheduleMgr.ScheduleTime.DayTime)
- {
- return maidStatusAndTaskUnit.daytimeTaskId;
- }
- }
- return null;
- }
- private void LoadYotogiTaskData(string taskId)
- {
- int num = int.Parse(taskId);
- this.m_listCondition = new List<ScheduleCtrl.VariableItem>();
- foreach (ScheduleBase scheduleBase in this.m_listWorksData[ScheduleTaskCtrl.TaskType.Yotogi])
- {
- if (scheduleBase.id == num)
- {
- ScheduleYotogi scheduleYotogi = (ScheduleYotogi)scheduleBase;
- this.m_lDescription.text = scheduleYotogi.info;
- base.DelChildGameObject(this.m_goConditionParent);
- int num2 = 1;
- if (scheduleYotogi.condInfo != null && scheduleYotogi.condInfo.Count > 0)
- {
- foreach (string text in scheduleYotogi.condInfo)
- {
- GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.m_goConditionUnit);
- gameObject.name = "condition_" + num2;
- base.SetTransformInfo(this.m_goConditionParent, gameObject);
- UILabel component = UTY.GetChildObject(gameObject, "No", false).GetComponent<UILabel>();
- component.text = num2.ToString();
- UILabel component2 = UTY.GetChildObject(gameObject, "Message", false).GetComponent<UILabel>();
- component2.text = text;
- ScheduleCtrl.VariableItem item = new ScheduleCtrl.VariableItem(gameObject, component2);
- this.m_listCondition.Add(item);
- num2++;
- }
- }
- }
- }
- this.ExamineDisplayItem();
- }
- private void ExamineDisplayItem()
- {
- int num = ScheduleCtrl.SetActiveExceptForNothing(this.m_listCondition, this.NOTHING);
- bool active = num > 0;
- this.m_goTitleOfConditiont.SetActive(active);
- BaseCreateViewerCtrl.Reposition(this.m_goConditionParent);
- this.AdjustConditon(num);
- }
- private void AdjustConditon(int displayConditionCount)
- {
- float num = 260f;
- float num2 = 10f;
- float num3 = 25f;
- float num4 = 4f;
- float num5 = 0f;
- if (displayConditionCount > 0)
- {
- num5 += (float)this.m_heightOfconditionTitle + num2;
- float y = this.m_goConditionParent.GetComponent<UITable>().padding.y;
- IEnumerator enumerator = this.m_goConditionParent.transform.GetEnumerator();
- try
- {
- while (enumerator.MoveNext())
- {
- object obj = enumerator.Current;
- Transform transform = (Transform)obj;
- if (transform.gameObject.activeSelf)
- {
- UILabel component = transform.Find("Message").GetComponent<UILabel>();
- num5 += (float)component.height + y * 2f + num4;
- }
- }
- }
- finally
- {
- IDisposable disposable;
- if ((disposable = (enumerator as IDisposable)) != null)
- {
- disposable.Dispose();
- }
- }
- num5 += num3;
- }
- this.m_spBGOfDescriptionViewer.height = (int)(num + num5);
- }
- public void SetTaskButtonActive(ScheduleTaskCtrl.TaskType type, string taskId)
- {
- foreach (KeyValuePair<string, ScheduleTaskCtrl.TaskButton> keyValuePair in this.m_dicTask[type])
- {
- string key = keyValuePair.Key;
- ScheduleTaskCtrl.TaskButton value = keyValuePair.Value;
- if (key == taskId)
- {
- if (value.enableTask)
- {
- value.btnTask.defaultColor = this.m_scheduleCtrl.GetActiveColor();
- }
- else
- {
- value.btnTask.defaultColor = this.m_scheduleCtrl.GetDisableColor();
- }
- value.selectCursor.SetActive(true);
- }
- else
- {
- value.selectCursor.SetActive(false);
- value.btnTask.defaultColor = this.m_scheduleCtrl.GetInActiveColor();
- }
- }
- }
- public void UpdateSelectedMaidTask(string taskId)
- {
- this.SetWorkId(ScheduleTaskViewer.ScheduleTime, int.Parse(taskId));
- string currentActiveButton = this.m_scheduleMgr.CurrentActiveButton;
- this.m_scheduleMgr.UpdateMaidStatus();
- this.CreateTaskViewer(currentActiveButton);
- this.m_scheduleMgr.CurrentActiveButton = currentActiveButton;
- }
- public void SetCommu(ScheduleMgr.ScheduleTime workTime, string guid, bool value)
- {
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
- {
- Maid stockMaid = characterMgr.GetStockMaid(i);
- bool flag = false;
- if (stockMaid.status.guid == guid)
- {
- flag = value;
- }
- if (stockMaid.status.guid == guid || flag)
- {
- if (workTime == ScheduleMgr.ScheduleTime.DayTime)
- {
- stockMaid.status.noonCommu = flag;
- }
- else if (workTime == ScheduleMgr.ScheduleTime.Night)
- {
- stockMaid.status.nightCommu = flag;
- }
- }
- }
- }
- private void SetWorkId(ScheduleMgr.ScheduleTime workTime, int taskId)
- {
- 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)
- {
- this.m_scheduleApi.SetNightWorkSlot_Safe(workTime, slotId, taskId);
- }
- }
- else
- {
- this.m_scheduleApi.SetNoonWorkSlot_Safe(workTime, slotId, taskId);
- }
- }
- if (!DailyMgr.IsLegacy)
- {
- GameMain.Instance.FacilityMgr.UpdateFacilityAssignedMaidData();
- }
- ScheduleAPI.MaidWorkIdErrorCheck(true);
- }
- private List<ScheduleTaskCtrl.TaskButton> LoadYotogiData(int slotNo)
- {
- this.m_scheduleApi = this.m_scheduleMgr.GetScheduleApi();
- List<ScheduleBase> scheduleData = this.m_scheduleApi.slot[slotNo].scheduleData;
- List<ScheduleBase> list = new List<ScheduleBase>();
- Maid maid = this.m_scheduleApi.slot[slotNo].maid;
- this.m_listWorksData.Add(ScheduleTaskCtrl.TaskType.Yotogi, list);
- List<ScheduleTaskCtrl.TaskButton> list2 = new List<ScheduleTaskCtrl.TaskButton>();
- foreach (ScheduleBase scheduleBase in scheduleData)
- {
- list.Add(scheduleBase);
- if (scheduleBase.workType == ScheduleType.Yotogi)
- {
- ScheduleYotogi scheduleYotogi = (ScheduleYotogi)scheduleBase;
- bool flag = scheduleYotogi.visible;
- if (flag && maid != null)
- {
- flag = PersonalEventBlocker.IsEnabledScheduleTask(maid.status.personal, scheduleBase.id);
- }
- if (flag)
- {
- list2.Add(new ScheduleTaskCtrl.YotogiTaskButton
- {
- id = scheduleYotogi.id.ToString(),
- name = scheduleYotogi.name,
- txtTaskIcon = scheduleYotogi.icon,
- enableTask = scheduleYotogi.enabled,
- data = scheduleYotogi
- });
- }
- }
- }
- return list2;
- }
- private List<ScheduleTaskCtrl.TaskButton> LoadTrainingData(int slotNo)
- {
- this.m_scheduleApi = this.m_scheduleMgr.GetScheduleApi();
- List<ScheduleBase> scheduleData = this.m_scheduleApi.slot[slotNo].scheduleData;
- List<ScheduleBase> list = new List<ScheduleBase>();
- Maid maid = this.m_scheduleApi.slot[slotNo].maid;
- this.m_listWorksData.Add(ScheduleTaskCtrl.TaskType.Training, list);
- this.m_currentSlotInfo = this.m_scheduleApi.slot[slotNo];
- List<ScheduleTaskCtrl.TaskButton> list2 = new List<ScheduleTaskCtrl.TaskButton>();
- foreach (ScheduleBase scheduleBase in scheduleData)
- {
- list.Add(scheduleBase);
- if (scheduleBase.workType == ScheduleType.Training)
- {
- ScheduleTraining scheduleTraining = (ScheduleTraining)scheduleBase;
- bool flag = scheduleTraining.visible;
- if (flag && maid != null)
- {
- flag = PersonalEventBlocker.IsEnabledScheduleTask(maid.status.personal, scheduleBase.id);
- }
- if (flag)
- {
- list2.Add(new ScheduleTaskCtrl.TrainingTaskButton
- {
- id = scheduleTraining.id.ToString(),
- name = scheduleTraining.name,
- rank = scheduleTraining.lv,
- expRatio = scheduleTraining.expRatioFrom0To10,
- txtTaskIcon = scheduleTraining.icon,
- enableTask = scheduleTraining.enabled,
- type = scheduleTraining.type
- });
- }
- }
- }
- return list2;
- }
- private List<ScheduleTaskCtrl.TaskButton> LoadWorkData(int slotNo)
- {
- this.m_scheduleApi = this.m_scheduleMgr.GetScheduleApi();
- List<ScheduleBase> scheduleData = this.m_scheduleApi.slot[slotNo].scheduleData;
- List<ScheduleBase> list = new List<ScheduleBase>();
- Maid maid = this.m_scheduleApi.slot[slotNo].maid;
- this.m_listWorksData.Add(ScheduleTaskCtrl.TaskType.Work, list);
- this.m_currentSlotInfo = this.m_scheduleApi.slot[slotNo];
- List<ScheduleTaskCtrl.TaskButton> list2 = new List<ScheduleTaskCtrl.TaskButton>();
- foreach (ScheduleBase scheduleBase in scheduleData)
- {
- list.Add(scheduleBase);
- if (scheduleBase.workType == ScheduleType.Work)
- {
- ScheduleWork scheduleWork = (ScheduleWork)scheduleBase;
- bool flag = scheduleWork.visible;
- if (flag && maid != null)
- {
- flag = PersonalEventBlocker.IsEnabledScheduleTask(maid.status.personal, scheduleBase.id);
- }
- if (flag)
- {
- list2.Add(new ScheduleTaskCtrl.WorkTaskButton
- {
- id = scheduleWork.id.ToString(),
- name = scheduleWork.name,
- rank = scheduleWork.lv,
- expRatio = scheduleWork.expRatioFrom0To10,
- txtTaskIcon = scheduleWork.icon,
- enableTask = scheduleWork.enabled,
- type = scheduleWork.type
- });
- }
- }
- }
- return list2;
- }
- private string Sign(int input, string format = null)
- {
- if (input <= 0)
- {
- return input.ToString();
- }
- if (format != null)
- {
- return "+" + input.ToString(format);
- }
- return "+" + input.ToString();
- }
- public bool CanSetTask(ScheduleTaskCtrl.TaskType type, int taskId)
- {
- foreach (ScheduleBase scheduleBase in this.m_listWorksData[type])
- {
- if (scheduleBase.id == taskId)
- {
- return scheduleBase.enabled;
- }
- }
- return false;
- }
- private ScheduleMgr m_scheduleMgr;
- private ScheduleCtrl m_scheduleCtrl;
- private ScheduleScene m_scheduleApi;
- private ScheduleTaskViewer m_taskViewer;
- private ScheduleRoomCtrl m_roomViewer;
- private Dictionary<ScheduleTaskCtrl.TaskType, Dictionary<string, ScheduleTaskCtrl.TaskButton>> m_dicTask;
- private Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleTaskCtrl.TaskButton>> m_listTaskButton;
- private Dictionary<ScheduleTaskCtrl.TaskType, List<ScheduleBase>> m_listWorksData;
- private List<ScheduleCtrl.VariableItem> m_listCondition;
- private GameObject m_goScheduleTaskViewer;
- private GameObject m_goTitleOfConditiont;
- private GameObject m_goConditionParent;
- private GameObject m_goConditionUnit;
- private GameObject m_content;
- private UISprite m_spBGOfParameterViewer;
- private UILabel m_lStudyRate;
- private UILabel m_lReception;
- private UILabel m_lCare;
- private UILabel m_lLovely;
- private UILabel m_lElegance;
- private UILabel m_lCharm;
- private UILabel m_lTeachRate;
- private UILabel m_lMaidClassExp;
- private UILabel m_lCleanliness;
- private UILabel m_lBrilliant;
- private UILabel m_lIncome;
- private UILabel m_lCurrentStudyRate;
- private UILabel m_lCurrentReception;
- private UILabel m_lCurrentCare;
- private UILabel m_lCurrentLovely;
- private UILabel m_lCurrentElegance;
- private UILabel m_lCurrentCharm;
- private UILabel m_lCurrentTeachRate;
- private UILabel m_lCurrentMaidClassExp;
- private UILabel m_lRoomName;
- private Slot m_currentSlotInfo;
- private UIScrollView m_taskScrollView;
- private UIScrollBar m_taskScrollBar;
- private UISprite m_spBGOfDescriptionViewer;
- private UILabel m_lDescription;
- private bool m_bInit;
- private float m_contentPosY;
- private string NOTHING = string.Empty;
- private int m_heightOfconditionTitle;
- [SerializeField]
- private int m_currentActiveSlotNo;
- private const string NIGHT_TASK_UNIT_PATH = "SceneDaily/Schedule/Prefab/NightTaskUnit";
- private const string CONDITION_UNIT_PATH = "SceneDaily/Schedule/Prefab/ConditionUnit";
- private const string PREFIX_BUTTON_NAME = "NightTask";
- private const int MAX_CONDITION_COUNT = 9;
- public class TaskButton
- {
- public ScheduleBase data;
- public string id;
- public string name;
- public int order;
- public bool enableTask;
- public UIButton btnTask;
- public Texture2D txtTaskIcon;
- public GameObject selectCursor;
- }
- public class YotogiTaskButton : ScheduleTaskCtrl.TaskButton
- {
- }
- public class TrainingTaskButton : ScheduleTaskCtrl.TaskButton
- {
- public int rank;
- public int expRatio;
- public List<GameObject> listRank;
- public ScheduleCSVData.TrainingType type;
- }
- public class WorkTaskButton : ScheduleTaskCtrl.TrainingTaskButton
- {
- }
- public enum TaskType
- {
- Yotogi,
- Training,
- Work,
- Max
- }
- }
|