CharacterSelectMain.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978
  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.NewYotogiAdditional || 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 = "GP01夜伽を行うメイドを選択してください。";
  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. if (!this.auto_select_)
  462. {
  463. GameMain.Instance.SoundMgr.PlayBGM("BGM015.ogg", 0.5f, true);
  464. }
  465. this.button_dic_["全選択"].gameObject.SetActive(false);
  466. this.button_dic_["全解除"].gameObject.SetActive(false);
  467. this.SetExplanatoryLabel("ライフモードに登場するメイドを選択してください");
  468. }
  469. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  470. for (int m = 0; m < characterMgr.GetStockMaidCount(); m++)
  471. {
  472. Maid stockMaid = characterMgr.GetStockMaid(m);
  473. if (stockMaid != null)
  474. {
  475. stockMaid.FaceAnime("通常", 0f, 0);
  476. stockMaid.FaceBlend("無し");
  477. }
  478. }
  479. if (flag)
  480. {
  481. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  482. }
  483. }
  484. private void OnCallAdditionalType()
  485. {
  486. Debug.Log("メイドをアクティブ化させるスロット : " + this.scene_chara_select_.select_maid_slot);
  487. CharacterSelectManager characterSelectManager = this.chara_select_mgr_;
  488. if (CharacterSelectMain.<>f__mg$cache1 == null)
  489. {
  490. CharacterSelectMain.<>f__mg$cache1 = new CharacterSelectManager.CallBackMaidList(KaraokeDataManager.GetMaidListAdditional);
  491. }
  492. characterSelectManager.SetCallBackMaidList(CharacterSelectMain.<>f__mg$cache1);
  493. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  494. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  495. if (this.chara_select_mgr_.maid_list_count == 1)
  496. {
  497. this.auto_select_ = true;
  498. }
  499. this.SetExplanatoryLabel("*メイドの追加呼び出し*");
  500. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  501. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  502. {
  503. Maid stockMaid = characterMgr.GetStockMaid(i);
  504. if (stockMaid != null)
  505. {
  506. stockMaid.FaceAnime("通常", 0f, 0);
  507. stockMaid.FaceBlend("無し");
  508. }
  509. }
  510. }
  511. protected override bool IsCallFadeIn()
  512. {
  513. if (this.auto_select_)
  514. {
  515. base.SetFadeStatus(WfScreenChildren.FadeStatus.Wait);
  516. float fade_time = base.fade_time;
  517. base.SetFadeTime(0f);
  518. this.Finish();
  519. base.SetFadeTime(fade_time);
  520. return false;
  521. }
  522. this.wait_count_++;
  523. return 2 < this.wait_count_;
  524. }
  525. public void SetExplanatoryLabel(string text)
  526. {
  527. this.explanatory_label_.text = text;
  528. Localize component = this.explanatory_label_.gameObject.GetComponent<Localize>();
  529. component.SetTerm("SceneCharaSelect/" + text);
  530. }
  531. public void SetCancelLabel(string cancel_call_label)
  532. {
  533. this.cancel_call_label_ = cancel_call_label;
  534. this.button_dic_["Cancel"].gameObject.SetActive(!string.IsNullOrEmpty(this.cancel_call_label_));
  535. }
  536. private void OnSelectAllChara()
  537. {
  538. this.chara_select_mgr_.SelectAllMaid();
  539. }
  540. private void OnSelectAllReleaseChara()
  541. {
  542. this.chara_select_mgr_.SelectAllReleaseMaid();
  543. }
  544. private void OnSelectChara(Maid select_maid)
  545. {
  546. this.select_maid_ = select_maid;
  547. }
  548. private void OnSingleDanceSelectChara(Maid select_maid)
  549. {
  550. this.loaded_check_maid_.Clear();
  551. this.loaded_check_maid_.Add(select_maid);
  552. }
  553. private void OnMultiDanceSelectChara(Maid[] maid_array)
  554. {
  555. this.loaded_check_maid_.Clear();
  556. for (int i = 0; i < maid_array.Length; i++)
  557. {
  558. this.loaded_check_maid_.Add(maid_array[i]);
  559. }
  560. }
  561. private void OnMultiSelectChara(Maid[] maid_array)
  562. {
  563. this.loaded_check_maid_.Clear();
  564. bool isEnabled = false;
  565. bool flag = true;
  566. bool flag2 = true;
  567. for (int i = 0; i < maid_array.Length; i++)
  568. {
  569. if (maid_array[i] == null)
  570. {
  571. flag = false;
  572. }
  573. else
  574. {
  575. flag2 = false;
  576. isEnabled = true;
  577. this.loaded_check_maid_.Add(maid_array[i]);
  578. }
  579. }
  580. this.button_dic_["OK"].isEnabled = isEnabled;
  581. this.button_dic_["全選択"].isEnabled = !flag;
  582. this.button_dic_["全解除"].isEnabled = !flag2;
  583. }
  584. private void OnMultiSelectCharaLifeMode(Maid[] maidArray)
  585. {
  586. this.loaded_check_maid_.Clear();
  587. foreach (Maid maid in maidArray)
  588. {
  589. if (maid != null)
  590. {
  591. this.loaded_check_maid_.Add(maid);
  592. }
  593. }
  594. this.UpdateSelectedMaidPanelOfLifeMode(maidArray);
  595. this.button_dic_["OK"].isEnabled = (this.loaded_check_maid_.Count > 0);
  596. }
  597. private void OnClickButton()
  598. {
  599. string text = string.Empty;
  600. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  601. {
  602. if (keyValuePair.Value == UIButton.current)
  603. {
  604. text = keyValuePair.Key;
  605. break;
  606. }
  607. }
  608. if (string.IsNullOrEmpty(text))
  609. {
  610. return;
  611. }
  612. if (text == "OK")
  613. {
  614. this.Finish();
  615. }
  616. else if (text == "Cancel")
  617. {
  618. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Yotogi || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogi)
  619. {
  620. string f_strMsg = "まだ夜伽を実行していないメイドがいます。\n夜伽を終了しますか?";
  621. GameMain.Instance.SysDlg.Show(f_strMsg, SystemDialog.TYPE.OK_CANCEL, delegate
  622. {
  623. GameMain.Instance.SysDlg.Close();
  624. this.select_maid_ = null;
  625. this.scene_chara_select_.move_screen.SetNextLabel(this.cancel_call_label_);
  626. this.Finish();
  627. }, null);
  628. }
  629. else
  630. {
  631. this.select_maid_ = null;
  632. this.scene_chara_select_.move_screen.SetNextLabel(this.cancel_call_label_);
  633. this.Finish();
  634. }
  635. }
  636. }
  637. private void OnOvrCamFree()
  638. {
  639. GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 0);
  640. this.Finish();
  641. }
  642. private void OnOvrCamMove()
  643. {
  644. GameMain.Instance.CMSystem.SetTmpGenericFlag("ダンスOVRカメラタイプ", 1);
  645. this.Finish();
  646. }
  647. public override bool Finish()
  648. {
  649. bool flag = base.Finish();
  650. if (flag && 0 < this.loaded_check_maid_.Count)
  651. {
  652. GameMain.Instance.SoundMgr.StopBGM(1.5f);
  653. }
  654. return flag;
  655. }
  656. protected override void OnFinish()
  657. {
  658. this.button_dic_["Cancel"].gameObject.SetActive(false);
  659. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Communication && this.select_maid_ != null)
  660. {
  661. int noonWorkId = this.select_maid_.status.noonWorkId;
  662. this.loaded_check_maid_.Add(this.select_maid_);
  663. ScheduleData[] scheduleSlot = GameMain.Instance.CharacterMgr.status.scheduleSlot;
  664. for (int i = 0; i < scheduleSlot.Length; i++)
  665. {
  666. if (scheduleSlot[i].maid_guid == this.select_maid_.status.guid)
  667. {
  668. scheduleSlot[i].noon_communication = true;
  669. break;
  670. }
  671. }
  672. if (noonWorkId == ScheduleAPI.GetNoonTrainerWorkId())
  673. {
  674. Maid noonTraineeMaid = ScheduleAPI.GetNoonTraineeMaid();
  675. NDebug.Assert(noonTraineeMaid != null, "研修生を特定できませんでした");
  676. this.loaded_check_maid_.Add(noonTraineeMaid);
  677. }
  678. else if (noonWorkId == ScheduleAPI.GetTraineeWorkId())
  679. {
  680. Maid noonTrainerMaid = ScheduleAPI.GetNoonTrainerMaid();
  681. NDebug.Assert(noonTrainerMaid != null, "研修官を特定できませんでした");
  682. this.loaded_check_maid_.Add(noonTrainerMaid);
  683. }
  684. }
  685. 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)
  686. {
  687. if (this.select_maid_ != null)
  688. {
  689. this.loaded_check_maid_.Add(this.select_maid_);
  690. SceneCharacterSelect.chara_guid_stock_list.Remove(this.select_maid_.status.guid);
  691. }
  692. else
  693. {
  694. SceneCharacterSelect.chara_guid_stock_list.Clear();
  695. }
  696. }
  697. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.CompetitiveShow)
  698. {
  699. CompetitiveShowMgr.check_maid_list.Clear();
  700. SceneCharacterSelect.select_maid_list.Clear();
  701. for (int j = 0; j < this.loaded_check_maid_.Count; j++)
  702. {
  703. SceneCharacterSelect.select_maid_list.Add(this.loaded_check_maid_[j]);
  704. }
  705. this.loaded_check_maid_.Clear();
  706. }
  707. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.TouchCharaSelect && 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.VRComSelect || this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.VRKaraokeSelect) && this.select_maid_ != null)
  712. {
  713. this.loaded_check_maid_.Add(this.select_maid_);
  714. }
  715. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.Additional)
  716. {
  717. this.chara_mgr_.SetActiveMaid(this.select_maid_, this.scene_chara_select_.select_maid_slot);
  718. }
  719. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.LifeMode)
  720. {
  721. NDebug.Assert(this.loaded_check_maid_.Count > 0);
  722. GameMain.Instance.LifeModeMgr.SetAllMaidList(this.loaded_check_maid_);
  723. this.loaded_check_maid_.Clear();
  724. }
  725. if (this.scene_chara_select_.select_type == SceneCharacterSelect.SelectType.NewYotogiAdditional)
  726. {
  727. this.loaded_check_maid_.Clear();
  728. this.loaded_check_maid_.Add(this.select_maid_);
  729. this.chara_mgr_.SetActiveMaid(this.loaded_check_maid_[0], 1);
  730. this.loaded_check_maid_[0].Visible = true;
  731. this.loaded_check_maid_[0].AllProcPropSeqStart();
  732. }
  733. else
  734. {
  735. for (int k = 0; k < this.loaded_check_maid_.Count; k++)
  736. {
  737. this.chara_mgr_.SetActiveMaid(this.loaded_check_maid_[k], k);
  738. this.loaded_check_maid_[k].Visible = true;
  739. this.loaded_check_maid_[k].AllProcPropSeqStart();
  740. }
  741. }
  742. GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay();
  743. if (this.loaded_check_maid_.Count == 0)
  744. {
  745. base.parent_mgr.CallScreen("Move");
  746. }
  747. }
  748. protected override void OnFadeEnd()
  749. {
  750. if (this.loaded_check_maid_.Count == 0)
  751. {
  752. return;
  753. }
  754. bool flag = true;
  755. for (int i = 0; i < this.loaded_check_maid_.Count; i++)
  756. {
  757. if (this.loaded_check_maid_[i].IsBusy)
  758. {
  759. flag = false;
  760. break;
  761. }
  762. }
  763. if (flag)
  764. {
  765. base.parent_mgr.CallScreen("Move");
  766. this.loaded_check_maid_.Clear();
  767. }
  768. }
  769. private void InitSelectedMaidPanelUI()
  770. {
  771. this.m_SelectedMaidPanelParent = UTY.GetChildObject(base.root_obj, "SelectedMaidParent", false);
  772. this.m_SelectedMaidPanelGrid = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/Grid", false).GetComponent<UIGrid>();
  773. this.m_SelectedMaidPanelListViewer = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/Grid", false).GetComponent<uGUIListViewer>();
  774. this.m_SelectedMaidPanelButtonAutoSelect = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/parent buttons/auto select", false).GetComponent<UIButton>();
  775. this.m_SelectedMaidPanelButtonAllRelease = UTY.GetChildObject(base.root_obj, "SelectedMaidParent/parent buttons/all release", false).GetComponent<UIButton>();
  776. NDebug.AssertNull(this.m_SelectedMaidPanelGrid);
  777. NDebug.AssertNull(this.m_SelectedMaidPanelListViewer);
  778. NDebug.AssertNull(this.m_SelectedMaidPanelButtonAutoSelect);
  779. NDebug.AssertNull(this.m_SelectedMaidPanelButtonAllRelease);
  780. this.m_SelectedMaidPanelParent.SetActive(false);
  781. }
  782. private void CreateSelectedMaidPanelOfLifeMode()
  783. {
  784. this.m_SelectedMaidPanelParent.SetActive(true);
  785. GameObject gameObject = Utility.CreatePrefab(this.m_SelectedMaidPanelGrid.gameObject, "CharacterSelect/Prefab/MaidPlateSimple", true);
  786. gameObject.SetActive(false);
  787. this.m_SelectedMaidPanelListViewer.tempItem = gameObject;
  788. this.m_SelectedMaidPanelListViewer.Show<MaidPlate>(21, delegate(int index, MaidPlate maidPlate)
  789. {
  790. if (EmpireLifeModeAPI.GetMaxMaidCount() <= index)
  791. {
  792. maidPlate.gameObject.SetActive(false);
  793. }
  794. else
  795. {
  796. maidPlate.gameObject.SetActive(true);
  797. }
  798. maidPlate.SetEmpty();
  799. UIButton uibutton = UTY.GetChildObject(maidPlate.gameObject, "Button", false).AddComponent<UIButton>();
  800. EventDelegate.Add(uibutton.onClick, delegate()
  801. {
  802. if (maidPlate.maid != null)
  803. {
  804. this.chara_select_mgr_.MoveGridArea(maidPlate.maid);
  805. this.chara_select_mgr_.SetSelectStateMaid(maidPlate.maid, false);
  806. }
  807. });
  808. maidPlate.GetComponentInChildren<Collider>().enabled = false;
  809. maidPlate.GetComponentInChildren<UIButton>().defaultColor = new Color(0f, 0f, 0f, 0.5f);
  810. maidPlate.GetComponentInChildren<UIPlayAnimation>().enabled = false;
  811. });
  812. EventDelegate.Add(this.m_SelectedMaidPanelButtonAutoSelect.onClick, new EventDelegate.Callback(this.OnClickButtonMaidAutoSelect));
  813. EventDelegate.Add(this.m_SelectedMaidPanelButtonAllRelease.onClick, new EventDelegate.Callback(this.OnClickButtonMaidAllRelease));
  814. }
  815. private void UpdateSelectedMaidPanelOfLifeMode(Maid[] nowMaidSelectState)
  816. {
  817. bool flag = false;
  818. int num = 0;
  819. while (num < nowMaidSelectState.Length && num < this.m_SelectedMaidPanelListViewer.ItemArray.Length)
  820. {
  821. GameObject gameObject = this.m_SelectedMaidPanelListViewer.ItemArray[num];
  822. MaidPlate component = gameObject.GetComponent<MaidPlate>();
  823. UIButton componentInChildren = gameObject.GetComponentInChildren<UIButton>();
  824. Maid maid = nowMaidSelectState[num];
  825. component.GetComponentInChildren<Collider>().enabled = (maid != null);
  826. componentInChildren.defaultColor = ((!(maid != null)) ? new Color(0f, 0f, 0f, 0.5f) : new Color(0f, 0f, 0f, 0f));
  827. if (maid == null)
  828. {
  829. component.SetEmpty();
  830. component.transform.SetAsLastSibling();
  831. flag = true;
  832. }
  833. if (!gameObject.activeSelf)
  834. {
  835. gameObject.SetActive(true);
  836. component.transform.SetAsLastSibling();
  837. flag = true;
  838. }
  839. if (maid != component.maid)
  840. {
  841. component.SetMaidData(maid);
  842. component.transform.SetAsLastSibling();
  843. flag = true;
  844. }
  845. num++;
  846. }
  847. if (flag)
  848. {
  849. this.m_SelectedMaidPanelGrid.Reposition();
  850. }
  851. foreach (Transform transform in this.chara_select_mgr_.MaidPlateParentGrid.GetChildList())
  852. {
  853. MaidPlate component2 = transform.GetComponent<MaidPlate>();
  854. if (component2.maid != null && this.loaded_check_maid_.Contains(component2.maid))
  855. {
  856. this.chara_select_mgr_.MoveNoDrawArea(component2.maid);
  857. }
  858. }
  859. foreach (MaidPlate maidPlate in this.chara_select_mgr_.NoDrawArea.GetComponentsInChildren<MaidPlate>())
  860. {
  861. if (maidPlate.maid != null && !this.loaded_check_maid_.Contains(maidPlate.maid))
  862. {
  863. this.chara_select_mgr_.MoveGridArea(maidPlate.maid);
  864. }
  865. }
  866. }
  867. private void OnClickButtonMaidAutoSelect()
  868. {
  869. int num = 0;
  870. List<Maid> list = new List<Maid>();
  871. List<MaidPlate> list2 = new List<MaidPlate>();
  872. int num2 = 0;
  873. while (num2 < this.m_SelectedMaidPanelListViewer.ItemArray.Length && num2 < this.chara_select_mgr_.select_max)
  874. {
  875. GameObject gameObject = this.m_SelectedMaidPanelListViewer.ItemArray[num2];
  876. MaidPlate component = gameObject.GetComponent<MaidPlate>();
  877. if (component.maid == null)
  878. {
  879. num++;
  880. }
  881. else
  882. {
  883. list.Add(component.maid);
  884. }
  885. num2++;
  886. }
  887. List<Transform> childList = this.chara_select_mgr_.MaidPlateParentGrid.GetChildList();
  888. for (int i = 0; i < childList.Count; i++)
  889. {
  890. MaidPlate component2 = childList[i].GetComponent<MaidPlate>();
  891. if (!list.Contains(component2.maid))
  892. {
  893. list2.Add(component2);
  894. }
  895. }
  896. foreach (MaidPlate maidPlate in from maid in list2
  897. orderby UnityEngine.Random.Range(0, 10)
  898. select maid)
  899. {
  900. if (num-- <= 0)
  901. {
  902. break;
  903. }
  904. this.chara_select_mgr_.SetSelectStateMaid(maidPlate.maid, true);
  905. }
  906. }
  907. private void OnClickButtonMaidAllRelease()
  908. {
  909. foreach (MaidPlate maidPlate in this.chara_select_mgr_.NoDrawArea.GetComponentsInChildren<MaidPlate>())
  910. {
  911. this.chara_select_mgr_.MoveGridArea(maidPlate.maid);
  912. }
  913. this.chara_select_mgr_.SelectAllReleaseMaid();
  914. }
  915. private SceneCharacterSelect scene_chara_select_;
  916. private Maid select_maid_;
  917. private CharacterMgr chara_mgr_;
  918. private CharacterSelectManager chara_select_mgr_;
  919. private Dictionary<string, UIButton> button_dic_ = new Dictionary<string, UIButton>();
  920. private List<Maid> loaded_check_maid_ = new List<Maid>();
  921. private UILabel explanatory_label_;
  922. private string cancel_call_label_ = string.Empty;
  923. private int wait_count_;
  924. private bool auto_select_;
  925. private FFNameDialog ovr_dance_cam_dlg_;
  926. private GameObject m_SelectedMaidPanelParent;
  927. private UIGrid m_SelectedMaidPanelGrid;
  928. private uGUIListViewer m_SelectedMaidPanelListViewer;
  929. private UIButton m_SelectedMaidPanelButtonAutoSelect;
  930. private UIButton m_SelectedMaidPanelButtonAllRelease;
  931. [CompilerGenerated]
  932. private static CharacterSelectManager.CallBackMaidList <>f__mg$cache0;
  933. [CompilerGenerated]
  934. private static CharacterSelectManager.CallBackMaidList <>f__mg$cache1;
  935. }