CharacterSelectMain.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using com.workman.cm3d2.scene.dailyEtc;
  6. using I2.Loc;
  7. using MaidStatus;
  8. using PlayerStatus;
  9. using Schedule;
  10. using UnityEngine;
  11. using wf;
  12. public class CharacterSelectMain : WfScreenChildren
  13. {
  14. public static bool compatibilityMode
  15. {
  16. get
  17. {
  18. return DailyMgr.IsLegacy;
  19. }
  20. }
  21. public override void Awake()
  22. {
  23. base.Awake();
  24. this.explanatory_label_ = UTY.GetChildObject(base.root_obj, "ExplanatoryText/Value", false).GetComponent<UILabel>();
  25. GameObject childObject = UTY.GetChildObject(base.root_obj, "ButtonParent/Tower/Grid", false);
  26. this.button_dic_.Add("全選択", UTY.GetChildObject(childObject, "全選択", false).GetComponent<UIButton>());
  27. EventDelegate.Add(this.button_dic_["全選択"].onClick, new EventDelegate.Callback(this.OnSelectAllChara));
  28. this.button_dic_.Add("全解除", UTY.GetChildObject(childObject, "全解除", false).GetComponent<UIButton>());
  29. EventDelegate.Add(this.button_dic_["全解除"].onClick, new EventDelegate.Callback(this.OnSelectAllReleaseChara));
  30. this.button_dic_.Add("OK", UTY.GetChildObject(base.root_obj, "ButtonParent/OK", false).GetComponent<UIButton>());
  31. this.button_dic_.Add("Cancel", UTY.GetChildObject(base.root_obj, "ButtonParent/Cancel", false).GetComponent<UIButton>());
  32. this.button_dic_["Cancel"].gameObject.SetActive(false);
  33. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  34. {
  35. EventDelegate.Add(keyValuePair.Value.onClick, new EventDelegate.Callback(this.OnClickButton));
  36. }
  37. this.chara_select_mgr_ = UTY.GetChildObject(base.root_obj, "CharacterSelectPanel", false).GetComponent<CharacterSelectManager>();
  38. this.InitSelectedMaidPanelUI();
  39. }
  40. protected override void OnCall()
  41. {
  42. this.auto_select_ = false;
  43. this.wait_count_ = 0;
  44. this.loaded_check_maid_.Clear();
  45. this.select_maid_ = null;
  46. this.chara_mgr_ = GameMain.Instance.CharacterMgr;
  47. this.scene_chara_select_ = (base.parent_mgr as SceneCharacterSelect);
  48. NDebug.AssertNull(this.scene_chara_select_);
  49. this.button_dic_["全選択"].gameObject.SetActive(false);
  50. this.button_dic_["全解除"].gameObject.SetActive(false);
  51. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Additional)
  52. {
  53. this.OnCallAdditionalType();
  54. return;
  55. }
  56. bool flag = this.scene_chara_select_.select_type != SceneCharacterSelect.SelectType.NewYotogiAdditional;
  57. if (flag)
  58. {
  59. for (int i = 0; i < this.chara_mgr_.GetMaidCount(); i++)
  60. {
  61. if (this.chara_mgr_.GetMaid(i) != null)
  62. {
  63. this.chara_mgr_.Deactivate(i, false);
  64. }
  65. }
  66. }
  67. else
  68. {
  69. for (int j = 0; j < this.chara_mgr_.GetMaidCount(); j++)
  70. {
  71. if (this.chara_mgr_.GetMaid(j) != null)
  72. {
  73. this.chara_mgr_.GetMaid(j).Visible = false;
  74. }
  75. }
  76. }
  77. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Communication)
  78. {
  79. NDebug.Assert("コミュキャラ選択は廃止されました", false);
  80. GameMain.Instance.BgMgr.ChangeBg("Syosai");
  81. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(-2.526511f, 1.715126f, -2.023701f), 7.999995f, new Vector2(-128.2036f, -6.149067f));
  82. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  83. {
  84. List<Maid> list3 = ScheduleAPI.CanCommunicationMaids(true);
  85. for (int n = 0; n < list3.Count; n++)
  86. {
  87. draw_maid_list.Add(list3[n]);
  88. }
  89. });
  90. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  91. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  92. if (this.chara_select_mgr_.maid_list_count == 1)
  93. {
  94. this.auto_select_ = true;
  95. }
  96. if (!this.auto_select_)
  97. {
  98. GameMain.Instance.SoundMgr.PlayBGM("BGM015.ogg", 0.5f, true);
  99. }
  100. this.SetExplanatoryLabel("コミュニケーションを行うメイドを選択してください。");
  101. }
  102. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Yotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogiAdditional || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Vip || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Facility)
  103. {
  104. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Yotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Vip)
  105. {
  106. if (!CharacterSelectMain.compatibilityMode)
  107. {
  108. GameMain.Instance.BgMgr.ChangeBg("Theater");
  109. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(12.39468f, 5.495444f, 22.72065f), 0.1f, new Vector2(-6.047941f, 14.65832f));
  110. }
  111. else
  112. {
  113. GameMain.Instance.BgMgr.ChangeBg("Salon");
  114. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(1.485176f, 0.5354422f, 1.606312f), 13.60001f, new Vector2(-208.1436f, -0.869565f));
  115. }
  116. }
  117. else
  118. {
  119. GameMain.Instance.BgMgr.ChangeBg("EmpireClub_Rotary");
  120. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(6.673284f, 3.031431f, 20.00305f), 0.2f, new Vector2(562.5145f, -4.906824f));
  121. }
  122. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  123. {
  124. List<string> chara_guid_stock_list = SceneCharacterSelect.chara_guid_stock_list;
  125. for (int n = 0; n < chara_guid_stock_list.Count; n++)
  126. {
  127. Maid stockMaid2 = GameMain.Instance.CharacterMgr.GetStockMaid(chara_guid_stock_list[n]);
  128. if (stockMaid2 != null)
  129. {
  130. if (!CharacterSelectMain.compatibilityMode)
  131. {
  132. draw_maid_list.Add(stockMaid2);
  133. }
  134. else if (stockMaid2.status.isCompatiblePersonality)
  135. {
  136. draw_maid_list.Add(stockMaid2);
  137. }
  138. }
  139. }
  140. });
  141. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  142. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  143. if (this.chara_select_mgr_.maid_list_count == 1 && this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Vip)
  144. {
  145. this.auto_select_ = true;
  146. }
  147. string explanatoryLabel = string.Empty;
  148. SceneCharacterSelect.SelectType select_type = this.scene_chara_select_.select_type;
  149. if (select_type != SceneCharacterSelect.SelectType.Yotogi)
  150. {
  151. if (select_type != SceneCharacterSelect.SelectType.Vip)
  152. {
  153. if (select_type != SceneCharacterSelect.SelectType.NewYotogi)
  154. {
  155. if (select_type != SceneCharacterSelect.SelectType.NewYotogiAdditional)
  156. {
  157. explanatoryLabel = "施設強化を行うメイドを選択してください。";
  158. }
  159. else
  160. {
  161. explanatoryLabel = "ハーレムのペアとなるメイドを選択してください。";
  162. }
  163. }
  164. else
  165. {
  166. explanatoryLabel = "新夜伽を行うメイドを選択してください。";
  167. }
  168. }
  169. else
  170. {
  171. explanatoryLabel = "Hイベントを行うメイドを選択してください。";
  172. }
  173. }
  174. else
  175. {
  176. explanatoryLabel = "夜伽を行うメイドを選択してください。";
  177. }
  178. this.SetExplanatoryLabel(explanatoryLabel);
  179. if (!this.auto_select_)
  180. {
  181. if (!CharacterSelectMain.compatibilityMode)
  182. {
  183. GameMain.Instance.SoundMgr.PlayBGM("BGM015.ogg", 0.5f, true);
  184. }
  185. else
  186. {
  187. GameMain.Instance.SoundMgr.PlayBGMLegacy("BGM014.ogg", 0.5f, true);
  188. }
  189. }
  190. }
  191. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.CompetitiveShow)
  192. {
  193. if (!CharacterSelectMain.compatibilityMode)
  194. {
  195. GameMain.Instance.BgMgr.ChangeBg("Theater");
  196. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(6.502444f, 1.154878f, 27.09383f), 0.1f, new Vector2(200.2396f, -12.36027f));
  197. }
  198. else
  199. {
  200. GameMain.Instance.BgMgr.ChangeBg("Salon_Day");
  201. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(1.485176f, 0.5354422f, 1.606312f), 13.60001f, new Vector2(-208.1436f, -0.869565f));
  202. }
  203. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  204. {
  205. List<Maid> list3 = new List<Maid>();
  206. CharacterSelectManager.DefaultMaidList(list3);
  207. for (int n = 0; n < list3.Count; n++)
  208. {
  209. if (!CharacterSelectMain.compatibilityMode && (list3[n].status.heroineType == HeroineType.Original || list3[n].status.heroineType == HeroineType.Transfer))
  210. {
  211. draw_maid_list.Add(list3[n]);
  212. }
  213. else if (CharacterSelectMain.compatibilityMode && list3[n].status.isCompatiblePersonality)
  214. {
  215. draw_maid_list.Add(list3[n]);
  216. }
  217. }
  218. });
  219. this.chara_select_mgr_.SetCallBackOnMultiSelect(new CharacterSelectManager.CallBackOnMultiSelect(this.OnMultiSelectChara));
  220. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Multiple, this.chara_mgr_.GetStockMaidCount(), false);
  221. this.button_dic_["OK"].isEnabled = false;
  222. if (this.chara_select_mgr_.maid_list_count == 1)
  223. {
  224. Maid[] array = new Maid[1];
  225. List<Maid> list = new List<Maid>();
  226. List<Maid> list2 = new List<Maid>();
  227. CharacterSelectManager.DefaultMaidList(list2);
  228. for (int k = 0; k < list2.Count; k++)
  229. {
  230. if (!CharacterSelectMain.compatibilityMode && list2[k].status.heroineType == HeroineType.Original)
  231. {
  232. list.Add(list2[k]);
  233. }
  234. else if (CharacterSelectMain.compatibilityMode && list2[k].status.isCompatiblePersonality)
  235. {
  236. list.Add(list2[k]);
  237. }
  238. }
  239. if (0 < list.Count)
  240. {
  241. array[0] = list[0];
  242. }
  243. if (array[0] != null)
  244. {
  245. this.OnMultiSelectChara(array);
  246. this.auto_select_ = true;
  247. }
  248. }
  249. if (!this.auto_select_)
  250. {
  251. if (!CharacterSelectMain.compatibilityMode)
  252. {
  253. GameMain.Instance.SoundMgr.PlayBGM("BGM006.ogg", 0.5f, true);
  254. }
  255. else
  256. {
  257. GameMain.Instance.SoundMgr.PlayBGMLegacy("BGM021.ogg", 0.5f, true);
  258. }
  259. }
  260. this.button_dic_["全選択"].gameObject.SetActive(true);
  261. this.button_dic_["全解除"].gameObject.SetActive(true);
  262. this.button_dic_["全選択"].isEnabled = true;
  263. this.button_dic_["全解除"].isEnabled = false;
  264. this.SetExplanatoryLabel("品評会を行うメイドを選択してください。");
  265. }
  266. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Free)
  267. {
  268. if (!CharacterSelectMain.compatibilityMode)
  269. {
  270. GameMain.Instance.BgMgr.ChangeBg("Theater");
  271. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(12.39468f, 5.495444f, 22.72065f), 0.1f, new Vector2(-6.047941f, 14.65832f));
  272. }
  273. else
  274. {
  275. GameMain.Instance.BgMgr.ChangeBg("Syosai");
  276. }
  277. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  278. {
  279. List<Maid> list3 = new List<Maid>();
  280. CharacterSelectManager.DefaultMaidList(list3);
  281. for (int n = 0; n < list3.Count; n++)
  282. {
  283. if (!CharacterSelectMain.compatibilityMode)
  284. {
  285. draw_maid_list.Add(list3[n]);
  286. }
  287. else if (list3[n].status.isCompatiblePersonality)
  288. {
  289. draw_maid_list.Add(list3[n]);
  290. }
  291. }
  292. });
  293. this.SetExplanatoryLabel("メイドを選択してください。");
  294. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  295. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  296. if (this.chara_select_mgr_.maid_list_count == 1)
  297. {
  298. this.auto_select_ = true;
  299. }
  300. }
  301. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.TouchCharaSelect)
  302. {
  303. if (GameMain.Instance.CharacterMgr.status.isDaytime)
  304. {
  305. GameMain.Instance.BgMgr.ChangeBg(DailyAPI.dayBg);
  306. }
  307. else
  308. {
  309. GameMain.Instance.BgMgr.ChangeBg(DailyAPI.nightBg);
  310. }
  311. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(1.32781f, 1.400725f, -0.06648348f), 0.1f, new Vector2(214.6109f, 8.136656f));
  312. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  313. {
  314. List<Maid> list3 = new List<Maid>();
  315. CharacterSelectManager.DefaultMaidList(list3);
  316. for (int n = 0; n < list3.Count; n++)
  317. {
  318. if (!CharacterSelectMain.compatibilityMode)
  319. {
  320. draw_maid_list.Add(list3[n]);
  321. }
  322. else if (list3[n].status.isCompatiblePersonality)
  323. {
  324. draw_maid_list.Add(list3[n]);
  325. }
  326. }
  327. });
  328. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  329. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  330. if (this.chara_select_mgr_.maid_list_count == 1)
  331. {
  332. this.auto_select_ = true;
  333. }
  334. if (!this.auto_select_)
  335. {
  336. GameMain.Instance.SoundMgr.PlayBGM("BGM015.ogg", 0.5f, true);
  337. }
  338. this.SetExplanatoryLabel("おさわりを行うメイドを選択してください。");
  339. }
  340. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.VRComSelect)
  341. {
  342. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  343. {
  344. List<Maid> list3 = new List<Maid>();
  345. CharacterSelectManager.DefaultMaidList(list3);
  346. for (int n = 0; n < list3.Count; n++)
  347. {
  348. if (!CharacterSelectMain.compatibilityMode)
  349. {
  350. draw_maid_list.Add(list3[n]);
  351. }
  352. else if (list3[n].status.isCompatiblePersonality)
  353. {
  354. draw_maid_list.Add(list3[n]);
  355. }
  356. }
  357. });
  358. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  359. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  360. if (this.chara_select_mgr_.maid_list_count == 1)
  361. {
  362. this.auto_select_ = true;
  363. }
  364. this.SetExplanatoryLabel("バカンスに連れていくメイドを選択してください。");
  365. }
  366. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.VRKaraokeSelect)
  367. {
  368. CharacterSelectManager characterSelectManager = this.chara_select_mgr_;
  369. if (CharacterSelectMain.<>f__mg$cache0 == null)
  370. {
  371. CharacterSelectMain.<>f__mg$cache0 = new CharacterSelectManager.CallBackMaidList(KaraokeDataManager.GetMaidListKaraoke);
  372. }
  373. characterSelectManager.SetCallBackMaidList(CharacterSelectMain.<>f__mg$cache0);
  374. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  375. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  376. if (this.chara_select_mgr_.maid_list_count == 1)
  377. {
  378. this.auto_select_ = true;
  379. }
  380. this.SetExplanatoryLabel("カラオケに連れていくメイドを選択してください。");
  381. }
  382. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Recollection)
  383. {
  384. if (!CharacterSelectMain.compatibilityMode)
  385. {
  386. GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu_ChairRot");
  387. GameMain.Instance.MainCamera.SetFromScriptOnTarget(new Vector3(-0.4103856f, 1.075485f, 0.775088f), 1.6f, new Vector2(321.3178f, 3.478252f));
  388. }
  389. else
  390. {
  391. GameMain.Instance.BgMgr.ChangeBg("Syosai");
  392. }
  393. string text = "recollection_subheroine.nei";
  394. List<int> subMaidList = new List<int>();
  395. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  396. {
  397. using (CsvParser csvParser = new CsvParser())
  398. {
  399. bool condition = csvParser.Open(afileBase);
  400. NDebug.Assert(condition, text + "\nopen failed.");
  401. for (int l = 1; l < csvParser.max_cell_y; l++)
  402. {
  403. if (csvParser.IsCellToExistData(0, l))
  404. {
  405. int cellAsInteger = csvParser.GetCellAsInteger(0, l);
  406. int cellAsInteger2 = csvParser.GetCellAsInteger(2, l);
  407. subMaidList.Add(cellAsInteger2);
  408. }
  409. }
  410. }
  411. }
  412. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  413. {
  414. List<Maid> list3 = new List<Maid>();
  415. CharacterSelectManager.DefaultMaidList(list3);
  416. for (int n = 0; n < list3.Count; n++)
  417. {
  418. Maid maid2 = list3[n];
  419. if (maid2.status.subCharaData == null || subMaidList.Contains(maid2.status.subCharaData.id))
  420. {
  421. if (!CharacterSelectMain.compatibilityMode || maid2.status.isCompatiblePersonality)
  422. {
  423. draw_maid_list.Add(list3[n]);
  424. }
  425. }
  426. }
  427. });
  428. this.SetExplanatoryLabel("メイドを選択してください。");
  429. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  430. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  431. if (this.chara_select_mgr_.maid_list_count == 1)
  432. {
  433. this.auto_select_ = true;
  434. }
  435. }
  436. else if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.LifeMode)
  437. {
  438. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  439. {
  440. List<Maid> list3 = new List<Maid>();
  441. CharacterSelectManager.DefaultMaidList(list3);
  442. foreach (Maid item in EmpireLifeModeAPI.SelectionMaidList(list3))
  443. {
  444. draw_maid_list.Add(item);
  445. }
  446. });
  447. this.chara_select_mgr_.big_thumbnail.isEnabled = false;
  448. this.CreateSelectedMaidPanelOfLifeMode();
  449. this.chara_select_mgr_.SetCallBackOnMultiSelect(new CharacterSelectManager.CallBackOnMultiSelect(this.OnMultiSelectCharaLifeMode));
  450. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Multiple, EmpireLifeModeAPI.GetMaxMaidCount(), false);
  451. this.button_dic_["OK"].isEnabled = false;
  452. foreach (Maid maid in GameMain.Instance.LifeModeMgr.lifeModeAllMaidList)
  453. {
  454. this.chara_select_mgr_.SetSelectStateMaid(maid, true);
  455. }
  456. if (this.chara_select_mgr_.maid_list_count == 1)
  457. {
  458. this.chara_select_mgr_.SelectAllMaid();
  459. this.auto_select_ = true;
  460. }
  461. this.button_dic_["全選択"].gameObject.SetActive(false);
  462. this.button_dic_["全解除"].gameObject.SetActive(false);
  463. this.SetExplanatoryLabel("※まだ作っている途中です※");
  464. }
  465. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  466. for (int m = 0; m < characterMgr.GetStockMaidCount(); m++)
  467. {
  468. Maid stockMaid = characterMgr.GetStockMaid(m);
  469. if (stockMaid != null)
  470. {
  471. stockMaid.FaceAnime("通常", 0f, 0);
  472. stockMaid.FaceBlend("無し");
  473. }
  474. }
  475. if (flag)
  476. {
  477. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  478. }
  479. }
  480. private void OnCallAdditionalType()
  481. {
  482. Debug.Log("メイドをアクティブ化させるスロット : " + this.scene_chara_select_.select_maid_slot);
  483. CharacterSelectManager characterSelectManager = this.chara_select_mgr_;
  484. if (CharacterSelectMain.<>f__mg$cache1 == null)
  485. {
  486. CharacterSelectMain.<>f__mg$cache1 = new CharacterSelectManager.CallBackMaidList(KaraokeDataManager.GetMaidListAdditional);
  487. }
  488. characterSelectManager.SetCallBackMaidList(CharacterSelectMain.<>f__mg$cache1);
  489. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  490. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  491. if (this.chara_select_mgr_.maid_list_count == 1)
  492. {
  493. this.auto_select_ = true;
  494. }
  495. this.SetExplanatoryLabel("*メイドの追加呼び出し*");
  496. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  497. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  498. {
  499. Maid stockMaid = characterMgr.GetStockMaid(i);
  500. if (stockMaid != null)
  501. {
  502. stockMaid.FaceAnime("通常", 0f, 0);
  503. stockMaid.FaceBlend("無し");
  504. }
  505. }
  506. }
  507. protected override bool IsCallFadeIn()
  508. {
  509. if (this.auto_select_)
  510. {
  511. base.SetFadeStatus(WfScreenChildren.FadeStatus.Wait);
  512. float fade_time = base.fade_time;
  513. base.SetFadeTime(0f);
  514. this.Finish();
  515. base.SetFadeTime(fade_time);
  516. return false;
  517. }
  518. this.wait_count_++;
  519. return 2 < this.wait_count_;
  520. }
  521. public void SetExplanatoryLabel(string text)
  522. {
  523. this.explanatory_label_.text = text;
  524. Localize component = this.explanatory_label_.gameObject.GetComponent<Localize>();
  525. component.SetTerm("SceneCharaSelect/" + text);
  526. }
  527. public void SetCancelLabel(string cancel_call_label)
  528. {
  529. this.cancel_call_label_ = cancel_call_label;
  530. this.button_dic_["Cancel"].gameObject.SetActive(!string.IsNullOrEmpty(this.cancel_call_label_));
  531. }
  532. private void OnSelectAllChara()
  533. {
  534. this.chara_select_mgr_.SelectAllMaid();
  535. }
  536. private void OnSelectAllReleaseChara()
  537. {
  538. this.chara_select_mgr_.SelectAllReleaseMaid();
  539. }
  540. private void OnSelectChara(Maid select_maid)
  541. {
  542. this.select_maid_ = select_maid;
  543. }
  544. private void OnSingleDanceSelectChara(Maid select_maid)
  545. {
  546. this.loaded_check_maid_.Clear();
  547. this.loaded_check_maid_.Add(select_maid);
  548. }
  549. private void OnMultiDanceSelectChara(Maid[] maid_array)
  550. {
  551. this.loaded_check_maid_.Clear();
  552. for (int i = 0; i < maid_array.Length; i++)
  553. {
  554. this.loaded_check_maid_.Add(maid_array[i]);
  555. }
  556. }
  557. private void OnMultiSelectChara(Maid[] maid_array)
  558. {
  559. this.loaded_check_maid_.Clear();
  560. bool isEnabled = false;
  561. bool flag = true;
  562. bool flag2 = true;
  563. for (int i = 0; i < maid_array.Length; i++)
  564. {
  565. if (maid_array[i] == null)
  566. {
  567. flag = false;
  568. }
  569. else
  570. {
  571. flag2 = false;
  572. isEnabled = true;
  573. this.loaded_check_maid_.Add(maid_array[i]);
  574. }
  575. }
  576. this.button_dic_["OK"].isEnabled = isEnabled;
  577. this.button_dic_["全選択"].isEnabled = !flag;
  578. this.button_dic_["全解除"].isEnabled = !flag2;
  579. }
  580. private void OnMultiSelectCharaLifeMode(Maid[] maidArray)
  581. {
  582. this.UpdateSelectedMaidPanelOfLifeMode(maidArray);
  583. this.loaded_check_maid_.Clear();
  584. foreach (Maid maid in maidArray)
  585. {
  586. if (maid != null)
  587. {
  588. this.loaded_check_maid_.Add(maid);
  589. }
  590. }
  591. this.button_dic_["OK"].isEnabled = (this.loaded_check_maid_.Count > 0);
  592. }
  593. private void OnClickButton()
  594. {
  595. string text = string.Empty;
  596. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  597. {
  598. if (keyValuePair.Value == UIButton.current)
  599. {
  600. text = keyValuePair.Key;
  601. break;
  602. }
  603. }
  604. if (string.IsNullOrEmpty(text))
  605. {
  606. return;
  607. }
  608. if (text == "OK")
  609. {
  610. this.Finish();
  611. }
  612. else if (text == "Cancel")
  613. {
  614. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Yotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogi)
  615. {
  616. string f_strMsg = "まだ夜伽を実行していないメイドがいます。\n夜伽を終了しますか?";
  617. GameMain.Instance.SysDlg.Show(f_strMsg, SystemDialog.TYPE.OK_CANCEL, delegate
  618. {
  619. GameMain.Instance.SysDlg.Close();
  620. this.select_maid_ = null;
  621. this.scene_chara_select_.move_screen.SetNextLabel(this.cancel_call_label_);
  622. this.Finish();
  623. }, null);
  624. }
  625. else
  626. {
  627. this.select_maid_ = null;
  628. this.scene_chara_select_.move_screen.SetNextLabel(this.cancel_call_label_);
  629. this.Finish();
  630. }
  631. }
  632. }
  633. private void OnOvrCamFree()
  634. {
  635. GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 0);
  636. this.Finish();
  637. }
  638. private void OnOvrCamMove()
  639. {
  640. GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 1);
  641. this.Finish();
  642. }
  643. public override bool Finish()
  644. {
  645. bool flag = base.Finish();
  646. if (flag && 0 < this.loaded_check_maid_.Count)
  647. {
  648. GameMain.Instance.SoundMgr.StopBGM(1.5f);
  649. }
  650. return flag;
  651. }
  652. protected override void OnFinish()
  653. {
  654. this.button_dic_["Cancel"].gameObject.SetActive(false);
  655. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Communication && this.select_maid_ != null)
  656. {
  657. int noonWorkId = this.select_maid_.status.noonWorkId;
  658. this.loaded_check_maid_.Add(this.select_maid_);
  659. ScheduleData[] scheduleSlot = GameMain.Instance.CharacterMgr.status.scheduleSlot;
  660. for (int i = 0; i < scheduleSlot.Length; i++)
  661. {
  662. if (scheduleSlot[i].maid_guid == this.select_maid_.status.guid)
  663. {
  664. scheduleSlot[i].noon_communication = true;
  665. break;
  666. }
  667. }
  668. if (noonWorkId == ScheduleAPI.GetNoonTrainerWorkId())
  669. {
  670. Maid noonTraineeMaid = ScheduleAPI.GetNoonTraineeMaid();
  671. NDebug.Assert(noonTraineeMaid != null, "研修生を特定できませんでした");
  672. this.loaded_check_maid_.Add(noonTraineeMaid);
  673. }
  674. else if (noonWorkId == ScheduleAPI.GetTraineeWorkId())
  675. {
  676. Maid noonTrainerMaid = ScheduleAPI.GetNoonTrainerMaid();
  677. NDebug.Assert(noonTrainerMaid != null, "研修官を特定できませんでした");
  678. this.loaded_check_maid_.Add(noonTrainerMaid);
  679. }
  680. }
  681. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Yotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Vip || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Facility || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Free || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Recollection)
  682. {
  683. if (this.select_maid_ != null)
  684. {
  685. this.loaded_check_maid_.Add(this.select_maid_);
  686. SceneCharacterSelect.chara_guid_stock_list.Remove(this.select_maid_.status.guid);
  687. }
  688. else
  689. {
  690. SceneCharacterSelect.chara_guid_stock_list.Clear();
  691. }
  692. }
  693. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.CompetitiveShow)
  694. {
  695. CompetitiveShowMgr.check_maid_list.Clear();
  696. SceneCharacterSelect.select_maid_list.Clear();
  697. for (int j = 0; j < this.loaded_check_maid_.Count; j++)
  698. {
  699. SceneCharacterSelect.select_maid_list.Add(this.loaded_check_maid_[j]);
  700. }
  701. this.loaded_check_maid_.Clear();
  702. }
  703. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.TouchCharaSelect && this.select_maid_ != null)
  704. {
  705. this.loaded_check_maid_.Add(this.select_maid_);
  706. }
  707. if ((this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.VRComSelect || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.VRKaraokeSelect) && this.select_maid_ != null)
  708. {
  709. this.loaded_check_maid_.Add(this.select_maid_);
  710. }
  711. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Additional)
  712. {
  713. this.chara_mgr_.SetActiveMaid(this.select_maid_, this.scene_chara_select_.select_maid_slot);
  714. }
  715. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.LifeMode)
  716. {
  717. NDebug.Assert(this.loaded_check_maid_.Count > 0);
  718. GameMain.Instance.LifeModeMgr.SetAllMaidList(this.loaded_check_maid_);
  719. this.loaded_check_maid_.Clear();
  720. }
  721. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogiAdditional)
  722. {
  723. this.loaded_check_maid_.Clear();
  724. this.loaded_check_maid_.Add(this.select_maid_);
  725. this.chara_mgr_.SetActiveMaid(this.loaded_check_maid_[0], 1);
  726. this.loaded_check_maid_[0].Visible = true;
  727. this.loaded_check_maid_[0].AllProcPropSeqStart();
  728. }
  729. else
  730. {
  731. for (int k = 0; k < this.loaded_check_maid_.Count; k++)
  732. {
  733. this.chara_mgr_.SetActiveMaid(this.loaded_check_maid_[k], k);
  734. this.loaded_check_maid_[k].Visible = true;
  735. this.loaded_check_maid_[k].AllProcPropSeqStart();
  736. }
  737. }
  738. GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay();
  739. if (this.loaded_check_maid_.Count == 0)
  740. {
  741. base.parent_mgr.CallScreen("Move");
  742. }
  743. }
  744. protected override void OnFadeEnd()
  745. {
  746. if (this.loaded_check_maid_.Count == 0)
  747. {
  748. return;
  749. }
  750. bool flag = true;
  751. for (int i = 0; i < this.loaded_check_maid_.Count; i++)
  752. {
  753. if (this.loaded_check_maid_[i].IsBusy)
  754. {
  755. flag = false;
  756. break;
  757. }
  758. }
  759. if (flag)
  760. {
  761. base.parent_mgr.CallScreen("Move");
  762. this.loaded_check_maid_.Clear();
  763. }
  764. }
  765. private void InitSelectedMaidPanelUI()
  766. {
  767. this.m_SelectedMaidPanelParent = UTY.GetChildObject(base.root_obj, "SelectedMaidParent", false);
  768. this.m_SelectedMaidPanelGrid = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/Grid", false).GetComponent<UIGrid>();
  769. this.m_SelectedMaidPanelListViewer = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/Grid", false).GetComponent<uGUIListViewer>();
  770. this.m_SelectedMaidPanelButtonAutoSelect = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/parent buttons/auto select", false).GetComponent<UIButton>();
  771. this.m_SelectedMaidPanelButtonAllRelease = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/parent buttons/all release", false).GetComponent<UIButton>();
  772. NDebug.AssertNull(this.m_SelectedMaidPanelGrid);
  773. NDebug.AssertNull(this.m_SelectedMaidPanelListViewer);
  774. NDebug.AssertNull(this.m_SelectedMaidPanelButtonAutoSelect);
  775. NDebug.AssertNull(this.m_SelectedMaidPanelButtonAllRelease);
  776. this.m_SelectedMaidPanelParent.SetActive(false);
  777. }
  778. private void CreateSelectedMaidPanelOfLifeMode()
  779. {
  780. this.m_SelectedMaidPanelParent.SetActive(true);
  781. GameObject gameObject = Utility.CreatePrefab(this.m_SelectedMaidPanelGrid.gameObject, "CharacterSelect/Prefab/MaidPlateSimple", true);
  782. gameObject.SetActive(false);
  783. this.m_SelectedMaidPanelListViewer.tempItem = gameObject;
  784. this.m_SelectedMaidPanelListViewer.Show<MaidPlate>(20, delegate(int index, MaidPlate maidPlate)
  785. {
  786. maidPlate.gameObject.SetActive(false);
  787. UIButton uibutton = UTY.GetChildObject(maidPlate.gameObject, "Button", false).AddComponent<UIButton>();
  788. EventDelegate.Add(uibutton.onClick, delegate()
  789. {
  790. if (maidPlate.maid != null)
  791. {
  792. this.chara_select_mgr_.SetSelectStateMaid(maidPlate.maid, false);
  793. }
  794. });
  795. });
  796. EventDelegate.Add(this.m_SelectedMaidPanelButtonAutoSelect.onClick, new EventDelegate.Callback(this.OnClickButtonMaidAutoSelect));
  797. EventDelegate.Add(this.m_SelectedMaidPanelButtonAllRelease.onClick, new EventDelegate.Callback(this.chara_select_mgr_.SelectAllReleaseMaid));
  798. }
  799. private void UpdateSelectedMaidPanelOfLifeMode(Maid[] nowMaidSelectState)
  800. {
  801. bool flag = false;
  802. int num = 0;
  803. while (num < nowMaidSelectState.Length && num < this.m_SelectedMaidPanelListViewer.ItemArray.Length)
  804. {
  805. GameObject gameObject = this.m_SelectedMaidPanelListViewer.ItemArray[num];
  806. MaidPlate component = gameObject.GetComponent<MaidPlate>();
  807. Maid maid = nowMaidSelectState[num];
  808. if (maid == null)
  809. {
  810. if (gameObject.activeSelf)
  811. {
  812. gameObject.SetActive(false);
  813. }
  814. component.SetMaidData(null);
  815. flag = true;
  816. }
  817. else
  818. {
  819. if (!gameObject.activeSelf)
  820. {
  821. gameObject.SetActive(true);
  822. component.transform.SetAsLastSibling();
  823. flag = true;
  824. }
  825. if (maid != component.maid)
  826. {
  827. component.SetMaidData(maid);
  828. component.transform.SetAsLastSibling();
  829. flag = true;
  830. }
  831. }
  832. num++;
  833. }
  834. if (flag)
  835. {
  836. this.m_SelectedMaidPanelGrid.Reposition();
  837. }
  838. }
  839. private void OnClickButtonMaidAutoSelect()
  840. {
  841. int num = 0;
  842. List<Maid> list = new List<Maid>();
  843. List<MaidPlate> list2 = new List<MaidPlate>();
  844. int num2 = 0;
  845. while (num2 < this.m_SelectedMaidPanelListViewer.ItemArray.Length && num2 < this.chara_select_mgr_.select_max)
  846. {
  847. GameObject gameObject = this.m_SelectedMaidPanelListViewer.ItemArray[num2];
  848. MaidPlate component = gameObject.GetComponent<MaidPlate>();
  849. if (component.maid == null)
  850. {
  851. num++;
  852. }
  853. else
  854. {
  855. list.Add(component.maid);
  856. }
  857. num2++;
  858. }
  859. List<Transform> childList = this.chara_select_mgr_.MaidPlateParentGrid.GetChildList();
  860. for (int i = 0; i < childList.Count; i++)
  861. {
  862. MaidPlate component2 = childList[i].GetComponent<MaidPlate>();
  863. if (!list.Contains(component2.maid))
  864. {
  865. list2.Add(component2);
  866. }
  867. }
  868. foreach (MaidPlate maidPlate in from maid in list2
  869. orderby UnityEngine.Random.Range(0, 2)
  870. select maid)
  871. {
  872. if (num-- <= 0)
  873. {
  874. break;
  875. }
  876. this.chara_select_mgr_.SetSelectStateMaid(maidPlate.maid, true);
  877. }
  878. }
  879. private SceneCharacterSelect scene_chara_select_;
  880. private Maid select_maid_;
  881. private CharacterMgr chara_mgr_;
  882. private CharacterSelectManager chara_select_mgr_;
  883. private Dictionary<string, UIButton> button_dic_ = new Dictionary<string, UIButton>();
  884. private List<Maid> loaded_check_maid_ = new List<Maid>();
  885. private UILabel explanatory_label_;
  886. private string cancel_call_label_ = string.Empty;
  887. private int wait_count_;
  888. private bool auto_select_;
  889. private FFNameDialog ovr_dance_cam_dlg_;
  890. private GameObject m_SelectedMaidPanelParent;
  891. private UIGrid m_SelectedMaidPanelGrid;
  892. private uGUIListViewer m_SelectedMaidPanelListViewer;
  893. private UIButton m_SelectedMaidPanelButtonAutoSelect;
  894. private UIButton m_SelectedMaidPanelButtonAllRelease;
  895. [CompilerGenerated]
  896. private static CharacterSelectManager.CallBackMaidList <>f__mg$cache0;
  897. [CompilerGenerated]
  898. private static CharacterSelectManager.CallBackMaidList <>f__mg$cache1;
  899. }