MaidManagementMain.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. using System;
  2. using System.Collections.Generic;
  3. using com.workman.cm3d2.scene.dailyEtc;
  4. using I2.Loc;
  5. using MaidStatus;
  6. using PlayerStatus;
  7. using UnityEngine;
  8. using wf;
  9. public class MaidManagementMain : WfScreenChildren
  10. {
  11. public override void Awake()
  12. {
  13. base.Awake();
  14. this.mainUIFade = base.root_obj.GetComponent<WfFadeBehaviour>();
  15. NDebug.AssertNull(this.mainUIFade);
  16. this.status_mgr_ = base.root_obj.GetComponent<CharaSelectStatusMgr>();
  17. this.status_mgr_.Init();
  18. this.status_mgr_.BaseInit();
  19. this.yotogi_info_object_ = UTY.GetChildObject(base.root_obj, "YotogiInfo", false);
  20. this.yotogi_info_object_.SetActive(true);
  21. UIWFTabPanel componentInChildren = this.yotogi_info_object_.GetComponentInChildren<UIWFTabPanel>();
  22. UIWFTabButton[] componentsInChildren = componentInChildren.GetComponentsInChildren<UIWFTabButton>();
  23. foreach (UIWFTabButton uiwftabButton in componentsInChildren)
  24. {
  25. EventDelegate.Add(uiwftabButton.onSelect, new EventDelegate.Callback(this.OnClickYotogiInfoTab));
  26. }
  27. this.yotogi_skill_list_mgr_ = UTY.GetChildObject(this.yotogi_info_object_, "YotogiSkillList", false).GetComponent<YotogiSkillListManager>();
  28. this.yotogi_class_list_mgr_ = UTY.GetChildObject(this.yotogi_info_object_, "YotogiClassList", false).GetComponent<YotogiClassListManager>();
  29. if (Product.supportMultiLanguage)
  30. {
  31. this.status_panel_ = UTY.GetChildObject(base.root_obj, "StatusPanel_localize", false);
  32. }
  33. else
  34. {
  35. this.status_panel_ = UTY.GetChildObject(base.root_obj, "StatusPanel", false);
  36. }
  37. this.class_change_panel_ = UTY.GetChildObject(base.root_obj, "ClassChangePanel", false).GetComponent<ClassChangePanel>();
  38. if (!this.class_change_panel_.gameObject.activeSelf)
  39. {
  40. this.class_change_panel_.gameObject.SetActive(true);
  41. }
  42. this.parent_grid_ = UTY.GetChildObject(base.root_obj, "ButtonParent/Tower/Grid", false).GetComponent<UIGrid>();
  43. this.button_dic_.Add("雇用", UTY.GetChildObject(this.parent_grid_.gameObject, "雇用", false).GetComponent<UIButton>());
  44. this.button_dic_.Add("移籍", UTY.GetChildObject(this.parent_grid_.gameObject, "移籍", false).GetComponent<UIButton>());
  45. this.button_dic_.Add("解雇", UTY.GetChildObject(this.parent_grid_.gameObject, "解雇", false).GetComponent<UIButton>());
  46. this.button_dic_.Add("メイド長", UTY.GetChildObject(this.parent_grid_.gameObject, "メイド長", false).GetComponent<UIButton>());
  47. this.button_dic_.Add("エディット", UTY.GetChildObject(this.parent_grid_.gameObject, "エディット", false).GetComponent<UIButton>());
  48. this.button_dic_.Add("ランキング", UTY.GetChildObject(this.parent_grid_.gameObject, "ランキング", false).GetComponent<UIButton>());
  49. this.button_dic_.Add("クラス変更", UTY.GetChildObject(this.parent_grid_.gameObject, "クラス変更", false).GetComponent<UIButton>());
  50. this.button_dic_.Add("夜伽スキル", UTY.GetChildObject(this.parent_grid_.gameObject, "夜伽スキル", false).GetComponent<UIButton>());
  51. this.button_dic_.Add("ステータス", UTY.GetChildObject(base.root_obj, "ButtonParent/Tower/ステータス", false).GetComponent<UIButton>());
  52. this.button_dic_.Add("View", UTY.GetChildObject(base.root_obj, "ButtonParent/View", false).GetComponent<UIButton>());
  53. this.button_dic_.Add("Cancel", UTY.GetChildObject(base.root_obj, "ButtonParent/Cancel", false).GetComponent<UIButton>());
  54. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  55. {
  56. EventDelegate.Add(keyValuePair.Value.onClick, new EventDelegate.Callback(this.OnClickButton));
  57. }
  58. this.chara_select_mgr_ = UTY.GetChildObject(base.root_obj, "CharacterSelectPanel", false).GetComponent<CharacterSelectManager>();
  59. this.employmentSelectUIFade.GetComponent<UIPanel>().alpha = 0f;
  60. if (MaidManagement.compatibilityMode)
  61. {
  62. base.root_obj.transform.localPosition = new Vector3(-340f, 404f, 0f);
  63. this.button_dic_["Cancel"].transform.localPosition = new Vector3(1231f, -877f, 0f);
  64. }
  65. }
  66. protected override void OnCall()
  67. {
  68. GameMain.Instance.SysShortcut.strSceneHelpName = "SceneMaidManagement";
  69. uGUITutorialPanel.OpenTutorial("SceneMaidManagement", null, false);
  70. this.chara_mgr_ = GameMain.Instance.CharacterMgr;
  71. base.SetCallInFadeWaitFrame(2);
  72. this.is_night_ = !this.chara_mgr_.status.isDaytime;
  73. this.status_mgr_.SetDurationToFadeIn(0.2f);
  74. this.status_mgr_.SetDurationToFadeOut(0.2f);
  75. PlayerStatus.Status status = GameMain.Instance.CharacterMgr.status;
  76. GameMain.Instance.MainLight.Reset();
  77. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  78. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  79. GameMain.Instance.SoundMgr.VoiceStopAll();
  80. if (!this.is_night_)
  81. {
  82. GameMain.Instance.SoundMgr.PlayBGM(DailyAPI.dayBgm, 0.5f, true);
  83. GameMain.Instance.BgMgr.ChangeBg(DailyAPI.dayBg);
  84. }
  85. else
  86. {
  87. GameMain.Instance.SoundMgr.PlayBGM(DailyAPI.nightBgm, 0.5f, true);
  88. GameMain.Instance.BgMgr.ChangeBg(DailyAPI.nightBg);
  89. }
  90. this.button_dic_["雇用"].gameObject.SetActive(status.isAvailableEmploymentAndBanishment);
  91. this.button_dic_["移籍"].gameObject.SetActive(this.isLegacy);
  92. this.button_dic_["解雇"].gameObject.SetActive(status.isAvailableEmploymentAndBanishment);
  93. this.button_dic_["クラス変更"].gameObject.SetActive(status.isAvailableClassChange);
  94. this.button_dic_["ランキング"].gameObject.SetActive(status.isAvailableRanking);
  95. UIWFTabPanel componentInChildren = this.yotogi_info_object_.GetComponentInChildren<UIWFTabPanel>();
  96. componentInChildren.Select(componentInChildren.GetComponentsInChildren<UIWFTabButton>(true)[0]);
  97. this.yotogi_info_object_.SetActive(false);
  98. this.VisibleClassChangePanel(false);
  99. this.parent_grid_.repositionNow = true;
  100. this.select_maid_ = null;
  101. for (int i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
  102. {
  103. if (this.chara_mgr_.GetStockMaid(i).status.leader)
  104. {
  105. this.cur_maid_leader_ = this.chara_mgr_.GetStockMaid(i);
  106. break;
  107. }
  108. }
  109. this.chara_select_mgr_.SetCallBackCallBackOnSelect(new CharacterSelectManager.CallBackOnSelect(this.OnSelectChara));
  110. this.chara_select_mgr_.SetCallBackMaidList(delegate(List<Maid> draw_maid_list)
  111. {
  112. if (!MaidManagement.compatibilityMode)
  113. {
  114. CharacterSelectManager.DefaultMaidList(draw_maid_list);
  115. return;
  116. }
  117. List<Maid> list = new List<Maid>();
  118. CharacterSelectManager.DefaultMaidList(list);
  119. for (int k = 0; k < list.Count; k++)
  120. {
  121. if (list[k].status.isCompatiblePersonality)
  122. {
  123. draw_maid_list.Add(list[k]);
  124. }
  125. }
  126. });
  127. this.chara_select_mgr_.Create(CharacterSelectManager.Type.Select, 3, true);
  128. if (!string.IsNullOrEmpty(MaidManagementMain.BackUpSelectMaidGUID))
  129. {
  130. this.chara_select_mgr_.SelectMaid(this.chara_mgr_.GetStockMaid(MaidManagementMain.BackUpSelectMaidGUID));
  131. MaidManagementMain.BackUpSelectMaidGUID = string.Empty;
  132. if (1f <= MaidManagementMain.BackUpBarValue && this.chara_mgr_.GetStockMaidCount() <= 7)
  133. {
  134. this.chara_select_mgr_.scroll_bar.value = 0f;
  135. }
  136. else
  137. {
  138. this.chara_select_mgr_.scroll_bar.value = MaidManagementMain.BackUpBarValue;
  139. }
  140. MaidManagementMain.BackUpBarValue = 0f;
  141. if (MaidManagementMain.BackUpRightPanelVisible)
  142. {
  143. this.ChangeRankingMode();
  144. MaidManagementMain.BackUpRightPanelVisible = false;
  145. }
  146. }
  147. if (this.is_night_)
  148. {
  149. this.button_dic_["雇用"].gameObject.SetActive(false);
  150. this.button_dic_["移籍"].gameObject.SetActive(false);
  151. this.button_dic_["解雇"].gameObject.SetActive(false);
  152. this.button_dic_["メイド長"].gameObject.SetActive(false);
  153. }
  154. if (MaidManagement.compatibilityMode)
  155. {
  156. this.button_dic_["雇用"].gameObject.SetActive(false);
  157. this.button_dic_["移籍"].gameObject.SetActive(false);
  158. this.button_dic_["解雇"].gameObject.SetActive(false);
  159. this.button_dic_["メイド長"].gameObject.SetActive(false);
  160. this.button_dic_["ランキング"].gameObject.SetActive(false);
  161. }
  162. if (this.button_dic_["雇用"].isEnabled)
  163. {
  164. this.button_dic_["雇用"].isEnabled = (this.GetMaidNumber() < 999);
  165. }
  166. if (this.button_dic_["移籍"].gameObject.activeInHierarchy && this.button_dic_["移籍"].isEnabled)
  167. {
  168. this.button_dic_["移籍"].isEnabled = (GameMain.Instance.CharacterMgr.status.isAvailableTransfer && this.GetMaidNumber() < 999);
  169. }
  170. if (Product.isPublic)
  171. {
  172. this.button_dic_["移籍"].gameObject.SetActive(false);
  173. this.button_dic_["夜伽スキル"].gameObject.SetActive(false);
  174. }
  175. for (int j = 0; j < this.chara_mgr_.GetMaidCount(); j++)
  176. {
  177. if (this.chara_mgr_.GetMaid(j) != null)
  178. {
  179. this.chara_mgr_.GetMaid(j).Visible = false;
  180. }
  181. }
  182. }
  183. public void SetMaidManagement(MaidManagement maid_management, string edit_label, string new_edit_label, string transfer_label)
  184. {
  185. this.maid_management_ = maid_management;
  186. this.edit_label_ = edit_label;
  187. this.new_edit_label_ = new_edit_label;
  188. this.transfer_label_ = transfer_label;
  189. }
  190. private void OnSelectChara(Maid select_maid)
  191. {
  192. this.select_maid_ = select_maid;
  193. if (this.select_maid_.status.heroineType == HeroineType.Sub)
  194. {
  195. this.button_dic_["エディット"].isEnabled = this.select_maid_.status.subCharaData.isEditPossible;
  196. this.button_dic_["メイド長"].isEnabled = false;
  197. this.button_dic_["クラス変更"].isEnabled = false;
  198. this.button_dic_["解雇"].isEnabled = false;
  199. this.button_dic_["夜伽スキル"].isEnabled = false;
  200. if (0 <= this.select_maid_.status.subCharaData.status.rehireEventId && Product.isJapan)
  201. {
  202. this.button_dic_["解雇"].isEnabled = true;
  203. }
  204. this.VisibleClassChangePanel(false);
  205. this.VisibleYotogiSkillList(false);
  206. if (this.status_panel_.activeSelf)
  207. {
  208. this.chara_select_mgr_.big_thumbnail.Visible = false;
  209. }
  210. }
  211. else
  212. {
  213. if (this.select_maid_.status.leader || this.select_maid_.status.contract == Contract.Trainee || this.select_maid_.status.heroineType == HeroineType.Transfer)
  214. {
  215. this.button_dic_["メイド長"].isEnabled = false;
  216. }
  217. else
  218. {
  219. this.button_dic_["メイド長"].isEnabled = true;
  220. }
  221. if (this.button_dic_["クラス変更"].gameObject.activeSelf)
  222. {
  223. this.button_dic_["クラス変更"].isEnabled = true;
  224. }
  225. if (this.select_maid_.status.leader || this.select_maid_.status.mainChara)
  226. {
  227. this.button_dic_["解雇"].isEnabled = false;
  228. }
  229. else
  230. {
  231. this.button_dic_["解雇"].isEnabled = true;
  232. }
  233. this.button_dic_["夜伽スキル"].isEnabled = true;
  234. }
  235. this.class_change_panel_.SetTargetMaid(select_maid);
  236. if (this.status_panel_.activeSelf)
  237. {
  238. this.status_mgr_.UpdateMaidStatus(select_maid);
  239. }
  240. if (this.yotogi_info_object_.activeSelf)
  241. {
  242. this.yotogi_skill_list_mgr_.CreateData(this.select_maid_);
  243. this.yotogi_class_list_mgr_.CreateData(this.select_maid_);
  244. }
  245. }
  246. private void OnClickButton()
  247. {
  248. string text = string.Empty;
  249. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  250. {
  251. if (keyValuePair.Value == UIButton.current)
  252. {
  253. text = keyValuePair.Key;
  254. break;
  255. }
  256. }
  257. if (string.IsNullOrEmpty(text))
  258. {
  259. return;
  260. }
  261. if (text == "雇用")
  262. {
  263. this.OnClickEmploymentButton();
  264. }
  265. else if (text == "移籍")
  266. {
  267. WfFadeJob.Create(this.employmentSelectUIFade, null, 0f, iTween.EaseType.easeOutSine);
  268. this.OnClickTransferButton();
  269. }
  270. else if (text == "解雇" && this.select_maid_ != null && 2 <= this.chara_mgr_.GetStockMaidCount() && !this.select_maid_.status.leader)
  271. {
  272. int banishmentPrice = this.select_maid_.status.banishmentPrice;
  273. string text2 = LocalizationManager.GetTranslation("Dialog/メイド管理/{0}を解雇しますか?", true, 0, true, false, null, null);
  274. text2 = string.Format(text2, this.select_maid_.status.charaName.GetFullName(" "));
  275. if (banishmentPrice > 0)
  276. {
  277. text2 = LocalizationManager.GetTranslation("Dialog/メイド管理/{0}を解雇しますか?資金 +{1}CR", true, 0, true, false, null, null);
  278. text2 = string.Format(text2, this.select_maid_.status.charaName.GetFullName(" "), Utility.ConvertMoneyText(banishmentPrice));
  279. }
  280. GameMain.Instance.SysDlg.Show(text2, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.BanishmentMaid), null);
  281. }
  282. else
  283. {
  284. if (text == "メイド長" && this.select_maid_ != null)
  285. {
  286. if (!this.select_maid_.status.leader)
  287. {
  288. if (this.cur_maid_leader_ != null)
  289. {
  290. this.cur_maid_leader_.status.leader = false;
  291. this.chara_select_mgr_.UpdateMaidPlate(this.cur_maid_leader_);
  292. }
  293. this.select_maid_.status.leader = true;
  294. this.chara_select_mgr_.UpdateMaidPlate(this.select_maid_);
  295. this.cur_maid_leader_ = this.select_maid_;
  296. this.button_dic_["メイド長"].isEnabled = !this.select_maid_.status.leader;
  297. this.button_dic_["解雇"].isEnabled = !this.select_maid_.status.leader;
  298. this.chara_select_mgr_.scroll_view.ResetPosition();
  299. this.chara_select_mgr_.Reposition();
  300. }
  301. return;
  302. }
  303. if (text == "ランキング")
  304. {
  305. this.ChangeRankingMode();
  306. }
  307. else if (text == "クラス変更")
  308. {
  309. this.VisibleClassChangePanel(!this.class_change_panel_.gameObject.activeSelf);
  310. }
  311. else if (text == "エディット" && this.select_maid_ != null)
  312. {
  313. if (string.IsNullOrEmpty(this.edit_label_))
  314. {
  315. return;
  316. }
  317. this.chara_mgr_.SetActiveMaid(this.select_maid_, 0);
  318. MaidManagementMain.BackUpSelectMaidGUID = this.select_maid_.status.guid;
  319. MaidManagementMain.BackUpBarValue = this.chara_select_mgr_.scroll_bar.value;
  320. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  321. this.maid_management_.move_screen.SetNextLabel(this.edit_label_);
  322. this.Finish();
  323. }
  324. else if (text == "夜伽スキル" && this.select_maid_ != null)
  325. {
  326. this.yotogi_skill_list_mgr_.CreateData(this.select_maid_);
  327. this.yotogi_class_list_mgr_.CreateData(this.select_maid_);
  328. this.VisibleYotogiSkillList(!this.yotogi_info_object_.activeSelf);
  329. }
  330. else if (text == "ステータス" && this.select_maid_ != null)
  331. {
  332. this.status_mgr_.UpdateMaidStatus(this.select_maid_);
  333. this.VisibleStatusPanel(!this.status_panel_.activeSelf);
  334. }
  335. else if (text == "Cancel")
  336. {
  337. this.Finish();
  338. }
  339. }
  340. }
  341. public void OnClickEmploymentButton()
  342. {
  343. if (string.IsNullOrEmpty(this.new_edit_label_))
  344. {
  345. return;
  346. }
  347. int num = this.employmentPrice;
  348. if (this.chara_mgr_.status.money - (long)num < 0L)
  349. {
  350. string text = LocalizationManager.GetTranslation("Dialog/メイド管理/新しいメイドを雇用するには{0}CRが必要です。", true, 0, true, false, null, null);
  351. text = string.Format(text, Utility.ConvertMoneyText(num));
  352. GameMain.Instance.SysDlg.Show(text, SystemDialog.TYPE.OK, null, null);
  353. }
  354. else
  355. {
  356. string text2 = LocalizationManager.GetTranslation("Dialog/メイド管理/新しいメイドを雇用しますか?資金 -{0}CR", true, 0, true, false, null, null);
  357. text2 = string.Format(text2, Utility.ConvertMoneyText(num));
  358. GameMain.Instance.SysDlg.Show(text2, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.Employment), null);
  359. }
  360. }
  361. public void OnClickTransferButton()
  362. {
  363. if (string.IsNullOrEmpty(this.transfer_label_))
  364. {
  365. return;
  366. }
  367. int num = this.transferPrice;
  368. if (this.chara_mgr_.status.money - (long)num < 0L)
  369. {
  370. string f_strMsg = "メイドを移籍するには\n" + Utility.ConvertMoneyText(num) + "CRが必要です。";
  371. GameMain.Instance.SysDlg.Show(f_strMsg, SystemDialog.TYPE.OK, null, null);
  372. }
  373. else
  374. {
  375. string f_strMsg2 = "メイドを移籍しますか?\n資金 -" + Utility.ConvertMoneyText(num) + "CR";
  376. GameMain.Instance.SysDlg.Show(f_strMsg2, SystemDialog.TYPE.OK_CANCEL, delegate
  377. {
  378. GameMain.Instance.SysDlg.Close();
  379. this.transferMain.Call(delegate
  380. {
  381. WfFadeJob.Create(null, this.employmentSelectUIFade, 0f, iTween.EaseType.easeOutSine);
  382. });
  383. }, null);
  384. }
  385. }
  386. public void OnClickEmploymentSelectCancel()
  387. {
  388. if (UIButton.current != null)
  389. {
  390. UIButton.current.SetState(UIButtonColor.State.Normal, true);
  391. }
  392. WfFadeJob.Create(null, this.employmentSelectUIFade, 0.3f, iTween.EaseType.easeOutSine);
  393. }
  394. private void OnClickYotogiInfoTab()
  395. {
  396. if (!UIWFSelectButton.current.isSelected)
  397. {
  398. return;
  399. }
  400. if (UIWFSelectButton.current.name.ToLower() == "class")
  401. {
  402. this.yotogi_skill_list_mgr_.gameObject.SetActive(false);
  403. this.yotogi_class_list_mgr_.gameObject.SetActive(true);
  404. }
  405. else
  406. {
  407. this.yotogi_skill_list_mgr_.gameObject.SetActive(true);
  408. this.yotogi_class_list_mgr_.gameObject.SetActive(false);
  409. }
  410. }
  411. public void ChangeRankingMode()
  412. {
  413. GameObject childObject = UTY.GetChildObject(base.root_obj, "ButtonParent/Tower", false);
  414. if (!this.ranking_mode_)
  415. {
  416. this.VisibleClassChangePanel(false);
  417. this.VisibleStatusPanel(false);
  418. this.VisibleYotogiSkillList(false);
  419. this.ranking_mode_ = true;
  420. this.chara_select_mgr_.SetRightVisible(true);
  421. this.chara_select_mgr_.SetSortType(CharacterSelectManager.SortType.Ranking);
  422. childObject.transform.localPosition = new Vector3(265f, 0f, 0f);
  423. this.chara_select_mgr_.big_thumbnail.Visible = false;
  424. }
  425. else
  426. {
  427. this.ranking_mode_ = false;
  428. this.chara_select_mgr_.SetRightVisible(false);
  429. this.chara_select_mgr_.SetSortType(CharacterSelectManager.SortType.Normal);
  430. childObject.transform.localPosition = Vector3.zero;
  431. this.chara_select_mgr_.big_thumbnail.Visible = true;
  432. }
  433. if (this.chara_select_mgr_.scroll_bar.alpha <= 0f)
  434. {
  435. this.chara_select_mgr_.scroll_bar.value = 0f;
  436. }
  437. }
  438. public void VisibleClassChangePanel(bool value)
  439. {
  440. if (this.ranking_mode_)
  441. {
  442. this.ChangeRankingMode();
  443. }
  444. if (value)
  445. {
  446. this.VisibleStatusPanel(false);
  447. this.VisibleYotogiSkillList(false);
  448. }
  449. this.class_change_panel_.gameObject.SetActive(value);
  450. this.chara_select_mgr_.big_thumbnail.Visible = !value;
  451. }
  452. public void VisibleStatusPanel(bool value)
  453. {
  454. if (this.status_panel_.activeSelf && !value)
  455. {
  456. this.chara_select_mgr_.big_thumbnail.Visible = true;
  457. this.status_mgr_.CloseStatusPanel();
  458. }
  459. else if (!this.status_panel_.activeSelf && value)
  460. {
  461. this.VisibleClassChangePanel(false);
  462. this.VisibleYotogiSkillList(false);
  463. this.chara_select_mgr_.big_thumbnail.Visible = false;
  464. this.status_mgr_.OpenStatusPanel();
  465. }
  466. }
  467. public void VisibleYotogiSkillList(bool value)
  468. {
  469. if (this.ranking_mode_)
  470. {
  471. this.ChangeRankingMode();
  472. }
  473. if (value)
  474. {
  475. this.VisibleStatusPanel(false);
  476. this.VisibleClassChangePanel(false);
  477. }
  478. this.yotogi_info_object_.SetActive(value);
  479. this.chara_select_mgr_.big_thumbnail.Visible = !value;
  480. }
  481. public void Employment()
  482. {
  483. GameMain.Instance.SysDlg.Close();
  484. int num = this.employmentPrice;
  485. GameMain.Instance.CharacterMgr.status.money += (long)(num * -1);
  486. Maid maid = this.chara_mgr_.AddStockMaid();
  487. MaidManagementMain.BackUpSelectMaidGUID = maid.status.guid;
  488. MaidManagementMain.BackUpBarValue = 1f;
  489. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  490. this.chara_mgr_.SetActiveMaid(maid, 0);
  491. this.maid_management_.move_screen.SetNextLabel(this.new_edit_label_);
  492. this.Finish();
  493. }
  494. public void Transfer(string loadSaveFilePath, OldDataConverter.MaidData oldData)
  495. {
  496. int num = this.transferPrice;
  497. GameMain.Instance.CharacterMgr.status.money += (long)(num * -1);
  498. Maid maid = this.chara_mgr_.AddStockMaid();
  499. maid.DeserializeOldData(oldData, false);
  500. MaidManagementMain.BackUpSelectMaidGUID = maid.status.guid;
  501. MaidManagementMain.BackUpBarValue = 1f;
  502. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  503. this.chara_mgr_.SetActiveMaid(maid, 0);
  504. this.maid_management_.move_screen.SetNextLabel(this.transfer_label_);
  505. this.Finish();
  506. }
  507. public void BanishmentMaid()
  508. {
  509. if (this.select_maid_.status.heroineType == HeroineType.Sub && this.select_maid_.status.subCharaData != null)
  510. {
  511. SubMaid.BackupStatus backupStatus = SubMaid.BackupStatus.CreateInstance(this.select_maid_);
  512. int num = -1;
  513. for (int i = 0; i < GameMain.Instance.CharacterMgr.subMaidBackupStatusList.Count; i++)
  514. {
  515. SubMaid.BackupStatus backupStatus2 = GameMain.Instance.CharacterMgr.subMaidBackupStatusList[i];
  516. if (backupStatus2.subCharaUniqueName == backupStatus.subCharaUniqueName)
  517. {
  518. num = i;
  519. break;
  520. }
  521. }
  522. if (num != -1)
  523. {
  524. backupStatus.subCharaUniqueName.Remove(num);
  525. }
  526. GameMain.Instance.CharacterMgr.subMaidBackupStatusList.Add(backupStatus);
  527. ScenarioData scenarioData = GameMain.Instance.ScenarioSelectMgr.GetScenarioData(this.select_maid_.status.subCharaData.status.rehireEventId);
  528. if (scenarioData == null)
  529. {
  530. GameMain.Instance.SysDlg.Show("解雇 error\n再雇用シナリオ " + this.select_maid_.status.subCharaData.status.rehireEventId + " not fund.", SystemDialog.TYPE.OK, null, null);
  531. return;
  532. }
  533. foreach (KeyValuePair<ScenarioData.PlayableCondition, ScenarioData.PlayableData> keyValuePair in scenarioData.m_PlayableData)
  534. {
  535. ScenarioData.PlayableData value = keyValuePair.Value;
  536. if (value.Condition == ScenarioData.PlayableCondition.シナリオ)
  537. {
  538. if (value.StringData.IndexOf("シナリオフラグ") >= 0)
  539. {
  540. GameMain.Instance.CharacterMgr.status.SetFlag(value.StringData.Split(new char[]
  541. {
  542. ':'
  543. })[1], 1);
  544. }
  545. }
  546. }
  547. }
  548. string text = LocalizationManager.GetTranslation("Dialog/メイド管理/{0}を解雇しました", true, 0, true, false, null, null);
  549. text = string.Format(text, this.select_maid_.status.charaName.GetFullName(" "));
  550. int banishmentPrice = this.select_maid_.status.banishmentPrice;
  551. GameMain.Instance.CharacterMgr.status.money += (long)banishmentPrice;
  552. int j;
  553. for (j = 0; j < this.chara_mgr_.GetStockMaidCount(); j++)
  554. {
  555. if (this.chara_mgr_.GetStockMaid(j) == this.select_maid_)
  556. {
  557. break;
  558. }
  559. }
  560. this.chara_select_mgr_.RemoveMaidPlate(this.select_maid_);
  561. this.chara_mgr_.BanishmentMaid(j);
  562. this.button_dic_["雇用"].isEnabled = (this.GetMaidNumber() < 999);
  563. this.button_dic_["移籍"].isEnabled = (GameMain.Instance.CharacterMgr.status.isAvailableTransfer && this.GetMaidNumber() < 999);
  564. GameMain.Instance.SysDlg.Show(text, SystemDialog.TYPE.OK, null, null);
  565. }
  566. private int GetMaidNumber()
  567. {
  568. int num = 0;
  569. for (int i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
  570. {
  571. Maid stockMaid = this.chara_mgr_.GetStockMaid(i);
  572. if (stockMaid != null && (stockMaid.status.heroineType == HeroineType.Original || stockMaid.status.heroineType == HeroineType.Transfer))
  573. {
  574. num++;
  575. }
  576. }
  577. return num;
  578. }
  579. protected override void OnFinish()
  580. {
  581. if ((this.maid_management_.move_screen.next_label == this.edit_label_ || this.maid_management_.move_screen.next_label == this.new_edit_label_ || this.maid_management_.move_screen.next_label == this.transfer_label_) && this.chara_mgr_.GetMaid(0) != null)
  582. {
  583. this.chara_mgr_.GetMaid(0).Visible = true;
  584. }
  585. if (!string.IsNullOrEmpty(this.maid_management_.move_screen.next_label))
  586. {
  587. this.maid_management_.CallScreen("Move");
  588. }
  589. }
  590. private bool isLegacy
  591. {
  592. get
  593. {
  594. return !string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && PluginData.IsEnabled("Legacy");
  595. }
  596. }
  597. public static string BackUpSelectMaidGUID = string.Empty;
  598. public static float BackUpBarValue = 0f;
  599. public static bool BackUpRightPanelVisible = false;
  600. [SerializeField]
  601. public int employmentPrice = 3000000;
  602. [SerializeField]
  603. public int transferPrice = 3000000;
  604. [SerializeField]
  605. public WfFadeBehaviour employmentSelectUIFade;
  606. [SerializeField]
  607. public MaidTransferLoadMain transferMain;
  608. private WfFadeBehaviour mainUIFade;
  609. private MaidManagement maid_management_;
  610. private ClassChangePanel class_change_panel_;
  611. private GameObject status_panel_;
  612. private CharaSelectStatusMgr status_mgr_;
  613. private GameObject yotogi_info_object_;
  614. private YotogiSkillListManager yotogi_skill_list_mgr_;
  615. private YotogiClassListManager yotogi_class_list_mgr_;
  616. private Maid cur_maid_leader_;
  617. private Maid select_maid_;
  618. private CharacterMgr chara_mgr_;
  619. private CharacterSelectManager chara_select_mgr_;
  620. private UIGrid parent_grid_;
  621. private Dictionary<string, UIButton> button_dic_ = new Dictionary<string, UIButton>();
  622. private string edit_label_;
  623. private string new_edit_label_;
  624. private string transfer_label_;
  625. private bool ranking_mode_;
  626. private bool is_night_;
  627. }