FaceWindow.cs 24 KB

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