SceneEdit.cs 131 KB

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