PhotoWindowManager.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  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 Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "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. }
  136. public void Initialize()
  137. {
  138. this.OnMaidChangeEvent(null);
  139. uGUITutorialPanel.OpenTutorial("ScenePhotoMode", null, false);
  140. GameMain.Instance.SysShortcut.strSceneHelpName = "ScenePhotoMode";
  141. }
  142. public virtual void Update()
  143. {
  144. }
  145. public void CallTutorial()
  146. {
  147. uGUITutorialPanel.OpenTutorial("ScenePhotoMode", null, true);
  148. }
  149. public void OpenSavePanel()
  150. {
  151. if (this.SaveAndLoadManager != null)
  152. {
  153. this.SaveAndLoadManager.Open(true);
  154. }
  155. }
  156. public void OpenLoadPanel()
  157. {
  158. if (this.SaveAndLoadManager != null)
  159. {
  160. this.SaveAndLoadManager.Open(false);
  161. }
  162. }
  163. protected override bool OnAddWindow(BasePhotoWindow add_win)
  164. {
  165. InterfaceMaidPhotoWindow interfaceMaidPhotoWindow = add_win as InterfaceMaidPhotoWindow;
  166. return interfaceMaidPhotoWindow != null;
  167. }
  168. public PhotoWindow GetWindow(PhotoWindowManager.WindowType window_type)
  169. {
  170. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  171. {
  172. InterfaceMaidPhotoWindow interfaceMaidPhotoWindow = keyValuePair.Key as InterfaceMaidPhotoWindow;
  173. if (interfaceMaidPhotoWindow != null)
  174. {
  175. if (interfaceMaidPhotoWindow.window_type == window_type)
  176. {
  177. return keyValuePair.Key as PhotoWindow;
  178. }
  179. }
  180. }
  181. return null;
  182. }
  183. public void OnMaidChangeEvent(Maid maid)
  184. {
  185. this.select_maid_ = maid;
  186. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  187. {
  188. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidChangeEvent(maid);
  189. }
  190. }
  191. public void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
  192. {
  193. if (!this.maid_store_data_.ContainsKey(maid.status.guid))
  194. {
  195. this.maid_store_data_.Add(maid.status.guid, new Dictionary<string, Dictionary<string, string>>());
  196. }
  197. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  198. {
  199. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidAddEvent(maid, is_deserialize_load);
  200. }
  201. }
  202. public void OnFinishMaidDeserializeLoad()
  203. {
  204. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  205. {
  206. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnFinishMaidDeserializeLoad();
  207. }
  208. }
  209. public void OnMaidRemoveEvent(Maid maid)
  210. {
  211. if (this.maid_store_data_.ContainsKey(maid.status.guid))
  212. {
  213. this.maid_store_data_.Remove(maid.status.guid);
  214. }
  215. if (maid == this.select_maid_)
  216. {
  217. this.select_maid_ = null;
  218. }
  219. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  220. {
  221. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidRemoveEvent(maid);
  222. }
  223. }
  224. public void OnMaidRemoveEventPrev(Maid maid)
  225. {
  226. if (maid == this.select_maid_)
  227. {
  228. this.select_maid_ = null;
  229. }
  230. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  231. {
  232. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnMaidRemoveEventPrev(maid);
  233. }
  234. }
  235. public Dictionary<string, string> GetMaidStoreData(Maid maid, PhotoWindow photo_window)
  236. {
  237. if (maid == null)
  238. {
  239. return null;
  240. }
  241. return this.GetMaidStoreData(maid.status.guid, photo_window);
  242. }
  243. public Dictionary<string, string> GetMaidStoreData(string maid_guid, PhotoWindow photo_window)
  244. {
  245. if (string.IsNullOrEmpty(maid_guid))
  246. {
  247. return null;
  248. }
  249. if (!this.maid_store_data_[maid_guid].ContainsKey(photo_window.Type.ToString()))
  250. {
  251. this.maid_store_data_[maid_guid].Add(photo_window.Type.ToString(), new Dictionary<string, string>());
  252. }
  253. return this.maid_store_data_[maid_guid][photo_window.Type.ToString()];
  254. }
  255. public List<string> GetMaidStoreGuidList()
  256. {
  257. List<string> list = new List<string>();
  258. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair in this.maid_store_data_)
  259. {
  260. list.Add(keyValuePair.Key);
  261. }
  262. return list;
  263. }
  264. public XElement OnSerializeEvent()
  265. {
  266. List<InterfaceMaidPhotoWindow> list = new List<InterfaceMaidPhotoWindow>();
  267. foreach (KeyValuePair<BasePhotoWindow, int> keyValuePair in this.window_dic_)
  268. {
  269. (keyValuePair.Key as InterfaceMaidPhotoWindow).OnSerializeEvent();
  270. }
  271. CameraMain mainCamera = GameMain.Instance.MainCamera;
  272. this.world_store_data_["カメラ"] = new Dictionary<string, Dictionary<string, string>>();
  273. this.world_store_data_["カメラ"]["transform"] = new Dictionary<string, string>();
  274. this.world_store_data_["カメラ"]["transform"]["target_position"] = mainCamera.GetTargetPos().ToString("G9");
  275. this.world_store_data_["カメラ"]["transform"]["distance"] = mainCamera.GetDistance().ToString("G9");
  276. this.world_store_data_["カメラ"]["transform"]["rotation"] = mainCamera.GetAroundAngle().ToString("G9");
  277. List<XElement> list2 = new List<XElement>();
  278. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair2 in this.world_store_data_)
  279. {
  280. string key = keyValuePair2.Key;
  281. Dictionary<string, Dictionary<string, string>> value = keyValuePair2.Value;
  282. List<XElement> list3 = new List<XElement>();
  283. foreach (KeyValuePair<string, Dictionary<string, string>> keyValuePair3 in value)
  284. {
  285. string key2 = keyValuePair3.Key;
  286. List<XElement> list4 = new List<XElement>();
  287. foreach (KeyValuePair<string, string> keyValuePair4 in keyValuePair3.Value)
  288. {
  289. string key3 = keyValuePair4.Key;
  290. string value2 = keyValuePair4.Value;
  291. XElement xelement = new XElement("elm", value2);
  292. xelement.SetAttributeValue("name", key3);
  293. list4.Add(xelement);
  294. }
  295. XElement xelement2 = new XElement("Category");
  296. xelement2.SetAttributeValue("name", key2);
  297. xelement2.Add(list4.ToArray());
  298. list3.Add(xelement2);
  299. }
  300. XElement xelement3 = new XElement("Type");
  301. xelement3.SetAttributeValue("name", key);
  302. xelement3.Add(list3);
  303. list2.Add(xelement3);
  304. }
  305. XElement xelement4 = new XElement("World", list2.ToArray());
  306. Dictionary<string, Dictionary<string, Dictionary<string, string>>> dictionary = this.maid_store_data_;
  307. List<XElement> list5 = new List<XElement>();
  308. foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, string>>> keyValuePair5 in this.maid_store_data_)
  309. {
  310. int num = -1;
  311. string key4 = keyValuePair5.Key;
  312. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(key4);
  313. if (maid == null)
  314. {
  315. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetManCount(); i++)
  316. {
  317. Maid man = GameMain.Instance.CharacterMgr.GetMan(i);
  318. if (man != null && man.status.guid == key4)
  319. {
  320. num = i;
  321. maid = man;
  322. break;
  323. }
  324. }
  325. }
  326. if (maid == null)
  327. {
  328. Debug.Log("GUIDからMaidを探せなかったので保存されませんでした\n" + key4);
  329. }
  330. else
  331. {
  332. if (!keyValuePair5.Value.ContainsKey(PhotoWindowManager.WindowType.Placement.ToString()))
  333. {
  334. keyValuePair5.Value[PhotoWindowManager.WindowType.Placement.ToString()] = new Dictionary<string, string>();
  335. }
  336. Dictionary<string, string> dictionary2 = keyValuePair5.Value[PhotoWindowManager.WindowType.Placement.ToString()];
  337. dictionary2["position"] = maid.gameObject.transform.position.ToString("G9");
  338. dictionary2["rotation"] = maid.gameObject.transform.rotation.ToString("G9");
  339. dictionary2["scale"] = maid.gameObject.transform.localScale.ToString("G9");
  340. dictionary2["visible"] = (maid.transform.GetChild(0).localScale.x != 0f).ToString();
  341. List<XElement> list6 = new List<XElement>();
  342. foreach (KeyValuePair<string, Dictionary<string, string>> keyValuePair6 in keyValuePair5.Value)
  343. {
  344. XElement xelement5 = new XElement("Type");
  345. xelement5.SetAttributeValue("name", keyValuePair6.Key);
  346. List<XElement> list7 = new List<XElement>();
  347. foreach (KeyValuePair<string, string> keyValuePair7 in keyValuePair6.Value)
  348. {
  349. string key5 = keyValuePair7.Key;
  350. string value3 = keyValuePair7.Value;
  351. XElement xelement6 = new XElement("elm", value3);
  352. xelement6.SetAttributeValue("name", key5);
  353. list7.Add(xelement6);
  354. }
  355. xelement5.Add(list7.ToArray());
  356. list6.Add(xelement5);
  357. }
  358. XElement xelement7 = new XElement("Maid");
  359. xelement7.SetAttributeValue("guid", key4);
  360. List<XElement> list8 = new List<XElement>();
  361. NamePair charaName = maid.status.charaName;
  362. list8.Add(new XElement("name", charaName.name1 + " " + charaName.name2));
  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 str = Path.Combine(PhotoWindowManager.path_photo_folder, "SaveData");
  616. return str + "/PhotoModeUISetting.save";
  617. }
  618. }
  619. protected override string save_header_uidata
  620. {
  621. get
  622. {
  623. return "CM3D2_PhotoModeUISetting";
  624. }
  625. }
  626. public static PhotoWindowManager.WindowType[] deserializeWindowArray = new PhotoWindowManager.WindowType[]
  627. {
  628. PhotoWindowManager.WindowType.Sound,
  629. PhotoWindowManager.WindowType.Placement,
  630. PhotoWindowManager.WindowType.Face,
  631. PhotoWindowManager.WindowType.Motion,
  632. PhotoWindowManager.WindowType.PoseEdit,
  633. PhotoWindowManager.WindowType.BG,
  634. PhotoWindowManager.WindowType.ObjectCreate,
  635. PhotoWindowManager.WindowType.BGObject,
  636. PhotoWindowManager.WindowType.Light,
  637. PhotoWindowManager.WindowType.ObjectManager,
  638. PhotoWindowManager.WindowType.Effect,
  639. PhotoWindowManager.WindowType.Message,
  640. PhotoWindowManager.WindowType.ScenePreset,
  641. PhotoWindowManager.WindowType.AlignmentPreset,
  642. PhotoWindowManager.WindowType.MaidItem,
  643. PhotoWindowManager.WindowType.Undressing,
  644. PhotoWindowManager.WindowType.GravityContro
  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 Maid select_maid_;
  651. private Dictionary<string, Dictionary<string, Dictionary<string, string>>> maid_store_data_ = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>();
  652. private List<GameObject> ui_hide_object_list_ = new List<GameObject>();
  653. private List<GizmoRender> ui_gizmo_object_list_ = new List<GizmoRender>();
  654. public enum WindowType
  655. {
  656. ObjectManager,
  657. BG,
  658. Placement,
  659. Motion,
  660. Face,
  661. BGObject,
  662. MaidItem,
  663. Light,
  664. Undressing,
  665. Effect,
  666. Sound,
  667. PoseEdit,
  668. Message,
  669. ScenePreset,
  670. AlignmentPreset,
  671. ObjectCreate,
  672. GravityContro
  673. }
  674. }