MaidManagementMain.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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 (GameUty.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() < 200);
  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() < 200);
  169. }
  170. for (int j = 0; j < this.chara_mgr_.GetMaidCount(); j++)
  171. {
  172. if (this.chara_mgr_.GetMaid(j) != null)
  173. {
  174. this.chara_mgr_.GetMaid(j).Visible = false;
  175. }
  176. }
  177. }
  178. public void SetMaidManagement(MaidManagement maid_management, string edit_label, string new_edit_label, string transfer_label)
  179. {
  180. this.maid_management_ = maid_management;
  181. this.edit_label_ = edit_label;
  182. this.new_edit_label_ = new_edit_label;
  183. this.transfer_label_ = transfer_label;
  184. }
  185. private void OnSelectChara(Maid select_maid)
  186. {
  187. this.select_maid_ = select_maid;
  188. if (this.select_maid_.status.heroineType == HeroineType.Sub)
  189. {
  190. this.button_dic_["エディット"].isEnabled = this.select_maid_.status.subCharaData.isEditPossible;
  191. this.button_dic_["メイド長"].isEnabled = false;
  192. this.button_dic_["クラス変更"].isEnabled = false;
  193. this.button_dic_["解雇"].isEnabled = false;
  194. this.button_dic_["夜伽スキル"].isEnabled = false;
  195. this.VisibleClassChangePanel(false);
  196. this.VisibleYotogiSkillList(false);
  197. if (this.status_panel_.activeSelf)
  198. {
  199. this.chara_select_mgr_.big_thumbnail.Visible = false;
  200. }
  201. }
  202. else
  203. {
  204. if (this.select_maid_.status.leader || this.select_maid_.status.contract == Contract.Trainee || this.select_maid_.status.heroineType == HeroineType.Transfer)
  205. {
  206. this.button_dic_["メイド長"].isEnabled = false;
  207. }
  208. else
  209. {
  210. this.button_dic_["メイド長"].isEnabled = true;
  211. }
  212. if (this.button_dic_["クラス変更"].gameObject.activeSelf)
  213. {
  214. this.button_dic_["クラス変更"].isEnabled = true;
  215. }
  216. if (this.select_maid_.status.leader || this.select_maid_.status.mainChara)
  217. {
  218. this.button_dic_["解雇"].isEnabled = false;
  219. }
  220. else
  221. {
  222. this.button_dic_["解雇"].isEnabled = true;
  223. }
  224. this.button_dic_["夜伽スキル"].isEnabled = true;
  225. }
  226. this.class_change_panel_.SetTargetMaid(select_maid);
  227. if (this.status_panel_.activeSelf)
  228. {
  229. this.status_mgr_.UpdateMaidStatus(select_maid);
  230. }
  231. if (this.yotogi_info_object_.activeSelf)
  232. {
  233. this.yotogi_skill_list_mgr_.CreateData(this.select_maid_);
  234. this.yotogi_class_list_mgr_.CreateData(this.select_maid_);
  235. }
  236. }
  237. private void OnClickButton()
  238. {
  239. string text = string.Empty;
  240. foreach (KeyValuePair<string, UIButton> keyValuePair in this.button_dic_)
  241. {
  242. if (keyValuePair.Value == UIButton.current)
  243. {
  244. text = keyValuePair.Key;
  245. break;
  246. }
  247. }
  248. if (string.IsNullOrEmpty(text))
  249. {
  250. return;
  251. }
  252. if (text == "雇用")
  253. {
  254. this.OnClickEmploymentButton();
  255. }
  256. else if (text == "移籍")
  257. {
  258. WfFadeJob.Create(this.employmentSelectUIFade, null, 0f, iTween.EaseType.easeOutSine);
  259. this.OnClickTransferButton();
  260. }
  261. else if (text == "解雇" && this.select_maid_ != null && 2 <= this.chara_mgr_.GetStockMaidCount() && !this.select_maid_.status.leader)
  262. {
  263. int banishmentPrice = this.select_maid_.status.banishmentPrice;
  264. string text2 = LocalizationManager.GetTranslation("Dialog/メイド管理/{0}を解雇しますか?資金 +{1}CR", true, 0, true, false, null, null);
  265. text2 = string.Format(text2, this.select_maid_.status.fullNameJpStyle, Utility.ConvertMoneyText(banishmentPrice));
  266. GameMain.Instance.SysDlg.Show(text2, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.BanishmentMaid), null);
  267. }
  268. else
  269. {
  270. if (text == "メイド長" && this.select_maid_ != null)
  271. {
  272. if (!this.select_maid_.status.leader)
  273. {
  274. if (this.cur_maid_leader_ != null)
  275. {
  276. this.cur_maid_leader_.status.leader = false;
  277. this.chara_select_mgr_.UpdateMaidPlate(this.cur_maid_leader_);
  278. }
  279. this.select_maid_.status.leader = true;
  280. this.chara_select_mgr_.UpdateMaidPlate(this.select_maid_);
  281. this.cur_maid_leader_ = this.select_maid_;
  282. this.button_dic_["メイド長"].isEnabled = !this.select_maid_.status.leader;
  283. this.button_dic_["解雇"].isEnabled = !this.select_maid_.status.leader;
  284. this.chara_select_mgr_.scroll_view.ResetPosition();
  285. this.chara_select_mgr_.Reposition();
  286. }
  287. return;
  288. }
  289. if (text == "ランキング")
  290. {
  291. this.ChangeRankingMode();
  292. }
  293. else if (text == "クラス変更")
  294. {
  295. this.VisibleClassChangePanel(!this.class_change_panel_.gameObject.activeSelf);
  296. }
  297. else if (text == "エディット" && this.select_maid_ != null)
  298. {
  299. if (string.IsNullOrEmpty(this.edit_label_))
  300. {
  301. return;
  302. }
  303. this.chara_mgr_.SetActiveMaid(this.select_maid_, 0);
  304. MaidManagementMain.BackUpSelectMaidGUID = this.select_maid_.status.guid;
  305. MaidManagementMain.BackUpBarValue = this.chara_select_mgr_.scroll_bar.value;
  306. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  307. this.maid_management_.move_screen.SetNextLabel(this.edit_label_);
  308. this.Finish();
  309. }
  310. else if (text == "夜伽スキル" && this.select_maid_ != null)
  311. {
  312. this.yotogi_skill_list_mgr_.CreateData(this.select_maid_);
  313. this.yotogi_class_list_mgr_.CreateData(this.select_maid_);
  314. this.VisibleYotogiSkillList(!this.yotogi_info_object_.activeSelf);
  315. }
  316. else if (text == "ステータス" && this.select_maid_ != null)
  317. {
  318. this.status_mgr_.UpdateMaidStatus(this.select_maid_);
  319. this.VisibleStatusPanel(!this.status_panel_.activeSelf);
  320. }
  321. else if (text == "Cancel")
  322. {
  323. this.Finish();
  324. }
  325. }
  326. }
  327. public void OnClickEmploymentButton()
  328. {
  329. if (string.IsNullOrEmpty(this.new_edit_label_))
  330. {
  331. return;
  332. }
  333. int num = this.employmentPrice;
  334. if (this.chara_mgr_.status.money - (long)num < 0L)
  335. {
  336. string text = LocalizationManager.GetTranslation("Dialog/メイド管理/新しいメイドを雇用するには{0}CRが必要です。", true, 0, true, false, null, null);
  337. text = string.Format(text, Utility.ConvertMoneyText(num));
  338. GameMain.Instance.SysDlg.Show(text, SystemDialog.TYPE.OK, null, null);
  339. }
  340. else
  341. {
  342. string text2 = LocalizationManager.GetTranslation("Dialog/メイド管理/新しいメイドを雇用しますか?資金 -{0}CR", true, 0, true, false, null, null);
  343. text2 = string.Format(text2, Utility.ConvertMoneyText(num));
  344. GameMain.Instance.SysDlg.Show(text2, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.Employment), null);
  345. }
  346. }
  347. public void OnClickTransferButton()
  348. {
  349. if (string.IsNullOrEmpty(this.transfer_label_))
  350. {
  351. return;
  352. }
  353. int num = this.transferPrice;
  354. if (this.chara_mgr_.status.money - (long)num < 0L)
  355. {
  356. string f_strMsg = "メイドを移籍するには\n" + Utility.ConvertMoneyText(num) + "CRが必要です。";
  357. GameMain.Instance.SysDlg.Show(f_strMsg, SystemDialog.TYPE.OK, null, null);
  358. }
  359. else
  360. {
  361. string f_strMsg2 = "メイドを移籍しますか?\n資金 -" + Utility.ConvertMoneyText(num) + "CR";
  362. GameMain.Instance.SysDlg.Show(f_strMsg2, SystemDialog.TYPE.OK_CANCEL, delegate
  363. {
  364. GameMain.Instance.SysDlg.Close();
  365. this.transferMain.Call(delegate
  366. {
  367. WfFadeJob.Create(null, this.employmentSelectUIFade, 0f, iTween.EaseType.easeOutSine);
  368. });
  369. }, null);
  370. }
  371. }
  372. public void OnClickEmploymentSelectCancel()
  373. {
  374. if (UIButton.current != null)
  375. {
  376. UIButton.current.SetState(UIButtonColor.State.Normal, true);
  377. }
  378. WfFadeJob.Create(null, this.employmentSelectUIFade, 0.3f, iTween.EaseType.easeOutSine);
  379. }
  380. private void OnClickYotogiInfoTab()
  381. {
  382. if (!UIWFSelectButton.current.isSelected)
  383. {
  384. return;
  385. }
  386. if (UIWFSelectButton.current.name.ToLower() == "class")
  387. {
  388. this.yotogi_skill_list_mgr_.gameObject.SetActive(false);
  389. this.yotogi_class_list_mgr_.gameObject.SetActive(true);
  390. }
  391. else
  392. {
  393. this.yotogi_skill_list_mgr_.gameObject.SetActive(true);
  394. this.yotogi_class_list_mgr_.gameObject.SetActive(false);
  395. }
  396. }
  397. public void ChangeRankingMode()
  398. {
  399. GameObject childObject = UTY.GetChildObject(base.root_obj, "ButtonParent/Tower", false);
  400. if (!this.ranking_mode_)
  401. {
  402. this.VisibleClassChangePanel(false);
  403. this.VisibleStatusPanel(false);
  404. this.VisibleYotogiSkillList(false);
  405. this.ranking_mode_ = true;
  406. this.chara_select_mgr_.SetRightVisible(true);
  407. this.chara_select_mgr_.SetSortType(CharacterSelectManager.SortType.Ranking);
  408. childObject.transform.localPosition = new Vector3(265f, 0f, 0f);
  409. this.chara_select_mgr_.big_thumbnail.Visible = false;
  410. }
  411. else
  412. {
  413. this.ranking_mode_ = false;
  414. this.chara_select_mgr_.SetRightVisible(false);
  415. this.chara_select_mgr_.SetSortType(CharacterSelectManager.SortType.Normal);
  416. childObject.transform.localPosition = Vector3.zero;
  417. this.chara_select_mgr_.big_thumbnail.Visible = true;
  418. }
  419. if (this.chara_select_mgr_.scroll_bar.alpha <= 0f)
  420. {
  421. this.chara_select_mgr_.scroll_bar.value = 0f;
  422. }
  423. }
  424. public void VisibleClassChangePanel(bool value)
  425. {
  426. if (this.ranking_mode_)
  427. {
  428. this.ChangeRankingMode();
  429. }
  430. if (value)
  431. {
  432. this.VisibleStatusPanel(false);
  433. this.VisibleYotogiSkillList(false);
  434. }
  435. this.class_change_panel_.gameObject.SetActive(value);
  436. this.chara_select_mgr_.big_thumbnail.Visible = !value;
  437. }
  438. public void VisibleStatusPanel(bool value)
  439. {
  440. if (this.status_panel_.activeSelf && !value)
  441. {
  442. this.chara_select_mgr_.big_thumbnail.Visible = true;
  443. this.status_mgr_.CloseStatusPanel();
  444. }
  445. else if (!this.status_panel_.activeSelf && value)
  446. {
  447. this.VisibleClassChangePanel(false);
  448. this.VisibleYotogiSkillList(false);
  449. this.chara_select_mgr_.big_thumbnail.Visible = false;
  450. this.status_mgr_.OpenStatusPanel();
  451. }
  452. }
  453. public void VisibleYotogiSkillList(bool value)
  454. {
  455. if (this.ranking_mode_)
  456. {
  457. this.ChangeRankingMode();
  458. }
  459. if (value)
  460. {
  461. this.VisibleStatusPanel(false);
  462. this.VisibleClassChangePanel(false);
  463. }
  464. this.yotogi_info_object_.SetActive(value);
  465. this.chara_select_mgr_.big_thumbnail.Visible = !value;
  466. }
  467. public void Employment()
  468. {
  469. GameMain.Instance.SysDlg.Close();
  470. int num = this.employmentPrice;
  471. GameMain.Instance.CharacterMgr.status.money += (long)(num * -1);
  472. Maid maid = this.chara_mgr_.AddStockMaid();
  473. MaidManagementMain.BackUpSelectMaidGUID = maid.status.guid;
  474. MaidManagementMain.BackUpBarValue = 1f;
  475. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  476. this.chara_mgr_.SetActiveMaid(maid, 0);
  477. this.maid_management_.move_screen.SetNextLabel(this.new_edit_label_);
  478. this.Finish();
  479. }
  480. public void Transfer(string loadSaveFilePath, OldDataConverter.MaidData oldData)
  481. {
  482. int num = this.transferPrice;
  483. GameMain.Instance.CharacterMgr.status.money += (long)(num * -1);
  484. Maid maid = this.chara_mgr_.AddStockMaid();
  485. maid.DeserializeOldData(oldData, false);
  486. MaidManagementMain.BackUpSelectMaidGUID = maid.status.guid;
  487. MaidManagementMain.BackUpBarValue = 1f;
  488. MaidManagementMain.BackUpRightPanelVisible = this.chara_select_mgr_.IsRightVisible();
  489. this.chara_mgr_.SetActiveMaid(maid, 0);
  490. this.maid_management_.move_screen.SetNextLabel(this.transfer_label_);
  491. this.Finish();
  492. }
  493. public void BanishmentMaid()
  494. {
  495. string text = LocalizationManager.GetTranslation("Dialog/メイド管理/{0}を解雇しました", true, 0, true, false, null, null);
  496. text = string.Format(text, this.select_maid_.status.fullNameJpStyle);
  497. int banishmentPrice = this.select_maid_.status.banishmentPrice;
  498. GameMain.Instance.CharacterMgr.status.money += (long)banishmentPrice;
  499. int i;
  500. for (i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
  501. {
  502. if (this.chara_mgr_.GetStockMaid(i) == this.select_maid_)
  503. {
  504. break;
  505. }
  506. }
  507. this.chara_select_mgr_.RemoveMaidPlate(this.select_maid_);
  508. this.chara_mgr_.BanishmentMaid(i);
  509. this.button_dic_["雇用"].isEnabled = (this.GetMaidNumber() < 200);
  510. this.button_dic_["移籍"].isEnabled = (GameMain.Instance.CharacterMgr.status.isAvailableTransfer && this.GetMaidNumber() < 200);
  511. GameMain.Instance.SysDlg.Show(text, SystemDialog.TYPE.OK, null, null);
  512. }
  513. private int GetMaidNumber()
  514. {
  515. int num = 0;
  516. for (int i = 0; i < this.chara_mgr_.GetStockMaidCount(); i++)
  517. {
  518. Maid stockMaid = this.chara_mgr_.GetStockMaid(i);
  519. if (stockMaid != null && (stockMaid.status.heroineType == HeroineType.Original || stockMaid.status.heroineType == HeroineType.Transfer))
  520. {
  521. num++;
  522. }
  523. }
  524. return num;
  525. }
  526. protected override void OnFinish()
  527. {
  528. 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)
  529. {
  530. this.chara_mgr_.GetMaid(0).Visible = true;
  531. }
  532. if (!string.IsNullOrEmpty(this.maid_management_.move_screen.next_label))
  533. {
  534. this.maid_management_.CallScreen("Move");
  535. }
  536. }
  537. private bool isLegacy
  538. {
  539. get
  540. {
  541. return !string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && PluginData.IsEnabled("Legacy");
  542. }
  543. }
  544. public static string BackUpSelectMaidGUID = string.Empty;
  545. public static float BackUpBarValue = 0f;
  546. public static bool BackUpRightPanelVisible = false;
  547. [SerializeField]
  548. public int employmentPrice = 3000000;
  549. [SerializeField]
  550. public int transferPrice = 3000000;
  551. [SerializeField]
  552. public WfFadeBehaviour employmentSelectUIFade;
  553. [SerializeField]
  554. public MaidTransferLoadMain transferMain;
  555. private WfFadeBehaviour mainUIFade;
  556. private MaidManagement maid_management_;
  557. private ClassChangePanel class_change_panel_;
  558. private GameObject status_panel_;
  559. private CharaSelectStatusMgr status_mgr_;
  560. private GameObject yotogi_info_object_;
  561. private YotogiSkillListManager yotogi_skill_list_mgr_;
  562. private YotogiClassListManager yotogi_class_list_mgr_;
  563. private Maid cur_maid_leader_;
  564. private Maid select_maid_;
  565. private CharacterMgr chara_mgr_;
  566. private CharacterSelectManager chara_select_mgr_;
  567. private UIGrid parent_grid_;
  568. private Dictionary<string, UIButton> button_dic_ = new Dictionary<string, UIButton>();
  569. private string edit_label_;
  570. private string new_edit_label_;
  571. private string transfer_label_;
  572. private bool ranking_mode_;
  573. private bool is_night_;
  574. }