SceneEdit.cs 112 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7. using Kasizuki;
  8. using MaidStatus;
  9. using SceneEditWindow;
  10. using UnityEngine;
  11. public class SceneEdit : MonoBehaviour
  12. {
  13. public static SceneEdit Instance { get; private set; }
  14. public static bool compatibilityMode
  15. {
  16. get
  17. {
  18. return DailyMgr.IsLegacy;
  19. }
  20. }
  21. public CustomViewWindow customViewWindow { get; private set; }
  22. public PoseIconWindow pauseIconWindow { get; private set; }
  23. public BgIconWindow bgIconWindow { get; private set; }
  24. public CustomPartsWindow customPartsWindow { get; private set; }
  25. public SceneEdit.ModeType modeType { get; private set; }
  26. public int maidPoint { get; set; }
  27. public HashSet<MPN> enabledMpns { get; private set; }
  28. public bool m_bUseGroup
  29. {
  30. get
  31. {
  32. return GameMain.Instance.CMSystem.EditItemGroup;
  33. }
  34. set
  35. {
  36. if (value == GameMain.Instance.CMSystem.EditItemGroup || this.m_Panel_PartsType == null)
  37. {
  38. return;
  39. }
  40. GameMain.Instance.CMSystem.EditItemGroup = value;
  41. this.UpdateCurrentItemPanel(true);
  42. }
  43. }
  44. public bool m_bUseTouchJump
  45. {
  46. get
  47. {
  48. return GameMain.Instance.CMSystem.EditTouchJump;
  49. }
  50. set
  51. {
  52. GameMain.Instance.CMSystem.EditTouchJump = value;
  53. foreach (CapsuleCollider capsuleCollider in this.touchJumpColliderList)
  54. {
  55. capsuleCollider.enabled = value;
  56. }
  57. }
  58. }
  59. public List<SceneEdit.SCategory> CategoryList
  60. {
  61. get
  62. {
  63. return this.m_listCategory;
  64. }
  65. }
  66. public EditViewReset viewReset
  67. {
  68. get
  69. {
  70. return this.m_viewreset;
  71. }
  72. }
  73. public Maid maid
  74. {
  75. get
  76. {
  77. return this.m_maid;
  78. }
  79. }
  80. public bool IsVRComMode
  81. {
  82. get
  83. {
  84. return this.m_bVRComMode;
  85. }
  86. }
  87. public MPN NowMPN
  88. {
  89. get
  90. {
  91. return this.m_nNowMPN;
  92. }
  93. }
  94. private static string GetParentMenuFileName(SceneEdit.SMenuItem mi)
  95. {
  96. if ((MPN.wear > mi.m_mpn || mi.m_mpn > MPN.onepiece) && (MPN.set_maidwear > mi.m_mpn || mi.m_mpn > MPN.set_body))
  97. {
  98. return string.Empty;
  99. }
  100. string text = mi.m_strMenuFileName;
  101. string result = string.Empty;
  102. text = text.ToLower();
  103. int num = text.IndexOf("_z");
  104. if (0 < num)
  105. {
  106. int num2 = text.IndexOf('_', num + 1);
  107. if (num2 == -1)
  108. {
  109. num2 = text.IndexOf('.', num + 1);
  110. }
  111. if (0 < num2 - num && 0 < text.Length - num2)
  112. {
  113. result = text.Substring(0, num) + text.Substring(num2, text.Length - num2);
  114. }
  115. }
  116. return result;
  117. }
  118. public void Awake()
  119. {
  120. this.m_cameraMoveSupport = base.gameObject.AddComponent<WfCameraMoveSupport>();
  121. SceneEdit.Instance = this;
  122. this.modeType = SceneEdit.ModeType.OriginalChara;
  123. this.enabledMpns = new HashSet<MPN>();
  124. Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
  125. string a;
  126. if (tag_backup != null && tag_backup.TryGetValue("name", out a) && a == "SceneEdit")
  127. {
  128. string strScriptArg;
  129. if (tag_backup.TryGetValue("label", out strScriptArg))
  130. {
  131. this.m_strScriptArg = strScriptArg;
  132. }
  133. bool flag = false;
  134. if (tag_backup.TryGetValue("original", out strScriptArg))
  135. {
  136. this.modeType = SceneEdit.ModeType.OriginalChara;
  137. flag = true;
  138. }
  139. else if (tag_backup.TryGetValue("main", out strScriptArg))
  140. {
  141. this.modeType = SceneEdit.ModeType.MainChara;
  142. flag = true;
  143. }
  144. else if (tag_backup.TryGetValue("after", out strScriptArg))
  145. {
  146. this.modeType = SceneEdit.ModeType.AfterEdit;
  147. flag = true;
  148. }
  149. else if (tag_backup.TryGetValue("facility_costume", out strScriptArg))
  150. {
  151. this.modeType = SceneEdit.ModeType.CostumeEdit;
  152. flag = true;
  153. }
  154. if (!flag)
  155. {
  156. NDebug.Assert("エディットシーンのモード指定がありませんでした。次のうち必ず一つは指定してください[original|main|after|costume]", false);
  157. }
  158. if (tag_backup.ContainsKey("vr_mode"))
  159. {
  160. this.m_bVRComMode = true;
  161. }
  162. }
  163. this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  164. EventDelegate.Add(this.EditItemGroupSwitch.onClick, new EventDelegate.Callback(this.OnClickEditItemGroup));
  165. this.EditTouchJumpSwitch.defaultColor = ((!this.m_bUseTouchJump) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  166. EventDelegate.Add(this.EditTouchJumpSwitch.onClick, new EventDelegate.Callback(this.OnClickEditTouchJump));
  167. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  168. {
  169. MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
  170. this.enabledMpns = new HashSet<MPN>(facilityCostumeEnableMPN);
  171. this.EditTouchJumpSwitch.gameObject.SetActive(false);
  172. }
  173. }
  174. private void Start()
  175. {
  176. this.customViewWindow = this.m_goUIRoot.GetComponentInChildren<CustomViewWindow>();
  177. this.pauseIconWindow = this.m_goUIRoot.GetComponentInChildren<PoseIconWindow>();
  178. this.pauseIconWindow.onSelectPauseEvent = delegate(PoseIconData.ItemData data)
  179. {
  180. if (this.customPartsWindowVisibleButton.visible)
  181. {
  182. this.customPartsWindowVisibleButton.windowVisible = false;
  183. }
  184. data.ExecScript();
  185. if (this.m_viewreset.GetVisibleAutoCam())
  186. {
  187. if (string.IsNullOrEmpty(data.targetBoneName))
  188. {
  189. this.CameraReset(0.5f);
  190. }
  191. else
  192. {
  193. base.StartCoroutine(this.CoPoseToCam(data.targetBoneName, 0.5f, 0.2f));
  194. }
  195. }
  196. };
  197. this.bgIconWindow = this.m_goUIRoot.GetComponentInChildren<BgIconWindow>();
  198. this.bgIconWindow.onSelectBgEvent = delegate(BgIconData.ItemData data)
  199. {
  200. data.Exec();
  201. };
  202. VoiceIconWindow componentInChildren = this.m_goUIRoot.GetComponentInChildren<VoiceIconWindow>();
  203. componentInChildren.onClickVoiceEvent = delegate(VoiceIconData.ItemData.EmotionType emotionType)
  204. {
  205. if (this.m_maid == null)
  206. {
  207. return;
  208. }
  209. if (this.customPartsWindowVisibleButton.visible)
  210. {
  211. this.customPartsWindowVisibleButton.windowVisible = false;
  212. }
  213. VoiceIconData.ItemData.EmotionData emotionData = VoiceIconData.GetEmotionData(this.m_maid, emotionType);
  214. emotionData.Apply(this.m_maid);
  215. };
  216. PresetSaveWindow componentInChildren2 = this.m_goUIRoot.GetComponentInChildren<PresetSaveWindow>();
  217. componentInChildren2.onClickPresetSaveEvent = delegate(PresetSaveWindow.SaveType type)
  218. {
  219. if (this.m_maid == null)
  220. {
  221. return;
  222. }
  223. PresetButtonCtrl component = UTY.GetChildObject(this.m_goUIRoot, "PresetButtonPanel", false).GetComponent<PresetButtonCtrl>();
  224. component.PresetSaveType(type);
  225. };
  226. UndressWindow componentInChildren3 = this.m_goUIRoot.GetComponentInChildren<UndressWindow>();
  227. componentInChildren3.onClickUndressEvent = delegate(UndressWindow.UndressType type)
  228. {
  229. if (this.m_maid == null)
  230. {
  231. return;
  232. }
  233. if (type == UndressWindow.UndressType.Dress)
  234. {
  235. this.ClothesState(SceneEditInfo.ClothesState.Wear);
  236. }
  237. else if (type == UndressWindow.UndressType.Lingerie)
  238. {
  239. this.ClothesState(SceneEditInfo.ClothesState.Underwear);
  240. }
  241. else if (type == UndressWindow.UndressType.Nude)
  242. {
  243. this.ClothesState(SceneEditInfo.ClothesState.Nude);
  244. }
  245. };
  246. this.customPartsWindow = this.m_goUIRoot.GetComponentInChildren<CustomPartsWindow>();
  247. this.customPartsWindowVisibleButton.visible = false;
  248. this.colorPaletteMgr.Close();
  249. CharacterMgr.EditModeLookHaveItem = true;
  250. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  251. this.m_maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  252. this.maidPoint = GameMain.Instance.CharacterMgr.status.maidPoint;
  253. this.m_maid.Visible = true;
  254. if (this.m_bVRComMode)
  255. {
  256. GameMain.Instance.SceneActivate("SceneEdit");
  257. }
  258. GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
  259. this.m_EditMod = base.gameObject.AddComponent<EditMod>();
  260. if (this.m_goUIRoot == null)
  261. {
  262. this.m_goUIRoot = GameObject.Find("UI Root");
  263. }
  264. NDebug.Assert(this.m_goUIRoot != null, "UI Root がシーン中にありません。");
  265. NDebug.Assert(this.m_listPanel.Count != 0, "UIPanelリストがありません。");
  266. for (int i = 0; i < this.m_listPanel.Count; i++)
  267. {
  268. if (this.m_listPanel[i] == null)
  269. {
  270. NDebug.Assert("UIPanelが外れています.", false);
  271. }
  272. }
  273. GameObject childObject = UTY.GetChildObject(this.m_goUIRoot, "Window-ItemInfo", false);
  274. childObject.SetActive(true);
  275. this.m_info = childObject.GetComponent<ItemInfoWnd>();
  276. GameObject childObject2 = UTY.GetChildObject(this.m_goUIRoot, "OkCancel", false);
  277. childObject2.SetActive(true);
  278. this.m_okcancel = childObject2.GetComponent<EditOkCancel>();
  279. this.m_okcancel.SetOnClickCallBack(new EditOkCancel.OnClick(this.OnEditOk), new EditOkCancel.OnClick(this.OnEditCancel));
  280. this.m_okcancel.Show(EditOkCancel.TYPE.OK);
  281. GameObject childObject3 = UTY.GetChildObject(this.m_goUIRoot, "ViewReset", false);
  282. childObject3.SetActive(true);
  283. this.m_viewreset = childObject3.GetComponent<EditViewReset>();
  284. this.m_viewreset.SetOnClickCallBack(new EditViewReset.OnClick(this.OnClickViewReset), new EditViewReset.OnClick(this.OnClickAutoCam), new EditViewReset.OnClick(this.OnClickEyeToCam));
  285. this.m_viewreset.Show();
  286. this.m_Panel_Category = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-Category");
  287. this.m_Panel_PartsType = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-PartsType");
  288. this.m_Panel_MenuItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-MenuItem");
  289. this.m_Panel_SetItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-SetItem");
  290. this.m_Panel_SliderItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-Slider");
  291. this.m_Panel_ColorSet = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-ColorSet");
  292. this.m_Panel_GroupSet = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-GroupSet");
  293. this.m_CheckBoxMayuDrawPriority = UTY.GetChildObject(this.m_Panel_ColorSet.goMain, "CheckBoxMayuDrawPriority", false).GetComponent<WFCheckBox>();
  294. this.m_CheckBoxMayuDrawPriority.onClick.Add(delegate(WFCheckBox checkbox)
  295. {
  296. this.m_maid.MayuDrawPriority = checkbox.check;
  297. });
  298. this.m_Panel_Category.SetActive(true);
  299. GameObject childObject4 = UTY.GetChildObject(this.m_goUIRoot, "ViewCancel", false);
  300. this.m_uipViewCancel = childObject4.GetComponent<UIPanel>();
  301. GameObject childObject5 = UTY.GetChildObject(childObject4, "Cancel", false);
  302. EventDelegate.Add(childObject5.GetComponentsInChildren<UIButton>(true)[0].onClick, new EventDelegate.Callback(this.FromView));
  303. childObject4.SetActive(false);
  304. GameObject childObject6 = UTY.GetChildObject(this.m_goUIRoot, "FFNameDialog", false);
  305. this.m_FFNameDlg = childObject6.GetComponent<FFNameDialog>();
  306. this.m_FFNameDlg.Init();
  307. childObject6.SetActive(false);
  308. Maid maid = this.m_maid;
  309. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  310. this.m_viewreset.SetVisibleEyeToCam(true);
  311. if (!GameMain.Instance.VRMode)
  312. {
  313. this.m_viewreset.SetVisibleAutoCam(true);
  314. }
  315. else
  316. {
  317. this.m_viewreset.SetVisibleAutoCam(false);
  318. }
  319. new List<string>
  320. {
  321. string.Empty
  322. }.AddRange(GameUty.PathList);
  323. Action<string> action = delegate(string strFileName)
  324. {
  325. if (!GameUty.FileSystem.IsExistentFile(strFileName))
  326. {
  327. return;
  328. }
  329. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(strFileName))
  330. {
  331. using (CsvParser csvParser = new CsvParser())
  332. {
  333. bool condition = csvParser.Open(afileBase);
  334. NDebug.Assert(condition, strFileName + "\nopen failed.");
  335. for (int j = 1; j < csvParser.max_cell_y; j++)
  336. {
  337. if (csvParser.IsCellToExistData(0, j))
  338. {
  339. SceneEdit.VoiceInfo voiceInfo = new SceneEdit.VoiceInfo();
  340. voiceInfo.strIconName = csvParser.GetCellAsString(1, j);
  341. string cellAsString = csvParser.GetCellAsString(2, j);
  342. voiceInfo.personal = Personal.GetData(cellAsString);
  343. voiceInfo.strVoiceFileName = csvParser.GetCellAsString(3, j);
  344. voiceInfo.strFace = csvParser.GetCellAsString(4, j);
  345. voiceInfo.strFace2 = csvParser.GetCellAsString(5, j);
  346. voiceInfo.texIcon = ImportCM.CreateTexture(voiceInfo.strIconName);
  347. if (!this.m_dicVoice.ContainsKey(voiceInfo.personal))
  348. {
  349. this.m_dicVoice.Add(voiceInfo.personal, new List<SceneEdit.PVBInfo>());
  350. }
  351. this.m_dicVoice[voiceInfo.personal].Add(voiceInfo);
  352. }
  353. }
  354. }
  355. }
  356. };
  357. GameMain.Instance.MainLight.Reset();
  358. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  359. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  360. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(-0.05539433f, 0.95894f, 0.1269088f), true);
  361. GameMain.Instance.MainCamera.SetDistance(3f, true);
  362. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(-180f, 11.5528f), true);
  363. this.m_cameraMoveSupport.SaveCameraPosition();
  364. if (GameMain.Instance.VRMode)
  365. {
  366. GameMain.Instance.MainCamera.SetPos(new Vector3(0f, 1.4871f, 1f));
  367. GameMain.Instance.MainCamera.SetRotation(new Vector3(0f, -180f, 0f));
  368. if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.FOVE)
  369. {
  370. FoveEyeRayMgr.m_TargetMaid = this.m_maid;
  371. }
  372. }
  373. GameMain.Instance.SoundMgr.PlayBGM("BGM005.ogg", 1f, true);
  374. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  375. GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay();
  376. GameMain.Instance.LoadIcon.force_draw_new = true;
  377. this.m_dicColor.Clear();
  378. base.StartCoroutine(this.InitMenuNative());
  379. GameMain.Instance.TutorialPanel.SetImage(TutorialPanel.ImageSet.Edit, false);
  380. }
  381. private IEnumerator CoLoadWait()
  382. {
  383. while (GameMain.Instance.CharacterMgr.IsBusy())
  384. {
  385. yield return null;
  386. }
  387. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  388. if (this.m_bVRComMode)
  389. {
  390. if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Night".ToLower())
  391. {
  392. this.m_maid.SetPos(new Vector3(-0.29f, 0f, 1.6f));
  393. this.m_maid.SetRot(new Vector3(0f, -90f, 0f));
  394. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-1.58508f, 1.601999f, 1.811131f), true);
  395. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 102f, 0f), true);
  396. GameMain.Instance.MainLight.SetRotation(new Vector3(40.00004f, 57.29157f, 18f));
  397. }
  398. else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom_Night".ToLower())
  399. {
  400. this.m_maid.SetPos(new Vector3(3.54f, 0f, 1.16f));
  401. this.m_maid.SetRot(new Vector3(0f, 180f, 0f));
  402. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(3.55631f, 1.601999f, -0.3987116f), true);
  403. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 358f, 0f), true);
  404. GameMain.Instance.MainLight.SetRotation(new Vector3(58.94946f, 0f, 198f));
  405. }
  406. else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm_Night".ToLower())
  407. {
  408. this.m_maid.SetPos(new Vector3(-0.235f, 0f, -1.898f));
  409. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-0.3528061f, 1.601999f, -0.6961781f), true);
  410. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 174f, 0f), true);
  411. }
  412. else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR_Night".ToLower())
  413. {
  414. this.m_maid.SetPos(new Vector3(-2.75f, 0f, -11f));
  415. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-2.685168f, 1.601999f, -9.861251f), true);
  416. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 180f, 0f), true);
  417. }
  418. else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo_Night".ToLower())
  419. {
  420. this.m_maid.SetPos(new Vector3(-0.235f, 0f, 2.028f));
  421. GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-0.2311308f, 1.601999f, 3.325274f), true);
  422. GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 182f, 0f), true);
  423. }
  424. GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
  425. }
  426. this.m_maid.boMabataki = true;
  427. MaidColliderCollect collect = MaidColliderCollect.AddColliderCollect(this.m_maid);
  428. this.touchJumpColliderList = collect.AddCollider(MaidColliderCollect.ColliderType.Grab);
  429. if (!GameMain.Instance.VRMode)
  430. {
  431. Dictionary<IKManager.BoneType, KeyValuePair<IKManager.BoneSetType, GameObject>> dictionary = IKManager.CreateBoneDic(this.m_maid);
  432. Dictionary<Transform, SceneEdit.TouchType> dictionary2 = new Dictionary<Transform, SceneEdit.TouchType>();
  433. dictionary2.Add(dictionary[IKManager.BoneType.Head].Value.transform, SceneEdit.TouchType.Head);
  434. dictionary2.Add(dictionary[IKManager.BoneType.Spine1].Value.transform, SceneEdit.TouchType.UpperBody);
  435. dictionary2.Add(dictionary[IKManager.BoneType.Bust_R].Value.transform, SceneEdit.TouchType.Bust);
  436. dictionary2.Add(dictionary[IKManager.BoneType.Bust_L].Value.transform, SceneEdit.TouchType.Bust);
  437. dictionary2.Add(dictionary[IKManager.BoneType.Pelvis].Value.transform, SceneEdit.TouchType.LowerBody);
  438. dictionary2.Add(dictionary[IKManager.BoneType.Thigh_L].Value.transform, SceneEdit.TouchType.Leg);
  439. dictionary2.Add(dictionary[IKManager.BoneType.Thigh_R].Value.transform, SceneEdit.TouchType.Leg);
  440. Dictionary<SceneEdit.TouchType, Action> dictionary3 = new Dictionary<SceneEdit.TouchType, Action>();
  441. dictionary3.Add(SceneEdit.TouchType.Head, delegate
  442. {
  443. this.$this.OnTouchJump(SceneEdit.TouchType.Head);
  444. });
  445. dictionary3.Add(SceneEdit.TouchType.Bust, delegate
  446. {
  447. this.$this.OnTouchJump(SceneEdit.TouchType.Bust);
  448. });
  449. dictionary3.Add(SceneEdit.TouchType.UpperBody, delegate
  450. {
  451. this.$this.OnTouchJump(SceneEdit.TouchType.UpperBody);
  452. });
  453. dictionary3.Add(SceneEdit.TouchType.LowerBody, delegate
  454. {
  455. this.$this.OnTouchJump(SceneEdit.TouchType.LowerBody);
  456. });
  457. dictionary3.Add(SceneEdit.TouchType.Leg, delegate
  458. {
  459. this.$this.OnTouchJump(SceneEdit.TouchType.Leg);
  460. });
  461. for (int i = 0; i < this.touchJumpColliderList.Count; i++)
  462. {
  463. ColliderEvent colliderEvent = this.touchJumpColliderList[i].gameObject.AddComponent<ColliderEvent>();
  464. Transform transform = colliderEvent.transform;
  465. while (transform != null && !dictionary2.ContainsKey(transform))
  466. {
  467. transform = transform.parent;
  468. }
  469. if (!(transform == null))
  470. {
  471. SceneEdit.TouchType key = dictionary2[transform];
  472. colliderEvent.onMouseDown = dictionary3[key];
  473. }
  474. }
  475. }
  476. else
  477. {
  478. this.touchJumpColliderList.Clear();
  479. }
  480. this.m_bUseTouchJump = this.m_bUseTouchJump;
  481. if (SceneEdit.compatibilityMode)
  482. {
  483. foreach (BgIconData.ItemData itemData in BgIconData.itemList)
  484. {
  485. if (itemData.isLegacyBG)
  486. {
  487. this.bgIconWindow.Exec(itemData.id);
  488. break;
  489. }
  490. }
  491. }
  492. else
  493. {
  494. foreach (BgIconData.ItemData itemData2 in BgIconData.itemList)
  495. {
  496. if (!itemData2.isLegacyBG)
  497. {
  498. this.bgIconWindow.Exec(itemData2.id);
  499. break;
  500. }
  501. }
  502. }
  503. this.customPartsWindow.Initizalize(this.m_maid);
  504. int initPoseId = PoseIconData.itemList[0].id;
  505. Action<PoseIconData.ItemData> backup = this.pauseIconWindow.onSelectPauseEvent;
  506. this.pauseIconWindow.onSelectPauseEvent = delegate(PoseIconData.ItemData data)
  507. {
  508. data.ExecScript();
  509. Maid maid = this.$this.m_maid;
  510. Transform bone = maid.body0.GetBone(data.targetBoneName);
  511. if (bone != null)
  512. {
  513. this.$this.m_cameraMoveSupport.SaveCameraPosition(bone.position, 3f, new Vector2(-180f, 11.5528f));
  514. this.$this.CameraReset(0f);
  515. }
  516. };
  517. this.pauseIconWindow.Exec(initPoseId);
  518. yield return new WaitForSeconds(0.5f);
  519. this.pauseIconWindow.Exec(initPoseId);
  520. this.pauseIconWindow.onSelectPauseEvent = backup;
  521. this.customViewWindow.Create();
  522. GameMain.Instance.LoadIcon.force_draw_new = false;
  523. GameMain.Instance.MainCamera.FadeIn(0.5f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
  524. yield break;
  525. }
  526. private void OnCompleteFadeIn()
  527. {
  528. }
  529. private IEnumerator InitMenuNative()
  530. {
  531. while (GameMain.Instance.CharacterMgr.IsBusy())
  532. {
  533. yield return null;
  534. }
  535. while (!GameMain.Instance.MenuDataBase.JobFinished())
  536. {
  537. yield return null;
  538. }
  539. this.InitCategoryList();
  540. int fileCount = GameMain.Instance.MenuDataBase.GetDataSize();
  541. List<SceneEdit.SMenuItem> menuList = new List<SceneEdit.SMenuItem>(fileCount);
  542. this.m_menuRidDic = new Dictionary<int, SceneEdit.SMenuItem>(fileCount);
  543. Dictionary<int, List<int>> menuGroupMemberDic = new Dictionary<int, List<int>>();
  544. MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
  545. float time = Time.realtimeSinceStartup;
  546. for (int i = 0; i < fileCount; i++)
  547. {
  548. menuDataBase.SetIndex(i);
  549. string fileName = menuDataBase.GetMenuFileName();
  550. string parent_filename = menuDataBase.GetParentMenuFileName();
  551. if (GameMain.Instance.CharacterMgr.status.IsHavePartsItem(fileName))
  552. {
  553. SceneEdit.SMenuItem mi = new SceneEdit.SMenuItem();
  554. mi.m_strMenuFileName = fileName;
  555. mi.m_nMenuFileRID = fileName.GetHashCode();
  556. try
  557. {
  558. SceneEdit.ReadMenuItemDataFromNative(mi, i);
  559. }
  560. catch (Exception ex)
  561. {
  562. Debug.LogError(string.Concat(new string[]
  563. {
  564. "ReadMenuItemDataFromNative 例外/",
  565. fileName,
  566. "/",
  567. ex.Message,
  568. " StackTrace/",
  569. ex.StackTrace
  570. }));
  571. }
  572. if (!mi.m_bMan && !(mi.m_texIcon == null))
  573. {
  574. this.AddMenuItemToList(mi);
  575. menuList.Add(mi);
  576. if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
  577. {
  578. this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
  579. }
  580. string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
  581. if (!string.IsNullOrEmpty(parentMenuName))
  582. {
  583. int hashCode = parentMenuName.GetHashCode();
  584. if (!menuGroupMemberDic.ContainsKey(hashCode))
  585. {
  586. menuGroupMemberDic.Add(hashCode, new List<int>());
  587. }
  588. menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
  589. }
  590. else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
  591. {
  592. mi.m_bGroupLeader = true;
  593. mi.m_listMember = new List<SceneEdit.SMenuItem>();
  594. mi.m_listMember.Add(mi);
  595. }
  596. if (0.5f < Time.realtimeSinceStartup - time)
  597. {
  598. yield return null;
  599. time = Time.realtimeSinceStartup;
  600. }
  601. }
  602. }
  603. }
  604. foreach (string strFileName in GameUty.ModOnlysMenuFiles)
  605. {
  606. SceneEdit.SMenuItem mi2 = new SceneEdit.SMenuItem();
  607. if (SceneEdit.GetMenuItemSetUP(mi2, strFileName, false))
  608. {
  609. if (!mi2.m_bMan && !(mi2.m_texIcon == null))
  610. {
  611. this.AddMenuItemToList(mi2);
  612. menuList.Add(mi2);
  613. if (!this.m_menuRidDic.ContainsKey(mi2.m_nMenuFileRID))
  614. {
  615. this.m_menuRidDic.Add(mi2.m_nMenuFileRID, mi2);
  616. }
  617. string parentMenuName2 = SceneEdit.GetParentMenuFileName(mi2);
  618. if (!string.IsNullOrEmpty(parentMenuName2))
  619. {
  620. int hashCode2 = parentMenuName2.GetHashCode();
  621. if (!menuGroupMemberDic.ContainsKey(hashCode2))
  622. {
  623. menuGroupMemberDic.Add(hashCode2, new List<int>());
  624. }
  625. menuGroupMemberDic[hashCode2].Add(mi2.m_strMenuFileName.ToLower().GetHashCode());
  626. }
  627. else if (mi2.m_strCateName.IndexOf("set_") != -1 && mi2.m_strMenuFileName.IndexOf("_del") == -1)
  628. {
  629. mi2.m_bGroupLeader = true;
  630. mi2.m_listMember = new List<SceneEdit.SMenuItem>();
  631. mi2.m_listMember.Add(mi2);
  632. }
  633. if (0.5f < Time.realtimeSinceStartup - time)
  634. {
  635. yield return null;
  636. time = Time.realtimeSinceStartup;
  637. }
  638. }
  639. }
  640. }
  641. yield return base.StartCoroutine(this.FixedInitMenu(menuList, this.m_menuRidDic, menuGroupMemberDic));
  642. yield return base.StartCoroutine(this.CoLoadWait());
  643. yield break;
  644. }
  645. private IEnumerator InitMenu()
  646. {
  647. this.InitCategoryList();
  648. string[] files = GameUty.MenuFiles;
  649. List<SceneEdit.SMenuItem> menuList = new List<SceneEdit.SMenuItem>(files.Length);
  650. this.m_menuRidDic = new Dictionary<int, SceneEdit.SMenuItem>(menuList.Capacity);
  651. Dictionary<int, List<int>> menuGroupMemberDic = new Dictionary<int, List<int>>();
  652. float time = Time.realtimeSinceStartup;
  653. foreach (string strFileName in files)
  654. {
  655. if (!strFileName.ToLower().Contains("/man"))
  656. {
  657. if (GameMain.Instance.CharacterMgr.status.IsHavePartsItem(Path.GetFileName(strFileName)))
  658. {
  659. SceneEdit.SMenuItem mi = new SceneEdit.SMenuItem();
  660. if (SceneEdit.GetMenuItemSetUP(mi, strFileName, false))
  661. {
  662. if (!mi.m_bMan && !(mi.m_texIcon == null))
  663. {
  664. this.AddMenuItemToList(mi);
  665. menuList.Add(mi);
  666. if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
  667. {
  668. this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
  669. }
  670. string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
  671. if (!string.IsNullOrEmpty(parentMenuName))
  672. {
  673. int hashCode = parentMenuName.GetHashCode();
  674. if (!menuGroupMemberDic.ContainsKey(hashCode))
  675. {
  676. menuGroupMemberDic.Add(hashCode, new List<int>());
  677. }
  678. menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
  679. }
  680. else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
  681. {
  682. mi.m_bGroupLeader = true;
  683. mi.m_listMember = new List<SceneEdit.SMenuItem>();
  684. mi.m_listMember.Add(mi);
  685. }
  686. if (0.5f < Time.realtimeSinceStartup - time)
  687. {
  688. yield return null;
  689. time = Time.realtimeSinceStartup;
  690. }
  691. }
  692. }
  693. }
  694. }
  695. }
  696. yield return base.StartCoroutine(this.FixedInitMenu(menuList, this.m_menuRidDic, menuGroupMemberDic));
  697. yield return base.StartCoroutine(this.CoLoadWait());
  698. yield break;
  699. }
  700. private IEnumerator FixedInitMenu(List<SceneEdit.SMenuItem> menuList, Dictionary<int, SceneEdit.SMenuItem> menuRidDic, Dictionary<int, List<int>> menuGroupMemberDic)
  701. {
  702. float time = Time.realtimeSinceStartup;
  703. string[] modfiles = Menu.GetModFiles();
  704. if (modfiles != null)
  705. {
  706. foreach (string strFileName in modfiles)
  707. {
  708. SceneEdit.SMenuItem mi2 = new SceneEdit.SMenuItem();
  709. if (SceneEdit.InitModMenuItemScript(mi2, strFileName))
  710. {
  711. this.AddMenuItemToList(mi2);
  712. menuList.Add(mi2);
  713. if (!menuRidDic.ContainsKey(mi2.m_nMenuFileRID))
  714. {
  715. menuRidDic.Add(mi2.m_nMenuFileRID, mi2);
  716. }
  717. else
  718. {
  719. menuRidDic[mi2.m_nMenuFileRID] = mi2;
  720. }
  721. string parentMenuName = SceneEdit.GetParentMenuFileName(mi2);
  722. if (!string.IsNullOrEmpty(parentMenuName))
  723. {
  724. int hashCode = parentMenuName.GetHashCode();
  725. if (!menuGroupMemberDic.ContainsKey(hashCode))
  726. {
  727. menuGroupMemberDic.Add(hashCode, new List<int>());
  728. }
  729. menuGroupMemberDic[hashCode].Add(mi2.m_strMenuFileName.ToLower().GetHashCode());
  730. }
  731. else if (mi2.m_strCateName.IndexOf("set_") != -1 && mi2.m_strMenuFileName.IndexOf("_del") == -1)
  732. {
  733. mi2.m_bGroupLeader = true;
  734. mi2.m_listMember = new List<SceneEdit.SMenuItem>();
  735. mi2.m_listMember.Add(mi2);
  736. }
  737. if (0.5f < Time.realtimeSinceStartup - time)
  738. {
  739. yield return null;
  740. time = Time.realtimeSinceStartup;
  741. }
  742. }
  743. }
  744. }
  745. foreach (KeyValuePair<int, List<int>> keyValuePair in menuGroupMemberDic)
  746. {
  747. if (menuRidDic.ContainsKey(keyValuePair.Key) && keyValuePair.Value.Count >= 1)
  748. {
  749. SceneEdit.SMenuItem smenuItem = menuRidDic[keyValuePair.Key];
  750. smenuItem.m_bGroupLeader = true;
  751. smenuItem.m_listMember = new List<SceneEdit.SMenuItem>();
  752. smenuItem.m_listMember.Add(smenuItem);
  753. for (int n = 0; n < keyValuePair.Value.Count; n++)
  754. {
  755. smenuItem.m_listMember.Add(menuRidDic[keyValuePair.Value[n]]);
  756. smenuItem.m_listMember[smenuItem.m_listMember.Count - 1].m_bMember = true;
  757. smenuItem.m_listMember[smenuItem.m_listMember.Count - 1].m_leaderMenu = smenuItem;
  758. }
  759. smenuItem.m_listMember.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
  760. {
  761. if (x.m_fPriority == y.m_fPriority)
  762. {
  763. return 0;
  764. }
  765. if (x.m_fPriority < y.m_fPriority)
  766. {
  767. return -1;
  768. }
  769. if (x.m_fPriority > y.m_fPriority)
  770. {
  771. return 1;
  772. }
  773. return 0;
  774. });
  775. smenuItem.m_listMember.Sort((SceneEdit.SMenuItem x, SceneEdit.SMenuItem y) => x.m_strMenuFileName.CompareTo(y.m_strMenuFileName));
  776. }
  777. }
  778. foreach (KeyValuePair<MPN, SceneEditInfo.CCateNameType> keyValuePair2 in SceneEditInfo.m_dicPartsTypePair)
  779. {
  780. if (keyValuePair2.Value.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  781. {
  782. this.AddMenuItemToList(new SceneEdit.SMenuItem
  783. {
  784. m_mpn = keyValuePair2.Key,
  785. m_nSliderValue = 500,
  786. m_strCateName = keyValuePair2.Key.ToString(),
  787. m_strMenuName = keyValuePair2.Value.m_strBtnPartsTypeName
  788. });
  789. }
  790. }
  791. for (int nM = 0; nM < menuList.Count; nM++)
  792. {
  793. SceneEdit.SMenuItem mi = menuList[nM];
  794. if (mi.m_eColorSetMPN != MPN.null_mpn)
  795. {
  796. if (mi.m_strMenuNameInColorSet != null)
  797. {
  798. mi.m_strMenuNameInColorSet = mi.m_strMenuNameInColorSet.Replace("*", ".*");
  799. mi.m_listColorSet = this.m_dicColor[mi.m_eColorSetMPN].FindAll((SceneEdit.SMenuItem i) => new Regex(mi.m_strMenuNameInColorSet).IsMatch(i.m_strMenuFileName));
  800. }
  801. else
  802. {
  803. mi.m_listColorSet = this.m_dicColor[mi.m_eColorSetMPN];
  804. }
  805. }
  806. if (0.5f < Time.realtimeSinceStartup - time)
  807. {
  808. yield return null;
  809. time = Time.realtimeSinceStartup;
  810. }
  811. }
  812. for (int j = 0; j < this.m_listCategory.Count; j++)
  813. {
  814. this.m_listCategory[j].SortPartsType();
  815. }
  816. for (int k = 0; k < this.m_listCategory.Count; k++)
  817. {
  818. this.m_listCategory[k].SortItem();
  819. }
  820. foreach (SceneEdit.SCategory scategory in this.m_listCategory)
  821. {
  822. if (scategory.m_eCategory == SceneEditInfo.EMenuCategory.プリセット || scategory.m_eCategory == SceneEditInfo.EMenuCategory.ランダム || scategory.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル || scategory.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
  823. {
  824. scategory.m_isEnabled = true;
  825. }
  826. else
  827. {
  828. scategory.m_isEnabled = false;
  829. foreach (SceneEdit.SPartsType spartsType in scategory.m_listPartsType)
  830. {
  831. if (spartsType.m_isEnabled)
  832. {
  833. scategory.m_isEnabled = true;
  834. break;
  835. }
  836. }
  837. }
  838. }
  839. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  840. {
  841. SceneEditInfo.EMenuCategory[] array = new SceneEditInfo.EMenuCategory[]
  842. {
  843. SceneEditInfo.EMenuCategory.セット,
  844. SceneEditInfo.EMenuCategory.プリセット,
  845. SceneEditInfo.EMenuCategory.ランダム,
  846. SceneEditInfo.EMenuCategory.プロフィ\u30FCル
  847. };
  848. SceneEditInfo.EMenuCategory[] array2 = array;
  849. for (int l = 0; l < array2.Length; l++)
  850. {
  851. SceneEditInfo.EMenuCategory cate = array2[l];
  852. this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cate).m_isEnabled = false;
  853. }
  854. }
  855. else if (this.maid.status.heroineType == HeroineType.Sub)
  856. {
  857. SceneEditInfo.EMenuCategory[] array3 = new SceneEditInfo.EMenuCategory[]
  858. {
  859. SceneEditInfo.EMenuCategory.プロフィ\u30FCル
  860. };
  861. SceneEditInfo.EMenuCategory[] array4 = array3;
  862. for (int m = 0; m < array4.Length; m++)
  863. {
  864. SceneEditInfo.EMenuCategory cate = array4[m];
  865. this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cate).m_isEnabled = false;
  866. }
  867. }
  868. this.UpdatePanel_Category();
  869. yield break;
  870. }
  871. private void InitCategoryList()
  872. {
  873. for (int i = 0; i < this.m_listCategory.Count; i++)
  874. {
  875. this.m_listCategory[i].Dispose();
  876. }
  877. this.m_listCategory.Clear();
  878. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.頭.ToString(), SceneEditInfo.EMenuCategory.頭));
  879. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.髪.ToString(), SceneEditInfo.EMenuCategory.髪));
  880. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.身体.ToString(), SceneEditInfo.EMenuCategory.身体));
  881. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.服装.ToString(), SceneEditInfo.EMenuCategory.服装));
  882. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.アクセサリ.ToString(), SceneEditInfo.EMenuCategory.アクセサリ));
  883. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  884. {
  885. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.着衣設定.ToString(), SceneEditInfo.EMenuCategory.着衣設定));
  886. }
  887. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.セット.ToString(), SceneEditInfo.EMenuCategory.セット));
  888. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プリセット.ToString(), SceneEditInfo.EMenuCategory.プリセット));
  889. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.ランダム.ToString(), SceneEditInfo.EMenuCategory.ランダム));
  890. this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プロフィ\u30FCル.ToString(), SceneEditInfo.EMenuCategory.プロフィ\u30FCル));
  891. }
  892. public static void ReadMenuItemDataFromNative(SceneEdit.SMenuItem mi, int menuDataBaseIndex)
  893. {
  894. MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
  895. menuDataBase.SetIndex(menuDataBaseIndex);
  896. mi.m_strMenuName = menuDataBase.GetMenuName();
  897. mi.m_strInfo = menuDataBase.GetItemInfoText();
  898. mi.m_mpn = (MPN)menuDataBase.GetCategoryMpn();
  899. mi.m_strCateName = menuDataBase.GetCategoryMpnText();
  900. mi.m_eColorSetMPN = (MPN)menuDataBase.GetColorSetMpn();
  901. mi.m_strMenuNameInColorSet = menuDataBase.GetMenuNameInColorSet();
  902. mi.m_pcMultiColorID = (MaidParts.PARTS_COLOR)menuDataBase.GetMultiColorId();
  903. mi.m_boDelOnly = menuDataBase.GetBoDelOnly();
  904. mi.m_fPriority = menuDataBase.GetPriority();
  905. mi.m_bMan = menuDataBase.GetIsMan();
  906. mi.m_bOld = (menuDataBase.GetVersion() < 2000);
  907. string iconS = menuDataBase.GetIconS();
  908. if (!string.IsNullOrEmpty(iconS))
  909. {
  910. try
  911. {
  912. mi.m_texIcon = ImportCM.CreateTexture(iconS);
  913. mi.m_texIconRandomColor = mi.m_texIcon;
  914. }
  915. catch (Exception)
  916. {
  917. Debug.LogError("Error:");
  918. }
  919. }
  920. }
  921. public static bool GetMenuItemSetUP(SceneEdit.SMenuItem mi, string f_strMenuFileName, bool f_bMan = false)
  922. {
  923. if (f_strMenuFileName.Contains("_zurashi"))
  924. {
  925. return false;
  926. }
  927. if (f_strMenuFileName.Contains("_mekure"))
  928. {
  929. return false;
  930. }
  931. f_strMenuFileName = Path.GetFileName(f_strMenuFileName);
  932. mi.m_strMenuFileName = f_strMenuFileName;
  933. mi.m_nMenuFileRID = f_strMenuFileName.ToLower().GetHashCode();
  934. try
  935. {
  936. if (!SceneEdit.InitMenuItemScript(mi, f_strMenuFileName, f_bMan))
  937. {
  938. NDebug.Assert(false, "メニュースクリプトが読めませんでした。" + f_strMenuFileName);
  939. }
  940. }
  941. catch (Exception ex)
  942. {
  943. Debug.LogError(string.Concat(new string[]
  944. {
  945. "GetMenuItemSetUP 例外/",
  946. f_strMenuFileName,
  947. "/",
  948. ex.Message,
  949. " StackTrace/",
  950. ex.StackTrace
  951. }));
  952. return false;
  953. }
  954. return true;
  955. }
  956. public static bool InitModMenuItemScript(SceneEdit.SMenuItem mi, string f_strModFileName)
  957. {
  958. byte[] buffer = null;
  959. try
  960. {
  961. using (FileStream fileStream = new FileStream(f_strModFileName, FileMode.Open))
  962. {
  963. if (fileStream == null)
  964. {
  965. Debug.LogWarning("MODアイテムメニューファイルが見つかりません。");
  966. return false;
  967. }
  968. buffer = new byte[fileStream.Length];
  969. fileStream.Read(buffer, 0, (int)fileStream.Length);
  970. }
  971. }
  972. catch (Exception ex)
  973. {
  974. Debug.LogError("InitModMenuItemScript MODアイテムメニューファイルが読み込めませんでした。 : " + f_strModFileName + " : " + ex.Message);
  975. return false;
  976. }
  977. BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8);
  978. string text = binaryReader.ReadString();
  979. NDebug.Assert(text == "CM3D2_MOD", "InitModMenuItemScript 例外 : ヘッダーファイルが不正です。" + text);
  980. int num = binaryReader.ReadInt32();
  981. string text2 = binaryReader.ReadString();
  982. string text3 = binaryReader.ReadString();
  983. string strMenuName = binaryReader.ReadString();
  984. string strCateName = binaryReader.ReadString();
  985. string text4 = binaryReader.ReadString();
  986. string text5 = binaryReader.ReadString();
  987. MPN mpn = MPN.null_mpn;
  988. try
  989. {
  990. mpn = (MPN)Enum.Parse(typeof(MPN), text5);
  991. }
  992. catch
  993. {
  994. NDebug.Assert("カテゴリがありません。" + text5, false);
  995. }
  996. string text6 = string.Empty;
  997. if (mpn != MPN.null_mpn)
  998. {
  999. text6 = binaryReader.ReadString();
  1000. }
  1001. string s = binaryReader.ReadString();
  1002. int num2 = binaryReader.ReadInt32();
  1003. Dictionary<string, byte[]> dictionary = new Dictionary<string, byte[]>();
  1004. for (int i = 0; i < num2; i++)
  1005. {
  1006. string key = binaryReader.ReadString();
  1007. int count = binaryReader.ReadInt32();
  1008. byte[] value = binaryReader.ReadBytes(count);
  1009. dictionary.Add(key, value);
  1010. }
  1011. binaryReader.Close();
  1012. binaryReader = null;
  1013. mi.m_bMod = true;
  1014. mi.m_strMenuFileName = Path.GetFileName(f_strModFileName);
  1015. mi.m_nMenuFileRID = mi.m_strMenuFileName.ToLower().GetHashCode();
  1016. mi.m_strMenuName = strMenuName;
  1017. mi.m_strInfo = text4.Replace("《改行》", "\n");
  1018. mi.m_strCateName = strCateName;
  1019. try
  1020. {
  1021. mi.m_mpn = (MPN)Enum.Parse(typeof(MPN), mi.m_strCateName);
  1022. }
  1023. catch
  1024. {
  1025. Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
  1026. mi.m_mpn = MPN.null_mpn;
  1027. }
  1028. if (mpn != MPN.null_mpn)
  1029. {
  1030. mi.m_eColorSetMPN = mpn;
  1031. if (!string.IsNullOrEmpty(text6))
  1032. {
  1033. mi.m_strMenuNameInColorSet = text6;
  1034. }
  1035. }
  1036. if (!string.IsNullOrEmpty(text2))
  1037. {
  1038. byte[] data = dictionary[text2];
  1039. mi.m_texIcon = new Texture2D(1, 1, TextureFormat.RGBA32, false);
  1040. mi.m_texIcon.LoadImage(data);
  1041. mi.m_texIconRandomColor = mi.m_texIcon;
  1042. }
  1043. mi.m_fPriority = 999f;
  1044. using (StringReader stringReader = new StringReader(s))
  1045. {
  1046. string empty = string.Empty;
  1047. string text7;
  1048. while ((text7 = stringReader.ReadLine()) != null)
  1049. {
  1050. string[] array = text7.Split(new char[]
  1051. {
  1052. '\t',
  1053. ' '
  1054. }, StringSplitOptions.RemoveEmptyEntries);
  1055. if (array[0] == "テクスチャ変更")
  1056. {
  1057. MaidParts.PARTS_COLOR pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
  1058. if (array.Length == 6)
  1059. {
  1060. string text8 = array[5];
  1061. try
  1062. {
  1063. pcMultiColorID = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text8.ToUpper());
  1064. }
  1065. catch
  1066. {
  1067. NDebug.Assert("無限色IDがありません。" + text8, false);
  1068. }
  1069. mi.m_pcMultiColorID = pcMultiColorID;
  1070. }
  1071. }
  1072. }
  1073. }
  1074. return true;
  1075. }
  1076. private bool AddMenuItemToList(SceneEdit.SMenuItem f_mi)
  1077. {
  1078. MPN mpn = f_mi.m_mpn;
  1079. if (f_mi.m_mpn == MPN.null_mpn)
  1080. {
  1081. Debug.LogWarning("カテゴリがnullの為、メニュー表示しません。" + f_mi.m_strCateName);
  1082. return false;
  1083. }
  1084. SceneEditInfo.CCateNameType cateType;
  1085. if (mpn != MPN.null_mpn && SceneEditInfo.m_dicPartsTypePair.TryGetValue(mpn, out cateType))
  1086. {
  1087. if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Item || cateType.m_eType == SceneEditInfo.CCateNameType.EType.Set || cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  1088. {
  1089. SceneEdit.SCategory scategory = this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cateType.m_eMenuCate);
  1090. SceneEdit.SPartsType spartsType = scategory.m_listPartsType.Find((SceneEdit.SPartsType p) => p.m_ePartsType == cateType.m_ePartsType);
  1091. if (spartsType == null)
  1092. {
  1093. string f_strPartsTypeName = string.Empty;
  1094. if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  1095. {
  1096. if (!SceneEditInfo.m_dicSliderPartsTypeBtnName.TryGetValue(cateType.m_ePartsType, out f_strPartsTypeName))
  1097. {
  1098. NDebug.Assert("スライダー群に対するパーツタイプ名がみつかりませんでした。", false);
  1099. }
  1100. }
  1101. else
  1102. {
  1103. f_strPartsTypeName = cateType.m_strBtnPartsTypeName;
  1104. }
  1105. spartsType = new SceneEdit.SPartsType(cateType.m_eType, mpn, f_strPartsTypeName, cateType.m_ePartsType);
  1106. if (this.enabledMpns.Count == 0)
  1107. {
  1108. spartsType.m_isEnabled = true;
  1109. }
  1110. else
  1111. {
  1112. spartsType.m_isEnabled = this.enabledMpns.Contains(spartsType.m_mpn);
  1113. }
  1114. scategory.m_listPartsType.Add(spartsType);
  1115. }
  1116. f_mi.m_ParentPartsType = spartsType;
  1117. if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  1118. {
  1119. f_mi.m_fPriority = (float)cateType.m_nIdx;
  1120. }
  1121. spartsType.m_listMenu.Add(f_mi);
  1122. }
  1123. else if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Color)
  1124. {
  1125. f_mi.m_bColor = true;
  1126. if (!this.m_dicColor.ContainsKey(f_mi.m_mpn))
  1127. {
  1128. this.m_dicColor.Add(f_mi.m_mpn, new List<SceneEdit.SMenuItem>());
  1129. }
  1130. this.m_dicColor[f_mi.m_mpn].Add(f_mi);
  1131. }
  1132. }
  1133. return true;
  1134. }
  1135. public static bool InitMenuItemScript(SceneEdit.SMenuItem mi, string f_strMenuFileName, bool f_bMan)
  1136. {
  1137. if (f_strMenuFileName.IndexOf("mod_") == 0)
  1138. {
  1139. string modPathFileName = Menu.GetModPathFileName(f_strMenuFileName);
  1140. return !string.IsNullOrEmpty(modPathFileName) && SceneEdit.InitModMenuItemScript(mi, modPathFileName);
  1141. }
  1142. try
  1143. {
  1144. using (AFileBase afileBase = GameUty.FileOpen(f_strMenuFileName, null))
  1145. {
  1146. NDebug.Assert(afileBase.IsValid(), "メニューファイルが存在しません。 :" + f_strMenuFileName);
  1147. if (SceneEdit.m_byItemFileBuffer == null)
  1148. {
  1149. SceneEdit.m_byItemFileBuffer = new byte[Math.Max(500000, afileBase.GetSize())];
  1150. }
  1151. else if (SceneEdit.m_byItemFileBuffer.Length < afileBase.GetSize())
  1152. {
  1153. SceneEdit.m_byItemFileBuffer = new byte[afileBase.GetSize()];
  1154. }
  1155. afileBase.Read(ref SceneEdit.m_byItemFileBuffer, afileBase.GetSize());
  1156. }
  1157. }
  1158. catch (Exception ex)
  1159. {
  1160. Debug.LogError(string.Concat(new string[]
  1161. {
  1162. "メニューファイルがが読み込めませんでした。 : ",
  1163. f_strMenuFileName,
  1164. " : ",
  1165. ex.Message,
  1166. " : StackTrace :\n",
  1167. ex.StackTrace
  1168. }));
  1169. throw ex;
  1170. }
  1171. BinaryReader binaryReader = new BinaryReader(new MemoryStream(SceneEdit.m_byItemFileBuffer), Encoding.UTF8);
  1172. string text = binaryReader.ReadString();
  1173. NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin 例外 : ヘッダーファイルが不正です。" + text);
  1174. int num = binaryReader.ReadInt32();
  1175. string path = binaryReader.ReadString();
  1176. string text2 = binaryReader.ReadString();
  1177. string text3 = binaryReader.ReadString();
  1178. string text4 = binaryReader.ReadString();
  1179. long num2 = (long)binaryReader.ReadInt32();
  1180. int num3 = 0;
  1181. string text5 = null;
  1182. string text6 = string.Empty;
  1183. string text7 = string.Empty;
  1184. try
  1185. {
  1186. for (;;)
  1187. {
  1188. int num4 = (int)binaryReader.ReadByte();
  1189. text7 = text6;
  1190. text6 = string.Empty;
  1191. if (num4 == 0)
  1192. {
  1193. break;
  1194. }
  1195. for (int i = 0; i < num4; i++)
  1196. {
  1197. text6 = text6 + "\"" + binaryReader.ReadString() + "\" ";
  1198. }
  1199. if (!(text6 == string.Empty))
  1200. {
  1201. string stringCom = UTY.GetStringCom(text6);
  1202. string[] stringList = UTY.GetStringList(text6);
  1203. if (stringCom == "name")
  1204. {
  1205. string text8 = stringList[1];
  1206. string text9 = string.Empty;
  1207. string arg = string.Empty;
  1208. int j = 0;
  1209. while (j < text8.Length && text8[j] != '\u3000' && text8[j] != ' ')
  1210. {
  1211. text9 += text8[j];
  1212. j++;
  1213. }
  1214. while (j < text8.Length)
  1215. {
  1216. arg += text8[j];
  1217. j++;
  1218. }
  1219. mi.m_strMenuName = text9;
  1220. }
  1221. else if (stringCom == "setumei")
  1222. {
  1223. mi.m_strInfo = stringList[1];
  1224. mi.m_strInfo = mi.m_strInfo.Replace("《改行》", "\n");
  1225. }
  1226. else if (stringCom == "category")
  1227. {
  1228. string strCateName = stringList[1].ToLower();
  1229. mi.m_strCateName = strCateName;
  1230. try
  1231. {
  1232. mi.m_mpn = (MPN)Enum.Parse(typeof(MPN), mi.m_strCateName);
  1233. }
  1234. catch
  1235. {
  1236. Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
  1237. mi.m_mpn = MPN.null_mpn;
  1238. }
  1239. }
  1240. else if (stringCom == "color_set")
  1241. {
  1242. try
  1243. {
  1244. mi.m_eColorSetMPN = (MPN)Enum.Parse(typeof(MPN), stringList[1].ToLower());
  1245. }
  1246. catch
  1247. {
  1248. Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
  1249. }
  1250. if (stringList.Length >= 3)
  1251. {
  1252. mi.m_strMenuNameInColorSet = stringList[2].ToLower();
  1253. }
  1254. }
  1255. else if (stringCom == "tex" || stringCom == "テクスチャ変更")
  1256. {
  1257. MaidParts.PARTS_COLOR pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
  1258. if (stringList.Length == 6)
  1259. {
  1260. string text10 = stringList[5];
  1261. try
  1262. {
  1263. pcMultiColorID = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text10.ToUpper());
  1264. }
  1265. catch
  1266. {
  1267. NDebug.Assert("無限色IDがありません。" + text10, false);
  1268. }
  1269. mi.m_pcMultiColorID = pcMultiColorID;
  1270. }
  1271. }
  1272. else if (stringCom == "icon" || stringCom == "icons")
  1273. {
  1274. text5 = stringList[1];
  1275. }
  1276. else if (!(stringCom == "iconl"))
  1277. {
  1278. if (!(stringCom == "setstr"))
  1279. {
  1280. if (!(stringCom == "アイテムパラメータ"))
  1281. {
  1282. if (stringCom == "saveitem")
  1283. {
  1284. string text11 = stringList[1];
  1285. if (text11 == string.Empty)
  1286. {
  1287. Debug.LogError("err SaveItem \"" + text11);
  1288. }
  1289. if (text11 == null)
  1290. {
  1291. Debug.LogError("err SaveItem null=\"" + text11);
  1292. }
  1293. if (text11 != string.Empty)
  1294. {
  1295. }
  1296. }
  1297. else if (!(stringCom == "catno"))
  1298. {
  1299. if (stringCom == "additem")
  1300. {
  1301. num3++;
  1302. }
  1303. else if (stringCom == "unsetitem")
  1304. {
  1305. mi.m_boDelOnly = true;
  1306. }
  1307. else if (stringCom == "priority")
  1308. {
  1309. mi.m_fPriority = float.Parse(stringList[1]);
  1310. }
  1311. else if (stringCom == "メニューフォルダ" && stringList[1].ToLower() == "man")
  1312. {
  1313. mi.m_bMan = true;
  1314. }
  1315. }
  1316. }
  1317. }
  1318. }
  1319. }
  1320. }
  1321. }
  1322. catch (Exception ex2)
  1323. {
  1324. Debug.LogError(string.Concat(new string[]
  1325. {
  1326. "Exception ",
  1327. Path.GetFileName(path),
  1328. " 現在処理中だった行 = ",
  1329. text6,
  1330. " 以前の行 = ",
  1331. text7,
  1332. " ",
  1333. ex2.Message,
  1334. "StackTrace:\n",
  1335. ex2.StackTrace
  1336. }));
  1337. throw ex2;
  1338. }
  1339. if (text5 != null && text5 != string.Empty)
  1340. {
  1341. try
  1342. {
  1343. mi.m_texIcon = ImportCM.CreateTexture(text5);
  1344. mi.m_texIconRandomColor = mi.m_texIcon;
  1345. }
  1346. catch (Exception)
  1347. {
  1348. Debug.LogError("Error:");
  1349. }
  1350. }
  1351. binaryReader.Close();
  1352. return true;
  1353. }
  1354. private bool UpdatePanel_Category()
  1355. {
  1356. this.m_listNg2Cate.Clear();
  1357. foreach (GameObject obj in this.m_listBtnCate)
  1358. {
  1359. UnityEngine.Object.DestroyImmediate(obj);
  1360. }
  1361. this.m_listBtnCate.Clear();
  1362. for (int i = 0; i < this.m_listCategory.Count; i++)
  1363. {
  1364. SceneEdit.SCategory scategory = this.m_listCategory[i];
  1365. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
  1366. GameObject gameObject = NGUITools.AddChild(this.m_Panel_Category.goGrid, @object as GameObject);
  1367. UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
  1368. uilabel.text = scategory.m_strCateName;
  1369. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  1370. buttonEdit.m_Category = scategory;
  1371. UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
  1372. uibutton.isEnabled = scategory.m_isEnabled;
  1373. if (uibutton.isEnabled)
  1374. {
  1375. EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
  1376. }
  1377. buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
  1378. buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
  1379. UIButton component = buttonEdit.GetComponent<UIButton>();
  1380. buttonEdit.m_colBtnDefault = component.defaultColor;
  1381. this.m_listBtnCate.Add(gameObject);
  1382. }
  1383. this.m_Panel_Category.gcScrollView.ResetPosition();
  1384. this.m_Panel_Category.gcUIGrid.Reposition();
  1385. this.m_Panel_PartsType.SetActive(false);
  1386. this.m_Panel_MenuItem.SetActive(false);
  1387. this.m_Panel_SetItem.SetActive(false);
  1388. this.m_Panel_SliderItem.SetActive(false);
  1389. this.m_Panel_ColorSet.SetActive(false);
  1390. this.m_Panel_GroupSet.SetActive(false);
  1391. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1392. return true;
  1393. }
  1394. private void UpdatePanel_PartsType(SceneEdit.SCategory f_cate)
  1395. {
  1396. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  1397. this.m_info.Close();
  1398. this.m_Panel_PartsType.SetActive(true);
  1399. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  1400. this.m_Panel_PartsType.VisibleArrow(false);
  1401. this.m_misDelOnly = null;
  1402. for (int i = 0; i < this.m_listBtnPartsType.Count; i++)
  1403. {
  1404. GameObject obj = this.m_listBtnPartsType[i];
  1405. UnityEngine.Object.DestroyImmediate(obj);
  1406. }
  1407. this.m_listBtnPartsType.Clear();
  1408. for (int j = 0; j < this.m_listSliderItem.Count; j++)
  1409. {
  1410. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[j];
  1411. sliderItemSet.Clear();
  1412. }
  1413. this.m_listSliderItem.Clear();
  1414. for (int k = 0; k < this.m_listBtnMenuItem.Count; k++)
  1415. {
  1416. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[k];
  1417. menuItemSet.Clear();
  1418. }
  1419. this.m_listBtnMenuItem.Clear();
  1420. for (int l = 0; l < this.m_listBtnColorSet.Count; l++)
  1421. {
  1422. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[l];
  1423. colorItemSet.Clear();
  1424. }
  1425. this.m_listBtnColorSet.Clear();
  1426. for (int m = 0; m < this.m_listBtnGroupMember.Count; m++)
  1427. {
  1428. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[m];
  1429. menuItemSet2.Clear();
  1430. }
  1431. this.m_listBtnGroupMember.Clear();
  1432. for (int n = 0; n < f_cate.m_listPartsType.Count; n++)
  1433. {
  1434. SceneEdit.SPartsType spartsType = f_cate.m_listPartsType[n];
  1435. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
  1436. GameObject gameObject = NGUITools.AddChild(this.m_Panel_PartsType.goGrid, @object as GameObject);
  1437. UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
  1438. uilabel.text = spartsType.m_strPartsTypeName;
  1439. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  1440. buttonEdit.m_PartsType = spartsType;
  1441. UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
  1442. uibutton.isEnabled = spartsType.m_isEnabled;
  1443. if (uibutton.isEnabled)
  1444. {
  1445. EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
  1446. }
  1447. buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
  1448. buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
  1449. UIButton component = buttonEdit.GetComponent<UIButton>();
  1450. buttonEdit.m_colBtnDefault = component.defaultColor;
  1451. this.m_listBtnPartsType.Add(gameObject);
  1452. }
  1453. this.m_Panel_PartsType.ResetScrollPos(0.5f);
  1454. this.m_Panel_MenuItem.ResetScrollPos(0f);
  1455. this.m_Panel_SetItem.ResetScrollPos(0f);
  1456. this.m_Panel_SliderItem.ResetScrollPos(0f);
  1457. }
  1458. private void UpdatePanel_MenuItem(SceneEdit.SPartsType f_pt)
  1459. {
  1460. if (f_pt.m_ePartsType == "set_maidwear" || f_pt.m_ePartsType == "set_mywear" || f_pt.m_ePartsType == "set_underwear" || f_pt.m_ePartsType == "set_body")
  1461. {
  1462. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT_MORE);
  1463. }
  1464. else
  1465. {
  1466. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  1467. }
  1468. this.m_misDelOnly = null;
  1469. this.m_info.Close();
  1470. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  1471. for (int i = 0; i < this.m_listSliderItem.Count; i++)
  1472. {
  1473. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
  1474. sliderItemSet.Clear();
  1475. }
  1476. this.m_listSliderItem.Clear();
  1477. for (int j = 0; j < this.m_listBtnMenuItem.Count; j++)
  1478. {
  1479. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[j];
  1480. menuItemSet.Clear();
  1481. }
  1482. this.m_listBtnMenuItem.Clear();
  1483. for (int k = 0; k < this.m_listBtnColorSet.Count; k++)
  1484. {
  1485. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[k];
  1486. colorItemSet.Clear();
  1487. }
  1488. this.m_listBtnColorSet.Clear();
  1489. for (int l = 0; l < this.m_listBtnGroupMember.Count; l++)
  1490. {
  1491. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[l];
  1492. menuItemSet2.Clear();
  1493. }
  1494. this.m_listBtnGroupMember.Clear();
  1495. float num = -1f;
  1496. if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item || f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
  1497. {
  1498. if (!string.IsNullOrEmpty(this.last_select_category_name_))
  1499. {
  1500. if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1501. {
  1502. this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_MenuItem.gcScrollBar.value * 100f) / 100f;
  1503. }
  1504. if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1505. {
  1506. this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_SetItem.gcScrollBar.value * 100f) / 100f;
  1507. }
  1508. }
  1509. if (this.backup_category_scroll_pos_.ContainsKey(f_pt.m_strPartsTypeName))
  1510. {
  1511. num = this.backup_category_scroll_pos_[f_pt.m_strPartsTypeName];
  1512. }
  1513. this.m_Panel_MenuItem.SetActive(false);
  1514. this.m_Panel_SetItem.SetActive(false);
  1515. SceneEdit.UIPanelSet uipanelSet = null;
  1516. string f_strPrefabName = string.Empty;
  1517. bool f_bSelectedFrame = false;
  1518. if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item)
  1519. {
  1520. uipanelSet = this.m_Panel_MenuItem;
  1521. f_strPrefabName = "ButtonItem";
  1522. f_bSelectedFrame = true;
  1523. }
  1524. else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
  1525. {
  1526. uipanelSet = this.m_Panel_SetItem;
  1527. f_strPrefabName = "ButtonSet";
  1528. f_bSelectedFrame = false;
  1529. this.customPartsWindowVisibleButton.windowVisible = false;
  1530. this.customPartsWindowVisibleButton.visible = false;
  1531. }
  1532. this.m_Panel_SliderItem.SetActive(false);
  1533. this.m_Panel_ColorSet.SetActive(false);
  1534. this.m_Panel_GroupSet.SetActive(false);
  1535. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1536. uipanelSet.SetActive(true);
  1537. for (int m = 0; m < f_pt.m_listMenu.Count; m++)
  1538. {
  1539. SceneEdit.SMenuItem smenuItem = f_pt.m_listMenu[m];
  1540. bool flag = this.m_bUseGroup;
  1541. if (smenuItem.m_mpn == MPN.set_body)
  1542. {
  1543. flag = false;
  1544. }
  1545. if (!flag || !smenuItem.m_bMember)
  1546. {
  1547. SceneEdit.MenuItemSet menuItemSet3 = new SceneEdit.MenuItemSet(uipanelSet.goGrid, smenuItem, f_strPrefabName, f_bSelectedFrame);
  1548. if (smenuItem.m_boDelOnly)
  1549. {
  1550. this.m_misDelOnly = menuItemSet3;
  1551. }
  1552. if (menuItemSet3.mi.m_strCateName.IndexOf("set_") != -1 && menuItemSet3.mi.m_bGroupLeader && flag)
  1553. {
  1554. EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallbackFromSetGroup));
  1555. }
  1556. else
  1557. {
  1558. EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  1559. }
  1560. if (smenuItem.m_bGroupLeader && flag)
  1561. {
  1562. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallbackOnGroup));
  1563. }
  1564. else
  1565. {
  1566. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  1567. }
  1568. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  1569. this.m_listBtnMenuItem.Add(menuItemSet3);
  1570. }
  1571. }
  1572. uipanelSet.gcUIGrid.GetComponent<UIGrid>().enabled = true;
  1573. this.UpdateSelectedMenuItem(f_pt);
  1574. this.last_select_category_name_ = f_pt.m_strPartsTypeName;
  1575. }
  1576. else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  1577. {
  1578. this.customPartsWindowVisibleButton.windowVisible = false;
  1579. this.customPartsWindowVisibleButton.visible = false;
  1580. this.m_Panel_MenuItem.SetActive(false);
  1581. this.m_Panel_SetItem.SetActive(false);
  1582. this.m_Panel_SliderItem.SetActive(true);
  1583. this.m_Panel_ColorSet.SetActive(false);
  1584. this.m_Panel_GroupSet.SetActive(false);
  1585. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1586. bool flag2 = false;
  1587. for (int n = 0; n < f_pt.m_listMenu.Count; n++)
  1588. {
  1589. SceneEdit.SMenuItem smenuItem2 = f_pt.m_listMenu[n];
  1590. SceneEdit.SliderItemSet sliderItemSet2 = new SceneEdit.SliderItemSet(this.m_Panel_SliderItem.goGrid, smenuItem2);
  1591. EventDelegate.Add(sliderItemSet2.gcSlider.onChange, new EventDelegate.Callback(this.SlideCallback));
  1592. this.m_listSliderItem.Add(sliderItemSet2);
  1593. flag2 |= (smenuItem2.m_mpn == MPN.MuneYawaraka);
  1594. }
  1595. BaseMgr<BodyStatusMgr>.Instance.OpenPanel(flag2);
  1596. this.UpdateSliders();
  1597. }
  1598. this.m_Panel_MenuItem.ResetScrollPos(0f);
  1599. this.m_Panel_SetItem.ResetScrollPos(0f);
  1600. this.m_Panel_SliderItem.ResetScrollPos(0f);
  1601. if (num != -1f)
  1602. {
  1603. if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1604. {
  1605. this.m_Panel_MenuItem.gcScrollBar.value = num;
  1606. }
  1607. if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1608. {
  1609. this.m_Panel_SetItem.gcScrollBar.value = num;
  1610. }
  1611. }
  1612. }
  1613. private void ClosePanel_MenuItem()
  1614. {
  1615. }
  1616. private void UpdateSelectedMenuItem(SceneEdit.SPartsType f_pt)
  1617. {
  1618. Maid maid = this.m_maid;
  1619. MaidProp prop = maid.GetProp(f_pt.m_mpn);
  1620. NDebug.Assert(prop != null, "指定MPNが不正です。");
  1621. SceneEdit.SMenuItem smenuItem = null;
  1622. if (this.m_misDelOnly != null)
  1623. {
  1624. this.m_misDelOnly.Selected(false);
  1625. }
  1626. for (int i = 0; i < this.m_listBtnMenuItem.Count; i++)
  1627. {
  1628. this.m_listBtnMenuItem[i].Selected(false);
  1629. }
  1630. bool flag = false;
  1631. HashSet<int> hashSet = new HashSet<int>();
  1632. foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
  1633. {
  1634. if (subPropMpnData.mpn == f_pt.m_mpn)
  1635. {
  1636. subPropMpnData.manager.UpdateAllItem();
  1637. flag = true;
  1638. if (subPropMpnData.manager.sloatItems != null)
  1639. {
  1640. foreach (SubSlotEditItem subSlotEditItem in subPropMpnData.manager.sloatItems)
  1641. {
  1642. if (!(subSlotEditItem == null) && subSlotEditItem.menuItem != null)
  1643. {
  1644. if (!hashSet.Contains(subSlotEditItem.menuItem.m_nMenuFileRID))
  1645. {
  1646. hashSet.Add(subSlotEditItem.menuItem.m_nMenuFileRID);
  1647. }
  1648. }
  1649. }
  1650. }
  1651. break;
  1652. }
  1653. }
  1654. int num = (this.modeType != SceneEdit.ModeType.CostumeEdit) ? prop.nFileNameRID : prop.nTempFileNameRID;
  1655. if (num != 0)
  1656. {
  1657. for (int l = 0; l < this.m_listBtnMenuItem.Count; l++)
  1658. {
  1659. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[l];
  1660. SceneEdit.SMenuItem menuItem = menuItemSet.gcBtnEdit.m_MenuItem;
  1661. if (!menuItem.m_bGroupLeader || !this.m_bUseGroup)
  1662. {
  1663. bool flag2 = menuItem.m_nMenuFileRID == num;
  1664. if (flag && (!flag2 || hashSet.Count != 0))
  1665. {
  1666. flag2 = hashSet.Contains(menuItem.m_nMenuFileRID);
  1667. }
  1668. if (flag2)
  1669. {
  1670. menuItemSet.Selected(true);
  1671. smenuItem = menuItem;
  1672. bool flag3 = this.customPartsWindow.SetItem(menuItem);
  1673. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1674. {
  1675. flag3 = false;
  1676. }
  1677. if (!flag3)
  1678. {
  1679. this.customPartsWindowVisibleButton.windowVisible = false;
  1680. }
  1681. this.customPartsWindowVisibleButton.visible = flag3;
  1682. }
  1683. }
  1684. else
  1685. {
  1686. NDebug.Assert(hashSet.Count == 0, "SubPropとグループが競合しています");
  1687. bool flag4 = false;
  1688. int num2 = 0;
  1689. while (num2 < menuItem.m_listMember.Count && !flag4)
  1690. {
  1691. flag4 |= (menuItem.m_listMember[num2].m_nMenuFileRID == num);
  1692. num2++;
  1693. }
  1694. if (flag4)
  1695. {
  1696. menuItemSet.Selected(true);
  1697. smenuItem = menuItem;
  1698. bool flag5 = this.customPartsWindow.SetItem(menuItem);
  1699. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1700. {
  1701. flag5 = false;
  1702. }
  1703. if (!flag5)
  1704. {
  1705. this.customPartsWindowVisibleButton.windowVisible = false;
  1706. }
  1707. this.customPartsWindowVisibleButton.visible = flag5;
  1708. }
  1709. }
  1710. }
  1711. }
  1712. else
  1713. {
  1714. for (int m = 0; m < this.m_listBtnMenuItem.Count; m++)
  1715. {
  1716. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnMenuItem[m];
  1717. if (menuItemSet2.mi.m_listColorSet != null)
  1718. {
  1719. SceneEdit.SMenuItem smenuItem2;
  1720. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1721. {
  1722. smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nTempFileNameRID);
  1723. }
  1724. else
  1725. {
  1726. smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nFileNameRID);
  1727. }
  1728. if (smenuItem2 != null)
  1729. {
  1730. menuItemSet2.Selected(true);
  1731. smenuItem = menuItemSet2.mi;
  1732. }
  1733. }
  1734. }
  1735. }
  1736. if (smenuItem == null && this.m_misDelOnly != null)
  1737. {
  1738. this.m_misDelOnly.Selected(true);
  1739. }
  1740. this.UpdatePanel_ColorSet(smenuItem);
  1741. foreach (SceneEdit.SubPropMpnData subPropMpnData2 in this.subPropDatas)
  1742. {
  1743. subPropMpnData2.manager.visible = false;
  1744. }
  1745. this.UpdatePanel_GroupSet(smenuItem);
  1746. if (smenuItem != null)
  1747. {
  1748. foreach (SceneEdit.SubPropMpnData subPropMpnData3 in this.subPropDatas)
  1749. {
  1750. if (subPropMpnData3.mpn == smenuItem.m_mpn)
  1751. {
  1752. this.m_Panel_GroupSet.SetActive(true);
  1753. subPropMpnData3.manager.visible = true;
  1754. subPropMpnData3.manager.UpdateAllItem();
  1755. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
  1756. Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1757. localPosition.x = 23f;
  1758. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
  1759. this.m_Panel_GroupSet.ResetScrollPos(0f);
  1760. }
  1761. }
  1762. }
  1763. if (this.customPartsWindowVisibleButton.visible)
  1764. {
  1765. if (this.m_Panel_GroupSet.goMain.activeInHierarchy)
  1766. {
  1767. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(119f, 406f, 0f);
  1768. }
  1769. else if (this.m_Panel_ColorSet.goMain.activeInHierarchy)
  1770. {
  1771. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(60f, 406f, 0f);
  1772. }
  1773. else
  1774. {
  1775. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(0f, 406f, 0f);
  1776. }
  1777. }
  1778. }
  1779. private void UpdatePanel_GroupSet(SceneEdit.SMenuItem f_miSelected)
  1780. {
  1781. if (f_miSelected == null || f_miSelected.m_mpn == MPN.set_body || !f_miSelected.m_bGroupLeader || !this.m_bUseGroup)
  1782. {
  1783. this.m_Panel_GroupSet.SetActive(false);
  1784. return;
  1785. }
  1786. Maid maid = this.m_maid;
  1787. MaidProp prop = maid.GetProp(f_miSelected.m_mpn);
  1788. this.m_Panel_GroupSet.SetActive(true);
  1789. bool flag = this.m_listBtnGroupMember.Count != f_miSelected.m_listMember.Count;
  1790. if (!flag)
  1791. {
  1792. int num = 0;
  1793. while (num < f_miSelected.m_listMember.Count && !flag)
  1794. {
  1795. if (this.m_listBtnGroupMember[num].mi != f_miSelected.m_listMember[num])
  1796. {
  1797. flag = true;
  1798. }
  1799. num++;
  1800. }
  1801. }
  1802. bool flag2 = f_miSelected.m_strCateName.IndexOf("set_") != -1;
  1803. if (flag)
  1804. {
  1805. for (int i = 0; i < this.m_listBtnGroupMember.Count; i++)
  1806. {
  1807. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnGroupMember[i];
  1808. menuItemSet.Clear();
  1809. }
  1810. this.m_listBtnGroupMember.Clear();
  1811. for (int j = 0; j < f_miSelected.m_listMember.Count; j++)
  1812. {
  1813. SceneEdit.MenuItemSet menuItemSet2 = new SceneEdit.MenuItemSet(this.m_Panel_GroupSet.goGrid, f_miSelected.m_listMember[j], (!flag2) ? "ButtonItem" : "ButtonSet", true);
  1814. if (flag2)
  1815. {
  1816. menuItemSet2.ToSmall();
  1817. }
  1818. EventDelegate.Add(menuItemSet2.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  1819. EventDelegate.Add(menuItemSet2.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  1820. EventDelegate.Add(menuItemSet2.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  1821. this.m_listBtnGroupMember.Add(menuItemSet2);
  1822. if (!flag2)
  1823. {
  1824. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1825. {
  1826. menuItemSet2.Selected(prop != null && prop.nTempFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
  1827. }
  1828. else
  1829. {
  1830. menuItemSet2.Selected(prop != null && prop.nFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
  1831. }
  1832. }
  1833. }
  1834. if (flag2)
  1835. {
  1836. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 127f;
  1837. Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1838. localPosition.x = 117f;
  1839. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
  1840. }
  1841. else
  1842. {
  1843. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
  1844. Vector3 localPosition2 = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1845. localPosition2.x = 23f;
  1846. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition2;
  1847. }
  1848. this.m_Panel_GroupSet.ResetScrollPos(0f);
  1849. }
  1850. else if (!flag2)
  1851. {
  1852. for (int k = 0; k < this.m_listBtnGroupMember.Count; k++)
  1853. {
  1854. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1855. {
  1856. this.m_listBtnGroupMember[k].Selected(prop != null && prop.nTempFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
  1857. }
  1858. else
  1859. {
  1860. this.m_listBtnGroupMember[k].Selected(prop != null && prop.nFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
  1861. }
  1862. }
  1863. }
  1864. }
  1865. private void UpdatePanel_ColorSet(SceneEdit.SMenuItem f_miSelected)
  1866. {
  1867. this.colorPaletteMgr.Close();
  1868. if (f_miSelected == null || f_miSelected.m_eColorSetMPN == MPN.null_mpn)
  1869. {
  1870. this.m_Panel_ColorSet.SetActive(false);
  1871. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1872. return;
  1873. }
  1874. if (f_miSelected.m_mpn == MPN.folder_mayu)
  1875. {
  1876. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(true);
  1877. this.m_CheckBoxMayuDrawPriority.check = this.m_maid.MayuDrawPriority;
  1878. }
  1879. if (this.modeType != SceneEdit.ModeType.CostumeEdit)
  1880. {
  1881. this.m_Panel_ColorSet.SetActive(true);
  1882. }
  1883. for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
  1884. {
  1885. this.m_listBtnColorSet[i].Clear();
  1886. }
  1887. this.m_listBtnColorSet.Clear();
  1888. for (int j = 0; j < f_miSelected.m_listColorSet.Count; j++)
  1889. {
  1890. SceneEdit.SMenuItem f_mi = f_miSelected.m_listColorSet[j];
  1891. SceneEdit.ColorItemSet colorItemSet = new SceneEdit.ColorItemSet(this.m_Panel_ColorSet.goGrid, f_mi);
  1892. EventDelegate.Add(colorItemSet.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  1893. EventDelegate.Add(colorItemSet.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  1894. EventDelegate.Add(colorItemSet.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  1895. this.m_listBtnColorSet.Add(colorItemSet);
  1896. }
  1897. this.m_Panel_ColorSet.ResetScrollPos(0f);
  1898. this.UpdateSelected_ColorSet(f_miSelected.m_eColorSetMPN);
  1899. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1900. {
  1901. this.m_Panel_ColorSet.SetActive(false);
  1902. }
  1903. }
  1904. private void UpdateSelected_ColorSet(MPN f_mpn)
  1905. {
  1906. Maid maid = this.m_maid;
  1907. MaidProp prop = maid.GetProp(f_mpn);
  1908. NDebug.Assert(prop != null, "指定MPNが不正です。");
  1909. SceneEdit.SMenuItem smenuItem = null;
  1910. if (prop.nFileNameRID != 0)
  1911. {
  1912. for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
  1913. {
  1914. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[i];
  1915. SceneEdit.SMenuItem menuItem = colorItemSet.gcBtnEdit.m_MenuItem;
  1916. colorItemSet.Selected(false);
  1917. if (menuItem.m_nMenuFileRID == prop.nFileNameRID)
  1918. {
  1919. colorItemSet.Selected(true);
  1920. smenuItem = menuItem;
  1921. }
  1922. }
  1923. if (smenuItem != null)
  1924. {
  1925. if (smenuItem.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE)
  1926. {
  1927. if (this.modeType != SceneEdit.ModeType.CostumeEdit)
  1928. {
  1929. this.colorPaletteMgr.Call(0, smenuItem.m_pcMultiColorID);
  1930. }
  1931. }
  1932. else
  1933. {
  1934. this.colorPaletteMgr.Close();
  1935. }
  1936. }
  1937. }
  1938. }
  1939. public void UpdateSliders()
  1940. {
  1941. for (int i = 0; i < this.m_listSliderItem.Count; i++)
  1942. {
  1943. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
  1944. Maid maid = this.m_maid;
  1945. MaidProp prop = maid.GetProp(sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName);
  1946. if (sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName == "MuneL")
  1947. {
  1948. MaidProp prop2 = maid.GetProp(MPN.MuneS);
  1949. int num;
  1950. if (0 <= prop2.value && prop.value == 0)
  1951. {
  1952. num = (int)Math.Round((double)(-30f * ((float)(prop2.value - prop2.min) / (float)(prop2.max - prop2.min))), MidpointRounding.AwayFromZero);
  1953. }
  1954. else
  1955. {
  1956. num = prop.value;
  1957. }
  1958. int num2 = prop.min - 30;
  1959. sliderItemSet.SetValue((float)(num - num2) / (float)(prop.max - num2), num.ToString());
  1960. }
  1961. else
  1962. {
  1963. sliderItemSet.SetValue((float)(prop.value - prop.min) / (float)(prop.max - prop.min), prop.value.ToString());
  1964. }
  1965. }
  1966. BaseMgr<BodyStatusMgr>.Instance.UpdateBodyStatus();
  1967. }
  1968. public void CategoryUnSelect()
  1969. {
  1970. for (int i = 0; i < this.m_listBtnCate.Count; i++)
  1971. {
  1972. GameObject gameObject = this.m_listBtnCate[i];
  1973. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  1974. UISprite component = buttonEdit.m_goFrame.GetComponent<UISprite>();
  1975. component.enabled = false;
  1976. UIButton component2 = buttonEdit.GetComponent<UIButton>();
  1977. component2.defaultColor = buttonEdit.m_colBtnDefault;
  1978. }
  1979. this.m_Panel_Category.VisibleArrow(false);
  1980. }
  1981. public void ProcMenuItem(SceneEdit.SMenuItem f_mi)
  1982. {
  1983. }
  1984. public void PartsTypeWearMode(MPN f_eMpn)
  1985. {
  1986. TBody.MaskMode maskMode;
  1987. if (SceneEditInfo.m_dicPartsTypeWearMode.TryGetValue(f_eMpn, out maskMode))
  1988. {
  1989. Maid maid = this.m_maid;
  1990. maid.body0.SetMaskMode(maskMode);
  1991. }
  1992. }
  1993. public void PartsTypeCamera(MPN f_eMpn)
  1994. {
  1995. SceneEditInfo.CamToBone camToBone;
  1996. if (this.m_viewreset.GetVisibleAutoCam() && SceneEditInfo.m_dicPartsTypeCamera.TryGetValue(f_eMpn, out camToBone))
  1997. {
  1998. Maid maid = this.m_maid;
  1999. if (string.IsNullOrEmpty(camToBone.bone))
  2000. {
  2001. this.CameraMoveTo(this.m_cameraMoveSupport.targetPosition, camToBone.distance, camToBone.angle, 0.5f);
  2002. }
  2003. else
  2004. {
  2005. Transform bone = maid.body0.GetBone(camToBone.bone);
  2006. if (bone != null)
  2007. {
  2008. this.CameraMoveTo(bone.position, camToBone.distance, camToBone.angle, 0.5f);
  2009. }
  2010. }
  2011. }
  2012. }
  2013. public void ClickCallbackFromSetGroup()
  2014. {
  2015. this.m_bOpenSetGroupPanel = true;
  2016. this.ClickCallback();
  2017. this.m_bOpenSetGroupPanel = false;
  2018. }
  2019. public void ClickCallback()
  2020. {
  2021. Maid maid = this.m_maid;
  2022. if (maid.IsBusy)
  2023. {
  2024. return;
  2025. }
  2026. ButtonEdit componentInChildren = UIButton.current.GetComponentInChildren<ButtonEdit>();
  2027. if (componentInChildren.m_MenuItem == null || !componentInChildren.m_MenuItem.m_bColor)
  2028. {
  2029. this.customPartsWindowVisibleButton.windowVisible = false;
  2030. }
  2031. if (componentInChildren.m_Category != null)
  2032. {
  2033. this.customPartsWindowVisibleButton.visible = false;
  2034. this.m_Panel_Category.VisibleArrow(false);
  2035. this.CategoryUnSelect();
  2036. this.colorPaletteMgr.Close();
  2037. UISprite component = componentInChildren.m_goFrame.GetComponent<UISprite>();
  2038. component.enabled = true;
  2039. UIButton component2 = componentInChildren.GetComponent<UIButton>();
  2040. component2.defaultColor = new Color(component2.defaultColor.r, component2.defaultColor.g, component2.defaultColor.b, 1f);
  2041. this.m_maid.OpenMouthLookTooth(false);
  2042. this.m_Panel_PartsType.SetActive(false);
  2043. this.m_Panel_MenuItem.SetActive(false);
  2044. this.m_Panel_SetItem.SetActive(false);
  2045. this.m_Panel_SliderItem.SetActive(false);
  2046. this.m_Panel_ColorSet.SetActive(false);
  2047. this.m_Panel_GroupSet.SetActive(false);
  2048. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  2049. BaseMgr<RandomPresetMgr>.Instance.CloseRandomPresetPanel();
  2050. BaseMgr<PresetMgr>.Instance.ClosePresetPanel();
  2051. BaseMgr<ProfileMgr>.Instance.CloseProfilePanel();
  2052. BaseMgr<CostumePartsEnabledMgr>.Instance.CloseRandomPresetPanel();
  2053. if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.ランダム)
  2054. {
  2055. if (this.m_viewreset.GetVisibleAutoCam())
  2056. {
  2057. this.CameraReset(0.5f);
  2058. }
  2059. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2060. BaseMgr<RandomPresetMgr>.Instance.OpenRandomPresetPanel();
  2061. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2062. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2063. }
  2064. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プリセット)
  2065. {
  2066. if (this.m_viewreset.GetVisibleAutoCam())
  2067. {
  2068. this.CameraReset(0.5f);
  2069. }
  2070. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2071. BaseMgr<PresetMgr>.Instance.OpenPresetPanel();
  2072. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2073. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2074. }
  2075. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
  2076. {
  2077. if (this.m_viewreset.GetVisibleAutoCam())
  2078. {
  2079. this.CameraReset(0.5f);
  2080. }
  2081. BaseMgr<ProfileMgr>.Instance.OpenProfilePanel();
  2082. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2083. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2084. }
  2085. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
  2086. {
  2087. if (this.m_viewreset.GetVisibleAutoCam())
  2088. {
  2089. this.CameraReset(0.5f);
  2090. }
  2091. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2092. BaseMgr<CostumePartsEnabledMgr>.Instance.OpenRandomPresetPanel();
  2093. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2094. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2095. }
  2096. else
  2097. {
  2098. this.UpdatePanel_PartsType(componentInChildren.m_Category);
  2099. }
  2100. this.m_Panel_Category.VisibleArrow(true);
  2101. this.m_Panel_Category.MoveArrow(componentInChildren.gameObject);
  2102. this.m_nNowMPN = MPN.null_mpn;
  2103. }
  2104. if (componentInChildren.m_PartsType != null)
  2105. {
  2106. for (int k = 0; k < this.m_listBtnPartsType.Count; k++)
  2107. {
  2108. GameObject gameObject = this.m_listBtnPartsType[k];
  2109. ButtonEdit componentInChildren2 = gameObject.GetComponentInChildren<ButtonEdit>();
  2110. UISprite component3 = componentInChildren2.m_goFrame.GetComponent<UISprite>();
  2111. component3.enabled = false;
  2112. UIButton component4 = componentInChildren2.GetComponent<UIButton>();
  2113. component4.defaultColor = componentInChildren2.m_colBtnDefault;
  2114. }
  2115. UISprite component5 = componentInChildren.m_goFrame.GetComponent<UISprite>();
  2116. component5.enabled = true;
  2117. UIButton component6 = componentInChildren.GetComponent<UIButton>();
  2118. component6.defaultColor = new Color(component6.defaultColor.r, component6.defaultColor.g, component6.defaultColor.b, 1f);
  2119. this.colorPaletteMgr.Close();
  2120. this.PartsTypeWearMode(componentInChildren.m_PartsType.m_mpn);
  2121. this.PartsTypeCamera(componentInChildren.m_PartsType.m_mpn);
  2122. if (componentInChildren.m_PartsType.m_mpn == MPN.accha)
  2123. {
  2124. this.m_maid.OpenMouthLookTooth(true);
  2125. }
  2126. else
  2127. {
  2128. this.m_maid.OpenMouthLookTooth(false);
  2129. }
  2130. this.UpdatePanel_MenuItem(componentInChildren.m_PartsType);
  2131. this.m_Panel_PartsType.VisibleArrow(true);
  2132. this.m_Panel_PartsType.MoveArrow(componentInChildren.gameObject);
  2133. this.m_EditMod.m_mpn = componentInChildren.m_PartsType.m_mpn;
  2134. this.m_nNowMPN = componentInChildren.m_PartsType.m_mpn;
  2135. }
  2136. if (componentInChildren.m_MenuItem != null && !maid.boAllProcPropBUSY)
  2137. {
  2138. SceneEdit.SMenuItem smenuItem = null;
  2139. MaidProp prop = maid.GetProp(componentInChildren.m_MenuItem.m_mpn);
  2140. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2141. {
  2142. if (prop != null && this.m_menuRidDic.ContainsKey(prop.nTempFileNameRID))
  2143. {
  2144. smenuItem = this.m_menuRidDic[prop.nTempFileNameRID];
  2145. }
  2146. }
  2147. else if (prop != null && this.m_menuRidDic.ContainsKey(prop.nFileNameRID))
  2148. {
  2149. smenuItem = this.m_menuRidDic[prop.nFileNameRID];
  2150. }
  2151. if (!this.m_bOpenSetGroupPanel)
  2152. {
  2153. if (!componentInChildren.m_MenuItem.m_bColor && this.modeType != SceneEdit.ModeType.CostumeEdit)
  2154. {
  2155. this.customPartsWindow.OnExecItemPrev(componentInChildren.m_MenuItem);
  2156. }
  2157. bool flag = false;
  2158. foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
  2159. {
  2160. if (subPropMpnData.mpn == componentInChildren.m_MenuItem.m_mpn)
  2161. {
  2162. flag = true;
  2163. subPropMpnData.manager.SetItem(componentInChildren.m_MenuItem);
  2164. break;
  2165. }
  2166. }
  2167. if (!flag)
  2168. {
  2169. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2170. {
  2171. maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, true, false);
  2172. }
  2173. else
  2174. {
  2175. maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
  2176. }
  2177. }
  2178. }
  2179. if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.null_mpn)
  2180. {
  2181. if (componentInChildren.m_MenuItem.m_eColorSetMPN == MPN.haircolor)
  2182. {
  2183. MaidProp prop2 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
  2184. if (string.IsNullOrEmpty(prop2.strFileName))
  2185. {
  2186. List<SceneEdit.SMenuItem> listColorSet = componentInChildren.m_MenuItem.m_listColorSet;
  2187. if (listColorSet.Count != 0)
  2188. {
  2189. SceneEdit.SMenuItem smenuItem2 = listColorSet.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE);
  2190. if (smenuItem2 == null)
  2191. {
  2192. smenuItem2 = listColorSet[0];
  2193. }
  2194. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2195. {
  2196. maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, true, false);
  2197. }
  2198. else
  2199. {
  2200. maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, false, false);
  2201. }
  2202. }
  2203. }
  2204. }
  2205. else
  2206. {
  2207. bool flag2 = false;
  2208. if (smenuItem != null)
  2209. {
  2210. MaidProp prop3 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
  2211. int num = 0;
  2212. foreach (SceneEdit.SMenuItem smenuItem3 in smenuItem.m_listColorSet)
  2213. {
  2214. if (smenuItem3.m_nMenuFileRID == prop3.nFileNameRID)
  2215. {
  2216. break;
  2217. }
  2218. num++;
  2219. }
  2220. if (num < componentInChildren.m_MenuItem.m_listColorSet.Count)
  2221. {
  2222. SceneEdit.SMenuItem smenuItem4 = componentInChildren.m_MenuItem.m_listColorSet[num];
  2223. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2224. {
  2225. maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, true, false);
  2226. }
  2227. else
  2228. {
  2229. maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, false, false);
  2230. }
  2231. flag2 = true;
  2232. }
  2233. }
  2234. if (!flag2)
  2235. {
  2236. List<SceneEdit.SMenuItem> listColorSet2 = componentInChildren.m_MenuItem.m_listColorSet;
  2237. if (listColorSet2.Count != 0)
  2238. {
  2239. SceneEdit.SMenuItem smenuItem5 = listColorSet2[0];
  2240. if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.eye)
  2241. {
  2242. smenuItem5 = listColorSet2.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID == MaidParts.PARTS_COLOR.NONE);
  2243. if (smenuItem5 == null)
  2244. {
  2245. smenuItem5 = listColorSet2[0];
  2246. }
  2247. }
  2248. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2249. {
  2250. maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, true, false);
  2251. }
  2252. else
  2253. {
  2254. maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, false, false);
  2255. }
  2256. }
  2257. }
  2258. }
  2259. }
  2260. maid.AllProcPropSeqStart();
  2261. if (componentInChildren.m_MenuItem.m_bColor)
  2262. {
  2263. this.UpdateSelected_ColorSet(componentInChildren.m_MenuItem.m_mpn);
  2264. }
  2265. else if (!this.m_bOpenSetGroupPanel)
  2266. {
  2267. this.UpdateSelectedMenuItem(componentInChildren.m_MenuItem.m_ParentPartsType);
  2268. }
  2269. else
  2270. {
  2271. this.UpdatePanel_GroupSet(componentInChildren.m_MenuItem);
  2272. }
  2273. }
  2274. }
  2275. public void HoverOverCallback()
  2276. {
  2277. ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
  2278. SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
  2279. Vector3 position = UIEventTrigger.current.transform.parent.position;
  2280. this.m_info.Open(position, menuItem.m_texIcon, menuItem.m_strMenuName, menuItem.m_strInfo, 0);
  2281. }
  2282. public void HoverOverCallbackOnGroup()
  2283. {
  2284. ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
  2285. SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
  2286. Vector3 position = UIEventTrigger.current.transform.parent.position;
  2287. this.m_info.Open(position, menuItem.m_texIcon, menuItem.m_strMenuName, menuItem.m_strInfo, (menuItem.m_listMember == null) ? 0 : menuItem.m_listMember.Count);
  2288. }
  2289. public void HoverOutCallback()
  2290. {
  2291. this.m_info.Close();
  2292. }
  2293. public void OnClickEditItemGroup()
  2294. {
  2295. this.m_bUseGroup = !this.m_bUseGroup;
  2296. this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  2297. }
  2298. public void OnClickEditTouchJump()
  2299. {
  2300. this.m_bUseTouchJump = !this.m_bUseTouchJump;
  2301. this.EditTouchJumpSwitch.defaultColor = ((!this.m_bUseTouchJump) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  2302. }
  2303. public void SlideCallback()
  2304. {
  2305. Maid maid = this.m_maid;
  2306. ButtonEdit componentInChildren = UIProgressBar.current.GetComponentInChildren<ButtonEdit>();
  2307. MaidProp prop = maid.GetProp(componentInChildren.m_SliderItem.m_strCateName);
  2308. if (componentInChildren.m_SliderItem.m_strCateName == "MuneL")
  2309. {
  2310. int num = prop.min - 30;
  2311. int num2 = (int)Math.Round((double)((float)num + (float)(prop.max - num) * UIProgressBar.current.value), MidpointRounding.AwayFromZero);
  2312. if (0 <= num2)
  2313. {
  2314. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, num2, false);
  2315. maid.SetProp(MPN.MuneS, 0, false);
  2316. }
  2317. else
  2318. {
  2319. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, 0, false);
  2320. maid.SetProp(MPN.MuneS, (int)(100f * ((float)num2 / -30f) + 0.5f), false);
  2321. }
  2322. }
  2323. else
  2324. {
  2325. int val = (int)((float)prop.min + (float)(prop.max - prop.min) * UIProgressBar.current.value + 0.5f);
  2326. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, val, false);
  2327. }
  2328. if (componentInChildren.m_SliderItem.m_mpn == MPN.MuneL)
  2329. {
  2330. MaidProp prop2 = maid.GetProp(MPN.MuneL);
  2331. MaidProp prop3 = maid.GetProp(MPN.MuneTare);
  2332. prop3.max = prop2.value;
  2333. if (prop3.max < 1)
  2334. {
  2335. prop3.max = 1;
  2336. prop3.value = 0;
  2337. }
  2338. maid.SetProp(MPN.MuneTare, prop3.value, false);
  2339. }
  2340. maid.AllProcProp();
  2341. this.UpdateSliders();
  2342. }
  2343. public void OpenColorSet(SceneEdit.SMenuItem f_miSelected)
  2344. {
  2345. if (f_miSelected.m_eColorSetMPN == MPN.null_mpn)
  2346. {
  2347. this.m_Panel_ColorSet.SetActive(false);
  2348. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  2349. return;
  2350. }
  2351. }
  2352. private IEnumerator CoPoseToCam(string f_lookBone, float f_cameraMoveTime, float f_waitTime = 0.2f)
  2353. {
  2354. if (f_waitTime != 0f)
  2355. {
  2356. yield return new WaitForSeconds(f_waitTime);
  2357. }
  2358. Maid maid = this.m_maid;
  2359. Transform trBone = maid.body0.GetBone(f_lookBone);
  2360. if (trBone != null)
  2361. {
  2362. this.m_cameraMoveSupport.SaveCameraPosition(trBone.position, 3f, new Vector2(-180f, 11.5528f));
  2363. this.CameraReset(f_cameraMoveTime);
  2364. }
  2365. yield break;
  2366. }
  2367. public void Voice(SceneEdit.PVBInfo f_pvb)
  2368. {
  2369. Maid maid = this.m_maid;
  2370. SceneEdit.VoiceInfo voiceInfo = f_pvb as SceneEdit.VoiceInfo;
  2371. maid.AudioMan.LoadPlay(voiceInfo.strVoiceFileName, 0f, false, false);
  2372. maid.FaceAnime(voiceInfo.strFace, 1f, 0);
  2373. if (string.IsNullOrEmpty(voiceInfo.strFace2))
  2374. {
  2375. maid.FaceBlend("無し");
  2376. }
  2377. else
  2378. {
  2379. maid.FaceBlend(voiceInfo.strFace2);
  2380. }
  2381. }
  2382. public void ToView()
  2383. {
  2384. if (GameMain.Instance.VRMode && !Input.GetKey(KeyCode.LeftShift))
  2385. {
  2386. Debug.Log("VRモードではViewモードになりません。");
  2387. return;
  2388. }
  2389. this.m_eCamOffsBack = this.m_eCamOffsNow;
  2390. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  2391. for (int i = 0; i < this.m_listPanel.Count; i++)
  2392. {
  2393. this.m_listPanel[i].alpha = 0f;
  2394. }
  2395. this.m_uipViewCancel.gameObject.SetActive(true);
  2396. this.m_uipViewCancel.alpha = 1f;
  2397. this.customViewWindow.mgr.gameObject.SetActive(false);
  2398. this.customPartsWindow.ViewMode(true);
  2399. }
  2400. public void FromView()
  2401. {
  2402. for (int i = 0; i < this.m_listPanel.Count; i++)
  2403. {
  2404. this.m_listPanel[i].alpha = 1f;
  2405. }
  2406. this.m_uipViewCancel.alpha = 0f;
  2407. this.m_uipViewCancel.gameObject.SetActive(false);
  2408. this.SetCameraOffset(this.m_eCamOffsBack);
  2409. this.customViewWindow.mgr.gameObject.SetActive(true);
  2410. this.customPartsWindow.ViewMode(false);
  2411. }
  2412. public void ClothesState(SceneEditInfo.ClothesState f_cs)
  2413. {
  2414. Maid maid = this.m_maid;
  2415. if (f_cs == SceneEditInfo.ClothesState.Nude)
  2416. {
  2417. maid.body0.SetMaskMode(TBody.MaskMode.Nude);
  2418. }
  2419. else if (f_cs == SceneEditInfo.ClothesState.Underwear)
  2420. {
  2421. maid.body0.SetMaskMode(TBody.MaskMode.Underwear);
  2422. }
  2423. if (f_cs == SceneEditInfo.ClothesState.Wear)
  2424. {
  2425. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2426. }
  2427. }
  2428. public void SetCameraOffset(SceneEdit.CAM_OFFS f_eCamOffs)
  2429. {
  2430. if (GameMain.Instance.MainCamera == null)
  2431. {
  2432. return;
  2433. }
  2434. if (f_eCamOffs == SceneEdit.CAM_OFFS.CENTER)
  2435. {
  2436. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3(0f, 0f, 0f), true);
  2437. }
  2438. else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT)
  2439. {
  2440. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 3f * 2f - (float)Screen.width / 2f, 0f, 0f), true);
  2441. }
  2442. else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT_MORE)
  2443. {
  2444. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 256f * 183f - (float)Screen.width / 2f, 0f, 0f), true);
  2445. }
  2446. this.m_eCamOffsNow = f_eCamOffs;
  2447. }
  2448. public void CallHowToNameDialog()
  2449. {
  2450. this.m_FFNameDlg.Show("名前と苗字のどちらで呼びますか?", "苗字で呼ぶ", delegate
  2451. {
  2452. this.m_FFNameDlg.Close();
  2453. this.m_maid.status.isFirstNameCall = false;
  2454. }, "名前で呼ぶ", delegate
  2455. {
  2456. this.m_FFNameDlg.Close();
  2457. this.m_maid.status.isFirstNameCall = true;
  2458. });
  2459. }
  2460. public void CallSettingNamePanel()
  2461. {
  2462. GameObject childObject = UTY.GetChildObject(this.m_goUIRoot, "NameSettingPanel", false);
  2463. if (childObject != null)
  2464. {
  2465. SceneEditNameSettingPanel component = childObject.GetComponent<SceneEditNameSettingPanel>();
  2466. if (component != null)
  2467. {
  2468. component.gameObject.SetActive(true);
  2469. component.Call();
  2470. }
  2471. }
  2472. }
  2473. private void OnEditOk()
  2474. {
  2475. if (GameMain.Instance.SysDlg.IsDecided && !GameMain.Instance.CharacterMgr.IsBusy())
  2476. {
  2477. Maid maid = this.m_maid;
  2478. if (this.customPartsWindowVisibleButton.visible)
  2479. {
  2480. this.customPartsWindowVisibleButton.windowVisible = false;
  2481. }
  2482. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2483. if (this.modeType == SceneEdit.ModeType.OriginalChara || this.modeType == SceneEdit.ModeType.MainChara)
  2484. {
  2485. this.m_FFNameDlg.Show("名前と苗字のどちらで呼びますか?", "苗字で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFamily), "名前で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFirst));
  2486. }
  2487. else
  2488. {
  2489. this.OnEndDlgOk();
  2490. }
  2491. }
  2492. }
  2493. private void OnFFNameFirst()
  2494. {
  2495. this.m_FFNameDlg.Close();
  2496. this.m_maid.status.isFirstNameCall = true;
  2497. this.Conform();
  2498. }
  2499. private void OnFFNameFamily()
  2500. {
  2501. this.m_FFNameDlg.Close();
  2502. this.m_maid.status.isFirstNameCall = false;
  2503. this.Conform();
  2504. }
  2505. private void Conform()
  2506. {
  2507. this.m_maid.boMabataki = false;
  2508. GameMain.Instance.SysDlg.Show("このメイドにしますか?", SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.OnEndDlgOk), new SystemDialog.OnClick(this.OnEndDlgCancel));
  2509. }
  2510. private void OnEndDlgOk()
  2511. {
  2512. BaseMgr<ProfileMgr>.Instance.UpdateProfileData(true);
  2513. GameMain.Instance.SysDlg.Close();
  2514. UICamera.InputEnable = false;
  2515. this.m_maid.ThumShotCamMove();
  2516. this.m_maid.body0.trsLookTarget = GameMain.Instance.ThumCamera.transform;
  2517. this.m_maid.boMabataki = false;
  2518. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2519. {
  2520. for (int i = 53; i <= 52; i++)
  2521. {
  2522. this.maid.ResetProp((MPN)i, true);
  2523. }
  2524. }
  2525. base.StartCoroutine(this.CoWaitPutCloth());
  2526. }
  2527. private IEnumerator CoWaitPutCloth()
  2528. {
  2529. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2530. {
  2531. while (GameMain.Instance.CharacterMgr.IsBusy())
  2532. {
  2533. yield return null;
  2534. }
  2535. }
  2536. for (int nF = 0; nF < 90; nF++)
  2537. {
  2538. yield return null;
  2539. }
  2540. GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
  2541. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2542. {
  2543. this.m_maid.ThumShotCustom(GameMain.Instance.FacilityMgr.tempSelectFacility.GetFacilityEditCostumeThumbnailName(), true);
  2544. }
  2545. else
  2546. {
  2547. this.m_maid.ThumShot();
  2548. }
  2549. this.m_maid.boMabataki = true;
  2550. this.m_maid.body0.trsLookTarget = null;
  2551. this.m_currentScriptFile = GameMain.Instance.ScriptMgr.adv_kag.kag.GetCurrentFileName();
  2552. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.CreateKasizukiThumShot), true, default(Color));
  2553. yield break;
  2554. }
  2555. private void OnEndDlgCancel()
  2556. {
  2557. GameMain.Instance.SysDlg.Close();
  2558. this.m_maid.boMabataki = true;
  2559. }
  2560. private void OnEditCancel()
  2561. {
  2562. }
  2563. private void CreateKasizukiThumShot()
  2564. {
  2565. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  2566. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2567. {
  2568. this.OnEndScene();
  2569. return;
  2570. }
  2571. ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
  2572. scriptMgr.adv_kag.LoadScriptFile("KasizukiThumShot.ks", string.Empty);
  2573. scriptMgr.adv_kag.Exec();
  2574. base.StartCoroutine(this.CoroutineKasizukiThumShot());
  2575. }
  2576. private IEnumerator CoroutineKasizukiThumShot()
  2577. {
  2578. for (int nF = 0; nF < 30; nF++)
  2579. {
  2580. yield return null;
  2581. }
  2582. Camera thumCamera = GameMain.Instance.ThumCamera;
  2583. CameraMain mainCamera = GameMain.Instance.MainCamera;
  2584. thumCamera.transform.position = mainCamera.transform.position;
  2585. thumCamera.transform.rotation = mainCamera.transform.rotation;
  2586. float backup = thumCamera.fieldOfView;
  2587. thumCamera.fieldOfView = mainCamera.camera.fieldOfView;
  2588. this.m_maid.body0.trsLookTarget = thumCamera.transform;
  2589. for (int nF2 = 0; nF2 < 30; nF2++)
  2590. {
  2591. yield return null;
  2592. }
  2593. this.m_maid.ThumShotCustom(KasizukiManager.CreateMaidTmpThumbName(this.m_maid), false);
  2594. thumCamera.fieldOfView = backup;
  2595. this.OnEndScene();
  2596. yield break;
  2597. }
  2598. private void OnEndScene()
  2599. {
  2600. if (GameMain.Instance.VRMode)
  2601. {
  2602. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  2603. }
  2604. UICamera.InputEnable = true;
  2605. if (!string.IsNullOrEmpty(this.m_strScriptArg))
  2606. {
  2607. Debug.Log("OnEndScene JumpTo " + this.m_strScriptArg);
  2608. GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_currentScriptFile, this.m_strScriptArg);
  2609. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  2610. }
  2611. }
  2612. public bool ClickEmulate(SceneEditInfo.EMenuCategory category, bool forceViewOff = false)
  2613. {
  2614. UIButton current = UIButton.current;
  2615. for (int i = 0; i < this.m_listCategory.Count; i++)
  2616. {
  2617. if (this.m_listCategory[i].m_eCategory == category && i < this.m_listBtnCate.Count)
  2618. {
  2619. UIButton componentInChildren = this.m_listBtnCate[i].GetComponentInChildren<UIButton>();
  2620. if (componentInChildren != null)
  2621. {
  2622. UIButton.current = componentInChildren;
  2623. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  2624. if (forceViewOff && visibleAutoCam)
  2625. {
  2626. this.m_viewreset.SetVisibleAutoCam(false);
  2627. }
  2628. this.ClickCallback();
  2629. if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
  2630. {
  2631. this.m_viewreset.SetVisibleAutoCam(false);
  2632. }
  2633. UIButton.current = current;
  2634. return true;
  2635. }
  2636. }
  2637. }
  2638. return false;
  2639. }
  2640. public bool isEnabledButton(MPN mpn)
  2641. {
  2642. switch (mpn)
  2643. {
  2644. case MPN.skin:
  2645. mpn = MPN.folder_skin;
  2646. break;
  2647. case MPN.underhair:
  2648. mpn = MPN.folder_underhair;
  2649. break;
  2650. case MPN.mayu:
  2651. mpn = MPN.folder_mayu;
  2652. break;
  2653. case MPN.eye:
  2654. mpn = MPN.folder_eye;
  2655. break;
  2656. }
  2657. if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
  2658. {
  2659. return false;
  2660. }
  2661. SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
  2662. SceneEditInfo.EMenuCategory eMenuCate = ccateNameType.m_eMenuCate;
  2663. string ePartsType = ccateNameType.m_ePartsType;
  2664. SceneEdit.SCategory scategory = null;
  2665. int num = 0;
  2666. while (num < this.m_listCategory.Count && scategory == null)
  2667. {
  2668. if (this.m_listCategory[num].m_eCategory == eMenuCate)
  2669. {
  2670. scategory = this.m_listCategory[num];
  2671. }
  2672. num++;
  2673. }
  2674. for (int i = 0; i < scategory.m_listPartsType.Count; i++)
  2675. {
  2676. if (scategory.m_listPartsType[i].m_ePartsType == ePartsType)
  2677. {
  2678. return scategory.m_listPartsType[i].m_isEnabled;
  2679. }
  2680. }
  2681. return false;
  2682. }
  2683. public bool ClickEmulate(MPN mpn, bool forceViewOff = false)
  2684. {
  2685. switch (mpn)
  2686. {
  2687. case MPN.skin:
  2688. mpn = MPN.folder_skin;
  2689. break;
  2690. case MPN.underhair:
  2691. mpn = MPN.folder_underhair;
  2692. break;
  2693. case MPN.mayu:
  2694. mpn = MPN.folder_mayu;
  2695. break;
  2696. case MPN.eye:
  2697. mpn = MPN.folder_eye;
  2698. break;
  2699. }
  2700. if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
  2701. {
  2702. return false;
  2703. }
  2704. SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
  2705. return this.ClickEmulate(ccateNameType.m_eMenuCate, ccateNameType.m_ePartsType, forceViewOff);
  2706. }
  2707. public bool ClickEmulate(SceneEditInfo.EMenuCategory category, string partsType, bool forceViewOff = false)
  2708. {
  2709. if (!this.ClickEmulate(category, false) || category == SceneEditInfo.EMenuCategory.プリセット || category == SceneEditInfo.EMenuCategory.ランダム || category == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
  2710. {
  2711. return false;
  2712. }
  2713. UIButton current = UIButton.current;
  2714. SceneEdit.SCategory scategory = null;
  2715. int num = 0;
  2716. while (num < this.m_listCategory.Count && scategory == null)
  2717. {
  2718. if (this.m_listCategory[num].m_eCategory == category)
  2719. {
  2720. scategory = this.m_listCategory[num];
  2721. }
  2722. num++;
  2723. }
  2724. for (int i = 0; i < scategory.m_listPartsType.Count; i++)
  2725. {
  2726. if (scategory.m_listPartsType[i].m_ePartsType == partsType && i < this.m_listBtnPartsType.Count)
  2727. {
  2728. UIButton componentInChildren = this.m_listBtnPartsType[i].GetComponentInChildren<UIButton>();
  2729. if (componentInChildren != null)
  2730. {
  2731. UIButton.current = componentInChildren;
  2732. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  2733. if (forceViewOff && visibleAutoCam)
  2734. {
  2735. this.m_viewreset.SetVisibleAutoCam(false);
  2736. }
  2737. this.ClickCallback();
  2738. if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
  2739. {
  2740. this.m_viewreset.SetVisibleAutoCam(false);
  2741. }
  2742. UIButton.current = current;
  2743. return true;
  2744. }
  2745. }
  2746. }
  2747. return false;
  2748. }
  2749. private void OnClickViewReset()
  2750. {
  2751. this.CameraReset(0.5f);
  2752. }
  2753. private void OnTouchJump(SceneEdit.TouchType type)
  2754. {
  2755. if (GameMain.Instance.VRMode || this.customPartsWindowVisibleButton.windowVisible || this.colorPaletteMgr.gameObject.activeSelf || !UICamera.InputEnable || this.m_uipViewCancel.gameObject.activeSelf)
  2756. {
  2757. return;
  2758. }
  2759. if (UICamera.Raycast(Input.mousePosition))
  2760. {
  2761. return;
  2762. }
  2763. MPN mpn = MPN.HeadX;
  2764. switch (type)
  2765. {
  2766. case SceneEdit.TouchType.Head:
  2767. mpn = MPN.HeadX;
  2768. break;
  2769. case SceneEdit.TouchType.Bust:
  2770. mpn = MPN.MuneL;
  2771. break;
  2772. case SceneEdit.TouchType.UpperBody:
  2773. mpn = MPN.west;
  2774. break;
  2775. case SceneEdit.TouchType.LowerBody:
  2776. mpn = MPN.koshi;
  2777. break;
  2778. case SceneEdit.TouchType.Leg:
  2779. mpn = MPN.DouPer;
  2780. break;
  2781. }
  2782. if (this.isEnabledButton(mpn))
  2783. {
  2784. this.ClickEmulate(mpn, false);
  2785. }
  2786. }
  2787. private void OnClickAutoCam()
  2788. {
  2789. this.m_viewreset.SetVisibleAutoCam(!this.m_viewreset.GetVisibleAutoCam());
  2790. }
  2791. private void OnClickEyeToCam()
  2792. {
  2793. Maid maid = this.m_maid;
  2794. this.m_viewreset.SetVisibleEyeToCam(!this.m_viewreset.GetVisibleEyeToCam());
  2795. if (this.m_viewreset.GetVisibleEyeToCam())
  2796. {
  2797. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0.8f);
  2798. }
  2799. else
  2800. {
  2801. maid.EyeToCamera(Maid.EyeMoveType.無視する, 0.8f);
  2802. }
  2803. }
  2804. private void CameraReset(float f_fTime = 0.5f)
  2805. {
  2806. this.m_cameraMoveSupport.moveTime = f_fTime;
  2807. this.m_cameraMoveSupport.ResetCamera();
  2808. }
  2809. private void CameraMoveTo(Vector3 f_vTarget, float f_fDistance, Vector2 f_vAngle, float f_fTime = 0.5f)
  2810. {
  2811. this.m_cameraMoveSupport.moveTime = f_fTime;
  2812. this.m_cameraMoveSupport.StartCameraPosition(f_vTarget, f_fDistance, f_vAngle);
  2813. }
  2814. public void OnDestroy()
  2815. {
  2816. if (GameMain.Instance.isQuitting)
  2817. {
  2818. return;
  2819. }
  2820. iTween.Stop(base.gameObject);
  2821. foreach (KeyValuePair<Personal.Data, List<SceneEdit.PVBInfo>> keyValuePair in this.m_dicVoice)
  2822. {
  2823. foreach (SceneEdit.PVBInfo pvbinfo in keyValuePair.Value)
  2824. {
  2825. UnityEngine.Object.Destroy(pvbinfo.texIcon);
  2826. }
  2827. }
  2828. CharacterMgr.EditModeLookHaveItem = false;
  2829. GameMain.Instance.ScriptMgr.StopMotionScript();
  2830. Maid maid = this.m_maid;
  2831. if (maid != null)
  2832. {
  2833. MaidColliderCollect.RemoveColliderAll(maid);
  2834. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2835. maid.OpenMouthLookTooth(false);
  2836. maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  2837. maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKMgrData.IKAttachType.Point, false);
  2838. maid.Visible = false;
  2839. }
  2840. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  2841. if (!this.m_bVRComMode)
  2842. {
  2843. GameMain.Instance.BgMgr.DeleteBg();
  2844. }
  2845. NUty.GCFree();
  2846. }
  2847. public void UpdateCurrentItemPanel(bool resetScrollBar)
  2848. {
  2849. if (this.m_Panel_PartsType.goMain.activeSelf && (this.m_Panel_MenuItem.goMain.activeSelf || this.m_Panel_SetItem.goMain.activeSelf))
  2850. {
  2851. ButtonEdit[] componentsInChildren = this.m_Panel_PartsType.goGrid.GetComponentsInChildren<ButtonEdit>();
  2852. foreach (ButtonEdit buttonEdit in componentsInChildren)
  2853. {
  2854. if (buttonEdit.m_goFrame.GetComponent<UISprite>().enabled)
  2855. {
  2856. if (buttonEdit.m_PartsType != null)
  2857. {
  2858. UIButton component = buttonEdit.GetComponent<UIButton>();
  2859. UIButton current = UIButton.current;
  2860. UIButton.current = component;
  2861. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  2862. this.m_viewreset.SetVisibleAutoCam(false);
  2863. this.ClickCallback();
  2864. this.m_viewreset.SetVisibleAutoCam(visibleAutoCam);
  2865. UIButton.current = current;
  2866. if (resetScrollBar && this.m_Panel_MenuItem.goMain.activeSelf)
  2867. {
  2868. this.m_Panel_MenuItem.gcScrollBar.value = 0f;
  2869. }
  2870. else if (resetScrollBar && this.m_Panel_SetItem.goMain.activeSelf)
  2871. {
  2872. this.m_Panel_SetItem.gcScrollBar.value = 0f;
  2873. }
  2874. break;
  2875. }
  2876. }
  2877. }
  2878. }
  2879. }
  2880. public void Update()
  2881. {
  2882. if (GameMain.Instance.VRMode)
  2883. {
  2884. if (!this.m_bVRComMode)
  2885. {
  2886. if (Input.GetKeyUp(KeyCode.B))
  2887. {
  2888. this.bgIconWindow.NextBG();
  2889. }
  2890. if (Input.GetKeyUp(KeyCode.P))
  2891. {
  2892. this.pauseIconWindow.NextPose();
  2893. }
  2894. if (Input.GetKeyUp(KeyCode.F5) || Input.GetKeyUp(KeyCode.R))
  2895. {
  2896. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  2897. }
  2898. }
  2899. if (Input.GetKey(KeyCode.LeftArrow))
  2900. {
  2901. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  2902. if (maid != null)
  2903. {
  2904. maid.gameObject.transform.Rotate(new Vector3(0f, 60f, 0f) * Time.deltaTime);
  2905. }
  2906. }
  2907. if (Input.GetKey(KeyCode.RightArrow))
  2908. {
  2909. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(0);
  2910. if (maid2 != null)
  2911. {
  2912. maid2.gameObject.transform.Rotate(new Vector3(0f, -60f, 0f) * Time.deltaTime);
  2913. }
  2914. }
  2915. }
  2916. if (GameMain.Instance.CharacterMgr.IsBusy())
  2917. {
  2918. this.updateCustomViewFlag = true;
  2919. return;
  2920. }
  2921. if (this.updateCustomViewFlag)
  2922. {
  2923. this.updateCustomViewFlag = false;
  2924. this.customViewWindow.UpdateAllItem();
  2925. }
  2926. }
  2927. private bool updateCustomViewFlag;
  2928. private List<CapsuleCollider> touchJumpColliderList = new List<CapsuleCollider>();
  2929. private List<SceneEdit.SCategory> m_listCategory = new List<SceneEdit.SCategory>();
  2930. private List<GameObject> m_listBtnCate = new List<GameObject>();
  2931. private List<GameObject> m_listBtnPartsType = new List<GameObject>();
  2932. private List<SceneEdit.MenuItemSet> m_listBtnMenuItem = new List<SceneEdit.MenuItemSet>();
  2933. private List<SceneEdit.SliderItemSet> m_listSliderItem = new List<SceneEdit.SliderItemSet>();
  2934. private List<SceneEdit.ColorItemSet> m_listBtnColorSet = new List<SceneEdit.ColorItemSet>();
  2935. private List<SceneEdit.MenuItemSet> m_listBtnGroupMember = new List<SceneEdit.MenuItemSet>();
  2936. public bool m_bOpenSetGroupPanel;
  2937. public UIButton EditItemGroupSwitch;
  2938. public UIButton EditTouchJumpSwitch;
  2939. [SerializeField]
  2940. public ColorPaletteManager colorPaletteMgr;
  2941. [SerializeField]
  2942. private WindowPartsWindowVisible customPartsWindowVisibleButton;
  2943. [SerializeField]
  2944. public SceneEdit.SubPropMpnData[] subPropDatas;
  2945. private SceneEdit.UIPanelSet m_Panel_Category;
  2946. private SceneEdit.UIPanelSet m_Panel_PartsType;
  2947. private SceneEdit.UIPanelSet m_Panel_MenuItem;
  2948. private SceneEdit.UIPanelSet m_Panel_SetItem;
  2949. private SceneEdit.UIPanelSet m_Panel_SliderItem;
  2950. private SceneEdit.UIPanelSet m_Panel_ColorSet;
  2951. private SceneEdit.UIPanelSet m_Panel_GroupSet;
  2952. private WFCheckBox m_CheckBoxMayuDrawPriority;
  2953. public BetterList<UIKeyNavigation2> m_listNg2Cate = new BetterList<UIKeyNavigation2>();
  2954. public BetterList<UIKeyNavigation2> m_listNg2PartsType = new BetterList<UIKeyNavigation2>();
  2955. public BetterList<UIKeyNavigation2> m_listNg2MenuItem = new BetterList<UIKeyNavigation2>();
  2956. public TextMesh m_tmDebugText;
  2957. private SceneEdit.MenuItemSet m_misDelOnly;
  2958. public Dictionary<MPN, List<SceneEdit.SMenuItem>> m_dicColor = new Dictionary<MPN, List<SceneEdit.SMenuItem>>();
  2959. public Dictionary<int, SceneEdit.SMenuItem> m_menuRidDic;
  2960. public Dictionary<Personal.Data, List<SceneEdit.PVBInfo>> m_dicVoice = new Dictionary<Personal.Data, List<SceneEdit.PVBInfo>>();
  2961. public GameObject m_goUIRoot;
  2962. private ItemInfoWnd m_info;
  2963. private EditOkCancel m_okcancel;
  2964. private EditViewReset m_viewreset;
  2965. public List<UIPanel> m_listPanel = new List<UIPanel>();
  2966. private UIPanel m_uipViewCancel;
  2967. private WfCameraMoveSupport m_cameraMoveSupport;
  2968. private Maid m_maid;
  2969. private string m_strScriptArg;
  2970. private string m_currentScriptFile;
  2971. private bool m_bVRComMode;
  2972. private FFNameDialog m_FFNameDlg;
  2973. private EditMod m_EditMod;
  2974. private string last_select_category_name_ = string.Empty;
  2975. private Dictionary<string, float> backup_category_scroll_pos_ = new Dictionary<string, float>();
  2976. private int m_nDemoBgNo;
  2977. private MPN m_nNowMPN;
  2978. private static byte[] m_byItemFileBuffer;
  2979. private SceneEdit.CAM_OFFS m_eCamOffsNow;
  2980. private SceneEdit.CAM_OFFS m_eCamOffsBack;
  2981. public enum ModeType
  2982. {
  2983. OriginalChara,
  2984. MainChara,
  2985. AfterEdit,
  2986. CostumeEdit
  2987. }
  2988. private enum TouchType
  2989. {
  2990. Head,
  2991. Bust,
  2992. UpperBody,
  2993. LowerBody,
  2994. Leg
  2995. }
  2996. public class SMenuItem : IDisposable
  2997. {
  2998. public void Dispose()
  2999. {
  3000. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3001. UnityEngine.Object.DestroyImmediate(this.m_texIcon);
  3002. UnityEngine.Object.DestroyImmediate(this.m_texIconRandomColor);
  3003. this.m_texIcon = null;
  3004. }
  3005. public void SortColorItem()
  3006. {
  3007. this.m_listColorSet.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
  3008. {
  3009. if (x.m_fPriority == y.m_fPriority)
  3010. {
  3011. return 0;
  3012. }
  3013. if (x.m_fPriority < y.m_fPriority)
  3014. {
  3015. return -1;
  3016. }
  3017. if (x.m_fPriority > y.m_fPriority)
  3018. {
  3019. return 1;
  3020. }
  3021. return 0;
  3022. });
  3023. }
  3024. public bool Compare(SceneEdit.SMenuItem item)
  3025. {
  3026. bool flag = true;
  3027. flag |= (this.m_strMenuName == item.m_strMenuName);
  3028. flag |= (this.m_strInfo == item.m_strInfo);
  3029. flag |= (this.m_mpn == item.m_mpn);
  3030. flag |= (this.m_strCateName == item.m_strCateName);
  3031. flag |= (this.m_eColorSetMPN == item.m_eColorSetMPN);
  3032. flag |= (this.m_strMenuNameInColorSet == item.m_strMenuNameInColorSet);
  3033. flag |= (this.m_pcMultiColorID == item.m_pcMultiColorID);
  3034. flag |= (this.m_boDelOnly == item.m_boDelOnly);
  3035. flag |= (this.m_fPriority == item.m_fPriority);
  3036. flag |= (this.m_bMan == item.m_bMan);
  3037. return flag | this.m_bOld == item.m_bOld;
  3038. }
  3039. public SceneEdit.SPartsType m_ParentPartsType;
  3040. public string m_strCateName;
  3041. public string m_strMenuName = string.Empty;
  3042. public MPN m_mpn;
  3043. public bool m_bColor;
  3044. public MPN m_eColorSetMPN;
  3045. public string m_strMenuNameInColorSet;
  3046. public List<SceneEdit.SMenuItem> m_listColorSet = new List<SceneEdit.SMenuItem>();
  3047. public MaidParts.PARTS_COLOR m_pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
  3048. public float m_fPriority;
  3049. public bool m_bMan;
  3050. public bool m_bOld;
  3051. public bool m_boDelOnly;
  3052. public string m_strInfo = string.Empty;
  3053. public Texture2D m_texIcon;
  3054. public Texture2D m_texIconRandomColor;
  3055. public string m_strMenuFileName;
  3056. public int m_nMenuFileRID;
  3057. public int m_nSliderValue;
  3058. public GameObject m_goButton;
  3059. public bool m_bMod;
  3060. public bool m_bGroupLeader;
  3061. public List<SceneEdit.SMenuItem> m_listMember;
  3062. public bool m_bMember;
  3063. public SceneEdit.SMenuItem m_leaderMenu;
  3064. }
  3065. public class SPartsType : IDisposable
  3066. {
  3067. public SPartsType(SceneEditInfo.CCateNameType.EType f_eType, MPN f_mpn, string f_strPartsTypeName, string f_ePartsType)
  3068. {
  3069. this.m_nIdx = SceneEditInfo.m_dicPartsTypePair[f_mpn].m_nIdx;
  3070. this.m_eType = f_eType;
  3071. this.m_mpn = f_mpn;
  3072. this.m_strPartsTypeName = f_strPartsTypeName;
  3073. this.m_ePartsType = f_ePartsType;
  3074. this.m_isEnabled = true;
  3075. }
  3076. public void Dispose()
  3077. {
  3078. for (int i = 0; i < this.m_listMenu.Count; i++)
  3079. {
  3080. this.m_listMenu[i].Dispose();
  3081. }
  3082. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3083. UnityEngine.Object.DestroyImmediate(this.m_goPanelMenu);
  3084. }
  3085. public void SortItem()
  3086. {
  3087. this.m_listMenu.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
  3088. {
  3089. if (x.m_fPriority == y.m_fPriority)
  3090. {
  3091. int num = x.m_strMenuName.CompareTo(y.m_strMenuName);
  3092. if (num == 0)
  3093. {
  3094. return 0;
  3095. }
  3096. if (num > 0)
  3097. {
  3098. return 1;
  3099. }
  3100. if (num < 0)
  3101. {
  3102. return -1;
  3103. }
  3104. return 0;
  3105. }
  3106. else
  3107. {
  3108. if (x.m_fPriority > y.m_fPriority)
  3109. {
  3110. return 1;
  3111. }
  3112. if (x.m_fPriority < y.m_fPriority)
  3113. {
  3114. return -1;
  3115. }
  3116. return 0;
  3117. }
  3118. });
  3119. for (int i = 0; i < this.m_listMenu.Count; i++)
  3120. {
  3121. this.m_listMenu[i].SortColorItem();
  3122. }
  3123. }
  3124. public SceneEditInfo.CCateNameType.EType m_eType;
  3125. public int m_nIdx;
  3126. public string m_strPartsTypeName;
  3127. public MPN m_mpn;
  3128. public string m_ePartsType;
  3129. public bool m_isEnabled;
  3130. public List<SceneEdit.SMenuItem> m_listMenu = new List<SceneEdit.SMenuItem>();
  3131. public GameObject m_goButton;
  3132. public GameObject m_goPanelMenu;
  3133. }
  3134. public class SCategory : IDisposable
  3135. {
  3136. public SCategory(string f_strCateName, SceneEditInfo.EMenuCategory f_eCategory)
  3137. {
  3138. this.m_strCateName = f_strCateName;
  3139. this.m_eCategory = f_eCategory;
  3140. this.m_isEnabled = true;
  3141. }
  3142. public void Dispose()
  3143. {
  3144. foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
  3145. {
  3146. spartsType.Dispose();
  3147. }
  3148. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3149. UnityEngine.Object.DestroyImmediate(this.m_goPanelPartsType);
  3150. }
  3151. public void SortPartsType()
  3152. {
  3153. this.m_listPartsType.Sort(delegate(SceneEdit.SPartsType x, SceneEdit.SPartsType y)
  3154. {
  3155. if (x.m_nIdx == y.m_nIdx)
  3156. {
  3157. return 0;
  3158. }
  3159. if (x.m_nIdx < y.m_nIdx)
  3160. {
  3161. return -1;
  3162. }
  3163. if (x.m_nIdx > y.m_nIdx)
  3164. {
  3165. return 1;
  3166. }
  3167. return 0;
  3168. });
  3169. }
  3170. public void SortItem()
  3171. {
  3172. foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
  3173. {
  3174. spartsType.SortItem();
  3175. }
  3176. }
  3177. public SceneEditInfo.EMenuCategory m_eCategory;
  3178. public string m_strCateName;
  3179. public GameObject m_goButton;
  3180. public GameObject m_goPanelPartsType;
  3181. public bool m_isEnabled;
  3182. public List<SceneEdit.SPartsType> m_listPartsType = new List<SceneEdit.SPartsType>();
  3183. }
  3184. private class UIPanelSet
  3185. {
  3186. public UIPanelSet(GameObject f_goUIRoot, string f_strPath)
  3187. {
  3188. this.goMain = UTY.GetChildObject(f_goUIRoot, f_strPath, false);
  3189. GameObject childObject = UTY.GetChildObject(this.goMain, "Scroll View", false);
  3190. this.gcScrollView = childObject.GetComponent<UIScrollView>();
  3191. this.goGrid = UTY.GetChildObject(childObject, "UIGrid", false);
  3192. this.gcUIGrid = this.goGrid.GetComponentsInChildren<UIGrid>(true)[0];
  3193. this.goScrollBar = UTY.GetChildObject(this.goMain, "Scroll Bar", false);
  3194. this.gcScrollBar = this.goScrollBar.GetComponent<UIScrollBar>();
  3195. this.goDragMat = UTY.GetChildObject(this.goMain, "DragMat", false);
  3196. this.goArrow = UTY.GetChildObject(this.goMain, "Arrow", false);
  3197. this.goArrow.SetActive(false);
  3198. }
  3199. public void SetActive(bool f_bActive)
  3200. {
  3201. this.goMain.SetActive(f_bActive);
  3202. }
  3203. public void ResetScrollPos(float f_fPos = 0.5f)
  3204. {
  3205. this.gcUIGrid.Reposition();
  3206. this.gcScrollView.ResetPosition();
  3207. this.gcScrollBar.value = f_fPos;
  3208. }
  3209. public void VisibleArrow(bool f_bActive)
  3210. {
  3211. this.goArrow.SetActive(f_bActive);
  3212. }
  3213. public void MoveArrow(GameObject f_goCurrentBtn)
  3214. {
  3215. if (this.goArrow == null)
  3216. {
  3217. return;
  3218. }
  3219. Transform parent = f_goCurrentBtn.transform.parent;
  3220. Vector3 position = parent.TransformPoint(new Vector3(0f, 0f, 0f));
  3221. Vector3 localPosition = this.goMain.transform.InverseTransformPoint(position);
  3222. localPosition.x = this.goArrow.transform.localPosition.x;
  3223. localPosition.y += 18f;
  3224. this.goArrow.transform.localPosition = localPosition;
  3225. }
  3226. public GameObject goMain;
  3227. public GameObject goGrid;
  3228. public UIGrid gcUIGrid;
  3229. public GameObject goScrollBar;
  3230. public UIScrollView gcScrollView;
  3231. public UIScrollBar gcScrollBar;
  3232. public GameObject goDragMat;
  3233. private GameObject goArrow;
  3234. }
  3235. private class MenuItemSet
  3236. {
  3237. public MenuItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi, string f_strPrefabName, bool f_bSelectedFrame)
  3238. {
  3239. this.mi = f_mi;
  3240. this.m_bSelectedFrame = f_bSelectedFrame;
  3241. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/" + f_strPrefabName);
  3242. this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3243. this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
  3244. this.gcBtnEdit.m_MenuItem = f_mi;
  3245. this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
  3246. this.goFrame.SetActive(false);
  3247. this.goOld = UTY.GetChildObject(this.goItem, "Old", false);
  3248. this.goOld.SetActive(f_mi.m_bOld);
  3249. this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
  3250. this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
  3251. if (f_mi.m_texIcon != null)
  3252. {
  3253. Sprite normalSprite2D = Sprite.Create(f_mi.m_texIcon, new Rect(0f, 0f, (float)f_mi.m_texIcon.width, (float)f_mi.m_texIcon.height), default(Vector2));
  3254. this.gcBtn.normalSprite2D = normalSprite2D;
  3255. }
  3256. }
  3257. public void ToSmall()
  3258. {
  3259. if (this.gcBtnEdit.m_MenuItem.m_texIcon.width == 138 && this.gcBtnEdit.m_MenuItem.m_texIcon.height == 200)
  3260. {
  3261. this.gcBtn.GetComponent<UI2DSprite>().SetDimensions(80, 116);
  3262. this.gcBtn.GetComponent<BoxCollider>().size = new Vector3(80f, 116f, 0f);
  3263. this.goOld.GetComponent<UISprite>().ResetAnchors();
  3264. }
  3265. }
  3266. public void Clear()
  3267. {
  3268. if (this.goItem != null)
  3269. {
  3270. UnityEngine.Object.DestroyImmediate(this.goItem);
  3271. }
  3272. }
  3273. public void Selected(bool f_bSelect)
  3274. {
  3275. if (this.m_bSelectedFrame)
  3276. {
  3277. this.goFrame.SetActive(f_bSelect);
  3278. }
  3279. }
  3280. public GameObject goItem;
  3281. public ButtonEdit gcBtnEdit;
  3282. private GameObject goFrame;
  3283. private GameObject goOld;
  3284. public UIButton gcBtn;
  3285. public UIEventTrigger gcEvent;
  3286. public SceneEdit.SMenuItem mi;
  3287. private bool m_bSelectedFrame = true;
  3288. }
  3289. private class ColorItemSet
  3290. {
  3291. public ColorItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
  3292. {
  3293. this.mi = f_mi;
  3294. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonColor");
  3295. this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3296. this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
  3297. this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
  3298. this.gcBtnEdit.m_MenuItem = f_mi;
  3299. this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
  3300. this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
  3301. NDebug.Assert(f_mi.m_texIcon != null, "アイコンテクスチャがありません。" + f_mi.m_strMenuFileName);
  3302. if (f_mi.m_texIcon != null)
  3303. {
  3304. Sprite normalSprite2D = Sprite.Create(f_mi.m_texIcon, new Rect(0f, 0f, (float)f_mi.m_texIcon.width, (float)f_mi.m_texIcon.height), default(Vector2));
  3305. this.gcBtn.normalSprite2D = normalSprite2D;
  3306. }
  3307. }
  3308. public void Clear()
  3309. {
  3310. if (this.goItem != null)
  3311. {
  3312. UnityEngine.Object.DestroyImmediate(this.goItem);
  3313. }
  3314. }
  3315. public void Selected(bool f_bSelect)
  3316. {
  3317. this.goFrame.SetActive(f_bSelect);
  3318. }
  3319. public GameObject goItem;
  3320. public ButtonEdit gcBtnEdit;
  3321. private GameObject goFrame;
  3322. public UIButton gcBtn;
  3323. public UIEventTrigger gcEvent;
  3324. public SceneEdit.SMenuItem mi;
  3325. }
  3326. private class SliderItemSet
  3327. {
  3328. public SliderItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
  3329. {
  3330. this.mpn = f_mi.m_mpn;
  3331. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/Slider");
  3332. this.goMain = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3333. this.gcSlider = this.goMain.GetComponentsInChildren<UISlider>(true)[0];
  3334. GameObject childObject = UTY.GetChildObject(this.goMain, "CategoryTitle/Name", false);
  3335. this.gcLabel = childObject.GetComponent<UILabel>();
  3336. this.gcLabel.text = f_mi.m_strMenuName;
  3337. GameObject childObject2 = UTY.GetChildObject(this.goMain, "CategoryTitle/Number/Value", false);
  3338. this.gcValue = childObject2.GetComponent<UILabel>();
  3339. this.gcValue.text = "000";
  3340. this.goMain.name = this.goMain.name + f_mi.m_strMenuName;
  3341. this.gcBtnEdit = this.goMain.GetComponentsInChildren<ButtonEdit>(true)[0];
  3342. this.gcBtnEdit.m_SliderItem = f_mi;
  3343. }
  3344. public void Clear()
  3345. {
  3346. if (this.goMain != null)
  3347. {
  3348. UnityEngine.Object.DestroyImmediate(this.goMain);
  3349. }
  3350. }
  3351. public void SetValue(float f_fValue, string f_strValue = null)
  3352. {
  3353. this.gcSlider.value = f_fValue;
  3354. if (f_strValue == null)
  3355. {
  3356. this.gcValue.text = f_fValue.ToString();
  3357. }
  3358. else
  3359. {
  3360. this.gcValue.text = f_strValue;
  3361. }
  3362. }
  3363. public GameObject goMain;
  3364. public UISlider gcSlider;
  3365. public UILabel gcLabel;
  3366. public UILabel gcValue;
  3367. public ButtonEdit gcBtnEdit;
  3368. private MPN mpn;
  3369. }
  3370. [Serializable]
  3371. public struct SubPropMpnData
  3372. {
  3373. public MPN mpn
  3374. {
  3375. get
  3376. {
  3377. return this.manager.targetMpn;
  3378. }
  3379. }
  3380. public SubSlotEditManager manager;
  3381. }
  3382. public class PVBInfo
  3383. {
  3384. public string strIconName;
  3385. public Texture2D texIcon;
  3386. }
  3387. public class VoiceInfo : SceneEdit.PVBInfo
  3388. {
  3389. public string strVoiceFileName;
  3390. public Personal.Data personal;
  3391. public string strFace;
  3392. public string strFace2;
  3393. }
  3394. public enum CAM_OFFS
  3395. {
  3396. CENTER,
  3397. RIGHT,
  3398. RIGHT_MORE
  3399. }
  3400. }