MaidLikabilityCtrl.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using wf;
  5. namespace Kasizuki
  6. {
  7. public class MaidLikabilityCtrl : NGUIWindow, IStatusCtrl<Maid>
  8. {
  9. protected override void Awake()
  10. {
  11. base.Awake();
  12. this.m_ListViewer = base.GetComponent<uGUIListViewer>();
  13. this.m_IsAwaked = true;
  14. }
  15. public void SetData(Maid maid)
  16. {
  17. if (maid == null)
  18. {
  19. NDebug.Warning("情報を表示するメイドにnullが指定されました。");
  20. return;
  21. }
  22. this.m_TargetMaid = maid;
  23. this.UpdateNGUILabel();
  24. }
  25. public void UpdateMaidInfo()
  26. {
  27. if (this.m_TargetMaid == null)
  28. {
  29. NDebug.Warning("情報を表示するメイドがnullでした。SetMaid( Maid )関数で、情報を表示するメイドを指定してください。");
  30. return;
  31. }
  32. this.UpdateNGUILabel();
  33. }
  34. private void UpdateNGUILabel()
  35. {
  36. if (!this.m_IsAwaked)
  37. {
  38. base.gameObject.SetActive(true);
  39. }
  40. KasizukiManager kasizukiMgr = GameMain.Instance.KasizukiMgr;
  41. Maid maid = this.m_TargetMaid;
  42. List<ManData.Data> manList = ManData.GetAllDatas(true, true);
  43. this.m_ListViewer.Show<Transform>(manList.Count, delegate(int index, Transform item)
  44. {
  45. ManData.Data data = manList[index];
  46. UILabel component2 = UTY.GetChildObject(item.gameObject, "Name", false).GetComponent<UILabel>();
  47. UILabel component3 = UTY.GetChildObject(item.gameObject, "Value", false).GetComponent<UILabel>();
  48. UISprite component4 = UTY.GetChildObject(item.gameObject, "Gauge/Gauge", false).GetComponent<UISprite>();
  49. int num = 0;
  50. ManDataType manType = data.manType;
  51. if (manType != ManDataType.主人公)
  52. {
  53. if (manType != ManDataType.傅き男1)
  54. {
  55. if (manType != ManDataType.傅き男2)
  56. {
  57. if (manType != ManDataType.傅き男3)
  58. {
  59. if (manType != ManDataType.傅き男4)
  60. {
  61. if (manType == ManDataType.傅き男5)
  62. {
  63. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男5, false);
  64. }
  65. }
  66. else
  67. {
  68. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男4, false);
  69. }
  70. }
  71. else
  72. {
  73. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男3, false);
  74. }
  75. }
  76. else
  77. {
  78. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男2, false);
  79. }
  80. }
  81. else
  82. {
  83. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男1, false);
  84. }
  85. }
  86. else
  87. {
  88. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F本編, false);
  89. }
  90. num = Mathf.Clamp(num, 0, 100);
  91. component2.text = data.drawName;
  92. Utility.SetLocalizeTerm(component2, data.drawNameTerm);
  93. component3.text = num.ToString();
  94. component4.fillAmount = (float)num / 100f;
  95. });
  96. UIGrid component = this.m_ListViewer.parentItemArea.GetComponent<UIGrid>();
  97. component.enabled = true;
  98. component.Reposition();
  99. UIScrollView componentInChildren = base.GetComponentInChildren<UIScrollView>();
  100. componentInChildren.ResetPosition();
  101. }
  102. private uGUIListViewer m_ListViewer;
  103. private Maid m_TargetMaid;
  104. private bool m_IsAwaked;
  105. }
  106. }