KasizukiPlayInfoCtrl.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using wf;
  5. namespace Kasizuki
  6. {
  7. public class KasizukiPlayInfoCtrl : NGUIWindow
  8. {
  9. public GameObject windowRoomList
  10. {
  11. get
  12. {
  13. return this.m_WindowRoomList;
  14. }
  15. }
  16. public GameObject windowManList
  17. {
  18. get
  19. {
  20. return this.m_WindowManList;
  21. }
  22. }
  23. public GameObject windowPlayList
  24. {
  25. get
  26. {
  27. return this.m_WindowPlayList;
  28. }
  29. }
  30. public GameObject windowDescriptionList
  31. {
  32. get
  33. {
  34. return this.m_WindowDesciption;
  35. }
  36. }
  37. public Action<RoomData.Data> onClickRoom { get; set; }
  38. public Action<ManData.Data> onClickMan { get; set; }
  39. public Action<PlayData.Data> onClickPlay { get; set; }
  40. public Action<PlayData.Data> onHoverPlay { get; set; }
  41. public Action<PlayData.Data> onOutPlay { get; set; }
  42. public ObjectCacheDic descriptionCache
  43. {
  44. get
  45. {
  46. return this.m_DescriptionCache;
  47. }
  48. }
  49. private void Start()
  50. {
  51. this.SetUpRoomList();
  52. this.SetUpManList();
  53. this.SetUpPlayList();
  54. this.SetUpDescription();
  55. }
  56. private void SetUpRoomList()
  57. {
  58. this.m_RoomListCache = new ObjectCacheDic();
  59. }
  60. private void SetUpManList()
  61. {
  62. this.m_ManListCache = new ObjectCacheDic();
  63. }
  64. private void SetUpPlayList()
  65. {
  66. this.m_PlayListCache = new ObjectCacheDic();
  67. }
  68. private void SetUpDescription()
  69. {
  70. this.m_DescriptionCache = new ObjectCacheDic();
  71. this.m_DescriptionCache.CacheChildObject<UILabel>(this.m_WindowDesciption, "Text Description", "説明文");
  72. this.m_DescriptionCache.CacheChildObject<uGUIListViewer>(this.m_WindowDesciption, "Parent Condition", "条件一覧");
  73. }
  74. public void OpenRoomList(List<RoomData.Data> roomDataList, RoomData.Data selectingData = null)
  75. {
  76. KasizukiPlayInfoCtrl.<OpenRoomList>c__AnonStorey1 <OpenRoomList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenRoomList>c__AnonStorey1();
  77. <OpenRoomList>c__AnonStorey.selectingData = selectingData;
  78. <OpenRoomList>c__AnonStorey.$this = this;
  79. ListViewerWindow component = this.m_WindowRoomList.GetComponent<ListViewerWindow>();
  80. component.Show<RoomData.Data, UIWFTabButton>(roomDataList, delegate(int index, RoomData.Data data, UIWFTabButton item)
  81. {
  82. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  83. componentInChildren.text = data.drawName;
  84. Utility.SetLocalizeTerm(componentInChildren, data.drawNameTerm, false);
  85. EventDelegate.Add(item.onClick, delegate()
  86. {
  87. <OpenRoomList>c__AnonStorey.OnClickRoom(data);
  88. });
  89. if (<OpenRoomList>c__AnonStorey.selectingData != null && <OpenRoomList>c__AnonStorey.selectingData == data)
  90. {
  91. item.SetSelect(true);
  92. }
  93. });
  94. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  95. if (component2)
  96. {
  97. component2.UpdateChildren();
  98. }
  99. }
  100. public void OnClickRoom(RoomData.Data roomData)
  101. {
  102. if (this.onClickRoom != null)
  103. {
  104. this.onClickRoom(roomData);
  105. }
  106. }
  107. public void OpenManList(List<ManData.Data> manDataList, ManData.Data selectingData = null, Action<UIWFTabButton, ManData.Data> onCreate = null)
  108. {
  109. KasizukiPlayInfoCtrl.<OpenManList>c__AnonStorey3 <OpenManList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenManList>c__AnonStorey3();
  110. <OpenManList>c__AnonStorey.selectingData = selectingData;
  111. <OpenManList>c__AnonStorey.onCreate = onCreate;
  112. <OpenManList>c__AnonStorey.$this = this;
  113. ListViewerWindow component = this.m_WindowManList.GetComponent<ListViewerWindow>();
  114. component.Show<ManData.Data, UIWFTabButton>(manDataList, delegate(int index, ManData.Data data, UIWFTabButton item)
  115. {
  116. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  117. componentInChildren.text = data.drawName;
  118. Utility.SetLocalizeTerm(componentInChildren, data.drawNameTerm, false);
  119. EventDelegate.Add(item.onClick, delegate()
  120. {
  121. <OpenManList>c__AnonStorey.OnClickMan(data);
  122. });
  123. if (<OpenManList>c__AnonStorey.selectingData != null && <OpenManList>c__AnonStorey.selectingData == data)
  124. {
  125. item.SetSelect(true);
  126. }
  127. if (<OpenManList>c__AnonStorey.onCreate != null)
  128. {
  129. <OpenManList>c__AnonStorey.onCreate(item, data);
  130. }
  131. });
  132. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  133. if (component2)
  134. {
  135. component2.UpdateChildren();
  136. }
  137. }
  138. public void OnClickMan(ManData.Data manData)
  139. {
  140. if (this.onClickMan != null)
  141. {
  142. this.onClickMan(manData);
  143. }
  144. }
  145. public void OpenPlayList(List<PlayData.Data> playDataList, PlayData.Data selectingData = null)
  146. {
  147. KasizukiPlayInfoCtrl.<OpenPlayList>c__AnonStorey5 <OpenPlayList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenPlayList>c__AnonStorey5();
  148. <OpenPlayList>c__AnonStorey.selectingData = selectingData;
  149. <OpenPlayList>c__AnonStorey.$this = this;
  150. ListViewerWindow component = this.m_WindowPlayList.GetComponent<ListViewerWindow>();
  151. component.Show<PlayData.Data, UIWFTabButton>(playDataList, delegate(int index, PlayData.Data data, UIWFTabButton item)
  152. {
  153. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  154. componentInChildren.text = data.drawName;
  155. Utility.SetLocalizeTerm(componentInChildren, data.drawNameTerm, false);
  156. EventDelegate.Add(item.onClick, delegate()
  157. {
  158. <OpenPlayList>c__AnonStorey.OnClickPlay(data);
  159. });
  160. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOver, delegate()
  161. {
  162. <OpenPlayList>c__AnonStorey.OnHoverPlay(data);
  163. });
  164. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOut, delegate()
  165. {
  166. <OpenPlayList>c__AnonStorey.OnOutPlay(data);
  167. });
  168. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOver, delegate()
  169. {
  170. <OpenPlayList>c__AnonStorey.OnHoverPlay(data);
  171. });
  172. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOut, delegate()
  173. {
  174. <OpenPlayList>c__AnonStorey.OnOutPlay(data);
  175. });
  176. if (<OpenPlayList>c__AnonStorey.selectingData != null && <OpenPlayList>c__AnonStorey.selectingData == data)
  177. {
  178. item.SetSelect(true);
  179. }
  180. item.isEnabled = data.IsPassed;
  181. });
  182. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  183. if (component2)
  184. {
  185. component2.UpdateChildren();
  186. }
  187. }
  188. public void OnClickPlay(PlayData.Data playData)
  189. {
  190. if (this.onClickPlay != null)
  191. {
  192. this.onClickPlay(playData);
  193. }
  194. }
  195. private void OnHoverPlay(PlayData.Data playData)
  196. {
  197. if (this.onHoverPlay != null)
  198. {
  199. this.onHoverPlay(playData);
  200. }
  201. }
  202. private void OnOutPlay(PlayData.Data playData)
  203. {
  204. if (this.onOutPlay != null)
  205. {
  206. this.onOutPlay(playData);
  207. }
  208. }
  209. [SerializeField]
  210. private GameObject m_WindowRoomList;
  211. [SerializeField]
  212. private GameObject m_WindowManList;
  213. [SerializeField]
  214. private GameObject m_WindowPlayList;
  215. [SerializeField]
  216. private GameObject m_WindowDesciption;
  217. private ObjectCacheDic m_RoomListCache;
  218. private ObjectCacheDic m_ManListCache;
  219. private ObjectCacheDic m_PlayListCache;
  220. private ObjectCacheDic m_DescriptionCache;
  221. }
  222. }