MaidStatusListCtrl.cs 3.1 KB

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