MaidLikabilityCtrl.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. if (manType != ManDataType.傅き男6)
  64. {
  65. if (manType != ManDataType.傅き男7)
  66. {
  67. if (manType != ManDataType.傅き男8)
  68. {
  69. if (manType != ManDataType.傅き男9)
  70. {
  71. if (manType != ManDataType.傅き男10)
  72. {
  73. if (manType != ManDataType.傅き男11)
  74. {
  75. if (manType != ManDataType.傅き男12)
  76. {
  77. if (manType != ManDataType.傅き男13)
  78. {
  79. if (manType != ManDataType.傅き男14)
  80. {
  81. if (manType != ManDataType.傅き男15)
  82. {
  83. if (manType != ManDataType.傅き男16)
  84. {
  85. if (manType != ManDataType.傅き男17)
  86. {
  87. if (manType != ManDataType.傅き男18)
  88. {
  89. if (manType == ManDataType.傅き男19)
  90. {
  91. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男19, false);
  92. }
  93. }
  94. else
  95. {
  96. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男18, false);
  97. }
  98. }
  99. else
  100. {
  101. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男17, false);
  102. }
  103. }
  104. else
  105. {
  106. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男16, false);
  107. }
  108. }
  109. else
  110. {
  111. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男15, false);
  112. }
  113. }
  114. else
  115. {
  116. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男14, false);
  117. }
  118. }
  119. else
  120. {
  121. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男13, false);
  122. }
  123. }
  124. else
  125. {
  126. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男12, false);
  127. }
  128. }
  129. else
  130. {
  131. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男11, false);
  132. }
  133. }
  134. else
  135. {
  136. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男10, false);
  137. }
  138. }
  139. else
  140. {
  141. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男9, false);
  142. }
  143. }
  144. else
  145. {
  146. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男8, false);
  147. }
  148. }
  149. else
  150. {
  151. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男7, false);
  152. }
  153. }
  154. else
  155. {
  156. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男6, false);
  157. }
  158. }
  159. else
  160. {
  161. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男5, false);
  162. }
  163. }
  164. else
  165. {
  166. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男4, false);
  167. }
  168. }
  169. else
  170. {
  171. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男3, false);
  172. }
  173. }
  174. else
  175. {
  176. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男2, false);
  177. }
  178. }
  179. else
  180. {
  181. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F傅き男1, false);
  182. }
  183. }
  184. else
  185. {
  186. num = kasizukiMgr.GetMaidData<int>(maid, MaidDataType.好感度\uFF3F本編, false);
  187. }
  188. num = Mathf.Clamp(num, 0, 100);
  189. component2.text = data.drawName;
  190. Utility.SetLocalizeTerm(component2, data.drawNameTerm, false);
  191. component3.text = num.ToString();
  192. component4.fillAmount = (float)num / 100f;
  193. });
  194. UIGrid component = this.m_ListViewer.parentItemArea.GetComponent<UIGrid>();
  195. component.enabled = true;
  196. component.Reposition();
  197. UIScrollView componentInChildren = base.GetComponentInChildren<UIScrollView>();
  198. componentInChildren.ResetPosition();
  199. }
  200. private uGUIListViewer m_ListViewer;
  201. private Maid m_TargetMaid;
  202. private bool m_IsAwaked;
  203. }
  204. }