MaidManagementMain.cs 22 KB

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