FreeSkillSelect.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using wf;
  6. using Yotogis;
  7. public class FreeSkillSelect : MonoBehaviour
  8. {
  9. public void Awake()
  10. {
  11. if (this.update_obj_dic_ != null)
  12. {
  13. return;
  14. }
  15. this.update_obj_dic_ = new Dictionary<string, FreeSkillSelect.UpdateObject>();
  16. Func<GameObject, FreeSkillSelect.UpdateObject> func = delegate(GameObject top_obj)
  17. {
  18. GameObject childObject = UTY.GetChildObject(top_obj, "Content", false);
  19. FreeSkillSelect.UpdateObject updateObject = new FreeSkillSelect.UpdateObject();
  20. updateObject.storage_obj = UTY.GetChildObject(childObject, "StorageRoom", true);
  21. updateObject.arrow_obj = UTY.GetChildObject(top_obj, "Arrow", false);
  22. updateObject.ui_panel = childObject.GetComponent<UIPanel>();
  23. updateObject.scroll_view = childObject.GetComponent<UIScrollView>();
  24. updateObject.button_parent = UTY.GetChildObject(childObject, "GridParent", false);
  25. updateObject.ui_grid = updateObject.button_parent.GetComponent<UIGrid>();
  26. updateObject.tab_panel = updateObject.button_parent.GetComponent<UIWFTabPanel>();
  27. return updateObject;
  28. };
  29. string[] array = new string[]
  30. {
  31. "TypeCategoryViewer",
  32. "CategoryViewer",
  33. "SkillSelectViewer",
  34. "LevelViewer",
  35. "StageSelectViewer"
  36. };
  37. string[] array2 = new string[]
  38. {
  39. "タイプ",
  40. "カテゴリー",
  41. "スキル",
  42. "レベル",
  43. "ステージ"
  44. };
  45. for (int i = 0; i < array.Length; i++)
  46. {
  47. this.update_obj_dic_.Add(array2[i], func(UTY.GetChildObject(base.gameObject, array[i], false)));
  48. }
  49. this.select_stage_ = (this.user_request_stage = YotogiStage.GetAllDatas(true)[0]);
  50. }
  51. public void Start()
  52. {
  53. }
  54. public void SetMaid(Maid maid)
  55. {
  56. this.maid_ = maid;
  57. }
  58. public void SetYotogiManager(YotogiManager yotogi_mgr)
  59. {
  60. this.yotogi_mgr_ = yotogi_mgr;
  61. }
  62. public void CreateInstanceButton()
  63. {
  64. if (this.button_data_list_ != null)
  65. {
  66. return;
  67. }
  68. FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
  69. FreeSkillSelect.UpdateObject updateObject2 = this.update_obj_dic_["タイプ"];
  70. FreeSkillSelect.UpdateObject updateObject3 = this.update_obj_dic_["レベル"];
  71. foreach (KeyValuePair<string, FreeSkillSelect.UpdateObject> keyValuePair in this.update_obj_dic_)
  72. {
  73. FreeSkillSelect.UpdateObject value = keyValuePair.Value;
  74. value.Clear();
  75. value.Update();
  76. }
  77. int clubGrade = GameMain.Instance.CharacterMgr.status.clubGrade;
  78. HashSet<int> hashSet = new HashSet<int>();
  79. List<YotogiStage.Data> allDatas = YotogiStage.GetAllDatas(true);
  80. allDatas.Sort();
  81. foreach (YotogiStage.Data data in allDatas)
  82. {
  83. if (data.isYotogiPlayable(clubGrade, false))
  84. {
  85. string a = string.Empty;
  86. for (int i = 0; i < 2; i++)
  87. {
  88. if (!string.IsNullOrEmpty(data.prefabName[i]) && !(a == data.prefabName[i]))
  89. {
  90. GameObject gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/StageSelect/Prefab/StageUnit", true);
  91. a = (gameObject.name = data.prefabName[0]);
  92. YotogiStageUnit component = gameObject.GetComponent<YotogiStageUnit>();
  93. component.SetStageData(data, true, i == 0);
  94. component.SetOnSelectEvent(new YotogiStageUnit.OnSelectEvent(this.OnClickStageEvent));
  95. component.is_change_bg = false;
  96. if (!hashSet.Contains(data.id))
  97. {
  98. hashSet.Add(data.id);
  99. }
  100. }
  101. }
  102. }
  103. }
  104. updateObject.Update();
  105. this.button_data_list_ = FreeSkillSelect.CreateButtonData(this.maid_, hashSet);
  106. GameObject button_parent = updateObject3.button_parent;
  107. for (int j = 0; j < 3; j++)
  108. {
  109. EventDelegate onclick_event = new EventDelegate(this, "OnClickLevelBtnEvent");
  110. UIWFTabButton uiwftabButton = this.CreateTypeAndCategoryButton(updateObject3, "Lv." + (j + 1).ToString(), true, onclick_event);
  111. uiwftabButton.name = (j + 1).ToString();
  112. }
  113. updateObject3.Update();
  114. List<Transform> childList = updateObject3.ui_grid.GetChildList();
  115. for (int k = 0; k < childList.Count; k++)
  116. {
  117. UIWFTabButton componentInChildren = childList[k].gameObject.GetComponentInChildren<UIWFTabButton>();
  118. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  119. {
  120. updateObject3.tab_panel.Select(componentInChildren);
  121. break;
  122. }
  123. }
  124. GameObject button_parent2 = updateObject2.button_parent;
  125. for (int l = 0; l < this.button_data_list_.Count; l++)
  126. {
  127. FreeSkillSelect.ButtonData buttonData = this.button_data_list_[l];
  128. EventDelegate eventDelegate = new EventDelegate(this, "OnClickTypeBtnEvent");
  129. eventDelegate.parameters[0].value = buttonData;
  130. if (buttonData.children_list.Count != 0)
  131. {
  132. buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject2, buttonData.name, 0 < this.button_data_list_[l].children_list.Count, eventDelegate);
  133. }
  134. }
  135. updateObject2.Update();
  136. childList = updateObject2.ui_grid.GetChildList();
  137. for (int m = 0; m < childList.Count; m++)
  138. {
  139. UIWFTabButton componentInChildren2 = childList[m].gameObject.GetComponentInChildren<UIWFTabButton>();
  140. if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
  141. {
  142. updateObject2.tab_panel.Select(componentInChildren2);
  143. break;
  144. }
  145. }
  146. }
  147. public void SelectSkill(Skill.Data skill, YotogiStage.Data stage_data)
  148. {
  149. if (skill == null)
  150. {
  151. return;
  152. }
  153. FreeSkillSelect.ButtonData buttonData = null;
  154. FreeSkillSelect.ButtonData buttonData2 = null;
  155. FreeSkillSelect.ButtonData buttonData3 = null;
  156. bool flag = true;
  157. int num = 0;
  158. while (num < this.button_data_list_.Count && flag)
  159. {
  160. buttonData = this.button_data_list_[num];
  161. int num2 = 0;
  162. while (num2 < buttonData.children_list.Count && flag)
  163. {
  164. buttonData2 = buttonData.children_list[num2];
  165. int num3 = 0;
  166. while (num3 < buttonData2.children_list.Count && flag)
  167. {
  168. buttonData3 = buttonData2.children_list[num3];
  169. if (buttonData3.skill_data == skill)
  170. {
  171. flag = false;
  172. }
  173. num3++;
  174. }
  175. num2++;
  176. }
  177. num++;
  178. }
  179. if (flag)
  180. {
  181. return;
  182. }
  183. if (!buttonData.tab_button_obj.isSelected)
  184. {
  185. this.update_obj_dic_["タイプ"].tab_panel.Select(buttonData.tab_button_obj);
  186. }
  187. if (!buttonData2.tab_button_obj.isSelected)
  188. {
  189. this.update_obj_dic_["カテゴリー"].tab_panel.Select(buttonData2.tab_button_obj);
  190. }
  191. this.user_request_stage = stage_data;
  192. if (!buttonData3.tab_button_obj.isSelected)
  193. {
  194. this.update_obj_dic_["スキル"].tab_panel.Select(buttonData3.tab_button_obj);
  195. }
  196. }
  197. public void FixSkill()
  198. {
  199. if (this.yotogi_mgr_ == null || this.yotogi_mgr_.maid == null)
  200. {
  201. return;
  202. }
  203. YotogiStageSelectManager.SelectStage(this.select_stage, this.is_day_time_);
  204. KeyValuePair<Skill.Data, bool>[] playSkillArray = new KeyValuePair<Skill.Data, bool>[]
  205. {
  206. new KeyValuePair<Skill.Data, bool>(this.select_skill, false)
  207. };
  208. this.yotogi_mgr_.SetPlaySkillArray(playSkillArray);
  209. }
  210. private void CreateCategory(FreeSkillSelect.ButtonData type_button_data)
  211. {
  212. FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["カテゴリー"];
  213. updateObject.MoveStorageRoom(true);
  214. updateObject.Clear();
  215. GameObject button_parent = updateObject.button_parent;
  216. bool lockNTRPlay = GameMain.Instance.CharacterMgr.status.lockNTRPlay;
  217. int i = 0;
  218. while (i < type_button_data.children_list.Count)
  219. {
  220. FreeSkillSelect.ButtonData buttonData = type_button_data.children_list[i];
  221. if (!lockNTRPlay)
  222. {
  223. goto IL_87;
  224. }
  225. Yotogi.Category category = (Yotogi.Category)Enum.Parse(typeof(Yotogi.Category), buttonData.name);
  226. if (category != Yotogi.Category.交換 && category != Yotogi.Category.乱交)
  227. {
  228. goto IL_87;
  229. }
  230. IL_E7:
  231. i++;
  232. continue;
  233. IL_87:
  234. bool flag = buttonData.children_list != null && 0 < buttonData.children_list.Count;
  235. EventDelegate eventDelegate = null;
  236. if (flag)
  237. {
  238. eventDelegate = new EventDelegate(this, "OnClickCategoryBtnEvent");
  239. eventDelegate.parameters[0].value = buttonData;
  240. }
  241. buttonData.tab_button_obj = this.CreateTypeAndCategoryButton(updateObject, buttonData.name, flag, eventDelegate);
  242. goto IL_E7;
  243. }
  244. updateObject.Update();
  245. List<Transform> childList = updateObject.ui_grid.GetChildList();
  246. for (int j = 0; j < childList.Count; j++)
  247. {
  248. UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  249. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  250. {
  251. updateObject.tab_panel.Select(componentInChildren);
  252. break;
  253. }
  254. }
  255. }
  256. private void CreateSkill(FreeSkillSelect.ButtonData skill_button_data)
  257. {
  258. FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["スキル"];
  259. updateObject.MoveStorageRoom(true);
  260. updateObject.Clear();
  261. GameObject button_parent = updateObject.button_parent;
  262. for (int i = 0; i < skill_button_data.children_list.Count; i++)
  263. {
  264. FreeSkillSelect.ButtonData buttonData = skill_button_data.children_list[i];
  265. if (buttonData.skill_data != null)
  266. {
  267. EventDelegate eventDelegate = new EventDelegate(this, "OnClickSkillBtnEvent");
  268. eventDelegate.parameters[0].value = buttonData;
  269. buttonData.tab_button_obj = this.CreateSkillButton(buttonData.skill_data, eventDelegate);
  270. }
  271. }
  272. updateObject.Update();
  273. List<Transform> childList = updateObject.ui_grid.GetChildList();
  274. for (int j = 0; j < childList.Count; j++)
  275. {
  276. UIWFTabButton componentInChildren = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  277. if (!(componentInChildren == null) && componentInChildren.isEnabled)
  278. {
  279. updateObject.tab_panel.Select(componentInChildren);
  280. break;
  281. }
  282. }
  283. }
  284. private void CreateStage(Skill.Data skill_data)
  285. {
  286. FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["ステージ"];
  287. YotogiStage.Data data = this.user_request_stage;
  288. UIWFTabButton uiwftabButton = null;
  289. updateObject.tab_panel.ResetSelect();
  290. List<Transform> childList = updateObject.ui_grid.GetChildList();
  291. for (int i = 0; i < childList.Count; i++)
  292. {
  293. YotogiStageUnit component = childList[i].gameObject.GetComponent<YotogiStageUnit>();
  294. UIWFTabButton componentInChildren = childList[i].gameObject.GetComponentInChildren<UIWFTabButton>();
  295. if (componentInChildren.isSelected)
  296. {
  297. componentInChildren.SetSelect(false);
  298. }
  299. if (componentInChildren.isEnabled != skill_data.IsExecStage(component.stage_data))
  300. {
  301. componentInChildren.isEnabled = skill_data.IsExecStage(component.stage_data);
  302. if (componentInChildren.isEnabled)
  303. {
  304. component.thumbnail_sprite.color = new Color(1f, 1f, 1f, 1f);
  305. }
  306. else
  307. {
  308. component.thumbnail_sprite.color = new Color(0.6f, 0.6f, 0.6f, 1f);
  309. }
  310. }
  311. if (data == component.stage_data && componentInChildren.isEnabled)
  312. {
  313. uiwftabButton = componentInChildren;
  314. }
  315. }
  316. if (uiwftabButton != null)
  317. {
  318. updateObject.tab_panel.Select(uiwftabButton);
  319. }
  320. else
  321. {
  322. for (int j = 0; j < childList.Count; j++)
  323. {
  324. UIWFTabButton componentInChildren2 = childList[j].gameObject.GetComponentInChildren<UIWFTabButton>();
  325. if (!(componentInChildren2 == null) && componentInChildren2.isEnabled)
  326. {
  327. updateObject.tab_panel.Select(componentInChildren2);
  328. break;
  329. }
  330. }
  331. this.user_request_stage = data;
  332. }
  333. }
  334. private UIWFTabButton CreateSkillButton(Skill.Data skill_data, EventDelegate onclick_event)
  335. {
  336. if (skill_data == null)
  337. {
  338. return null;
  339. }
  340. FreeSkillSelect.UpdateObject updateObject = this.update_obj_dic_["スキル"];
  341. GameObject gameObject = updateObject.MoveButtonParent();
  342. if (gameObject == null)
  343. {
  344. gameObject = Utility.CreatePrefab(updateObject.button_parent, "SceneYotogi/FreeMode/FreeSkillButton", true);
  345. }
  346. UTY.GetChildObject(gameObject, "title", false).GetComponent<UILabel>().text = skill_data.name;
  347. gameObject.name = skill_data.name;
  348. UIWFTabButton component = UTY.GetChildObject(gameObject, "BG", false).GetComponent<UIWFTabButton>();
  349. if (onclick_event != null)
  350. {
  351. component.onClick.Add(onclick_event);
  352. }
  353. return component;
  354. }
  355. private UIWFTabButton CreateTypeAndCategoryButton(FreeSkillSelect.UpdateObject update_obj, string name, bool enabled, EventDelegate onclick_event)
  356. {
  357. GameObject gameObject = update_obj.MoveButtonParent();
  358. if (gameObject == null)
  359. {
  360. gameObject = Utility.CreatePrefab(update_obj.button_parent, "SceneYotogi/SkillSelect/Prefab/CategoryBtn", true);
  361. }
  362. UTY.GetChildObject(gameObject, "Label", false).GetComponent<UILabel>().text = name;
  363. UIWFTabButton component = UTY.GetChildObject(gameObject, "Button", false).GetComponent<UIWFTabButton>();
  364. gameObject.name = name;
  365. component.isEnabled = enabled;
  366. if (enabled && onclick_event != null)
  367. {
  368. component.onClick.Add(onclick_event);
  369. }
  370. return component;
  371. }
  372. private void OnClickTypeBtnEvent(FreeSkillSelect.ButtonData type_btn_data)
  373. {
  374. this.update_obj_dic_["タイプ"].UpdateArrow(type_btn_data.tab_button_obj.gameObject);
  375. this.CreateCategory(type_btn_data);
  376. }
  377. private void OnClickCategoryBtnEvent(FreeSkillSelect.ButtonData categorybtn_data)
  378. {
  379. this.update_obj_dic_["カテゴリー"].UpdateArrow(categorybtn_data.tab_button_obj.gameObject);
  380. this.CreateSkill(categorybtn_data);
  381. }
  382. private void OnClickSkillBtnEvent(FreeSkillSelect.ButtonData skill_data)
  383. {
  384. this.update_obj_dic_["スキル"].UpdateArrow(skill_data.tab_button_obj.gameObject);
  385. this.select_skill_ = skill_data.skill_data;
  386. this.CreateStage(skill_data.skill_data);
  387. }
  388. private void OnClickLevelBtnEvent()
  389. {
  390. this.update_obj_dic_["レベル"].UpdateArrow(UIButton.current.gameObject);
  391. this.yotogi_mgr_.fix_skill_level = int.Parse(UIButton.current.gameObject.name);
  392. }
  393. private void OnClickStageEvent(YotogiStageUnit stage_unit)
  394. {
  395. this.select_stage_ = (this.user_request_stage = stage_unit.stage_data);
  396. this.is_day_time_ = stage_unit.is_daytime;
  397. this.FixSkill();
  398. }
  399. private static List<FreeSkillSelect.ButtonData> CreateButtonData(Maid maid, HashSet<int> selectableStageIds)
  400. {
  401. List<FreeSkillSelect.ButtonData> list = new List<FreeSkillSelect.ButtonData>();
  402. Dictionary<Skill.Data.SpecialConditionType, KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>> type_data_dic = new Dictionary<Skill.Data.SpecialConditionType, KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>>();
  403. List<KeyValuePair<Skill.Data.SpecialConditionType, string>> list2 = new List<KeyValuePair<Skill.Data.SpecialConditionType, string>>();
  404. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Null, "通常"));
  405. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Drunk, "酔い"));
  406. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Mask, "目隠し"));
  407. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Drug, "媚薬"));
  408. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Confess, "告白"));
  409. list2.Add(new KeyValuePair<Skill.Data.SpecialConditionType, string>(Skill.Data.SpecialConditionType.Faint, "気絶"));
  410. for (int i = 0; i < list2.Count; i++)
  411. {
  412. FreeSkillSelect.ButtonData buttonData = new FreeSkillSelect.ButtonData();
  413. buttonData.children_list = new List<FreeSkillSelect.ButtonData>();
  414. buttonData.name = list2[i].Value;
  415. buttonData.condition_type = list2[i].Key;
  416. list.Add(buttonData);
  417. type_data_dic.Add(buttonData.condition_type, new KeyValuePair<FreeSkillSelect.ButtonData, Dictionary<string, FreeSkillSelect.ButtonData>>(buttonData, new Dictionary<string, FreeSkillSelect.ButtonData>()));
  418. }
  419. for (int j = 0; j < list.Count; j++)
  420. {
  421. for (int k = 0; k < 8; k++)
  422. {
  423. FreeSkillSelect.ButtonData buttonData2 = list[j];
  424. FreeSkillSelect.ButtonData buttonData3 = new FreeSkillSelect.ButtonData();
  425. buttonData3.children_list = new List<FreeSkillSelect.ButtonData>();
  426. FreeSkillSelect.ButtonData buttonData4 = buttonData3;
  427. Yotogi.Category category = (Yotogi.Category)k;
  428. buttonData4.name = category.ToString();
  429. buttonData3.parent = buttonData2;
  430. buttonData2.children_list.Add(buttonData3);
  431. type_data_dic[list[j].condition_type].Value.Add(buttonData3.name, buttonData3);
  432. }
  433. }
  434. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  435. int[] keyArray = maid.status.yotogiSkill.datas.GetKeyArray();
  436. Dictionary<int, List<Skill.Data>> dictionary = new Dictionary<int, List<Skill.Data>>();
  437. for (int l = 0; l < keyArray.Length; l++)
  438. {
  439. Skill.Data data = Skill.Get(keyArray[l]);
  440. bool flag = false;
  441. foreach (int item in data.playable_stageid_list)
  442. {
  443. flag = selectableStageIds.Contains(item);
  444. if (flag)
  445. {
  446. break;
  447. }
  448. }
  449. if (flag)
  450. {
  451. int category2 = (int)data.category;
  452. if (!dictionary.ContainsKey(category2))
  453. {
  454. dictionary.Add(category2, new List<Skill.Data>());
  455. }
  456. dictionary[category2].Add(data);
  457. }
  458. }
  459. foreach (KeyValuePair<int, List<Skill.Data>> keyValuePair in dictionary)
  460. {
  461. List<Skill.Data> value = keyValuePair.Value;
  462. value.Sort((Skill.Data a, Skill.Data b) => a.sortId - b.sortId);
  463. }
  464. List<Skill.Data> list3 = new List<Skill.Data>();
  465. foreach (KeyValuePair<int, List<Skill.Data>> keyValuePair2 in dictionary)
  466. {
  467. List<Skill.Data> value2 = keyValuePair2.Value;
  468. foreach (Skill.Data item2 in value2)
  469. {
  470. list3.Add(item2);
  471. }
  472. }
  473. foreach (Skill.Data data2 in list3)
  474. {
  475. if (1 < data2.player_num)
  476. {
  477. int num = 0;
  478. for (int m = 0; m < characterMgr.GetMaidCount(); m++)
  479. {
  480. if (!(characterMgr.GetMaid(m) != null))
  481. {
  482. break;
  483. }
  484. num++;
  485. }
  486. if (num < data2.player_num)
  487. {
  488. continue;
  489. }
  490. }
  491. if (data2.IsExecMaid(maid.status))
  492. {
  493. FreeSkillSelect.ButtonData buttonData5 = type_data_dic[data2.specialConditionType].Value[data2.category.ToString()];
  494. if (buttonData5 != null)
  495. {
  496. FreeSkillSelect.ButtonData buttonData6 = new FreeSkillSelect.ButtonData();
  497. buttonData6.parent = buttonData5;
  498. buttonData6.name = data2.name;
  499. buttonData6.skill_data = data2;
  500. buttonData5.children_list.Add(buttonData6);
  501. }
  502. }
  503. }
  504. Action<Skill.Data.SpecialConditionType> action = delegate(Skill.Data.SpecialConditionType type)
  505. {
  506. Dictionary<string, FreeSkillSelect.ButtonData> value3 = type_data_dic[type].Value;
  507. HashSet<string> hashSet = new HashSet<string>();
  508. List<FreeSkillSelect.ButtonData> list4 = new List<FreeSkillSelect.ButtonData>();
  509. foreach (KeyValuePair<string, FreeSkillSelect.ButtonData> keyValuePair3 in value3)
  510. {
  511. if (keyValuePair3.Value.children_list != null && 1 <= keyValuePair3.Value.children_list.Count && !hashSet.Contains(keyValuePair3.Key))
  512. {
  513. hashSet.Add(keyValuePair3.Key);
  514. list4.Add(keyValuePair3.Value);
  515. }
  516. }
  517. type_data_dic[type].Key.children_list = list4;
  518. };
  519. foreach (FreeSkillSelect.ButtonData buttonData7 in list)
  520. {
  521. if (buttonData7.condition_type != Skill.Data.SpecialConditionType.Null)
  522. {
  523. action(buttonData7.condition_type);
  524. }
  525. }
  526. return list;
  527. }
  528. private static FreeSkillSelect.ButtonData GetButtonData(List<FreeSkillSelect.ButtonData> check_list, string name)
  529. {
  530. FreeSkillSelect.ButtonData result = null;
  531. if (check_list == null || string.IsNullOrEmpty(name))
  532. {
  533. return result;
  534. }
  535. for (int i = 0; i < check_list.Count; i++)
  536. {
  537. if (check_list[i] != null)
  538. {
  539. if (!string.IsNullOrEmpty(check_list[i].name) && check_list[i].name == name)
  540. {
  541. result = check_list[i];
  542. break;
  543. }
  544. }
  545. }
  546. return result;
  547. }
  548. public YotogiStage.Data select_stage
  549. {
  550. get
  551. {
  552. return this.select_stage_;
  553. }
  554. }
  555. public Skill.Data select_skill
  556. {
  557. get
  558. {
  559. return this.select_skill_;
  560. }
  561. }
  562. private Maid maid_;
  563. private List<FreeSkillSelect.ButtonData> button_data_list_;
  564. private Dictionary<string, FreeSkillSelect.UpdateObject> update_obj_dic_;
  565. private YotogiManager yotogi_mgr_;
  566. private Skill.Data select_skill_;
  567. private YotogiStage.Data select_stage_;
  568. private bool is_day_time_ = true;
  569. private YotogiStage.Data user_request_stage;
  570. private class ButtonData
  571. {
  572. public UIWFTabButton tab_button_obj;
  573. public FreeSkillSelect.ButtonData parent;
  574. public List<FreeSkillSelect.ButtonData> children_list;
  575. public string name;
  576. public Skill.Data skill_data;
  577. public Skill.Data.SpecialConditionType condition_type;
  578. }
  579. private class UpdateObject
  580. {
  581. public void Update()
  582. {
  583. this.ui_grid.Reposition();
  584. this.tab_panel.UpdateChildren();
  585. this.scroll_view.ResetPosition();
  586. this.ui_panel.UpdateAnchors();
  587. }
  588. public void MoveStorageRoom(bool click_event_clear)
  589. {
  590. if (this.storage_obj == null)
  591. {
  592. return;
  593. }
  594. Transform transform = this.button_parent.transform;
  595. Transform transform2 = this.storage_obj.transform;
  596. while (0 < transform.childCount)
  597. {
  598. GameObject gameObject = transform.GetChild(0).gameObject;
  599. UIWFTabButton componentInChildren = gameObject.GetComponentInChildren<UIWFTabButton>();
  600. if (componentInChildren != null)
  601. {
  602. componentInChildren.SetSelect(false);
  603. if (click_event_clear)
  604. {
  605. componentInChildren.onClick.Clear();
  606. }
  607. }
  608. gameObject.transform.SetParent(transform2, false);
  609. gameObject.transform.localPosition = Vector3.zero;
  610. }
  611. transform.DetachChildren();
  612. }
  613. public GameObject MoveButtonParent()
  614. {
  615. if (this.storage_obj == null)
  616. {
  617. return null;
  618. }
  619. GameObject gameObject = null;
  620. Transform transform = this.button_parent.transform;
  621. Transform transform2 = this.storage_obj.transform;
  622. if (0 < transform2.childCount)
  623. {
  624. gameObject = transform2.GetChild(0).gameObject;
  625. gameObject.transform.SetParent(transform, false);
  626. }
  627. return gameObject;
  628. }
  629. public GameObject MoveButtonParent(string object_name)
  630. {
  631. if (this.storage_obj == null || string.IsNullOrEmpty(object_name))
  632. {
  633. return null;
  634. }
  635. GameObject gameObject = null;
  636. Transform transform = this.button_parent.transform;
  637. Transform transform2 = this.storage_obj.transform;
  638. for (int i = 0; i < transform2.childCount; i++)
  639. {
  640. if (transform2.GetChild(i).name == object_name)
  641. {
  642. gameObject = transform2.GetChild(i).gameObject;
  643. gameObject.transform.SetParent(transform, false);
  644. break;
  645. }
  646. }
  647. return gameObject;
  648. }
  649. public void UpdateArrow(GameObject target_obj)
  650. {
  651. if (this.arrow_obj == null || target_obj == null)
  652. {
  653. return;
  654. }
  655. Vector3 position = target_obj.transform.TransformPoint(new Vector3(0f, 0f, 0f));
  656. Vector3 local_pos = this.arrow_obj.transform.parent.InverseTransformPoint(position);
  657. local_pos.x = this.arrow_obj.transform.localPosition.x;
  658. local_pos.y += 18f;
  659. Hashtable args = TweenHash.EaseOutQuint(TweenHash.Type.Position, local_pos, 0.3f);
  660. iTween.MoveTo(this.arrow_obj, args);
  661. }
  662. public void Clear()
  663. {
  664. Transform transform = this.button_parent.transform;
  665. for (int i = 0; i < transform.childCount; i++)
  666. {
  667. UnityEngine.Object.Destroy(transform.GetChild(i).gameObject);
  668. }
  669. transform.DetachChildren();
  670. }
  671. public GameObject button_parent;
  672. public UIGrid ui_grid;
  673. public UIWFTabPanel tab_panel;
  674. public UIScrollView scroll_view;
  675. public UIPanel ui_panel;
  676. public GameObject arrow_obj;
  677. public GameObject storage_obj;
  678. }
  679. }