FaceWindow.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using wf;
  5. public class FaceWindow : BaseMaidPhotoWindow
  6. {
  7. public override void Awake()
  8. {
  9. base.Awake();
  10. PhotoFaceData.Create();
  11. this.noCharaActive = base.GetComponentInChildren<PhotoNoCharaActive>();
  12. Dictionary<string, List<KeyValuePair<string, object>>> dictionary = new Dictionary<string, List<KeyValuePair<string, object>>>();
  13. foreach (KeyValuePair<string, List<PhotoFaceData>> keyValuePair in PhotoFaceData.category_list)
  14. {
  15. if (!dictionary.ContainsKey(keyValuePair.Key))
  16. {
  17. dictionary.Add(keyValuePair.Key, new List<KeyValuePair<string, object>>());
  18. }
  19. for (int i = 0; i < keyValuePair.Value.Count; i++)
  20. {
  21. dictionary[keyValuePair.Key].Add(new KeyValuePair<string, object>(keyValuePair.Value[i].name, keyValuePair.Value[i]));
  22. }
  23. }
  24. this.PopupAndTabList.SetData(dictionary, false);
  25. this.PopupAndTabList.onChangePopUpListValue.Add(new Action<KeyValuePair<string, UnityEngine.Object>>(this.OnChangePopUpList));
  26. this.PopupAndTabList.onSelect.Add(new Action<object>(this.OnSelectItem));
  27. this.SliderFaceToX.onChangeValue.Add(new Action<WindowPartsInputSliderSet.SliderAndInputSet, float>(this.OnChangeSliderXValue));
  28. this.SliderFaceToY.onChangeValue.Add(new Action<WindowPartsInputSliderSet.SliderAndInputSet, float>(this.OnChangeSliderYValue));
  29. this.CheckBoxEyeToCamera.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
  30. this.CheckBoxFaceToCamera.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
  31. this.CheckOpenMouse.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
  32. this.CheckMorphWindowVisible.onClick.Add(delegate(WFCheckBox check_box)
  33. {
  34. this.MorphSubWindow.visible = check_box.check;
  35. });
  36. UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = false;
  37. }
  38. public override void Start()
  39. {
  40. base.Start();
  41. this.placement_window_ = (base.mgr.GetWindow(PhotoWindowManager.WindowType.Placement) as PlacementWindow);
  42. this.motion_window_ = (base.mgr.GetWindow(PhotoWindowManager.WindowType.Motion) as MotionWindow);
  43. this.man_edit_mgr_ = new PhotoManEditManager();
  44. List<SceneEdit.SMenuItem>[] array = new List<SceneEdit.SMenuItem>[]
  45. {
  46. this.man_edit_mgr_.man_head_menu_list,
  47. this.man_edit_mgr_.man_body_menu_list
  48. };
  49. UIWFTabPanel[] array2 = new UIWFTabPanel[]
  50. {
  51. this.HeadItemTabPanel,
  52. this.BodyItemTabPanel
  53. };
  54. EventDelegate.Callback[] array3 = new EventDelegate.Callback[]
  55. {
  56. new EventDelegate.Callback(this.OnSelectManHeadItem),
  57. new EventDelegate.Callback(this.OnSelectManHeadItem)
  58. };
  59. for (int i = 0; i < array.Length; i++)
  60. {
  61. UIWFTabPanel uiwftabPanel = array2[i];
  62. EventDelegate.Callback callback = array3[i];
  63. foreach (SceneEdit.SMenuItem smenuItem in array[i])
  64. {
  65. GameObject gameObject = Utility.CreatePrefab(uiwftabPanel.gameObject, "ScenePhotoMode/EditItemIcon", true);
  66. if (smenuItem.m_texIcon != null)
  67. {
  68. Sprite sprite2D = Sprite.Create(smenuItem.m_texIcon, new Rect(0f, 0f, (float)smenuItem.m_texIcon.width, (float)smenuItem.m_texIcon.height), default(Vector2));
  69. UI2DSprite componentInChildren = gameObject.GetComponentInChildren<UI2DSprite>();
  70. componentInChildren.sprite2D = sprite2D;
  71. componentInChildren.SetDimensions(60, 60);
  72. }
  73. UIWFTabButton component = gameObject.GetComponent<UIWFTabButton>();
  74. component.name = smenuItem.m_nMenuFileRID.ToString();
  75. EventDelegate.Add(component.onSelect, callback);
  76. }
  77. Utility.ResetNGUI(uiwftabPanel.GetComponent<UIGrid>());
  78. Utility.ResetNGUI(uiwftabPanel.transform.parent.GetComponent<UIScrollView>());
  79. uiwftabPanel.UpdateChildren();
  80. }
  81. this.UpdateChildren();
  82. WFCheckBox checkBoxEyeToCamera = this.CheckBoxEyeToCamera;
  83. bool flag = false;
  84. this.SliderFaceToY.enabled = flag;
  85. flag = flag;
  86. this.SliderFaceToX.enabled = flag;
  87. flag = flag;
  88. this.CheckOpenMouse.enabled = flag;
  89. flag = flag;
  90. this.CheckBoxFaceToCamera.enabled = flag;
  91. checkBoxEyeToCamera.enabled = flag;
  92. this.add_option_dic_ = new Dictionary<string, WFCheckBox>();
  93. Transform transform = UTY.GetChildObject(this.content_game_object.gameObject, "ContentParent/AddOption/Btns", false).transform;
  94. for (int j = 0; j < transform.childCount; j++)
  95. {
  96. WFCheckBox component2 = transform.GetChild(j).GetComponent<WFCheckBox>();
  97. component2.check = false;
  98. component2.enabled = false;
  99. this.add_option_dic_.Add(component2.GetComponentInChildren<UILabel>().text, component2);
  100. component2.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBoxAddOption));
  101. }
  102. this.CheckOpenMouse.check = false;
  103. WFCheckBox checkMorphWindowVisible = this.CheckMorphWindowVisible;
  104. flag = false;
  105. this.CheckMorphWindowVisible.enabled = flag;
  106. checkMorphWindowVisible.check = flag;
  107. this.MorphSubWindow.gameObject.SetActive(true);
  108. this.MorphSubWindow.SetButtonEnabled(BasePhotoSubWindow.BtnType.End, true, false);
  109. this.MorphSubWindow.GetButtonOnClickEventList(BasePhotoSubWindow.BtnType.End).Add(delegate
  110. {
  111. this.CheckMorphWindowVisible.check = false;
  112. foreach (Action<WFCheckBox> action in this.CheckMorphWindowVisible.onClick)
  113. {
  114. action(this.CheckMorphWindowVisible);
  115. }
  116. });
  117. this.ContentParentMan.SetActive(false);
  118. this.FaceMorphInput.SetFaceWindow(this);
  119. this.noCharaActive.ChangeMode(true, true);
  120. }
  121. public void OnDestroy()
  122. {
  123. if (this.man_edit_mgr_ != null)
  124. {
  125. this.man_edit_mgr_.Destroy();
  126. }
  127. this.man_edit_mgr_ = null;
  128. }
  129. public void OnClickCheckBoxAddOption(WFCheckBox check_box)
  130. {
  131. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
  132. string[] array = new string[]
  133. {
  134. "頬染め1",
  135. "頬染め2",
  136. "頬染め3"
  137. };
  138. string[] array2 = new string[]
  139. {
  140. "涙1",
  141. "涙2",
  142. "涙3"
  143. };
  144. string[][] array3 = new string[][]
  145. {
  146. array,
  147. array2
  148. };
  149. foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
  150. {
  151. if (keyValuePair.Value == check_box)
  152. {
  153. maidStoreData[keyValuePair.Key] = check_box.check.ToString();
  154. foreach (string array4 in array3)
  155. {
  156. if (0 <= Array.IndexOf<string>(array4, keyValuePair.Key))
  157. {
  158. for (int j = 0; j < array4.Length; j++)
  159. {
  160. if (!(array4[j] == keyValuePair.Key))
  161. {
  162. if (this.add_option_dic_[array4[j]].check)
  163. {
  164. this.add_option_dic_[array4[j]].check = false;
  165. }
  166. maidStoreData[array4[j]] = false.ToString();
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. this.UpdateMaidAddOption();
  174. }
  175. public void OnClickCheckBox(WFCheckBox check_box)
  176. {
  177. if (base.mgr.select_maid == null)
  178. {
  179. return;
  180. }
  181. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
  182. if (check_box == this.CheckBoxEyeToCamera)
  183. {
  184. maidStoreData["eye_to_camera"] = check_box.check.ToString();
  185. }
  186. else if (check_box == this.CheckBoxFaceToCamera)
  187. {
  188. maidStoreData["face_to_camera"] = check_box.check.ToString();
  189. }
  190. else if (check_box == this.CheckOpenMouse)
  191. {
  192. maidStoreData["open_mouse"] = check_box.check.ToString();
  193. }
  194. WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
  195. bool enabled = !this.CheckBoxFaceToCamera.check;
  196. this.SliderFaceToY.enabled = enabled;
  197. sliderFaceToX.enabled = enabled;
  198. this.Apply(base.mgr.select_maid);
  199. }
  200. public void UpdateMaidAddOption()
  201. {
  202. if (base.mgr.select_maid == null)
  203. {
  204. return;
  205. }
  206. this.Apply(base.mgr.select_maid);
  207. }
  208. public void OnChangeSliderXValue(WindowPartsInputSliderSet.SliderAndInputSet obj, float val)
  209. {
  210. if (base.mgr.select_maid == null)
  211. {
  212. return;
  213. }
  214. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
  215. maidStoreData["face_to_x"] = val.ToString("G9");
  216. WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
  217. bool enabled = !this.CheckBoxFaceToCamera.check;
  218. this.SliderFaceToY.enabled = enabled;
  219. sliderFaceToX.enabled = enabled;
  220. this.Apply(base.mgr.select_maid);
  221. }
  222. public void OnChangeSliderYValue(WindowPartsInputSliderSet.SliderAndInputSet obj, float val)
  223. {
  224. if (base.mgr.select_maid == null)
  225. {
  226. return;
  227. }
  228. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
  229. maidStoreData["face_to_y"] = val.ToString("G9");
  230. WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
  231. bool enabled = !this.CheckBoxFaceToCamera.check;
  232. this.SliderFaceToY.enabled = enabled;
  233. sliderFaceToX.enabled = enabled;
  234. this.Apply(base.mgr.select_maid);
  235. }
  236. public override void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
  237. {
  238. base.OnMaidAddEvent(maid, is_deserialize_load);
  239. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
  240. if (maid.boMAN)
  241. {
  242. this.man_controller_ = new PhotoManEditManager.Controller(maid);
  243. if (!is_deserialize_load)
  244. {
  245. maidStoreData.Add("color", this.man_controller_.color.ToString());
  246. maidStoreData.Add("fat", this.man_controller_.fat.ToString("G9"));
  247. maidStoreData.Add("parts_visible", true.ToString());
  248. maidStoreData.Add("head_menu_rid", this.man_controller_.head_menu_rid.ToString());
  249. maidStoreData.Add("body_menu_rid", this.man_controller_.body_menu_rid.ToString());
  250. }
  251. else
  252. {
  253. this.man_controller_.color = Parse.Color(maidStoreData["color"]);
  254. this.man_controller_.fat = float.Parse(maidStoreData["fat"]);
  255. this.man_controller_.parts_visible = bool.Parse(maidStoreData["parts_visible"]);
  256. int num = int.Parse(maidStoreData["head_menu_rid"]);
  257. foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
  258. {
  259. if (num == smenuItem.m_nMenuFileRID)
  260. {
  261. this.man_controller_.SetMenu(smenuItem);
  262. break;
  263. }
  264. }
  265. int num2 = int.Parse(maidStoreData["body_menu_rid"]);
  266. foreach (SceneEdit.SMenuItem smenuItem2 in this.man_edit_mgr_.man_head_menu_list)
  267. {
  268. if (num2 == smenuItem2.m_nMenuFileRID)
  269. {
  270. this.man_controller_.SetMenu(smenuItem2);
  271. this.motion_window_.UpdateAnimationData(this.man_controller_.man);
  272. break;
  273. }
  274. }
  275. }
  276. this.man_controller_ = null;
  277. return;
  278. }
  279. maid.FaceBlend("オリジナル");
  280. if (!is_deserialize_load)
  281. {
  282. maidStoreData.Clear();
  283. maidStoreData.Add("id", PhotoFaceData.init_data.id.ToString());
  284. maidStoreData.Add("eye_to_camera", true.ToString());
  285. maidStoreData.Add("face_to_camera", true.ToString());
  286. maidStoreData.Add("face_to_x", 0.ToString());
  287. maidStoreData.Add("face_to_y", 0.ToString());
  288. maidStoreData.Add("open_mouse", false.ToString());
  289. foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
  290. {
  291. maidStoreData.Add(keyValuePair.Key, false.ToString());
  292. }
  293. }
  294. else if (!maidStoreData.ContainsKey("open_mouse"))
  295. {
  296. maidStoreData.Add("open_mouse", false.ToString());
  297. }
  298. this.FaceMorphInput.OnMaidAddEvent(maid, is_deserialize_load, maidStoreData);
  299. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  300. this.Apply(maid);
  301. }
  302. public override void OnMaidChangeEvent(Maid maid)
  303. {
  304. base.OnMaidChangeEvent(maid);
  305. this.PopupAndTabList.ResetSelect();
  306. this.PopupAndTabList.gameObject.SetActive(true);
  307. this.ContentParentMan.SetActive(false);
  308. if (maid == null || maid.boMAN)
  309. {
  310. if (maid == null)
  311. {
  312. this.noCharaActive.ChangeMode(true, true);
  313. }
  314. else
  315. {
  316. this.noCharaActive.ChangeMode(false, true);
  317. }
  318. this.MorphSubWindow.gameObject.SetActive(false);
  319. WFCheckBox checkMorphWindowVisible = this.CheckMorphWindowVisible;
  320. bool flag = false;
  321. this.CheckMorphWindowVisible.check = flag;
  322. checkMorphWindowVisible.enabled = flag;
  323. UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = false;
  324. this.head_transform_ = null;
  325. this.PopupAndTabList.popup_value_list = null;
  326. this.PopupAndTabList.SetPopupValue(this.PopupAndTabList.popup_value_list[0].Key);
  327. WFCheckBox checkBoxEyeToCamera = this.CheckBoxEyeToCamera;
  328. flag = false;
  329. this.SliderFaceToY.enabled = flag;
  330. flag = flag;
  331. this.SliderFaceToX.enabled = flag;
  332. flag = flag;
  333. this.CheckOpenMouse.enabled = flag;
  334. flag = flag;
  335. this.CheckBoxFaceToCamera.enabled = flag;
  336. checkBoxEyeToCamera.enabled = flag;
  337. foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
  338. {
  339. WFCheckBox value2 = keyValuePair.Value;
  340. flag = false;
  341. keyValuePair.Value.enabled = flag;
  342. value2.check = flag;
  343. }
  344. this.CheckOpenMouse.check = false;
  345. if (maid != null && maid.boMAN)
  346. {
  347. this.PopupAndTabList.gameObject.SetActive(false);
  348. this.ContentParentMan.SetActive(true);
  349. PlacementWindow.ManDataBackup manDataBackup = this.placement_window_.man_backup_data_dic[maid.status.guid];
  350. Dictionary<string, string> store_data = base.GetMaidStoreData(maid);
  351. this.man_controller_ = new PhotoManEditManager.Controller(maid);
  352. this.ManColor.onChangeValue.Clear();
  353. this.ManColor.ResetNum = manDataBackup.color;
  354. this.ManColor.ColorPalette.SetColor(Parse.Color(store_data["color"]));
  355. Action<WindowPartsInputColorrPalette, Color> item = delegate(WindowPartsInputColorrPalette parent, Color color)
  356. {
  357. if (this.man_controller_ != null)
  358. {
  359. this.man_controller_.color = color;
  360. }
  361. store_data["color"] = color.ToString();
  362. };
  363. this.ManColor.onChangeValue.Add(item);
  364. PhotoSliderAndInput sliderAndInput = this.ManFat.GetSliderAndInput("fat");
  365. sliderAndInput.onChangeValue.Clear();
  366. sliderAndInput.ResetNum = manDataBackup.fat;
  367. sliderAndInput.value = float.Parse(store_data["fat"]);
  368. Action<float> item2 = delegate(float value)
  369. {
  370. if (this.man_controller_ != null)
  371. {
  372. this.man_controller_.fat = value;
  373. }
  374. store_data["fat"] = value.ToString("G9");
  375. };
  376. sliderAndInput.onChangeValue.Add(item2);
  377. this.PartVisibleCheckBox.onClick.Clear();
  378. this.PartVisibleCheckBox.check = bool.Parse(store_data["parts_visible"]);
  379. Action<WFCheckBox> item3 = delegate(WFCheckBox check_box)
  380. {
  381. bool check = check_box.check;
  382. if (this.man_controller_ != null)
  383. {
  384. this.man_controller_.parts_visible = check;
  385. }
  386. store_data["parts_visible"] = check.ToString();
  387. };
  388. this.PartVisibleCheckBox.onClick.Add(item3);
  389. UIWFTabButton[] componentsInChildren = this.HeadItemTabPanel.GetComponentsInChildren<UIWFTabButton>();
  390. foreach (UIWFTabButton uiwftabButton in componentsInChildren)
  391. {
  392. if (uiwftabButton.name == store_data["head_menu_rid"])
  393. {
  394. this.HeadItemTabPanel.Select(uiwftabButton);
  395. break;
  396. }
  397. }
  398. UIWFTabButton[] componentsInChildren2 = this.BodyItemTabPanel.GetComponentsInChildren<UIWFTabButton>();
  399. foreach (UIWFTabButton uiwftabButton2 in componentsInChildren2)
  400. {
  401. if (uiwftabButton2.name == store_data["body_menu_rid"])
  402. {
  403. this.BodyItemTabPanel.Select(uiwftabButton2);
  404. break;
  405. }
  406. }
  407. }
  408. }
  409. else
  410. {
  411. this.noCharaActive.ChangeMode(false, true);
  412. this.MorphSubWindow.gameObject.SetActive(true);
  413. this.CheckMorphWindowVisible.enabled = true;
  414. this.CheckMorphWindowVisible.check = this.MorphSubWindow.visible;
  415. UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = true;
  416. this.head_transform_ = base.mgr.select_maid.body0.GetBone("Bip01 Head");
  417. WFCheckBox checkBoxEyeToCamera2 = this.CheckBoxEyeToCamera;
  418. bool flag = true;
  419. this.SliderFaceToY.enabled = flag;
  420. flag = flag;
  421. this.SliderFaceToX.enabled = flag;
  422. flag = flag;
  423. this.CheckOpenMouse.enabled = flag;
  424. flag = flag;
  425. this.CheckBoxFaceToCamera.enabled = flag;
  426. checkBoxEyeToCamera2.enabled = flag;
  427. Transform transform = UTY.GetChildObject(this.content_game_object.gameObject, "ContentParent/AddOption/Btns", false).transform;
  428. for (int k = 0; k < transform.childCount; k++)
  429. {
  430. transform.GetChild(k).GetComponent<WFCheckBox>().enabled = true;
  431. }
  432. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
  433. PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
  434. this.PopupAndTabList.popup_value_list = PhotoFaceData.popup_category_list;
  435. this.PopupAndTabList.SetPopupValue(photoFaceData.category);
  436. this.PopupAndTabList.SetSelectButton(photoFaceData, false);
  437. this.CheckBoxEyeToCamera.check = bool.Parse(maidStoreData["eye_to_camera"]);
  438. this.CheckBoxFaceToCamera.check = bool.Parse(maidStoreData["face_to_camera"]);
  439. this.SliderFaceToX.SetValue("x", float.Parse(maidStoreData["face_to_x"]));
  440. this.SliderFaceToY.enabled = true;
  441. this.SliderFaceToY.SetValue("y", float.Parse(maidStoreData["face_to_y"]));
  442. this.CheckOpenMouse.check = bool.Parse(maidStoreData["open_mouse"]);
  443. foreach (KeyValuePair<string, WFCheckBox> keyValuePair2 in this.add_option_dic_)
  444. {
  445. keyValuePair2.Value.check = bool.Parse(maidStoreData[keyValuePair2.Key]);
  446. }
  447. if (this.CheckBoxFaceToCamera.check)
  448. {
  449. WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
  450. flag = false;
  451. this.SliderFaceToY.enabled = flag;
  452. sliderFaceToX.enabled = flag;
  453. }
  454. this.Apply(base.mgr.select_maid);
  455. }
  456. }
  457. public override void OnMaidRemoveEventPrev(Maid maid)
  458. {
  459. if (!maid.boMAN)
  460. {
  461. return;
  462. }
  463. PlacementWindow.ManDataBackup manDataBackup = this.placement_window_.man_backup_data_dic[maid.status.guid];
  464. PhotoManEditManager.Controller controller = new PhotoManEditManager.Controller(maid);
  465. controller.color = manDataBackup.color;
  466. controller.fat = manDataBackup.fat;
  467. controller.parts_visible = true;
  468. foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
  469. {
  470. if (manDataBackup.head_item_rid == smenuItem.m_nMenuFileRID)
  471. {
  472. controller.SetMenu(smenuItem);
  473. break;
  474. }
  475. }
  476. }
  477. public void OnSelectManHeadItem()
  478. {
  479. UIWFSelectButton current = UIWFSelectButton.current;
  480. if (this.man_controller_ == null || !current.isSelected)
  481. {
  482. return;
  483. }
  484. int num = int.Parse(current.name);
  485. foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
  486. {
  487. if (num == smenuItem.m_nMenuFileRID)
  488. {
  489. this.man_controller_.SetMenu(smenuItem);
  490. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(this.man_controller_.man);
  491. maidStoreData["head_menu_rid"] = smenuItem.m_nMenuFileRID.ToString();
  492. break;
  493. }
  494. }
  495. foreach (SceneEdit.SMenuItem smenuItem2 in this.man_edit_mgr_.man_body_menu_list)
  496. {
  497. if (num == smenuItem2.m_nMenuFileRID)
  498. {
  499. bool flag = this.man_controller_.SetMenu(smenuItem2);
  500. if (flag)
  501. {
  502. Dictionary<string, string> maidStoreData2 = this.motion_window_.GetMaidStoreData(this.man_controller_.man);
  503. PhotoMotionData motion_data = PhotoMotionData.Get(long.Parse(maidStoreData2["id"]));
  504. this.motion_window_.Apply(motion_data, this.man_controller_.man);
  505. }
  506. Dictionary<string, string> maidStoreData3 = base.GetMaidStoreData(this.man_controller_.man);
  507. maidStoreData3["body_menu_rid"] = smenuItem2.m_nMenuFileRID.ToString();
  508. break;
  509. }
  510. }
  511. }
  512. protected void OnChangePopUpList(KeyValuePair<string, UnityEngine.Object> popup_val)
  513. {
  514. }
  515. private void OnSelectItem(object select_data_obj)
  516. {
  517. if (base.mgr.select_maid == null || select_data_obj == null)
  518. {
  519. return;
  520. }
  521. PhotoFaceData photoFaceData = select_data_obj as PhotoFaceData;
  522. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
  523. maidStoreData["id"] = photoFaceData.id.ToString();
  524. this.FaceMorphInput.ApplyBackupData(base.mgr.select_maid);
  525. photoFaceData.Apply(base.mgr.select_maid);
  526. this.Apply(base.mgr.select_maid);
  527. }
  528. private void Apply(Maid maid)
  529. {
  530. if (maid == null || maid.boMAN)
  531. {
  532. return;
  533. }
  534. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
  535. PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
  536. photoFaceData.Apply(maid);
  537. TMorph.AddBlendType addBlendType = TMorph.AddBlendType.None;
  538. Dictionary<string, TMorph.AddBlendType> dictionary = new Dictionary<string, TMorph.AddBlendType>
  539. {
  540. {
  541. "頬染め1",
  542. TMorph.AddBlendType.Cheek1
  543. },
  544. {
  545. "頬染め2",
  546. TMorph.AddBlendType.Cheek2
  547. },
  548. {
  549. "頬染め3",
  550. TMorph.AddBlendType.Cheek3
  551. },
  552. {
  553. "涙1",
  554. TMorph.AddBlendType.Tear1
  555. },
  556. {
  557. "涙2",
  558. TMorph.AddBlendType.Tear2
  559. },
  560. {
  561. "涙3",
  562. TMorph.AddBlendType.Tear3
  563. },
  564. {
  565. "涙(玉)",
  566. TMorph.AddBlendType.TearBig
  567. },
  568. {
  569. "涎",
  570. TMorph.AddBlendType.Yodare
  571. },
  572. {
  573. "赤面",
  574. TMorph.AddBlendType.Blush
  575. },
  576. {
  577. "ショック",
  578. TMorph.AddBlendType.Shock
  579. }
  580. };
  581. foreach (KeyValuePair<string, TMorph.AddBlendType> keyValuePair in dictionary)
  582. {
  583. if (maidStoreData.ContainsKey(keyValuePair.Key) && bool.Parse(maidStoreData[keyValuePair.Key]))
  584. {
  585. addBlendType |= keyValuePair.Value;
  586. }
  587. }
  588. maid.body0.Face.morph.SetValueOriginalBlendSet(addBlendType);
  589. if (bool.Parse(maidStoreData["face_to_camera"]))
  590. {
  591. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  592. }
  593. else
  594. {
  595. Transform bone = maid.body0.GetBone("Bip01 Head");
  596. if (bone.Find("face_to_object") == null)
  597. {
  598. GameObject gameObject = new GameObject();
  599. gameObject.name = "face_to_object";
  600. gameObject.transform.SetParent(bone);
  601. gameObject.transform.localPosition = Vector3.zero;
  602. gameObject.transform.localRotation = Quaternion.identity;
  603. gameObject.transform.localScale = Vector3.one;
  604. }
  605. Transform transform = bone.Find("face_to_object");
  606. Vector3 localPosition = new Vector3(float.Parse(maidStoreData["face_to_y"]) * -1f * 0.2f, 0.2f, float.Parse(maidStoreData["face_to_x"]) * 0.2f);
  607. transform.localPosition = localPosition;
  608. maid.EyeToTargetObject(transform, 0f);
  609. }
  610. maid.OpenMouth(bool.Parse(maidStoreData["open_mouse"]));
  611. maid.body0.boEyeToCam = bool.Parse(maidStoreData["eye_to_camera"]);
  612. this.FaceMorphInput.SetPhotoFaceData(photoFaceData);
  613. this.FaceMorphInput.UpdateGui(maid);
  614. }
  615. public override void OnDeserializeEvent()
  616. {
  617. List<string> maidStoreGuidList = base.mgr.GetMaidStoreGuidList();
  618. for (int i = 0; i < maidStoreGuidList.Count; i++)
  619. {
  620. Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maidStoreGuidList[i]);
  621. if (maidStoreData.Count > 0)
  622. {
  623. if (maidStoreData.ContainsKey("id"))
  624. {
  625. PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
  626. if (photoFaceData == null)
  627. {
  628. photoFaceData = PhotoFaceData.init_data;
  629. }
  630. maidStoreData["id"] = photoFaceData.id.ToString();
  631. }
  632. }
  633. }
  634. }
  635. public PopupAndTabList PopupAndTabList;
  636. public WFCheckBox CheckBoxEyeToCamera;
  637. public WFCheckBox CheckBoxFaceToCamera;
  638. public WindowPartsInputSliderSet SliderFaceToX;
  639. public WindowPartsInputSliderSet SliderFaceToY;
  640. public WFCheckBox CheckOpenMouse;
  641. [SerializeField]
  642. [Header("モーフオプション")]
  643. public BasePhotoSubWindow MorphSubWindow;
  644. public WindowPartsFaceMorph FaceMorphInput;
  645. public WFCheckBox CheckMorphWindowVisible;
  646. [SerializeField]
  647. [Header("男オプション")]
  648. public GameObject ContentParentMan;
  649. public WindowPartsInputColorrPalette ManColor;
  650. public WindowPartsInputSliderSet ManFat;
  651. public WFCheckBox PartVisibleCheckBox;
  652. public UIWFTabPanel HeadItemTabPanel;
  653. public UIWFTabPanel BodyItemTabPanel;
  654. private PhotoNoCharaActive noCharaActive;
  655. private PlacementWindow placement_window_;
  656. private MotionWindow motion_window_;
  657. private Dictionary<string, WFCheckBox> add_option_dic_;
  658. private Transform head_transform_;
  659. private PhotoManEditManager man_edit_mgr_;
  660. private PhotoManEditManager.Controller man_controller_;
  661. }