123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using wf;
- public class PhotoManEditManager
- {
- public PhotoManEditManager()
- {
- this.man_head_menu_list_ = new List<SceneEdit.SMenuItem>();
- this.man_body_menu_list_ = new List<SceneEdit.SMenuItem>();
- if (PhotoManEditManager.menu_file_name_list_ == null)
- {
- MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
- PhotoManEditManager.menu_file_name_list_ = new HashSet<string>();
- for (int i = 0; i < menuDataBase.GetDataSize(); i++)
- {
- menuDataBase.SetIndex(i);
- string text = menuDataBase.GetMenuFileName().ToLower();
- string text2 = text;
- if (text2.Contains("mhead") || text2.Contains("mbody"))
- {
- SceneEdit.SMenuItem smenuItem = new SceneEdit.SMenuItem();
- if (SceneEdit.GetMenuItemSetUP(smenuItem, text, true))
- {
- if (!(smenuItem.m_texIconRef == null) && smenuItem.m_bMan)
- {
- if (!PhotoManEditManager.menu_file_name_list_.Contains(text))
- {
- PhotoManEditManager.menu_file_name_list_.Add(text);
- if (smenuItem.m_mpn == MPN.head)
- {
- this.man_head_menu_list_.Add(smenuItem);
- }
- else
- {
- this.man_body_menu_list_.Add(smenuItem);
- }
- }
- }
- }
- }
- }
- }
- else
- {
- foreach (string f_strMenuFileName in PhotoManEditManager.menu_file_name_list_)
- {
- SceneEdit.SMenuItem smenuItem2 = new SceneEdit.SMenuItem();
- if (SceneEdit.GetMenuItemSetUP(smenuItem2, f_strMenuFileName, true))
- {
- if (smenuItem2.m_mpn == MPN.head)
- {
- this.man_head_menu_list_.Add(smenuItem2);
- }
- else
- {
- this.man_body_menu_list_.Add(smenuItem2);
- }
- }
- }
- }
- }
- public void Destroy()
- {
- List<SceneEdit.SMenuItem>[] array = new List<SceneEdit.SMenuItem>[]
- {
- this.man_head_menu_list_,
- this.man_body_menu_list_
- };
- foreach (List<SceneEdit.SMenuItem> list in array)
- {
- foreach (SceneEdit.SMenuItem smenuItem in list)
- {
- if (smenuItem.m_texIconRef != null)
- {
- UnityEngine.Object.Destroy(smenuItem.m_texIconRef);
- }
- if (smenuItem.m_texIconRandomColorRef != null)
- {
- UnityEngine.Object.Destroy(smenuItem.m_texIconRandomColorRef);
- }
- }
- list.Clear();
- }
- }
- public List<SceneEdit.SMenuItem> man_head_menu_list
- {
- get
- {
- return this.man_head_menu_list_;
- }
- }
- public List<SceneEdit.SMenuItem> man_body_menu_list
- {
- get
- {
- return this.man_body_menu_list_;
- }
- }
- private List<SceneEdit.SMenuItem> man_head_menu_list_;
- private List<SceneEdit.SMenuItem> man_body_menu_list_;
- private static HashSet<string> menu_file_name_list_;
- public class Controller
- {
- public Controller()
- {
- }
- public Controller(Maid man)
- {
- this.man = man;
- if (man != null)
- {
- NDebug.Assert(man.boMAN, "メイドが設定されました");
- }
- }
- public bool SetMenu(SceneEdit.SMenuItem set_menu)
- {
- if (this.man == null || this.IsSelected(set_menu))
- {
- return false;
- }
- bool chinkoVisible = this.man.body0.GetChinkoVisible();
- bool result = false;
- if (this.man.GetProp(set_menu.m_mpn).nFileNameRID != set_menu.m_nMenuFileRID)
- {
- this.man.SetProp(set_menu.m_mpn, set_menu.m_strMenuFileName, set_menu.m_nMenuFileRID, false, false);
- this.man.AllProcProp();
- result = true;
- }
- if (set_menu.m_mpn == MPN.body)
- {
- this.man.body0.SetChinkoVisible(chinkoVisible);
- }
- return result;
- }
- public bool IsSelected(SceneEdit.SMenuItem check_menu)
- {
- if (this.man == null || check_menu == null)
- {
- return false;
- }
- MaidProp prop = this.man.GetProp(check_menu.m_mpn);
- return prop != null && prop.nFileNameRID == check_menu.m_nMenuFileRID;
- }
- public Maid man { get; set; }
- public float fat
- {
- get
- {
- if (this.man == null)
- {
- return 0f;
- }
- MaidProp prop = this.man.GetProp(MPN.Hara);
- return (float)(prop.value - prop.min) / (float)(prop.max - prop.min);
- }
- set
- {
- if (this.man == null)
- {
- return;
- }
- MaidProp prop = this.man.GetProp(MPN.Hara);
- if (this.fat == value)
- {
- return;
- }
- this.man.SetProp(MPN.Hara, (int)((float)prop.min + (float)(prop.max - prop.min) * value + 0.5f), false);
- this.man.AllProcProp();
- }
- }
- public Color color
- {
- get
- {
- return (!(this.man == null)) ? this.man.ManColor : Color.black;
- }
- set
- {
- if (this.man == null)
- {
- return;
- }
- this.man.ManColor = value;
- this.man.ManColorUpdate();
- }
- }
- public int alpha
- {
- get
- {
- return GameMain.Instance.CMSystem.ManAlpha;
- }
- set
- {
- GameMain.Instance.CMSystem.ManAlpha = wf.Math.RoundMinMax(value, 0, 100);
- GameMain.Instance.CharacterMgr.ManAlphaUpdate();
- }
- }
- public bool parts_visible
- {
- get
- {
- if (this.man == null || this.man.body0 == null)
- {
- return false;
- }
- List<TBodySkin> goSlot = this.man.body0.goSlot;
- foreach (TBodySkin tbodySkin in goSlot)
- {
- if (!(tbodySkin.obj == null))
- {
- Transform transform = CMT.SearchObjName(tbodySkin.obj.transform, "chinkoCenter", false);
- if (!(transform == null))
- {
- return transform.localScale == Vector3.one;
- }
- }
- }
- return false;
- }
- set
- {
- if (this.man == null || this.man.body0 == null)
- {
- return;
- }
- this.man.body0.SetChinkoVisible(value);
- }
- }
- public int head_menu_rid
- {
- get
- {
- return (!(this.man == null)) ? this.man.GetProp(MPN.head).nFileNameRID : -1;
- }
- }
- public int body_menu_rid
- {
- get
- {
- return (!(this.man == null)) ? this.man.GetProp(MPN.body).nFileNameRID : -1;
- }
- }
- }
- }
|