PhotoWindowManager.cs 23 KB

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