FaceWindow.cs 24 KB

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