FaceWindow.cs 24 KB

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