123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using wf;
- public class FaceWindow : BaseMaidPhotoWindow
- {
- public override void Awake()
- {
- base.Awake();
- PhotoFaceData.Create();
- this.noCharaActive = base.GetComponentInChildren<PhotoNoCharaActive>();
- Dictionary<string, List<string>> dictionary = new Dictionary<string, List<string>>();
- Dictionary<string, List<KeyValuePair<string, object>>> dictionary2 = new Dictionary<string, List<KeyValuePair<string, object>>>();
- foreach (KeyValuePair<string, List<PhotoFaceData>> keyValuePair in PhotoFaceData.category_list)
- {
- if (!dictionary2.ContainsKey(keyValuePair.Key))
- {
- dictionary2.Add(keyValuePair.Key, new List<KeyValuePair<string, object>>());
- dictionary.Add(keyValuePair.Key, new List<string>());
- }
- for (int i = 0; i < keyValuePair.Value.Count; i++)
- {
- dictionary2[keyValuePair.Key].Add(new KeyValuePair<string, object>(keyValuePair.Value[i].name, keyValuePair.Value[i]));
- dictionary[keyValuePair.Key].Add(keyValuePair.Value[i].termName);
- }
- }
- if (!Product.supportMultiLanguage)
- {
- dictionary = null;
- }
- this.PopupAndTabList.SetData(dictionary2, dictionary, false);
- this.PopupAndTabList.onChangePopUpListValue.Add(new Action<KeyValuePair<string, UnityEngine.Object>>(this.OnChangePopUpList));
- this.PopupAndTabList.onSelect.Add(new Action<object>(this.OnSelectItem));
- this.SliderFaceToX.onChangeValue.Add(new Action<WindowPartsInputSliderSet.SliderAndInputSet, float>(this.OnChangeSliderXValue));
- this.SliderFaceToY.onChangeValue.Add(new Action<WindowPartsInputSliderSet.SliderAndInputSet, float>(this.OnChangeSliderYValue));
- this.CheckBoxEyeToCamera.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
- this.CheckBoxFaceToCamera.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
- this.CheckOpenMouse.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBox));
- this.CheckMorphWindowVisible.onClick.Add(delegate(WFCheckBox check_box)
- {
- this.MorphSubWindow.visible = check_box.check;
- });
- UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = false;
- }
- public override void Start()
- {
- base.Start();
- this.placement_window_ = (base.mgr.GetWindow(PhotoWindowManager.WindowType.Placement) as PlacementWindow);
- this.motion_window_ = (base.mgr.GetWindow(PhotoWindowManager.WindowType.Motion) as MotionWindow);
- this.man_edit_mgr_ = new PhotoManEditManager();
- List<SceneEdit.SMenuItem>[] array = new List<SceneEdit.SMenuItem>[]
- {
- this.man_edit_mgr_.man_head_menu_list,
- this.man_edit_mgr_.man_body_menu_list
- };
- UIWFTabPanel[] array2 = new UIWFTabPanel[]
- {
- this.HeadItemTabPanel,
- this.BodyItemTabPanel
- };
- EventDelegate.Callback[] array3 = new EventDelegate.Callback[]
- {
- new EventDelegate.Callback(this.OnSelectManHeadItem),
- new EventDelegate.Callback(this.OnSelectManHeadItem)
- };
- for (int i = 0; i < array.Length; i++)
- {
- UIWFTabPanel uiwftabPanel = array2[i];
- EventDelegate.Callback callback = array3[i];
- foreach (SceneEdit.SMenuItem smenuItem in array[i])
- {
- GameObject gameObject = Utility.CreatePrefab(uiwftabPanel.gameObject, "ScenePhotoMode/EditItemIcon", true);
- if (smenuItem.m_texIconRef != null)
- {
- Sprite sprite2D = Sprite.Create(smenuItem.m_texIconRef, new Rect(0f, 0f, (float)smenuItem.m_texIconRef.width, (float)smenuItem.m_texIconRef.height), default(Vector2));
- UI2DSprite componentInChildren = gameObject.GetComponentInChildren<UI2DSprite>();
- componentInChildren.sprite2D = sprite2D;
- componentInChildren.SetDimensions(60, 60);
- }
- UIWFTabButton component = gameObject.GetComponent<UIWFTabButton>();
- component.name = smenuItem.m_nMenuFileRID.ToString();
- EventDelegate.Add(component.onSelect, callback);
- }
- Utility.ResetNGUI(uiwftabPanel.GetComponent<UIGrid>());
- Utility.ResetNGUI(uiwftabPanel.transform.parent.GetComponent<UIScrollView>());
- uiwftabPanel.UpdateChildren();
- }
- this.UpdateChildren();
- WFCheckBox checkBoxEyeToCamera = this.CheckBoxEyeToCamera;
- bool flag = false;
- this.SliderFaceToY.enabled = flag;
- flag = flag;
- this.SliderFaceToX.enabled = flag;
- flag = flag;
- this.CheckOpenMouse.enabled = flag;
- flag = flag;
- this.CheckBoxFaceToCamera.enabled = flag;
- checkBoxEyeToCamera.enabled = flag;
- this.add_option_dic_ = new Dictionary<string, WFCheckBox>();
- Transform transform = UTY.GetChildObject(this.content_game_object.gameObject, "ContentParent/AddOption/Btns", false).transform;
- for (int j = 0; j < transform.childCount; j++)
- {
- WFCheckBox component2 = transform.GetChild(j).GetComponent<WFCheckBox>();
- component2.check = false;
- component2.enabled = false;
- this.add_option_dic_.Add(component2.GetComponentInChildren<UILabel>().text, component2);
- component2.onClick.Add(new Action<WFCheckBox>(this.OnClickCheckBoxAddOption));
- }
- this.CheckOpenMouse.check = false;
- WFCheckBox checkMorphWindowVisible = this.CheckMorphWindowVisible;
- flag = false;
- this.CheckMorphWindowVisible.enabled = flag;
- checkMorphWindowVisible.check = flag;
- this.MorphSubWindow.gameObject.SetActive(true);
- this.MorphSubWindow.SetButtonEnabled(BasePhotoSubWindow.BtnType.End, true, false);
- this.MorphSubWindow.GetButtonOnClickEventList(BasePhotoSubWindow.BtnType.End).Add(delegate
- {
- this.CheckMorphWindowVisible.check = false;
- foreach (Action<WFCheckBox> action in this.CheckMorphWindowVisible.onClick)
- {
- action(this.CheckMorphWindowVisible);
- }
- });
- this.ContentParentMan.SetActive(false);
- this.FaceMorphInput.SetFaceWindow(this);
- this.noCharaActive.ChangeMode(true, true);
- }
- public void OnDestroy()
- {
- if (this.man_edit_mgr_ != null)
- {
- this.man_edit_mgr_.Destroy();
- }
- this.man_edit_mgr_ = null;
- }
- public void OnClickCheckBoxAddOption(WFCheckBox check_box)
- {
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
- string[] array = new string[]
- {
- "頬染め1",
- "頬染め2",
- "頬染め3"
- };
- string[] array2 = new string[]
- {
- "涙1",
- "涙2",
- "涙3"
- };
- string[][] array3 = new string[][]
- {
- array,
- array2
- };
- foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
- {
- if (keyValuePair.Value == check_box)
- {
- maidStoreData[keyValuePair.Key] = check_box.check.ToString();
- foreach (string array4 in array3)
- {
- if (0 <= Array.IndexOf<string>(array4, keyValuePair.Key))
- {
- for (int j = 0; j < array4.Length; j++)
- {
- if (!(array4[j] == keyValuePair.Key))
- {
- if (this.add_option_dic_[array4[j]].check)
- {
- this.add_option_dic_[array4[j]].check = false;
- }
- maidStoreData[array4[j]] = false.ToString();
- }
- }
- }
- }
- }
- }
- this.UpdateMaidAddOption();
- }
- public void OnClickCheckBox(WFCheckBox check_box)
- {
- if (base.mgr.select_maid == null)
- {
- return;
- }
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
- if (check_box == this.CheckBoxEyeToCamera)
- {
- maidStoreData["eye_to_camera"] = check_box.check.ToString();
- }
- else if (check_box == this.CheckBoxFaceToCamera)
- {
- maidStoreData["face_to_camera"] = check_box.check.ToString();
- }
- else if (check_box == this.CheckOpenMouse)
- {
- maidStoreData["open_mouse"] = check_box.check.ToString();
- }
- WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
- bool enabled = !this.CheckBoxFaceToCamera.check;
- this.SliderFaceToY.enabled = enabled;
- sliderFaceToX.enabled = enabled;
- this.Apply(base.mgr.select_maid);
- }
- public void UpdateMaidAddOption()
- {
- if (base.mgr.select_maid == null)
- {
- return;
- }
- this.Apply(base.mgr.select_maid);
- }
- public void OnChangeSliderXValue(WindowPartsInputSliderSet.SliderAndInputSet obj, float val)
- {
- if (base.mgr.select_maid == null)
- {
- return;
- }
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
- maidStoreData["face_to_x"] = val.ToString("G9");
- WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
- bool enabled = !this.CheckBoxFaceToCamera.check;
- this.SliderFaceToY.enabled = enabled;
- sliderFaceToX.enabled = enabled;
- this.Apply(base.mgr.select_maid);
- }
- public void OnChangeSliderYValue(WindowPartsInputSliderSet.SliderAndInputSet obj, float val)
- {
- if (base.mgr.select_maid == null)
- {
- return;
- }
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
- maidStoreData["face_to_y"] = val.ToString("G9");
- WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
- bool enabled = !this.CheckBoxFaceToCamera.check;
- this.SliderFaceToY.enabled = enabled;
- sliderFaceToX.enabled = enabled;
- this.Apply(base.mgr.select_maid);
- }
- public override void OnMaidAddEvent(Maid maid, bool is_deserialize_load)
- {
- base.OnMaidAddEvent(maid, is_deserialize_load);
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
- if (maid.boMAN)
- {
- this.man_controller_ = new PhotoManEditManager.Controller(maid);
- if (!is_deserialize_load)
- {
- maidStoreData.Add("color", this.man_controller_.color.ToString());
- maidStoreData.Add("fat", this.man_controller_.fat.ToString("G9"));
- maidStoreData.Add("parts_visible", true.ToString());
- maidStoreData.Add("head_menu_rid", this.man_controller_.head_menu_rid.ToString());
- maidStoreData.Add("body_menu_rid", this.man_controller_.body_menu_rid.ToString());
- }
- else
- {
- this.man_controller_.color = Parse.Color(maidStoreData["color"]);
- this.man_controller_.fat = float.Parse(maidStoreData["fat"]);
- this.man_controller_.parts_visible = bool.Parse(maidStoreData["parts_visible"]);
- int num = int.Parse(maidStoreData["head_menu_rid"]);
- foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
- {
- if (num == smenuItem.m_nMenuFileRID)
- {
- this.man_controller_.SetMenu(smenuItem);
- break;
- }
- }
- int num2 = int.Parse(maidStoreData["body_menu_rid"]);
- foreach (SceneEdit.SMenuItem smenuItem2 in this.man_edit_mgr_.man_head_menu_list)
- {
- if (num2 == smenuItem2.m_nMenuFileRID)
- {
- this.man_controller_.SetMenu(smenuItem2);
- this.motion_window_.UpdateAnimationData(this.man_controller_.man);
- break;
- }
- }
- }
- this.man_controller_ = null;
- return;
- }
- maid.FaceBlend("オリジナル");
- if (!is_deserialize_load)
- {
- maidStoreData.Clear();
- maidStoreData.Add("id", PhotoFaceData.init_data.id.ToString());
- maidStoreData.Add("eye_to_camera", true.ToString());
- maidStoreData.Add("face_to_camera", true.ToString());
- maidStoreData.Add("face_to_x", 0.ToString());
- maidStoreData.Add("face_to_y", 0.ToString());
- maidStoreData.Add("open_mouse", false.ToString());
- foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
- {
- maidStoreData.Add(keyValuePair.Key, false.ToString());
- }
- }
- else if (!maidStoreData.ContainsKey("open_mouse"))
- {
- maidStoreData.Add("open_mouse", false.ToString());
- }
- this.FaceMorphInput.OnMaidAddEvent(maid, is_deserialize_load, maidStoreData);
- maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
- this.Apply(maid);
- }
- public override void OnMaidChangeEvent(Maid maid)
- {
- base.OnMaidChangeEvent(maid);
- this.PopupAndTabList.ResetSelect();
- this.PopupAndTabList.gameObject.SetActive(true);
- this.ContentParentMan.SetActive(false);
- if (maid == null || maid.boMAN)
- {
- if (maid == null)
- {
- this.noCharaActive.ChangeMode(true, true);
- }
- else
- {
- this.noCharaActive.ChangeMode(false, true);
- }
- this.MorphSubWindow.gameObject.SetActive(false);
- WFCheckBox checkMorphWindowVisible = this.CheckMorphWindowVisible;
- bool flag = false;
- this.CheckMorphWindowVisible.check = flag;
- checkMorphWindowVisible.enabled = flag;
- UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = false;
- this.head_transform_ = null;
- this.PopupAndTabList.popup_value_list = null;
- this.PopupAndTabList.SetPopupValue(this.PopupAndTabList.popup_value_list[0].Key);
- WFCheckBox checkBoxEyeToCamera = this.CheckBoxEyeToCamera;
- flag = false;
- this.SliderFaceToY.enabled = flag;
- flag = flag;
- this.SliderFaceToX.enabled = flag;
- flag = flag;
- this.CheckOpenMouse.enabled = flag;
- flag = flag;
- this.CheckBoxFaceToCamera.enabled = flag;
- checkBoxEyeToCamera.enabled = flag;
- foreach (KeyValuePair<string, WFCheckBox> keyValuePair in this.add_option_dic_)
- {
- WFCheckBox value2 = keyValuePair.Value;
- flag = false;
- keyValuePair.Value.enabled = flag;
- value2.check = flag;
- }
- this.CheckOpenMouse.check = false;
- if (maid != null && maid.boMAN)
- {
- this.PopupAndTabList.gameObject.SetActive(false);
- this.ContentParentMan.SetActive(true);
- PlacementWindow.ManDataBackup manDataBackup = this.placement_window_.man_backup_data_dic[maid.status.guid];
- Dictionary<string, string> store_data = base.GetMaidStoreData(maid);
- this.man_controller_ = new PhotoManEditManager.Controller(maid);
- this.ManColor.onChangeValue.Clear();
- this.ManColor.ResetNum = manDataBackup.color;
- this.ManColor.ColorPalette.SetColor(Parse.Color(store_data["color"]));
- Action<WindowPartsInputColorrPalette, Color> item = delegate(WindowPartsInputColorrPalette parent, Color color)
- {
- if (this.man_controller_ != null)
- {
- this.man_controller_.color = color;
- }
- store_data["color"] = color.ToString();
- };
- this.ManColor.onChangeValue.Add(item);
- PhotoSliderAndInput sliderAndInput = this.ManFat.GetSliderAndInput("fat");
- sliderAndInput.onChangeValue.Clear();
- sliderAndInput.ResetNum = manDataBackup.fat;
- sliderAndInput.value = float.Parse(store_data["fat"]);
- Action<float> item2 = delegate(float value)
- {
- if (this.man_controller_ != null)
- {
- this.man_controller_.fat = value;
- }
- store_data["fat"] = value.ToString("G9");
- };
- sliderAndInput.onChangeValue.Add(item2);
- this.PartVisibleCheckBox.onClick.Clear();
- this.PartVisibleCheckBox.check = bool.Parse(store_data["parts_visible"]);
- Action<WFCheckBox> item3 = delegate(WFCheckBox check_box)
- {
- bool check = check_box.check;
- if (this.man_controller_ != null)
- {
- this.man_controller_.parts_visible = check;
- }
- store_data["parts_visible"] = check.ToString();
- };
- this.PartVisibleCheckBox.onClick.Add(item3);
- UIWFTabButton[] componentsInChildren = this.HeadItemTabPanel.GetComponentsInChildren<UIWFTabButton>();
- foreach (UIWFTabButton uiwftabButton in componentsInChildren)
- {
- if (uiwftabButton.name == store_data["head_menu_rid"])
- {
- this.HeadItemTabPanel.Select(uiwftabButton);
- break;
- }
- }
- UIWFTabButton[] componentsInChildren2 = this.BodyItemTabPanel.GetComponentsInChildren<UIWFTabButton>();
- foreach (UIWFTabButton uiwftabButton2 in componentsInChildren2)
- {
- if (uiwftabButton2.name == store_data["body_menu_rid"])
- {
- this.BodyItemTabPanel.Select(uiwftabButton2);
- break;
- }
- }
- }
- }
- else
- {
- this.noCharaActive.ChangeMode(false, true);
- this.MorphSubWindow.gameObject.SetActive(true);
- this.CheckMorphWindowVisible.enabled = true;
- this.CheckMorphWindowVisible.check = this.MorphSubWindow.visible;
- UTY.GetChildObject(this.content_game_object, "ContentParent/ListParent/DragMat", false).GetComponent<BoxCollider>().enabled = true;
- this.head_transform_ = base.mgr.select_maid.body0.GetBone("Bip01 Head");
- WFCheckBox checkBoxEyeToCamera2 = this.CheckBoxEyeToCamera;
- bool flag = true;
- this.SliderFaceToY.enabled = flag;
- flag = flag;
- this.SliderFaceToX.enabled = flag;
- flag = flag;
- this.CheckOpenMouse.enabled = flag;
- flag = flag;
- this.CheckBoxFaceToCamera.enabled = flag;
- checkBoxEyeToCamera2.enabled = flag;
- Transform transform = UTY.GetChildObject(this.content_game_object.gameObject, "ContentParent/AddOption/Btns", false).transform;
- for (int k = 0; k < transform.childCount; k++)
- {
- transform.GetChild(k).GetComponent<WFCheckBox>().enabled = true;
- }
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
- PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
- this.PopupAndTabList.popup_term_list = ((!Product.supportMultiLanguage) ? null : PhotoFaceData.popup_category_term_list);
- this.PopupAndTabList.popup_value_list = PhotoFaceData.popup_category_list;
- this.PopupAndTabList.SetPopupValue(photoFaceData.category);
- this.PopupAndTabList.SetSelectButton(photoFaceData, false);
- this.CheckBoxEyeToCamera.check = bool.Parse(maidStoreData["eye_to_camera"]);
- this.CheckBoxFaceToCamera.check = bool.Parse(maidStoreData["face_to_camera"]);
- this.SliderFaceToX.SetValue("x", float.Parse(maidStoreData["face_to_x"]));
- this.SliderFaceToY.enabled = true;
- this.SliderFaceToY.SetValue("y", float.Parse(maidStoreData["face_to_y"]));
- this.CheckOpenMouse.check = bool.Parse(maidStoreData["open_mouse"]);
- foreach (KeyValuePair<string, WFCheckBox> keyValuePair2 in this.add_option_dic_)
- {
- keyValuePair2.Value.check = bool.Parse(maidStoreData[keyValuePair2.Key]);
- }
- if (this.CheckBoxFaceToCamera.check)
- {
- WindowPartsInputSliderSet sliderFaceToX = this.SliderFaceToX;
- flag = false;
- this.SliderFaceToY.enabled = flag;
- sliderFaceToX.enabled = flag;
- }
- this.Apply(base.mgr.select_maid);
- }
- }
- public override void OnMaidRemoveEventPrev(Maid maid)
- {
- if (!maid.boMAN)
- {
- return;
- }
- PlacementWindow.ManDataBackup manDataBackup = this.placement_window_.man_backup_data_dic[maid.status.guid];
- PhotoManEditManager.Controller controller = new PhotoManEditManager.Controller(maid);
- controller.color = manDataBackup.color;
- controller.fat = manDataBackup.fat;
- controller.parts_visible = true;
- foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
- {
- if (manDataBackup.head_item_rid == smenuItem.m_nMenuFileRID)
- {
- controller.SetMenu(smenuItem);
- break;
- }
- }
- }
- public void OnSelectManHeadItem()
- {
- UIWFSelectButton current = UIWFSelectButton.current;
- if (this.man_controller_ == null || !current.isSelected)
- {
- return;
- }
- int num = int.Parse(current.name);
- foreach (SceneEdit.SMenuItem smenuItem in this.man_edit_mgr_.man_head_menu_list)
- {
- if (num == smenuItem.m_nMenuFileRID)
- {
- this.man_controller_.SetMenu(smenuItem);
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(this.man_controller_.man);
- maidStoreData["head_menu_rid"] = smenuItem.m_nMenuFileRID.ToString();
- break;
- }
- }
- foreach (SceneEdit.SMenuItem smenuItem2 in this.man_edit_mgr_.man_body_menu_list)
- {
- if (num == smenuItem2.m_nMenuFileRID)
- {
- bool flag = this.man_controller_.SetMenu(smenuItem2);
- if (flag)
- {
- Dictionary<string, string> maidStoreData2 = this.motion_window_.GetMaidStoreData(this.man_controller_.man);
- PhotoMotionData motion_data = PhotoMotionData.Get(long.Parse(maidStoreData2["id"]));
- this.motion_window_.Apply(motion_data, this.man_controller_.man);
- }
- Dictionary<string, string> maidStoreData3 = base.GetMaidStoreData(this.man_controller_.man);
- maidStoreData3["body_menu_rid"] = smenuItem2.m_nMenuFileRID.ToString();
- break;
- }
- }
- }
- protected void OnChangePopUpList(KeyValuePair<string, UnityEngine.Object> popup_val)
- {
- }
- private void OnSelectItem(object select_data_obj)
- {
- if (base.mgr.select_maid == null || select_data_obj == null)
- {
- return;
- }
- PhotoFaceData photoFaceData = select_data_obj as PhotoFaceData;
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(base.mgr.select_maid);
- maidStoreData["id"] = photoFaceData.id.ToString();
- this.FaceMorphInput.ApplyBackupData(base.mgr.select_maid);
- photoFaceData.Apply(base.mgr.select_maid);
- this.Apply(base.mgr.select_maid);
- }
- private void Apply(Maid maid)
- {
- if (maid == null || maid.boMAN)
- {
- return;
- }
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maid);
- PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
- photoFaceData.Apply(maid);
- TMorph.AddBlendType addBlendType = TMorph.AddBlendType.None;
- Dictionary<string, TMorph.AddBlendType> dictionary = new Dictionary<string, TMorph.AddBlendType>
- {
- {
- "頬染め1",
- TMorph.AddBlendType.Cheek1
- },
- {
- "頬染め2",
- TMorph.AddBlendType.Cheek2
- },
- {
- "頬染め3",
- TMorph.AddBlendType.Cheek3
- },
- {
- "涙1",
- TMorph.AddBlendType.Tear1
- },
- {
- "涙2",
- TMorph.AddBlendType.Tear2
- },
- {
- "涙3",
- TMorph.AddBlendType.Tear3
- },
- {
- "涙(玉)",
- TMorph.AddBlendType.TearBig
- },
- {
- "涎",
- TMorph.AddBlendType.Yodare
- },
- {
- "赤面",
- TMorph.AddBlendType.Blush
- },
- {
- "ショック",
- TMorph.AddBlendType.Shock
- }
- };
- foreach (KeyValuePair<string, TMorph.AddBlendType> keyValuePair in dictionary)
- {
- if (maidStoreData.ContainsKey(keyValuePair.Key) && bool.Parse(maidStoreData[keyValuePair.Key]))
- {
- addBlendType |= keyValuePair.Value;
- }
- }
- maid.body0.Face.morph.SetValueOriginalBlendSet(addBlendType);
- if (bool.Parse(maidStoreData["face_to_camera"]))
- {
- maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
- }
- else
- {
- Transform bone = maid.body0.GetBone("Bip01 Head");
- if (bone.Find("face_to_object") == null)
- {
- GameObject gameObject = new GameObject();
- gameObject.name = "face_to_object";
- gameObject.transform.SetParent(bone);
- gameObject.transform.localPosition = Vector3.zero;
- gameObject.transform.localRotation = Quaternion.identity;
- gameObject.transform.localScale = Vector3.one;
- }
- Transform transform = bone.Find("face_to_object");
- Vector3 localPosition = new Vector3(float.Parse(maidStoreData["face_to_y"]) * -1f * 0.2f, 0.2f, float.Parse(maidStoreData["face_to_x"]) * 0.2f);
- transform.localPosition = localPosition;
- maid.EyeToTargetObject(transform, 0f);
- }
- maid.OpenMouth(bool.Parse(maidStoreData["open_mouse"]));
- maid.body0.boEyeToCam = bool.Parse(maidStoreData["eye_to_camera"]);
- this.FaceMorphInput.SetPhotoFaceData(photoFaceData);
- this.FaceMorphInput.UpdateGui(maid);
- }
- public override void OnDeserializeEvent()
- {
- List<string> maidStoreGuidList = base.mgr.GetMaidStoreGuidList();
- for (int i = 0; i < maidStoreGuidList.Count; i++)
- {
- Dictionary<string, string> maidStoreData = base.GetMaidStoreData(maidStoreGuidList[i]);
- if (maidStoreData.Count > 0)
- {
- if (maidStoreData.ContainsKey("id"))
- {
- PhotoFaceData photoFaceData = PhotoFaceData.Get(long.Parse(maidStoreData["id"]));
- if (photoFaceData == null)
- {
- photoFaceData = PhotoFaceData.init_data;
- }
- maidStoreData["id"] = photoFaceData.id.ToString();
- }
- }
- }
- }
- public PopupAndTabList PopupAndTabList;
- public WFCheckBox CheckBoxEyeToCamera;
- public WFCheckBox CheckBoxFaceToCamera;
- public WindowPartsInputSliderSet SliderFaceToX;
- public WindowPartsInputSliderSet SliderFaceToY;
- public WFCheckBox CheckOpenMouse;
- [SerializeField]
- [Header("モーフオプション")]
- public BasePhotoSubWindow MorphSubWindow;
- public WindowPartsFaceMorph FaceMorphInput;
- public WFCheckBox CheckMorphWindowVisible;
- [SerializeField]
- [Header("男オプション")]
- public GameObject ContentParentMan;
- public WindowPartsInputColorrPalette ManColor;
- public WindowPartsInputSliderSet ManFat;
- public WFCheckBox PartVisibleCheckBox;
- public UIWFTabPanel HeadItemTabPanel;
- public UIWFTabPanel BodyItemTabPanel;
- private PhotoNoCharaActive noCharaActive;
- private PlacementWindow placement_window_;
- private MotionWindow motion_window_;
- private Dictionary<string, WFCheckBox> add_option_dic_;
- private Transform head_transform_;
- private PhotoManEditManager man_edit_mgr_;
- private PhotoManEditManager.Controller man_controller_;
- }
|