MaidStatusListCtrl.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System;
  2. using System.Collections.Generic;
  3. using Schedule;
  4. using UnityEngine;
  5. public class MaidStatusListCtrl : MonoBehaviour
  6. {
  7. public void Init(ScheduleMgr scheduleMgr, ScheduleCtrl scheduleCtrl, GameObject goPanel)
  8. {
  9. this.m_scheduleMgr = scheduleMgr;
  10. this.m_scheduleCtrl = scheduleCtrl;
  11. this.m_goMaidStatusListViewer = UTY.GetChildObject(goPanel, "CharacterSelectPanel", false);
  12. this.m_goMaidStatusListViewer.SetActive(false);
  13. this.m_charSelMgr = UTY.GetChildObject(goPanel, "CharacterSelectPanel", false).GetComponent<CharacterSelectManager>();
  14. }
  15. public void CreateTaskViewer(string buttonName)
  16. {
  17. this.m_scheduleCtrl.SetMaidIdByButtonName(buttonName);
  18. this.m_scheduleCtrl.SetSelectedRowActive(buttonName);
  19. this.m_scheduleCtrl.SetViewerActive(ScheduleCtrl.ExclusiveViewer.MaidStatusList);
  20. this.m_charSelMgr.SetCallBackOnClick(new CharacterSelectManager.CallBackOnClick(this.m_scheduleMgr.ClickMaidStatusInListViewer));
  21. this.m_charSelMgr.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  22. {
  23. List<Maid> list = new List<Maid>();
  24. CharacterSelectManager.DefaultMaidList(list);
  25. for (int i = 0; i < list.Count; i++)
  26. {
  27. Maid maid = list[i];
  28. if (!DailyMgr.IsLegacy || maid.status.isCompatiblePersonality)
  29. {
  30. draw_maid_list.Add(list[i]);
  31. }
  32. }
  33. });
  34. this.m_charSelMgr.Create(CharacterSelectManager.Type.Click, 3, true);
  35. this.RemoveMaidInSlot();
  36. }
  37. private void RemoveMaidInSlot()
  38. {
  39. Dictionary<string, ScheduleCtrl.MaidStatusAndTaskUnit> dicMaidStatusAndTask = this.m_scheduleCtrl.GetDicMaidStatusAndTask();
  40. foreach (KeyValuePair<string, ScheduleCtrl.MaidStatusAndTaskUnit> keyValuePair in dicMaidStatusAndTask)
  41. {
  42. ScheduleCtrl.MaidStatusAndTaskUnit value = keyValuePair.Value;
  43. this.m_charSelMgr.MoveNoDrawArea(value.maidStatus.maid);
  44. }
  45. }
  46. public void MoveMaidToSlot(ScheduleScene scheduleApi, Maid maidToMoveInSlot)
  47. {
  48. string currentActiveButton = this.m_scheduleMgr.CurrentActiveButton;
  49. int slotId = ScheduleCtrl.ToIntSlotNo(this.m_scheduleCtrl.GetActiveSlotNo());
  50. scheduleApi.SetSlot_Safe(slotId, maidToMoveInSlot, true, true);
  51. this.m_charSelMgr.MoveNoDrawArea(maidToMoveInSlot);
  52. Maid maidByActiveSlot = this.m_scheduleCtrl.GetMaidByActiveSlot();
  53. if (maidByActiveSlot != null)
  54. {
  55. this.m_charSelMgr.MoveGridArea(maidByActiveSlot);
  56. }
  57. this.m_scheduleMgr.UpdateMaidStatus();
  58. this.m_scheduleCtrl.SetSelectedRowActive(currentActiveButton);
  59. this.m_scheduleMgr.CurrentActiveButton = currentActiveButton;
  60. this.m_scheduleCtrl.SetViewerActive(ScheduleCtrl.ExclusiveViewer.MaidStatusList);
  61. }
  62. private ScheduleMgr m_scheduleMgr;
  63. private ScheduleCtrl m_scheduleCtrl;
  64. private CharacterSelectManager m_charSelMgr;
  65. private GameObject m_goMaidStatusListViewer;
  66. public class MaidStatusButton
  67. {
  68. public Maid maid;
  69. public string id;
  70. public string name;
  71. public string firstName;
  72. public string lastName;
  73. public int Rranking;
  74. public bool isReader;
  75. public Texture2D crownIcon;
  76. public Texture2D maidIcon;
  77. public UIButton uiButton;
  78. public UITexture uiMaidIcon;
  79. public string contractTypeName;
  80. public GameObject selectCursor;
  81. }
  82. }