PhotoWindowManager.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Xml.Linq;
  5. using MaidStatus;
  6. using UnityEngine;
  7. using wf;
  8. public class PhotoWindowManager : BasePhotoWindowManager
  9. {
  10. public static Dictionary<string, string> maidGuidReplaceDic { get; private set; }
  11. public static GameObject GetWorldTransformAxisParent()
  12. {
  13. GameObject gameObject = GameObject.Find("WorldTransformAxisParent");
  14. if (gameObject == null)
  15. {
  16. gameObject = new GameObject("WorldTransformAxisParent");
  17. }
  18. return gameObject;
  19. }
  20. public static WorldTransformAxis CreateWorldTransformAxis(GameObject move_target_obj, bool forc_create, bool small = false)
  21. {
  22. GameObject gameObject = GameObject.Find("WorldTransformAxisParent");
  23. if (gameObject == null)
  24. {
  25. gameObject = new GameObject("WorldTransformAxisParent");
  26. }
  27. GameObject gameObject2 = GameObject.Find("WorldTransformAxisParent/TargetObj_" + move_target_obj.name);
  28. if (gameObject2 != null && !forc_create)
  29. {
  30. return gameObject2.GetComponent<WorldTransformAxis>();
  31. }
  32. WorldTransformAxis component;
  33. if (!small)
  34. {
  35. if (GameMain.Instance.VRMode)
  36. {
  37. component = Utility.CreatePrefab(gameObject, "System/Prefab/XYZAxis_VR", false).GetComponent<WorldTransformAxis>();
  38. }
  39. else
  40. {
  41. component = Utility.CreatePrefab(gameObject, "System/Prefab/XYZAxis", true).GetComponent<WorldTransformAxis>();
  42. }
  43. }
  44. else if (GameMain.Instance.VRMode)
  45. {
  46. component = Utility.CreatePrefab(gameObject, "System/Prefab/XYZAxis_VR_s", false).GetComponent<WorldTransformAxis>();
  47. }
  48. else
  49. {
  50. component = Utility.CreatePrefab(gameObject, "System/Prefab/XYZAxis_s", false).GetComponent<WorldTransformAxis>();
  51. }
  52. component.TargetObject = move_target_obj;
  53. component.name = "TargetObj_" + move_target_obj.name;
  54. component.Update();
  55. return component;
  56. }
  57. public static GizmoRender CreateWorldTransformRotate(GameObject rotate_target_obj, bool forc_create)
  58. {
  59. GizmoRender gizmoRender = rotate_target_obj.GetComponent<GizmoRender>();
  60. if (gizmoRender == null)
  61. {
  62. gizmoRender = rotate_target_obj.AddComponent<GizmoRender>();
  63. gizmoRender.eRotate = true;
  64. gizmoRender.Visible = false;
  65. }
  66. return gizmoRender;
  67. }
  68. public static string path_photo_folder
  69. {
  70. get
  71. {
  72. return UTY.gameProjectPath + "\\PhotoModeData\\";
  73. }
  74. }
  75. public static string path_photo_save
  76. {
  77. get
  78. {
  79. string text = Path.Combine(PhotoWindowManager.path_photo_folder, "SaveData");
  80. if (!Directory.Exists(text))
  81. {
  82. Directory.CreateDirectory(text);
  83. }
  84. return text;
  85. }
  86. }
  87. public static string path_photo_mod_motion
  88. {
  89. get
  90. {
  91. string text = Path.Combine(PhotoWindowManager.path_photo_folder, "Mod\\Motion");
  92. if (!Directory.Exists(text))
  93. {
  94. Directory.CreateDirectory(text);
  95. }
  96. return text;
  97. }
  98. }
  99. public override void Awake()
  100. {
  101. PhotoWindowManager.maidGuidReplaceDic = null;
  102. BaseMaidPhotoWindow[] componentsInChildren = base.transform.GetComponentsInChildren<BaseMaidPhotoWindow>(true);
  103. foreach (BaseMaidPhotoWindow baseMaidPhotoWindow in componentsInChildren)
  104. {
  105. if (!baseMaidPhotoWindow.gameObject.activeSelf)
  106. {
  107. baseMaidPhotoWindow.gameObject.SetActive(true);
  108. }
  109. }
  110. BasePhotoSubWindow[] componentsInChildren2 = base.transform.GetComponentsInChildren<BasePhotoSubWindow>(true);
  111. foreach (BasePhotoSubWindow basePhotoSubWindow in componentsInChildren2)
  112. {
  113. if (!basePhotoSubWindow.gameObject.activeSelf)
  114. {
  115. basePhotoSubWindow.gameObject.SetActive(true);
  116. }
  117. }
  118. base.Awake();
  119. }
  120. public override void Start()
  121. {
  122. Dictionary<PhotoWindowManager.WindowType, int> indexDic = new Dictionary<PhotoWindowManager.WindowType, int>();
  123. for (int i = 0; i < PhotoWindowManager.deserializeWindowArray.Length; i++)
  124. {
  125. indexDic.Add(PhotoWindowManager.deserializeWindowArray[i], i);
  126. }
  127. this.window_dic_.Sort((KeyValuePair<BasePhotoWindow, int> a, KeyValuePair<BasePhotoWindow, int> b) => indexDic[(a.Key as PhotoWindow).Type] - indexDic[(b.Key as PhotoWindow).Type]);
  128. base.Start();
  129. this.maid_store_data_.Clear();
  130. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  131. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  132. this.SaveAndLoadManager.folder_path = PhotoWindowManager.path_photo_save;
  133. this.SaveAndLoadManager.onSerializeEvent = new Func<XElement>(this.OnSerializeEvent);
  134. this.SaveAndLoadManager.onDeserializeEvent = new Action<XElement>(this.OnDeserializeEvent);
  135. this.is_first_ = true;
  136. }
  137. public virtual void Update()
  138. {
  139. if (this.is_first_)
  140. {
  141. this.OnMaidChangeEvent(null);
  142. this.is_first_ = false;
  143. uGUITutorialPanel.OpenTutorial("ScenePhotoMode", null, false);
  144. GameMain.Instance.SysShortcut.strSceneHelpName = "ScenePhotoMode";
  145. }
  146. }
  147. public void CallTutorial()
  148. {
  149. uGUITutorialPanel.OpenTutorial("ScenePhotoMode", null, true);
  150. }
  151. public void OpenSavePanel()
  152. {
  153. if (this.SaveAndLoadManager != null)
  154. {
  155. this.SaveAndLoadManager.Open(true);
  156. }
  157. }
  158. public void OpenLoadPanel()
  159. {
  160. if (this.SaveAndLoadManager != null)
  161. {
  162. this.SaveAndLoadManager.Open(false);
  163. }
  164. }
  165. protected override bool OnAddWindow(BasePhotoWindow add_win)
  166. {
  167. InterfaceMaidPhotoWindow interfaceMaidPhotoWindow = add_win as InterfaceMaidPhotoWindow;
  168. return interfaceMaidPhotoWindow != null;
  169. }
  170. public PhotoWindow GetWindow(PhotoWindowManager.WindowType window_type)
  171. {
  172. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  173. {
  174. InterfaceMaidPhotoWindow interfaceMaidPhotoWindow = keyValuePair.Key as InterfaceMaidPhotoWindow;
  175. if (interfaceMaidPhotoWindow != null)
  176. {
  177. if (interfaceMaidPhotoWindow.window_type == window_type)
  178. {
  179. return keyValuePair.Key as PhotoWindow;
  180. }
  181. }
  182. }
  183. return null;
  184. }
  185. public void OnMaidChangeEvent(Maid maid)
  186. {
  187. this.select_maid_ = maid;
  188. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  189. {
  190. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidChangeEvent(maid);
  191. }
  192. }
  193. public void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
  194. {
  195. if (!this.maid_store_data_.ContainsKey(maid.status.guid))
  196. {
  197. this.maid_store_data_.Add(maid.status.guid, new Dictionary<string, Dictionary<string, string>>());
  198. }
  199. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  200. {
  201. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidAddEvent(maid, is_deserialize_load);
  202. }
  203. }
  204. public void OnFinishMaidDeserializeLoad()
  205. {
  206. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  207. {
  208. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnFinishMaidDeserializeLoad();
  209. }
  210. }
  211. public void OnMaidRemoveEvent(Maid maid)
  212. {
  213. if (this.maid_store_data_.ContainsKey(maid.status.guid))
  214. {
  215. this.maid_store_data_.Remove(maid.status.guid);
  216. }
  217. if (maid == this.select_maid_)
  218. {
  219. this.select_maid_ = null;
  220. }
  221. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  222. {
  223. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidRemoveEvent(maid);
  224. }
  225. }
  226. public void OnMaidRemoveEventPrev(Maid maid)
  227. {
  228. if (maid == this.select_maid_)
  229. {
  230. this.select_maid_ = null;
  231. }
  232. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  233. {
  234. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidRemoveEventPrev(maid);
  235. }
  236. }
  237. public Dictionary<string, string> GetMaidStoreData(Maid maid, PhotoWindow photo_window)
  238. {
  239. if (maid == null)
  240. {
  241. return null;
  242. }
  243. return this.GetMaidStoreData(maid.status.guid, photo_window);
  244. }
  245. public Dictionary<string, string> GetMaidStoreData(string maid_guid, PhotoWindow photo_window)
  246. {
  247. if (string.IsNullOrEmpty(maid_guid))
  248. {
  249. return null;
  250. }
  251. if (!this.maid_store_data_[maid_guid].ContainsKey(photo_window.Type.ToString()))
  252. {
  253. this.maid_store_data_[maid_guid].Add(photo_window.Type.ToString(), new Dictionary<string, string>());
  254. }
  255. return this.maid_store_data_[maid_guid][photo_window.Type.ToString()];
  256. }
  257. public List<string> GetMaidStoreGuidList()
  258. {
  259. List<string> list = new List<string>();
  260. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair in this.maid_store_data_)
  261. {
  262. list.Add(keyValuePair.Key);
  263. }
  264. return list;
  265. }
  266. public XElement OnSerializeEvent()
  267. {
  268. List<InterfaceMaidPhotoWindow> list = new List<InterfaceMaidPhotoWindow>();
  269. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  270. {
  271. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnSerializeEvent();
  272. }
  273. CameraMain mainCamera = GameMain.Instance.MainCamera;
  274. this.world_store_data_["カメラ"] = new Dictionary<string, Dictionary<string, string>>();
  275. this.world_store_data_["カメラ"]["transform"] = new Dictionary<string, string>();
  276. this.world_store_data_["カメラ"]["transform"]["target_position"] = mainCamera.GetTargetPos().ToString("G9");
  277. this.world_store_data_["カメラ"]["transform"]["distance"] = mainCamera.GetDistance().ToString("G9");
  278. this.world_store_data_["カメラ"]["transform"]["rotation"] = mainCamera.GetAroundAngle().ToString("G9");
  279. List<XElement> list2 = new List<XElement>();
  280. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair2 in this.world_store_data_)
  281. {
  282. string key = keyValuePair2.Key;
  283. Dictionary<string, Dictionary<string, string>> value = keyValuePair2.Value;
  284. List<XElement> list3 = new List<XElement>();
  285. foreach (KeyValuePair<string, Dictionary<string, string>> keyValuePair3 in value)
  286. {
  287. string key2 = keyValuePair3.Key;
  288. List<XElement> list4 = new List<XElement>();
  289. foreach (KeyValuePair<string, string> keyValuePair4 in keyValuePair3.Value)
  290. {
  291. string key3 = keyValuePair4.Key;
  292. string value2 = keyValuePair4.Value;
  293. XElement xelement = new XElement("elm", value2);
  294. xelement.SetAttributeValue("name", key3);
  295. list4.Add(xelement);
  296. }
  297. XElement xelement2 = new XElement("Category");
  298. xelement2.SetAttributeValue("name", key2);
  299. xelement2.Add(list4.ToArray());
  300. list3.Add(xelement2);
  301. }
  302. XElement xelement3 = new XElement("Type");
  303. xelement3.SetAttributeValue("name", key);
  304. xelement3.Add(list3);
  305. list2.Add(xelement3);
  306. }
  307. XElement xelement4 = new XElement("World", list2.ToArray());
  308. Dictionary<string, Dictionary<string, Dictionary<string, string>>> dictionary = this.maid_store_data_;
  309. List<XElement> list5 = new List<XElement>();
  310. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair5 in this.maid_store_data_)
  311. {
  312. int num = -1;
  313. string key4 = keyValuePair5.Key;
  314. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(key4);
  315. if (maid == null)
  316. {
  317. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetManCount(); i++)
  318. {
  319. Maid man = GameMain.Instance.CharacterMgr.GetMan(i);
  320. if (man != null && man.status.guid == key4)
  321. {
  322. num = i;
  323. maid = man;
  324. break;
  325. }
  326. }
  327. }
  328. if (maid == null)
  329. {
  330. Debug.Log("GUIDからMaidを探せなかったので保存されませんでした\n" + key4);
  331. }
  332. else
  333. {
  334. if (!keyValuePair5.Value.ContainsKey(PhotoWindowManager.WindowType.Placement.ToString()))
  335. {
  336. keyValuePair5.Value[PhotoWindowManager.WindowType.Placement.ToString()] = new Dictionary<string, string>();
  337. }
  338. Dictionary<string, string> dictionary2 = keyValuePair5.Value[PhotoWindowManager.WindowType.Placement.ToString()];
  339. dictionary2["position"] = maid.gameObject.transform.position.ToString("G9");
  340. dictionary2["rotation"] = maid.gameObject.transform.rotation.ToString("G9");
  341. dictionary2["scale"] = maid.gameObject.transform.localScale.ToString("G9");
  342. dictionary2["visible"] = (maid.transform.GetChild(0).localScale.x != 0f).ToString();
  343. List<XElement> list6 = new List<XElement>();
  344. foreach (KeyValuePair<string, Dictionary<string, string>> keyValuePair6 in keyValuePair5.Value)
  345. {
  346. XElement xelement5 = new XElement("Type");
  347. xelement5.SetAttributeValue("name", keyValuePair6.Key);
  348. List<XElement> list7 = new List<XElement>();
  349. foreach (KeyValuePair<string, string> keyValuePair7 in keyValuePair6.Value)
  350. {
  351. string key5 = keyValuePair7.Key;
  352. string value3 = keyValuePair7.Value;
  353. XElement xelement6 = new XElement("elm", value3);
  354. xelement6.SetAttributeValue("name", key5);
  355. list7.Add(xelement6);
  356. }
  357. xelement5.Add(list7.ToArray());
  358. list6.Add(xelement5);
  359. }
  360. XElement xelement7 = new XElement("Maid");
  361. xelement7.SetAttributeValue("guid", key4);
  362. List<XElement> list8 = new List<XElement>();
  363. NamePair charaName = maid.status.charaName;
  364. list8.Add(new XElement("name", charaName.name1 + " " + charaName.name2));
  365. if (maid.boMAN)
  366. {
  367. list8.Add(new XElement("man_sloat", num.ToString()));
  368. }
  369. xelement7.Add(list8.ToArray());
  370. xelement7.Add(list6.ToArray());
  371. list5.Add(xelement7);
  372. }
  373. }
  374. XElement xelement8 = new XElement("Maids", list5.ToArray());
  375. return new XElement("PhotSetting", new object[]
  376. {
  377. xelement4,
  378. xelement8
  379. });
  380. }
  381. public List<InterfaceMaidPhotoWindow> GetDeserializeWindowList()
  382. {
  383. List<InterfaceMaidPhotoWindow> list = new List<InterfaceMaidPhotoWindow>();
  384. for (int i = 0; i < PhotoWindowManager.deserializeWindowArray.Length; i++)
  385. {
  386. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  387. {
  388. if ((keyValuePair.Key as InterfaceMaidPhotoWindow).window_type == PhotoWindowManager.deserializeWindowArray[i])
  389. {
  390. list.Add(keyValuePair.Key as InterfaceMaidPhotoWindow);
  391. break;
  392. }
  393. }
  394. }
  395. return list;
  396. }
  397. public void OnDeserializeEvent(XElement xml_data)
  398. {
  399. List<InterfaceMaidPhotoWindow> call_window_list = this.GetDeserializeWindowList();
  400. for (int i = 0; i < call_window_list.Count; i++)
  401. {
  402. call_window_list[i].OnReset();
  403. }
  404. XElement xelement = xml_data.Element("PhotSetting");
  405. XElement xelement2 = xelement.Element("World");
  406. XElement xelement3 = xelement.Element("Maids");
  407. this.world_store_data_.Clear();
  408. foreach (XElement xelement4 in xelement2.Elements("Type"))
  409. {
  410. string value = xelement4.Attribute("name").Value;
  411. this.world_store_data_[value] = new Dictionary<string, Dictionary<string, string>>();
  412. foreach (XElement xelement5 in xelement4.Elements("Category"))
  413. {
  414. string value2 = xelement5.Attribute("name").Value;
  415. this.world_store_data_[value][value2] = new Dictionary<string, string>();
  416. foreach (XElement xelement6 in xelement5.Elements("elm"))
  417. {
  418. this.world_store_data_[value][value2].Add(xelement6.Attribute("name").Value, xelement6.Value);
  419. }
  420. }
  421. }
  422. this.maid_store_data_.Clear();
  423. List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
  424. foreach (XElement xelement7 in xelement3.Elements("Maid"))
  425. {
  426. bool flag = xelement7.Element("man_sloat") != null;
  427. int nManNo = (!flag) ? 0 : int.Parse(xelement7.Element("man_sloat").Value);
  428. string key = xelement7.Attribute("guid").Value;
  429. string value3 = xelement7.Element("name").Value;
  430. if (flag)
  431. {
  432. Maid man = GameMain.Instance.CharacterMgr.GetMan(nManNo);
  433. if (man == null)
  434. {
  435. continue;
  436. }
  437. key = man.status.guid;
  438. }
  439. this.maid_store_data_[key] = new Dictionary<string, Dictionary<string, string>>();
  440. foreach (XElement xelement8 in xelement7.Elements("Type"))
  441. {
  442. string value4 = xelement8.Attribute("name").Value;
  443. this.maid_store_data_[key][value4] = new Dictionary<string, string>();
  444. foreach (XElement xelement9 in xelement8.Elements("elm"))
  445. {
  446. this.maid_store_data_[key][value4].Add(xelement9.Attribute("name").Value, xelement9.Value);
  447. }
  448. }
  449. if (!flag)
  450. {
  451. list.Add(new KeyValuePair<string, string>(key, value3));
  452. }
  453. else
  454. {
  455. this.maid_store_data_[key]["is_man"] = new Dictionary<string, string>();
  456. this.maid_store_data_[key]["is_man"].Add("no", nManNo.ToString());
  457. }
  458. }
  459. this.SaveAndLoadManager.LoadReplaceMaidPanel.OnReplaceEndEvent = delegate(Dictionary<string, Maid> replace_dic)
  460. {
  461. PhotoWindowManager.maidGuidReplaceDic = new Dictionary<string, string>();
  462. foreach (KeyValuePair<string, Maid> keyValuePair in replace_dic)
  463. {
  464. Dictionary<string, Dictionary<string, string>> value5 = this.maid_store_data_[keyValuePair.Key];
  465. this.maid_store_data_.Remove(keyValuePair.Key);
  466. if (keyValuePair.Value != null)
  467. {
  468. this.maid_store_data_[keyValuePair.Value.status.guid] = value5;
  469. }
  470. PhotoWindowManager.maidGuidReplaceDic.Add(keyValuePair.Key, (!(keyValuePair.Value != null)) ? string.Empty : keyValuePair.Value.status.guid);
  471. }
  472. for (int j = 0; j < call_window_list.Count; j++)
  473. {
  474. call_window_list[j].OnDeserializeEvent();
  475. }
  476. PhotoWindowManager.maidGuidReplaceDic = null;
  477. };
  478. this.SaveAndLoadManager.LoadReplaceMaidPanel.CheckAndStart(list);
  479. Dictionary<string, string> dictionary = this.world_store_data_["カメラ"]["transform"];
  480. GameMain.Instance.MainCamera.SetTargetPos(Parse.Vector3(dictionary["target_position"]), true);
  481. GameMain.Instance.MainCamera.SetDistance(float.Parse(dictionary["distance"]), true);
  482. GameMain.Instance.MainCamera.SetAroundAngle(Parse.Vector2(dictionary["rotation"]), true);
  483. }
  484. public void ScreenShot()
  485. {
  486. GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
  487. GameMain.Instance.MainCamera.ScreenShot(true);
  488. }
  489. public void AllCloseWindow()
  490. {
  491. GameObject childObject = UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent", false);
  492. WindowPartsWindowVisible[] componentsInChildren = childObject.GetComponentsInChildren<WindowPartsWindowVisible>();
  493. for (int i = 0; i < componentsInChildren.Length; i++)
  494. {
  495. if (componentsInChildren[i].TargetWindow.visible)
  496. {
  497. componentsInChildren[i].TargetWindow.visible = false;
  498. }
  499. }
  500. }
  501. public void AllInitPosWindow()
  502. {
  503. GameObject childObject = UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent", false);
  504. WindowPartsWindowVisible[] componentsInChildren = childObject.GetComponentsInChildren<WindowPartsWindowVisible>();
  505. for (int i = 0; i < componentsInChildren.Length; i++)
  506. {
  507. componentsInChildren[i].TargetWindow.ResetPosition();
  508. }
  509. }
  510. public void SetUIDrawOn()
  511. {
  512. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  513. {
  514. keyValuePair.Key.gameObject.SetActive(true);
  515. }
  516. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtns/Grid", false).SetActive(true);
  517. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/Grid", false).SetActive(true);
  518. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtns/UIOFF", false).SetActive(true);
  519. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/End", false).SetActive(true);
  520. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/UION", false).SetActive(false);
  521. for (int i = 0; i < this.ui_hide_object_list_.Count; i++)
  522. {
  523. this.ui_hide_object_list_[i].SetActive(true);
  524. }
  525. for (int j = 0; j < this.ui_gizmo_object_list_.Count; j++)
  526. {
  527. this.ui_gizmo_object_list_[j].Visible = true;
  528. }
  529. this.ui_hide_object_list_.Clear();
  530. this.ui_gizmo_object_list_.Clear();
  531. }
  532. public void SetUIDrawOff()
  533. {
  534. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  535. {
  536. keyValuePair.Key.gameObject.SetActive(false);
  537. }
  538. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtns/Grid", false).SetActive(false);
  539. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/Grid", false).SetActive(false);
  540. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtns/UIOFF", false).SetActive(false);
  541. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/End", false).SetActive(false);
  542. UTY.GetChildObject(base.gameObject, "WindowVisibleBtnsParent/WindowVisibleBtnsLine2/UION", false).SetActive(true);
  543. this.ui_hide_object_list_.Clear();
  544. GameObject gameObject = GameObject.Find("WorldTransformAxisParent");
  545. if (gameObject != null)
  546. {
  547. Transform transform = gameObject.transform;
  548. for (int i = 0; i < transform.childCount; i++)
  549. {
  550. if (transform.gameObject.activeSelf)
  551. {
  552. transform.gameObject.SetActive(true);
  553. this.ui_hide_object_list_.Add(transform.gameObject);
  554. }
  555. }
  556. gameObject.SetActive(false);
  557. }
  558. this.ui_gizmo_object_list_.Clear();
  559. string[] array = new string[]
  560. {
  561. "BG",
  562. "Character/Active"
  563. };
  564. for (int j = 0; j < array.Length; j++)
  565. {
  566. GameObject childObject = UTY.GetChildObject(GameMain.Instance.gameObject, array[j], true);
  567. if (!(childObject == null))
  568. {
  569. GizmoRender[] componentsInChildren = childObject.GetComponentsInChildren<GizmoRender>();
  570. for (int k = 0; k < componentsInChildren.Length; k++)
  571. {
  572. if (componentsInChildren[k].Visible)
  573. {
  574. componentsInChildren[k].Visible = false;
  575. this.ui_gizmo_object_list_.Add(componentsInChildren[k]);
  576. }
  577. }
  578. }
  579. }
  580. GameObject gameObject2 = GameObject.Find("PoseEditWorkParent");
  581. if (gameObject2 != null)
  582. {
  583. GizmoRender[] componentsInChildren2 = gameObject2.GetComponentsInChildren<GizmoRender>();
  584. for (int l = 0; l < componentsInChildren2.Length; l++)
  585. {
  586. if (componentsInChildren2[l].Visible)
  587. {
  588. componentsInChildren2[l].Visible = false;
  589. this.ui_gizmo_object_list_.Add(componentsInChildren2[l]);
  590. }
  591. }
  592. }
  593. }
  594. public void OnEnd()
  595. {
  596. List<InterfaceMaidPhotoWindow> deserializeWindowList = this.GetDeserializeWindowList();
  597. for (int i = 0; i < deserializeWindowList.Count; i++)
  598. {
  599. deserializeWindowList[i].OnReset();
  600. }
  601. }
  602. public int GetActiveMaidCount()
  603. {
  604. return this.GetWindow(PhotoWindowManager.WindowType.Placement).GetComponentInChildren<PlacementWindow>().GetActiveMaidCount();
  605. }
  606. public Maid select_maid
  607. {
  608. get
  609. {
  610. return this.select_maid_;
  611. }
  612. }
  613. protected override string save_fullpath_uidata
  614. {
  615. get
  616. {
  617. string str = UTY.gameProjectPath + "\\";
  618. string str2 = str + "PhotoModeData/SaveData";
  619. return str2 + "/PhotoModeUISetting.save";
  620. }
  621. }
  622. protected override string save_header_uidata
  623. {
  624. get
  625. {
  626. return "CM3D2_PhotoModeUISetting";
  627. }
  628. }
  629. public static PhotoWindowManager.WindowType[] deserializeWindowArray = new PhotoWindowManager.WindowType[]
  630. {
  631. PhotoWindowManager.WindowType.Sound,
  632. PhotoWindowManager.WindowType.Placement,
  633. PhotoWindowManager.WindowType.Face,
  634. PhotoWindowManager.WindowType.Motion,
  635. PhotoWindowManager.WindowType.PoseEdit,
  636. PhotoWindowManager.WindowType.BG,
  637. PhotoWindowManager.WindowType.ObjectCreate,
  638. PhotoWindowManager.WindowType.BGObject,
  639. PhotoWindowManager.WindowType.Light,
  640. PhotoWindowManager.WindowType.ObjectManager,
  641. PhotoWindowManager.WindowType.Effect,
  642. PhotoWindowManager.WindowType.Message,
  643. PhotoWindowManager.WindowType.ScenePreset,
  644. PhotoWindowManager.WindowType.AlignmentPreset,
  645. PhotoWindowManager.WindowType.MaidItem,
  646. PhotoWindowManager.WindowType.Undressing,
  647. PhotoWindowManager.WindowType.GravityContro
  648. };
  649. public PhotoModeSaveAndLoad SaveAndLoadManager;
  650. public UIButton EndButton;
  651. public Action<Maid> CallEditSceneFunction;
  652. public List<Action<Maid>> onMaidChangeEventList = new List<Action<Maid>>();
  653. private bool is_first_;
  654. private Maid select_maid_;
  655. private Dictionary<string, Dictionary<string, Dictionary<string, string>>> maid_store_data_ = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>();
  656. private List<GameObject> ui_hide_object_list_ = new List<GameObject>();
  657. private List<GizmoRender> ui_gizmo_object_list_ = new List<GizmoRender>();
  658. public enum WindowType
  659. {
  660. ObjectManager,
  661. BG,
  662. Placement,
  663. Motion,
  664. Face,
  665. BGObject,
  666. MaidItem,
  667. Light,
  668. Undressing,
  669. Effect,
  670. Sound,
  671. PoseEdit,
  672. Message,
  673. ScenePreset,
  674. AlignmentPreset,
  675. ObjectCreate,
  676. GravityContro
  677. }
  678. }