123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Text;
- using System.Text.RegularExpressions;
- using CharacterEdit;
- using I2.Loc;
- using Kasizuki;
- using MaidStatus;
- using SceneEditWindow;
- using SceneNPCEdit;
- using UnityEngine;
- using wf;
- public class SceneEdit : MonoBehaviour
- {
- public static SceneEdit Instance { get; private set; }
- public static bool compatibilityMode
- {
- get
- {
- return DailyMgr.IsLegacy;
- }
- }
- public static void AllProcPropSeqStart(Maid maid)
- {
- if (maid == null)
- {
- return;
- }
- if (Product.isPublic)
- {
- maid.AllProcProp();
- if (SceneEdit.Instance != null)
- {
- SceneEdit.Instance.updateCustomViewFlag = true;
- }
- }
- else
- {
- maid.AllProcPropSeqStart();
- }
- }
- public CustomViewWindow customViewWindow { get; private set; }
- public PoseIconWindow pauseIconWindow { get; private set; }
- public BgIconWindow bgIconWindow { get; private set; }
- public CustomPartsWindow customPartsWindow { get; private set; }
- public EditItemTextureCache editItemTextureCache { get; private set; }
- public SceneEdit.ModeType modeType { get; private set; }
- public int maidPoint { get; set; }
- public HashSet<MPN> enabledMpns { get; private set; }
- public bool m_bUseGroup
- {
- get
- {
- return GameMain.Instance.CMSystem.EditItemGroup;
- }
- set
- {
- if (value == GameMain.Instance.CMSystem.EditItemGroup || this.m_Panel_PartsType == null)
- {
- return;
- }
- GameMain.Instance.CMSystem.EditItemGroup = value;
- this.UpdateCurrentItemPanel(true);
- }
- }
- public bool m_bUseTouchJump
- {
- get
- {
- return GameMain.Instance.CMSystem.EditTouchJump;
- }
- set
- {
- GameMain.Instance.CMSystem.EditTouchJump = value;
- foreach (CapsuleCollider capsuleCollider in this.touchJumpColliderList)
- {
- capsuleCollider.enabled = value;
- }
- }
- }
- public bool isNewFace
- {
- get
- {
- return this.maid != null && this.maid.body0 != null && CMT.SearchObjName(this.maid.body0.m_trBones, "Ear_L", false) != null;
- }
- }
- public bool isFBFace
- {
- get
- {
- return this.maid != null && this.maid.body0 != null && 120 <= this.maid.body0.GetSlot(1).PartsVersion;
- }
- }
- public List<SceneEdit.SCategory> CategoryList
- {
- get
- {
- return this.m_listCategory;
- }
- }
- public EditViewReset viewReset
- {
- get
- {
- return this.m_viewreset;
- }
- }
- public Maid maid
- {
- get
- {
- return this.m_maid;
- }
- }
- public bool IsVRComMode
- {
- get
- {
- return this.m_bVRComMode;
- }
- }
- public MPN NowMPN
- {
- get
- {
- return this.m_nNowMPN;
- }
- }
- private static string GetParentMenuFileName(SceneEdit.SMenuItem mi)
- {
- if ((MPN.wear > mi.m_mpn || mi.m_mpn > MPN.onepiece) && (MPN.set_maidwear > mi.m_mpn || mi.m_mpn > MPN.set_body))
- {
- return string.Empty;
- }
- string text = mi.m_strMenuFileName;
- string result = string.Empty;
- text = text.ToLower();
- int num = text.IndexOf("_z");
- if (0 < num)
- {
- int num2 = text.IndexOf('_', num + 1);
- if (num2 == -1)
- {
- num2 = text.IndexOf('.', num + 1);
- }
- if (0 < num2 - num && 0 < text.Length - num2)
- {
- result = text.Substring(0, num) + text.Substring(num2, text.Length - num2);
- }
- }
- return result;
- }
- public void Awake()
- {
- this.m_cameraMoveSupport = base.gameObject.AddComponent<WfCameraMoveSupport>();
- this.editItemTextureCache = base.gameObject.AddComponent<EditItemTextureCache>();
- SceneEdit.Instance = this;
- this.modeType = SceneEdit.ModeType.OriginalChara;
- this.enabledMpns = new HashSet<MPN>();
- Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
- string a;
- if (tag_backup != null && tag_backup.TryGetValue("name", out a) && a == "SceneEdit")
- {
- string strScriptArg;
- if (tag_backup.TryGetValue("label", out strScriptArg))
- {
- this.m_strScriptArg = strScriptArg;
- }
- bool flag = false;
- if (tag_backup.TryGetValue("original", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.OriginalChara;
- flag = true;
- }
- else if (tag_backup.TryGetValue("main", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.MainChara;
- flag = true;
- }
- else if (tag_backup.TryGetValue("after", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.AfterEdit;
- flag = true;
- }
- else if (tag_backup.TryGetValue("facility_costume", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.CostumeEdit;
- flag = true;
- }
- else if (tag_backup.TryGetValue("npcedit", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.NpcEdit;
- flag = true;
- }
- else if (tag_backup.TryGetValue("scout", out strScriptArg))
- {
- this.modeType = SceneEdit.ModeType.ScoutChara;
- flag = true;
- }
- if (!flag)
- {
- NDebug.Assert("エディットシーンのモード指定がありませんでした。次のうち必ず一つは指定してください[original|main|after|costume]", false);
- }
- if (tag_backup.ContainsKey("vr_mode"))
- {
- this.m_bVRComMode = true;
- }
- }
- this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
- EventDelegate.Add(this.EditItemGroupSwitch.onClick, new EventDelegate.Callback(this.OnClickEditItemGroup));
- this.EditTouchJumpSwitch.defaultColor = ((!this.m_bUseTouchJump) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
- EventDelegate.Add(this.EditTouchJumpSwitch.onClick, new EventDelegate.Callback(this.OnClickEditTouchJump));
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
- this.enabledMpns = new HashSet<MPN>(facilityCostumeEnableMPN);
- this.EditTouchJumpSwitch.gameObject.SetActive(false);
- }
- }
- private void Start()
- {
- this.customViewWindow = this.m_goUIRoot.GetComponentInChildren<CustomViewWindow>();
- this.pauseIconWindow = this.m_goUIRoot.GetComponentInChildren<PoseIconWindow>();
- this.pauseIconWindow.onSelectPauseEvent = delegate(PoseIconData.ItemData data)
- {
- if (this.customPartsWindowVisibleButton.visible)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- data.ExecScript();
- if (this.m_viewreset.GetVisibleAutoCam())
- {
- if (string.IsNullOrEmpty(data.targetBoneName))
- {
- this.CameraReset(0.5f);
- }
- else
- {
- base.StartCoroutine(this.CoPoseToCam(data.targetBoneName, 0.5f, 0.2f));
- }
- }
- };
- this.bgIconWindow = this.m_goUIRoot.GetComponentInChildren<BgIconWindow>();
- this.bgIconWindow.onSelectBgEvent = delegate(BgIconData.ItemData data)
- {
- data.Exec();
- };
- VoiceIconWindow componentInChildren = this.m_goUIRoot.GetComponentInChildren<VoiceIconWindow>();
- componentInChildren.onClickVoiceEvent = delegate(VoiceIconData.ItemData.EmotionType emotionType)
- {
- if (this.m_maid == null)
- {
- return;
- }
- if (this.customPartsWindowVisibleButton.visible)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- VoiceIconData.ItemData.EmotionData emotionData = VoiceIconData.GetEmotionData(this.m_maid, emotionType);
- emotionData.Apply(this.m_maid);
- };
- PresetSaveWindow componentInChildren2 = this.m_goUIRoot.GetComponentInChildren<PresetSaveWindow>();
- componentInChildren2.onClickPresetSaveEvent = delegate(PresetSaveWindow.SaveType type)
- {
- if (this.m_maid == null)
- {
- return;
- }
- PresetButtonCtrl component = UTY.GetChildObject(this.m_goUIRoot, "PresetButtonPanel", false).GetComponent<PresetButtonCtrl>();
- component.PresetSaveType(type);
- };
- UndressWindow componentInChildren3 = this.m_goUIRoot.GetComponentInChildren<UndressWindow>();
- componentInChildren3.onClickUndressEvent = delegate(UndressWindow.UndressType type)
- {
- if (this.m_maid == null)
- {
- return;
- }
- if (type == UndressWindow.UndressType.Dress)
- {
- this.ClothesState(SceneEditInfo.ClothesState.Wear);
- }
- else if (type == UndressWindow.UndressType.Lingerie)
- {
- this.ClothesState(SceneEditInfo.ClothesState.Underwear);
- }
- else if (type == UndressWindow.UndressType.Nude)
- {
- this.ClothesState(SceneEditInfo.ClothesState.Nude);
- }
- };
- this.customPartsWindow = this.m_goUIRoot.GetComponentInChildren<CustomPartsWindow>();
- this.customPartsWindowVisibleButton.visible = false;
- this.colorPaletteMgr.Close();
- CharacterMgr.EditModeLookHaveItem = true;
- GameMain.Instance.CharacterMgr.DeactivateCharaAll();
- this.m_maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- this.maidPoint = GameMain.Instance.CharacterMgr.status.maidPoint;
- this.m_maid.Visible = true;
- if (this.m_bVRComMode)
- {
- GameMain.Instance.SceneActivate("SceneEdit");
- }
- GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
- this.m_EditMod = base.gameObject.AddComponent<EditMod>();
- if (this.m_goUIRoot == null)
- {
- this.m_goUIRoot = GameObject.Find("UI Root");
- }
- NDebug.Assert(this.m_goUIRoot != null, "UI Root がシーン中にありません。");
- NDebug.Assert(this.m_listPanel.Count != 0, "UIPanelリストがありません。");
- for (int i = 0; i < this.m_listPanel.Count; i++)
- {
- if (this.m_listPanel[i] == null)
- {
- NDebug.Assert("UIPanelが外れています.", false);
- }
- }
- GameObject childObject = UTY.GetChildObject(this.m_goUIRoot, "Window-ItemInfo", false);
- childObject.SetActive(true);
- this.m_info = childObject.GetComponent<ItemInfoWnd>();
- GameObject childObject2 = UTY.GetChildObject(this.m_goUIRoot, "OkCancel", false);
- childObject2.SetActive(true);
- this.m_okcancel = childObject2.GetComponent<EditOkCancel>();
- this.m_okcancel.SetOnClickCallBack(new EditOkCancel.OnClick(this.OnEditOk), new EditOkCancel.OnClick(this.OnEditCancel));
- this.m_okcancel.Show(EditOkCancel.TYPE.OK);
- GameObject childObject3 = UTY.GetChildObject(this.m_goUIRoot, "ViewReset", false);
- childObject3.SetActive(true);
- this.m_viewreset = childObject3.GetComponent<EditViewReset>();
- this.m_viewreset.SetOnClickCallBack(new EditViewReset.OnClick(this.OnClickViewReset), new EditViewReset.OnClick(this.OnClickAutoCam), new EditViewReset.OnClick(this.OnClickEyeToCam));
- this.m_viewreset.Show();
- this.m_Panel_Category = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-Category");
- this.m_Panel_PartsType = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-PartsType");
- this.m_Panel_MenuItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-MenuItem");
- this.m_Panel_SetItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-SetItem");
- this.m_Panel_SliderItem = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-Slider");
- this.m_Panel_ColorSet = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-ColorSet");
- this.m_Panel_GroupSet = new SceneEdit.UIPanelSet(this.m_goUIRoot, "ScrollPanel-GroupSet");
- this.m_CheckBoxMayuDrawPriority = UTY.GetChildObject(this.m_Panel_ColorSet.goMain, "CheckBoxMayuDrawPriority", false).GetComponent<WFCheckBox>();
- this.m_CheckBoxMayuDrawPriority.onClick.Add(delegate(WFCheckBox checkbox)
- {
- this.m_maid.MayuDrawPriority = checkbox.check;
- });
- this.m_Panel_Category.SetActive(true);
- GameObject childObject4 = UTY.GetChildObject(this.m_goUIRoot, "ViewCancel", false);
- this.m_uipViewCancel = childObject4.GetComponent<UIPanel>();
- GameObject childObject5 = UTY.GetChildObject(childObject4, "Cancel", false);
- EventDelegate.Add(childObject5.GetComponentsInChildren<UIButton>(true)[0].onClick, new EventDelegate.Callback(this.FromView));
- childObject4.SetActive(false);
- GameObject childObject6 = UTY.GetChildObject(this.m_goUIRoot, "FFNameDialog", false);
- this.m_FFNameDlg = childObject6.GetComponent<FFNameDialog>();
- this.m_FFNameDlg.Init();
- childObject6.SetActive(false);
- Maid maid = this.m_maid;
- this.m_viewreset.SetVisibleEyeToCam(GameMain.Instance.CMSystem.SConfig.EditEyeToCam);
- if (GameMain.Instance.CMSystem.SConfig.EditEyeToCam)
- {
- maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
- }
- else
- {
- maid.EyeToCamera(Maid.EyeMoveType.無視する, 0f);
- }
- if (!GameMain.Instance.VRMode)
- {
- this.m_viewreset.SetVisibleAutoCam(GameMain.Instance.CMSystem.SConfig.EditAutoCam);
- }
- else
- {
- this.m_viewreset.SetVisibleAutoCam(false);
- GameMain.Instance.CMSystem.SConfig.EditAutoCam = false;
- }
- new List<string>
- {
- string.Empty
- }.AddRange(GameUty.PathList);
- Action<string> action = delegate(string strFileName)
- {
- if (!GameUty.FileSystem.IsExistentFile(strFileName))
- {
- return;
- }
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(strFileName))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, strFileName + "\nopen failed.");
- for (int j = 1; j < csvParser.max_cell_y; j++)
- {
- if (csvParser.IsCellToExistData(0, j))
- {
- SceneEdit.VoiceInfo voiceInfo = new SceneEdit.VoiceInfo();
- voiceInfo.strIconName = csvParser.GetCellAsString(1, j);
- string cellAsString = csvParser.GetCellAsString(2, j);
- voiceInfo.personal = Personal.GetData(cellAsString);
- voiceInfo.strVoiceFileName = csvParser.GetCellAsString(3, j);
- voiceInfo.strFace = csvParser.GetCellAsString(4, j);
- voiceInfo.strFace2 = csvParser.GetCellAsString(5, j);
- voiceInfo.texIcon = ImportCM.CreateTexture(voiceInfo.strIconName);
- if (!this.m_dicVoice.ContainsKey(voiceInfo.personal))
- {
- this.m_dicVoice.Add(voiceInfo.personal, new List<SceneEdit.PVBInfo>());
- }
- this.m_dicVoice[voiceInfo.personal].Add(voiceInfo);
- }
- }
- }
- }
- };
- GameMain.Instance.MainLight.Reset();
- GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
- this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
- GameMain.Instance.MainCamera.SetTargetPos(new Vector3(-0.05539433f, 0.95894f, 0.1269088f), true);
- GameMain.Instance.MainCamera.SetDistance(3f, true);
- GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(-180f, 11.5528f), true);
- this.m_cameraMoveSupport.SaveCameraPosition();
- if (GameMain.Instance.VRMode)
- {
- GameMain.Instance.MainCamera.SetPos(new Vector3(0f, 1.4871f, 1f));
- GameMain.Instance.MainCamera.SetRotation(new Vector3(0f, -180f, 0f));
- if (GameMain.Instance.VRFamily == GameMain.VRFamilyType.FOVE)
- {
- FoveEyeRayMgr.m_TargetMaid = this.m_maid;
- }
- }
- GameMain.Instance.SoundMgr.PlayBGM("BGM005.ogg", 1f, true);
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- GameMain.Instance.LoadIcon.NextLoadIcontImmediatelyDisplay();
- GameMain.Instance.LoadIcon.force_draw_new = true;
- this.m_dicColor.Clear();
- base.StartCoroutine(this.InitMenuNative());
- GameMain.Instance.TutorialPanel.SetImage(TutorialPanel.ImageSet.Edit, false);
- if (Product.type == Product.Type.JpPublic || (PluginData.IsEnabled("GP001") && !PluginData.IsEnabled("GP001FB")))
- {
- uGUITutorialPanel.OpenTutorial("SceneEditGP01", null, false);
- GameMain.Instance.SysShortcut.strSceneHelpName = "SceneEditGP01";
- }
- else if (PluginData.IsEnabled("GP001FB"))
- {
- uGUITutorialPanel.OpenTutorial("SceneEditGPFB01", null, false);
- GameMain.Instance.SysShortcut.strSceneHelpName = "SceneEditGPFB01";
- }
- else
- {
- GameMain.Instance.SysShortcut.strSceneHelpName = string.Empty;
- }
- }
- private IEnumerator CoLoadWait()
- {
- while (GameMain.Instance.CharacterMgr.IsBusy())
- {
- yield return null;
- }
- GameMain.Instance.CharacterMgr.ResetCharaPosAll();
- if (this.m_bVRComMode)
- {
- if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Night".ToLower())
- {
- this.m_maid.SetPos(new Vector3(-0.29f, 0f, 1.6f));
- this.m_maid.SetRot(new Vector3(0f, -90f, 0f));
- GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-1.58508f, 1.601999f, 1.811131f), true);
- GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 102f, 0f), true);
- GameMain.Instance.MainLight.SetRotation(new Vector3(40.00004f, 57.29157f, 18f));
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_BedRoom_Night".ToLower())
- {
- this.m_maid.SetPos(new Vector3(3.54f, 0f, 1.16f));
- this.m_maid.SetRot(new Vector3(0f, 180f, 0f));
- GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(3.55631f, 1.601999f, -0.3987116f), true);
- GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 358f, 0f), true);
- GameMain.Instance.MainLight.SetRotation(new Vector3(58.94946f, 0f, 198f));
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Villa_Farm_Night".ToLower())
- {
- this.m_maid.SetPos(new Vector3(-0.235f, 0f, -1.898f));
- GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-0.3528061f, 1.601999f, -0.6961781f), true);
- GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 174f, 0f), true);
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Sea_VR_Night".ToLower())
- {
- this.m_maid.SetPos(new Vector3(-2.75f, 0f, -11f));
- GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-2.685168f, 1.601999f, -9.861251f), true);
- GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 180f, 0f), true);
- }
- else if (GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo".ToLower() || GameMain.Instance.BgMgr.GetBGName().ToLower() == "Rotenburo_Night".ToLower())
- {
- this.m_maid.SetPos(new Vector3(-0.235f, 0f, 2.028f));
- GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(-0.2311308f, 1.601999f, 3.325274f), true);
- GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, 182f, 0f), true);
- }
- GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
- }
- this.m_maid.boMabataki = true;
- MaidColliderCollect collect = MaidColliderCollect.AddColliderCollect(this.m_maid);
- this.touchJumpColliderList = collect.AddCollider(MaidColliderCollect.ColliderType.Grab);
- if (!GameMain.Instance.VRMode)
- {
- Dictionary<IKManager.BoneType, KeyValuePair<IKManager.BoneSetType, GameObject>> dictionary = IKManager.CreateBoneDic(this.m_maid);
- Dictionary<Transform, SceneEdit.TouchType> dictionary2 = new Dictionary<Transform, SceneEdit.TouchType>();
- dictionary2.Add(dictionary[IKManager.BoneType.Head].Value.transform, SceneEdit.TouchType.Head);
- dictionary2.Add(dictionary[IKManager.BoneType.Spine1].Value.transform, SceneEdit.TouchType.UpperBody);
- dictionary2.Add(dictionary[IKManager.BoneType.Bust_R].Value.transform, SceneEdit.TouchType.Bust);
- dictionary2.Add(dictionary[IKManager.BoneType.Bust_L].Value.transform, SceneEdit.TouchType.Bust);
- dictionary2.Add(dictionary[IKManager.BoneType.Pelvis].Value.transform, SceneEdit.TouchType.LowerBody);
- dictionary2.Add(dictionary[IKManager.BoneType.Thigh_L].Value.transform, SceneEdit.TouchType.Leg);
- dictionary2.Add(dictionary[IKManager.BoneType.Thigh_R].Value.transform, SceneEdit.TouchType.Leg);
- Dictionary<SceneEdit.TouchType, Action> dictionary3 = new Dictionary<SceneEdit.TouchType, Action>();
- dictionary3.Add(SceneEdit.TouchType.Head, delegate
- {
- this.OnTouchJump(SceneEdit.TouchType.Head);
- });
- dictionary3.Add(SceneEdit.TouchType.Bust, delegate
- {
- this.OnTouchJump(SceneEdit.TouchType.Bust);
- });
- dictionary3.Add(SceneEdit.TouchType.UpperBody, delegate
- {
- this.OnTouchJump(SceneEdit.TouchType.UpperBody);
- });
- dictionary3.Add(SceneEdit.TouchType.LowerBody, delegate
- {
- this.OnTouchJump(SceneEdit.TouchType.LowerBody);
- });
- dictionary3.Add(SceneEdit.TouchType.Leg, delegate
- {
- this.OnTouchJump(SceneEdit.TouchType.Leg);
- });
- for (int i = 0; i < this.touchJumpColliderList.Count; i++)
- {
- ColliderEvent colliderEvent = this.touchJumpColliderList[i].gameObject.AddComponent<ColliderEvent>();
- Transform transform = colliderEvent.transform;
- while (transform != null && !dictionary2.ContainsKey(transform))
- {
- transform = transform.parent;
- }
- if (!(transform == null))
- {
- SceneEdit.TouchType key = dictionary2[transform];
- colliderEvent.onMouseDown = dictionary3[key];
- }
- }
- }
- else
- {
- this.touchJumpColliderList.Clear();
- }
- this.m_bUseTouchJump = this.m_bUseTouchJump;
- if (SceneEdit.compatibilityMode)
- {
- foreach (BgIconData.ItemData itemData in BgIconData.itemList)
- {
- if (itemData.isLegacyBG)
- {
- this.bgIconWindow.Exec(itemData.id);
- break;
- }
- }
- }
- else
- {
- foreach (BgIconData.ItemData itemData2 in BgIconData.itemList)
- {
- if (!itemData2.isLegacyBG)
- {
- this.bgIconWindow.Exec(itemData2.id);
- break;
- }
- }
- }
- this.customPartsWindow.Initizalize(this.m_maid);
- int initPoseId = PoseIconData.itemList[0].id;
- Action<PoseIconData.ItemData> backup = this.pauseIconWindow.onSelectPauseEvent;
- this.pauseIconWindow.onSelectPauseEvent = delegate(PoseIconData.ItemData data)
- {
- data.ExecScript();
- Maid maid = this.m_maid;
- Transform bone = maid.body0.GetBone(data.targetBoneName);
- if (bone != null)
- {
- this.m_cameraMoveSupport.SaveCameraPosition(bone.position, 3f, new Vector2(-180f, 11.5528f));
- this.CameraReset(0f);
- }
- };
- this.pauseIconWindow.Exec(initPoseId);
- yield return new WaitForSeconds(0.5f);
- this.pauseIconWindow.Exec(initPoseId);
- this.pauseIconWindow.onSelectPauseEvent = backup;
- this.customViewWindow.Create();
- GameMain.Instance.LoadIcon.force_draw_new = false;
- GameMain.Instance.MainCamera.FadeIn(0.5f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
- yield break;
- }
- private void OnCompleteFadeIn()
- {
- }
- private IEnumerator InitMenuNative()
- {
- while (GameMain.Instance.CharacterMgr.IsBusy())
- {
- yield return null;
- }
- MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
- while (!menuDataBase.JobFinished())
- {
- yield return null;
- }
- this.InitCategoryList();
- int fileCount = menuDataBase.GetDataSize();
- List<SceneEdit.SMenuItem> menuList = new List<SceneEdit.SMenuItem>(fileCount);
- this.m_menuRidDic = new Dictionary<int, SceneEdit.SMenuItem>(fileCount);
- Dictionary<int, List<int>> menuGroupMemberDic = new Dictionary<int, List<int>>();
- float time = Time.realtimeSinceStartup;
- for (int i = 0; i < fileCount; i++)
- {
- menuDataBase.SetIndex(i);
- string fileName = menuDataBase.GetMenuFileName();
- string parent_filename = menuDataBase.GetParentMenuFileName();
- if (GameMain.Instance.CharacterMgr.status.IsHavePartsItem(fileName))
- {
- SceneEdit.SMenuItem mi = new SceneEdit.SMenuItem();
- mi.m_strMenuFileName = fileName;
- mi.m_nMenuFileRID = fileName.GetHashCode();
- try
- {
- SceneEdit.ReadMenuItemDataFromNative(mi, i);
- }
- catch (Exception ex)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "ReadMenuItemDataFromNative 例外/",
- fileName,
- "/",
- ex.Message,
- " StackTrace/",
- ex.StackTrace
- }));
- }
- if (!mi.m_bMan && this.editItemTextureCache.IsRegister(mi.m_nMenuFileRID))
- {
- this.AddMenuItemToList(mi);
- menuList.Add(mi);
- if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
- {
- this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
- }
- string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
- if (!string.IsNullOrEmpty(parentMenuName))
- {
- int hashCode = parentMenuName.GetHashCode();
- if (!menuGroupMemberDic.ContainsKey(hashCode))
- {
- menuGroupMemberDic.Add(hashCode, new List<int>());
- }
- menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
- }
- else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
- {
- mi.m_bGroupLeader = true;
- mi.m_listMember = new List<SceneEdit.SMenuItem>();
- mi.m_listMember.Add(mi);
- }
- if (0.5f < Time.realtimeSinceStartup - time)
- {
- yield return null;
- time = Time.realtimeSinceStartup;
- }
- }
- }
- }
- foreach (string strFileName in GameUty.ModOnlysMenuFiles)
- {
- SceneEdit.SMenuItem mi2 = new SceneEdit.SMenuItem();
- if (SceneEdit.GetMenuItemSetUP(mi2, strFileName, false))
- {
- if (!mi2.m_bMan && !(mi2.m_texIconRef == null))
- {
- this.AddMenuItemToList(mi2);
- menuList.Add(mi2);
- if (!this.m_menuRidDic.ContainsKey(mi2.m_nMenuFileRID))
- {
- this.m_menuRidDic.Add(mi2.m_nMenuFileRID, mi2);
- }
- string parentMenuName2 = SceneEdit.GetParentMenuFileName(mi2);
- if (!string.IsNullOrEmpty(parentMenuName2))
- {
- int hashCode2 = parentMenuName2.GetHashCode();
- if (!menuGroupMemberDic.ContainsKey(hashCode2))
- {
- menuGroupMemberDic.Add(hashCode2, new List<int>());
- }
- menuGroupMemberDic[hashCode2].Add(mi2.m_strMenuFileName.ToLower().GetHashCode());
- }
- else if (mi2.m_strCateName.IndexOf("set_") != -1 && mi2.m_strMenuFileName.IndexOf("_del") == -1)
- {
- mi2.m_bGroupLeader = true;
- mi2.m_listMember = new List<SceneEdit.SMenuItem>();
- mi2.m_listMember.Add(mi2);
- }
- if (0.5f < Time.realtimeSinceStartup - time)
- {
- yield return null;
- time = Time.realtimeSinceStartup;
- }
- }
- }
- }
- yield return base.StartCoroutine(this.FixedInitMenu(menuList, this.m_menuRidDic, menuGroupMemberDic));
- yield return base.StartCoroutine(this.CoLoadWait());
- yield break;
- }
- private IEnumerator InitMenu()
- {
- this.InitCategoryList();
- string[] files = GameUty.MenuFiles;
- List<SceneEdit.SMenuItem> menuList = new List<SceneEdit.SMenuItem>(files.Length);
- this.m_menuRidDic = new Dictionary<int, SceneEdit.SMenuItem>(menuList.Capacity);
- Dictionary<int, List<int>> menuGroupMemberDic = new Dictionary<int, List<int>>();
- float time = Time.realtimeSinceStartup;
- foreach (string strFileName in files)
- {
- if (!strFileName.ToLower().Contains("/man"))
- {
- if (GameMain.Instance.CharacterMgr.status.IsHavePartsItem(Path.GetFileName(strFileName)))
- {
- SceneEdit.SMenuItem mi = new SceneEdit.SMenuItem();
- if (SceneEdit.GetMenuItemSetUP(mi, strFileName, false))
- {
- if (!mi.m_bMan && !(mi.m_texIconRef == null))
- {
- this.AddMenuItemToList(mi);
- menuList.Add(mi);
- if (!this.m_menuRidDic.ContainsKey(mi.m_nMenuFileRID))
- {
- this.m_menuRidDic.Add(mi.m_nMenuFileRID, mi);
- }
- string parentMenuName = SceneEdit.GetParentMenuFileName(mi);
- if (!string.IsNullOrEmpty(parentMenuName))
- {
- int hashCode = parentMenuName.GetHashCode();
- if (!menuGroupMemberDic.ContainsKey(hashCode))
- {
- menuGroupMemberDic.Add(hashCode, new List<int>());
- }
- menuGroupMemberDic[hashCode].Add(mi.m_strMenuFileName.ToLower().GetHashCode());
- }
- else if (mi.m_strCateName.IndexOf("set_") != -1 && mi.m_strMenuFileName.IndexOf("_del") == -1)
- {
- mi.m_bGroupLeader = true;
- mi.m_listMember = new List<SceneEdit.SMenuItem>();
- mi.m_listMember.Add(mi);
- }
- if (0.5f < Time.realtimeSinceStartup - time)
- {
- yield return null;
- time = Time.realtimeSinceStartup;
- }
- }
- }
- }
- }
- }
- yield return base.StartCoroutine(this.FixedInitMenu(menuList, this.m_menuRidDic, menuGroupMemberDic));
- yield return base.StartCoroutine(this.CoLoadWait());
- yield break;
- }
- private IEnumerator FixedInitMenu(List<SceneEdit.SMenuItem> menuList, Dictionary<int, SceneEdit.SMenuItem> menuRidDic, Dictionary<int, List<int>> menuGroupMemberDic)
- {
- float time = Time.realtimeSinceStartup;
- string[] modfiles = Menu.GetModFiles();
- if (modfiles != null)
- {
- foreach (string strFileName in modfiles)
- {
- SceneEdit.SMenuItem mi2 = new SceneEdit.SMenuItem();
- if (SceneEdit.InitModMenuItemScript(mi2, strFileName))
- {
- this.AddMenuItemToList(mi2);
- menuList.Add(mi2);
- if (!menuRidDic.ContainsKey(mi2.m_nMenuFileRID))
- {
- menuRidDic.Add(mi2.m_nMenuFileRID, mi2);
- }
- else
- {
- menuRidDic[mi2.m_nMenuFileRID] = mi2;
- }
- string parentMenuName = SceneEdit.GetParentMenuFileName(mi2);
- if (!string.IsNullOrEmpty(parentMenuName))
- {
- int hashCode = parentMenuName.GetHashCode();
- if (!menuGroupMemberDic.ContainsKey(hashCode))
- {
- menuGroupMemberDic.Add(hashCode, new List<int>());
- }
- menuGroupMemberDic[hashCode].Add(mi2.m_strMenuFileName.ToLower().GetHashCode());
- }
- else if (mi2.m_strCateName.IndexOf("set_") != -1 && mi2.m_strMenuFileName.IndexOf("_del") == -1)
- {
- mi2.m_bGroupLeader = true;
- mi2.m_listMember = new List<SceneEdit.SMenuItem>();
- mi2.m_listMember.Add(mi2);
- }
- if (0.5f < Time.realtimeSinceStartup - time)
- {
- yield return null;
- time = Time.realtimeSinceStartup;
- }
- }
- }
- }
- foreach (KeyValuePair<int, List<int>> keyValuePair in menuGroupMemberDic)
- {
- if (menuRidDic.ContainsKey(keyValuePair.Key) && keyValuePair.Value.Count >= 1)
- {
- SceneEdit.SMenuItem smenuItem = menuRidDic[keyValuePair.Key];
- smenuItem.m_bGroupLeader = true;
- smenuItem.m_listMember = new List<SceneEdit.SMenuItem>();
- smenuItem.m_listMember.Add(smenuItem);
- for (int n = 0; n < keyValuePair.Value.Count; n++)
- {
- smenuItem.m_listMember.Add(menuRidDic[keyValuePair.Value[n]]);
- smenuItem.m_listMember[smenuItem.m_listMember.Count - 1].m_bMember = true;
- smenuItem.m_listMember[smenuItem.m_listMember.Count - 1].m_leaderMenu = smenuItem;
- }
- smenuItem.m_listMember.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
- {
- if (x.m_fPriority == y.m_fPriority)
- {
- return 0;
- }
- if (x.m_fPriority < y.m_fPriority)
- {
- return -1;
- }
- if (x.m_fPriority > y.m_fPriority)
- {
- return 1;
- }
- return 0;
- });
- smenuItem.m_listMember.Sort((SceneEdit.SMenuItem x, SceneEdit.SMenuItem y) => x.m_strMenuFileName.CompareTo(y.m_strMenuFileName));
- }
- }
- foreach (KeyValuePair<MPN, SceneEditInfo.CCateNameType> keyValuePair2 in SceneEditInfo.m_dicPartsTypePair)
- {
- if (keyValuePair2.Value.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
- {
- this.AddMenuItemToList(new SceneEdit.SMenuItem
- {
- m_mpn = keyValuePair2.Key,
- m_nSliderValue = 500,
- m_strCateName = keyValuePair2.Key.ToString(),
- m_strMenuName = keyValuePair2.Value.m_strBtnPartsTypeName,
- m_requestNewFace = keyValuePair2.Value.m_requestNewFace,
- m_requestFBFace = keyValuePair2.Value.m_requestFBFace
- });
- }
- }
- for (int nM = 0; nM < menuList.Count; nM++)
- {
- SceneEdit.SMenuItem mi = menuList[nM];
- if (SceneEditInfo.m_dicPartsTypePair.ContainsKey(mi.m_eColorSetMPN))
- {
- if (mi.m_eColorSetMPN != MPN.null_mpn)
- {
- if (mi.m_strMenuNameInColorSet != null)
- {
- mi.m_strMenuNameInColorSet = mi.m_strMenuNameInColorSet.Replace("*", ".*");
- mi.m_listColorSet = this.m_dicColor[mi.m_eColorSetMPN].FindAll((SceneEdit.SMenuItem i) => new Regex(mi.m_strMenuNameInColorSet).IsMatch(i.m_strMenuFileName));
- }
- else
- {
- mi.m_listColorSet = this.m_dicColor[mi.m_eColorSetMPN];
- }
- }
- if (0.5f < Time.realtimeSinceStartup - time)
- {
- yield return null;
- time = Time.realtimeSinceStartup;
- }
- }
- }
- for (int j = 0; j < this.m_listCategory.Count; j++)
- {
- this.m_listCategory[j].SortPartsType();
- }
- for (int k = 0; k < this.m_listCategory.Count; k++)
- {
- this.m_listCategory[k].SortItem();
- }
- foreach (SceneEdit.SCategory scategory in this.m_listCategory)
- {
- if (scategory.m_eCategory == SceneEditInfo.EMenuCategory.プリセット || scategory.m_eCategory == SceneEditInfo.EMenuCategory.ランダム || scategory.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル || scategory.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
- {
- scategory.m_isEnabled = true;
- }
- else
- {
- scategory.m_isEnabled = false;
- foreach (SceneEdit.SPartsType spartsType in scategory.m_listPartsType)
- {
- if (spartsType.m_isEnabled)
- {
- scategory.m_isEnabled = true;
- break;
- }
- }
- }
- }
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- SceneEditInfo.EMenuCategory[] array = new SceneEditInfo.EMenuCategory[]
- {
- SceneEditInfo.EMenuCategory.セット,
- SceneEditInfo.EMenuCategory.プリセット,
- SceneEditInfo.EMenuCategory.ランダム,
- SceneEditInfo.EMenuCategory.プロフィ\u30FCル
- };
- SceneEditInfo.EMenuCategory[] array2 = array;
- for (int l = 0; l < array2.Length; l++)
- {
- SceneEditInfo.EMenuCategory cate = array2[l];
- this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cate).m_isEnabled = false;
- }
- }
- else if (this.maid.status.heroineType == HeroineType.Sub || this.maid.boNPC)
- {
- SceneEditInfo.EMenuCategory[] array3 = new SceneEditInfo.EMenuCategory[]
- {
- SceneEditInfo.EMenuCategory.プロフィ\u30FCル
- };
- SceneEditInfo.EMenuCategory[] array4 = array3;
- for (int m = 0; m < array4.Length; m++)
- {
- SceneEditInfo.EMenuCategory cate = array4[m];
- this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cate).m_isEnabled = false;
- }
- }
- this.UpdatePanel_Category();
- yield break;
- }
- private void InitCategoryList()
- {
- for (int i = 0; i < this.m_listCategory.Count; i++)
- {
- this.m_listCategory[i].Dispose();
- }
- this.m_listCategory.Clear();
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.頭.ToString(), SceneEditInfo.EMenuCategory.頭));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.髪.ToString(), SceneEditInfo.EMenuCategory.髪));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.身体.ToString(), SceneEditInfo.EMenuCategory.身体));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.服装.ToString(), SceneEditInfo.EMenuCategory.服装));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.アクセサリ.ToString(), SceneEditInfo.EMenuCategory.アクセサリ));
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.着衣設定.ToString(), SceneEditInfo.EMenuCategory.着衣設定));
- }
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.セット.ToString(), SceneEditInfo.EMenuCategory.セット));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プリセット.ToString(), SceneEditInfo.EMenuCategory.プリセット));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.ランダム.ToString(), SceneEditInfo.EMenuCategory.ランダム));
- this.m_listCategory.Add(new SceneEdit.SCategory(SceneEditInfo.EMenuCategory.プロフィ\u30FCル.ToString(), SceneEditInfo.EMenuCategory.プロフィ\u30FCル));
- }
- public static void ReadMenuItemDataFromNative(SceneEdit.SMenuItem mi, int menuDataBaseIndex)
- {
- MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
- menuDataBase.SetIndex(menuDataBaseIndex);
- mi.m_strMenuName = menuDataBase.GetMenuName();
- mi.m_strInfo = menuDataBase.GetItemInfoText();
- mi.m_mpn = (MPN)menuDataBase.GetCategoryMpn();
- mi.m_strCateName = menuDataBase.GetCategoryMpnText();
- mi.m_eColorSetMPN = (MPN)menuDataBase.GetColorSetMpn();
- mi.m_strMenuNameInColorSet = menuDataBase.GetMenuNameInColorSet();
- mi.m_pcMultiColorID = (MaidParts.PARTS_COLOR)menuDataBase.GetMultiColorId();
- mi.m_boDelOnly = menuDataBase.GetBoDelOnly();
- mi.m_fPriority = menuDataBase.GetPriority();
- mi.m_bMan = menuDataBase.GetIsMan();
- mi.m_bOld = (menuDataBase.GetVersion() < 2000);
- string iconS = menuDataBase.GetIconS();
- if (!string.IsNullOrEmpty(iconS) && GameUty.FileSystem.IsExistentFile(iconS))
- {
- if (SceneEdit.Instance != null)
- {
- SceneEdit.Instance.editItemTextureCache.PreLoadRegister(mi.m_nMenuFileRID, iconS);
- }
- else
- {
- try
- {
- mi.m_texIcon = ImportCM.CreateTexture(iconS);
- }
- catch (Exception)
- {
- Debug.LogError("Error:");
- }
- }
- }
- }
- public static bool GetMenuItemSetUP(SceneEdit.SMenuItem mi, string f_strMenuFileName, bool f_bMan = false)
- {
- if (f_strMenuFileName.Contains("_zurashi"))
- {
- return false;
- }
- if (f_strMenuFileName.Contains("_mekure"))
- {
- return false;
- }
- f_strMenuFileName = Path.GetFileName(f_strMenuFileName);
- mi.m_strMenuFileName = f_strMenuFileName;
- mi.m_nMenuFileRID = f_strMenuFileName.ToLower().GetHashCode();
- try
- {
- if (!SceneEdit.InitMenuItemScript(mi, f_strMenuFileName, f_bMan))
- {
- NDebug.Assert(false, "メニュースクリプトが読めませんでした。" + f_strMenuFileName);
- }
- }
- catch (Exception ex)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "GetMenuItemSetUP 例外/",
- f_strMenuFileName,
- "/",
- ex.Message,
- " StackTrace/",
- ex.StackTrace
- }));
- return false;
- }
- return true;
- }
- public static bool InitModMenuItemScript(SceneEdit.SMenuItem mi, string f_strModFileName)
- {
- byte[] buffer = null;
- try
- {
- using (FileStream fileStream = new FileStream(f_strModFileName, FileMode.Open))
- {
- if (fileStream == null)
- {
- Debug.LogWarning("MODアイテムメニューファイルが見つかりません。");
- return false;
- }
- buffer = new byte[fileStream.Length];
- fileStream.Read(buffer, 0, (int)fileStream.Length);
- }
- }
- catch (Exception ex)
- {
- Debug.LogError("InitModMenuItemScript MODアイテムメニューファイルが読み込めませんでした。 : " + f_strModFileName + " : " + ex.Message);
- return false;
- }
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8);
- string text = binaryReader.ReadString();
- NDebug.Assert(text == "CM3D2_MOD", "InitModMenuItemScript 例外 : ヘッダーファイルが不正です。" + text);
- int num = binaryReader.ReadInt32();
- string text2 = binaryReader.ReadString();
- string text3 = binaryReader.ReadString();
- string strMenuName = binaryReader.ReadString();
- string strCateName = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- string text5 = binaryReader.ReadString();
- MPN mpn = MPN.null_mpn;
- try
- {
- mpn = (MPN)Enum.Parse(typeof(MPN), text5);
- }
- catch
- {
- NDebug.Assert("カテゴリがありません。" + text5, false);
- }
- string text6 = string.Empty;
- if (mpn != MPN.null_mpn)
- {
- text6 = binaryReader.ReadString();
- }
- string s = binaryReader.ReadString();
- int num2 = binaryReader.ReadInt32();
- Dictionary<string, byte[]> dictionary = new Dictionary<string, byte[]>();
- for (int i = 0; i < num2; i++)
- {
- string key = binaryReader.ReadString();
- int count = binaryReader.ReadInt32();
- byte[] value = binaryReader.ReadBytes(count);
- dictionary.Add(key, value);
- }
- binaryReader.Close();
- binaryReader = null;
- mi.m_bMod = true;
- mi.m_strMenuFileName = Path.GetFileName(f_strModFileName);
- mi.m_nMenuFileRID = mi.m_strMenuFileName.ToLower().GetHashCode();
- mi.m_strMenuName = strMenuName;
- mi.m_strInfo = text4.Replace("《改行》", "\n");
- mi.m_strCateName = strCateName;
- try
- {
- mi.m_mpn = (MPN)Enum.Parse(typeof(MPN), mi.m_strCateName);
- }
- catch
- {
- Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
- mi.m_mpn = MPN.null_mpn;
- }
- if (mpn != MPN.null_mpn)
- {
- mi.m_eColorSetMPN = mpn;
- if (!string.IsNullOrEmpty(text6))
- {
- mi.m_strMenuNameInColorSet = text6;
- }
- }
- if (!string.IsNullOrEmpty(text2))
- {
- byte[] data = dictionary[text2];
- mi.m_texIcon = new Texture2D(1, 1, TextureFormat.RGBA32, false);
- mi.m_texIcon.LoadImage(data);
- }
- mi.m_fPriority = 999f;
- using (StringReader stringReader = new StringReader(s))
- {
- string empty = string.Empty;
- string text7;
- while ((text7 = stringReader.ReadLine()) != null)
- {
- string[] array = text7.Split(new char[]
- {
- '\t',
- ' '
- }, StringSplitOptions.RemoveEmptyEntries);
- if (array[0] == "テクスチャ変更")
- {
- MaidParts.PARTS_COLOR pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
- if (array.Length == 6)
- {
- string text8 = array[5];
- try
- {
- pcMultiColorID = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text8.ToUpper());
- }
- catch
- {
- NDebug.Assert("無限色IDがありません。" + text8, false);
- }
- mi.m_pcMultiColorID = pcMultiColorID;
- }
- }
- }
- }
- return true;
- }
- private bool AddMenuItemToList(SceneEdit.SMenuItem f_mi)
- {
- MPN mpn = f_mi.m_mpn;
- if (f_mi.m_mpn == MPN.null_mpn)
- {
- Debug.LogWarning("カテゴリがnullの為、メニュー表示しません。" + f_mi.m_strCateName);
- return false;
- }
- SceneEditInfo.CCateNameType cateType;
- if (!string.IsNullOrEmpty(f_mi.m_strMenuFileName) && Product.type == Product.Type.JpAdult)
- {
- if (SceneEditInfo.m_listCollaboCategory.Contains(f_mi.m_strMenuFileName.ToLower()))
- {
- if (mpn != MPN.null_mpn && SceneEditInfo.m_dicPartsTypePair.TryGetValue(mpn, out cateType))
- {
- cateType.m_strBtnPartsTypeName = "コラボ";
- cateType.m_ePartsType = "set_collabo";
- }
- }
- else if (mpn != MPN.null_mpn && SceneEditInfo.m_dicPartsTypePair.TryGetValue(mpn, out cateType) && cateType.m_strBtnPartsTypeName == "コラボ" && cateType.m_ePartsType == "set_collabo")
- {
- if (mpn == MPN.set_maidwear)
- {
- cateType.m_strBtnPartsTypeName = "メイド服";
- cateType.m_ePartsType = "set_maidwear";
- }
- else if (mpn == MPN.set_mywear)
- {
- cateType.m_strBtnPartsTypeName = "コスチューム";
- cateType.m_ePartsType = "set_mywear";
- }
- else if (mpn == MPN.set_underwear)
- {
- cateType.m_strBtnPartsTypeName = "下着";
- cateType.m_ePartsType = "set_underwear";
- }
- }
- }
- if (mpn != MPN.null_mpn && SceneEditInfo.m_dicPartsTypePair.TryGetValue(mpn, out cateType))
- {
- if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Item || cateType.m_eType == SceneEditInfo.CCateNameType.EType.Set || cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
- {
- SceneEdit.SCategory scategory = this.m_listCategory.Find((SceneEdit.SCategory c) => c.m_eCategory == cateType.m_eMenuCate);
- SceneEdit.SPartsType spartsType = scategory.m_listPartsType.Find((SceneEdit.SPartsType p) => p.m_ePartsType == cateType.m_ePartsType);
- if (spartsType == null)
- {
- string f_strPartsTypeName = string.Empty;
- if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
- {
- if (!SceneEditInfo.m_dicSliderPartsTypeBtnName.TryGetValue(cateType.m_ePartsType, out f_strPartsTypeName))
- {
- NDebug.Assert("スライダー群に対するパーツタイプ名がみつかりませんでした。", false);
- }
- }
- else
- {
- f_strPartsTypeName = cateType.m_strBtnPartsTypeName;
- }
- spartsType = new SceneEdit.SPartsType(cateType.m_eType, mpn, f_strPartsTypeName, cateType.m_ePartsType, cateType.m_requestNewFace, cateType.m_requestFBFace);
- if (this.enabledMpns.Count == 0)
- {
- spartsType.m_isEnabled = true;
- }
- else
- {
- spartsType.m_isEnabled = this.enabledMpns.Contains(spartsType.m_mpn);
- }
- scategory.m_listPartsType.Add(spartsType);
- }
- f_mi.m_ParentPartsType = spartsType;
- if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
- {
- f_mi.m_fPriority = (float)cateType.m_nIdx;
- }
- spartsType.m_listMenu.Add(f_mi);
- }
- else if (cateType.m_eType == SceneEditInfo.CCateNameType.EType.Color)
- {
- f_mi.m_bColor = true;
- if (!this.m_dicColor.ContainsKey(f_mi.m_mpn))
- {
- this.m_dicColor.Add(f_mi.m_mpn, new List<SceneEdit.SMenuItem>());
- }
- this.m_dicColor[f_mi.m_mpn].Add(f_mi);
- }
- }
- return true;
- }
- public static bool InitMenuItemScript(SceneEdit.SMenuItem mi, string f_strMenuFileName, bool f_bMan)
- {
- if (f_strMenuFileName.IndexOf("mod_") == 0)
- {
- string modPathFileName = Menu.GetModPathFileName(f_strMenuFileName);
- return !string.IsNullOrEmpty(modPathFileName) && SceneEdit.InitModMenuItemScript(mi, modPathFileName);
- }
- try
- {
- using (AFileBase afileBase = GameUty.FileOpen(f_strMenuFileName, null))
- {
- NDebug.Assert(afileBase.IsValid(), "メニューファイルが存在しません。 :" + f_strMenuFileName);
- if (SceneEdit.m_byItemFileBuffer == null)
- {
- SceneEdit.m_byItemFileBuffer = new byte[System.Math.Max(500000, afileBase.GetSize())];
- }
- else if (SceneEdit.m_byItemFileBuffer.Length < afileBase.GetSize())
- {
- SceneEdit.m_byItemFileBuffer = new byte[afileBase.GetSize()];
- }
- afileBase.Read(ref SceneEdit.m_byItemFileBuffer, afileBase.GetSize());
- }
- }
- catch (Exception ex)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "メニューファイルがが読み込めませんでした。 : ",
- f_strMenuFileName,
- " : ",
- ex.Message,
- " : StackTrace :\n",
- ex.StackTrace
- }));
- throw ex;
- }
- BinaryReader binaryReader = new BinaryReader(new MemoryStream(SceneEdit.m_byItemFileBuffer), Encoding.UTF8);
- string text = binaryReader.ReadString();
- NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin 例外 : ヘッダーファイルが不正です。" + text);
- int num = binaryReader.ReadInt32();
- string path = binaryReader.ReadString();
- string text2 = binaryReader.ReadString();
- string text3 = binaryReader.ReadString();
- string text4 = binaryReader.ReadString();
- long num2 = (long)binaryReader.ReadInt32();
- int num3 = 0;
- string text5 = null;
- string text6 = string.Empty;
- string text7 = string.Empty;
- try
- {
- for (;;)
- {
- int num4 = (int)binaryReader.ReadByte();
- text7 = text6;
- text6 = string.Empty;
- if (num4 == 0)
- {
- break;
- }
- for (int i = 0; i < num4; i++)
- {
- text6 = text6 + "\"" + binaryReader.ReadString() + "\" ";
- }
- if (!(text6 == string.Empty))
- {
- string stringCom = UTY.GetStringCom(text6);
- string[] stringList = UTY.GetStringList(text6);
- if (stringCom == "name")
- {
- string text8 = stringList[1];
- string text9 = string.Empty;
- string arg = string.Empty;
- int j = 0;
- while (j < text8.Length && text8[j] != '\u3000' && text8[j] != ' ')
- {
- text9 += text8[j];
- j++;
- }
- while (j < text8.Length)
- {
- arg += text8[j];
- j++;
- }
- mi.m_strMenuName = text9;
- }
- else if (stringCom == "setumei")
- {
- mi.m_strInfo = stringList[1];
- mi.m_strInfo = mi.m_strInfo.Replace("《改行》", "\n");
- }
- else if (stringCom == "category")
- {
- string strCateName = stringList[1].ToLower();
- mi.m_strCateName = strCateName;
- try
- {
- mi.m_mpn = (MPN)Enum.Parse(typeof(MPN), mi.m_strCateName);
- }
- catch
- {
- Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
- mi.m_mpn = MPN.null_mpn;
- }
- }
- else if (stringCom == "color_set")
- {
- try
- {
- mi.m_eColorSetMPN = (MPN)Enum.Parse(typeof(MPN), stringList[1].ToLower());
- }
- catch
- {
- Debug.LogWarning("カテゴリがありません。" + mi.m_strCateName);
- }
- if (stringList.Length >= 3)
- {
- mi.m_strMenuNameInColorSet = stringList[2].ToLower();
- }
- }
- else if (stringCom == "tex" || stringCom == "テクスチャ変更")
- {
- MaidParts.PARTS_COLOR pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
- if (stringList.Length == 6)
- {
- string text10 = stringList[5];
- try
- {
- pcMultiColorID = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text10.ToUpper());
- }
- catch
- {
- NDebug.Assert("無限色IDがありません。" + text10, false);
- }
- mi.m_pcMultiColorID = pcMultiColorID;
- }
- }
- else if (stringCom == "icon" || stringCom == "icons")
- {
- text5 = stringList[1];
- }
- else if (!(stringCom == "iconl"))
- {
- if (!(stringCom == "setstr"))
- {
- if (!(stringCom == "アイテムパラメータ"))
- {
- if (stringCom == "saveitem")
- {
- string text11 = stringList[1];
- if (text11 == string.Empty)
- {
- Debug.LogError("err SaveItem \"" + text11);
- }
- if (text11 == null)
- {
- Debug.LogError("err SaveItem null=\"" + text11);
- }
- if (text11 != string.Empty)
- {
- }
- }
- else if (!(stringCom == "catno"))
- {
- if (stringCom == "additem")
- {
- num3++;
- }
- else if (stringCom == "unsetitem")
- {
- mi.m_boDelOnly = true;
- }
- else if (stringCom == "priority")
- {
- mi.m_fPriority = float.Parse(stringList[1]);
- }
- else if (stringCom == "メニューフォルダ" && stringList[1].ToLower() == "man")
- {
- mi.m_bMan = true;
- }
- }
- }
- }
- }
- }
- }
- }
- catch (Exception ex2)
- {
- Debug.LogError(string.Concat(new string[]
- {
- "Exception ",
- Path.GetFileName(path),
- " 現在処理中だった行 = ",
- text6,
- " 以前の行 = ",
- text7,
- " ",
- ex2.Message,
- "StackTrace:\n",
- ex2.StackTrace
- }));
- throw ex2;
- }
- if (text5 != null && text5 != string.Empty)
- {
- try
- {
- mi.m_texIcon = ImportCM.CreateTexture(text5);
- }
- catch (Exception)
- {
- Debug.LogError("Error:");
- }
- }
- binaryReader.Close();
- return true;
- }
- private bool UpdatePanel_Category()
- {
- this.m_listNg2Cate.Clear();
- foreach (GameObject obj in this.m_listBtnCate)
- {
- UnityEngine.Object.DestroyImmediate(obj);
- }
- this.m_listBtnCate.Clear();
- for (int i = 0; i < this.m_listCategory.Count; i++)
- {
- SceneEdit.SCategory scategory = this.m_listCategory[i];
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
- GameObject gameObject = NGUITools.AddChild(this.m_Panel_Category.goGrid, @object as GameObject);
- UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
- Localize component = uilabel.gameObject.GetComponent<Localize>();
- if (component != null)
- {
- component.SetTerm("SceneEdit/カテゴリー/" + scategory.m_strCateName);
- }
- ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
- buttonEdit.m_Category = scategory;
- UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
- uibutton.isEnabled = scategory.m_isEnabled;
- if (uibutton.isEnabled)
- {
- EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
- }
- buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
- buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
- UIButton component2 = buttonEdit.GetComponent<UIButton>();
- buttonEdit.m_colBtnDefault = component2.defaultColor;
- this.m_listBtnCate.Add(gameObject);
- }
- this.m_Panel_Category.gcScrollView.ResetPosition();
- this.m_Panel_Category.gcUIGrid.Reposition();
- this.m_Panel_PartsType.SetActive(false);
- this.m_Panel_MenuItem.SetActive(false);
- this.m_Panel_SetItem.SetActive(false);
- this.m_Panel_SliderItem.SetActive(false);
- this.m_Panel_ColorSet.SetActive(false);
- this.m_Panel_GroupSet.SetActive(false);
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- if (this.highlightSelector != null)
- {
- this.highlightSelector.visible = true;
- this.highlightSelector.visible = false;
- }
- return true;
- }
- private void UpdatePanel_PartsType(SceneEdit.SCategory f_cate)
- {
- this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
- this.m_info.Close();
- this.m_Panel_PartsType.SetActive(true);
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- this.m_Panel_PartsType.VisibleArrow(false);
- this.m_misDelOnly = null;
- for (int i = 0; i < this.m_listBtnPartsType.Count; i++)
- {
- GameObject gameObject = this.m_listBtnPartsType[i];
- if (gameObject != null)
- {
- UnityEngine.Object.DestroyImmediate(gameObject);
- }
- }
- this.m_listBtnPartsType.Clear();
- for (int j = 0; j < this.m_listSliderItem.Count; j++)
- {
- SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[j];
- sliderItemSet.Clear();
- }
- this.m_listSliderItem.Clear();
- for (int k = 0; k < this.m_listBtnMenuItem.Count; k++)
- {
- SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[k];
- menuItemSet.Clear();
- }
- this.m_listBtnMenuItem.Clear();
- for (int l = 0; l < this.m_listBtnColorSet.Count; l++)
- {
- SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[l];
- colorItemSet.Clear();
- }
- this.m_listBtnColorSet.Clear();
- for (int m = 0; m < this.m_listBtnGroupMember.Count; m++)
- {
- SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[m];
- menuItemSet2.Clear();
- }
- this.m_listBtnGroupMember.Clear();
- for (int n = 0; n < f_cate.m_listPartsType.Count; n++)
- {
- SceneEdit.SPartsType spartsType = f_cate.m_listPartsType[n];
- if ((!PluginData.IsEnabled("GP001") && !PluginData.IsEnabled("GP001FB") && spartsType.m_isGP01Face) || (!PluginData.IsEnabled("GP001FB") && spartsType.m_isFBFace))
- {
- this.m_listBtnPartsType.Add(null);
- }
- else
- {
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
- GameObject gameObject2 = NGUITools.AddChild(this.m_Panel_PartsType.goGrid, @object as GameObject);
- UILabel uilabel = gameObject2.GetComponentsInChildren<UILabel>(true)[0];
- Localize component = uilabel.gameObject.GetComponent<Localize>();
- if (component != null)
- {
- component.SetTerm("SceneEdit/カテゴリー/サブ/" + spartsType.m_strPartsTypeName);
- }
- ButtonEdit buttonEdit = gameObject2.GetComponentsInChildren<ButtonEdit>(true)[0];
- buttonEdit.m_PartsType = spartsType;
- UIButton uibutton = gameObject2.GetComponentsInChildren<UIButton>(true)[0];
- uibutton.isEnabled = spartsType.m_isEnabled;
- if (spartsType.m_isFBFace && !this.isFBFace)
- {
- uibutton.isEnabled = false;
- }
- if (uibutton.isEnabled)
- {
- EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
- }
- buttonEdit.m_goFrame = gameObject2.transform.Find("Frame").gameObject;
- buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
- UIButton component2 = buttonEdit.GetComponent<UIButton>();
- buttonEdit.m_colBtnDefault = component2.defaultColor;
- this.m_listBtnPartsType.Add(gameObject2);
- }
- }
- this.m_Panel_PartsType.ResetScrollPos(0.5f);
- this.m_Panel_MenuItem.ResetScrollPos(0f);
- this.m_Panel_SetItem.ResetScrollPos(0f);
- this.m_Panel_SliderItem.ResetScrollPos(0f);
- }
- private void UpdatePanel_MenuItem(SceneEdit.SPartsType f_pt)
- {
- 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")
- {
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT_MORE);
- }
- else
- {
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
- }
- this.m_misDelOnly = null;
- this.m_info.Close();
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- for (int i = 0; i < this.m_listSliderItem.Count; i++)
- {
- SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
- sliderItemSet.Clear();
- }
- this.m_listSliderItem.Clear();
- for (int j = 0; j < this.m_listBtnMenuItem.Count; j++)
- {
- SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[j];
- menuItemSet.Clear();
- }
- this.m_listBtnMenuItem.Clear();
- for (int k = 0; k < this.m_listBtnColorSet.Count; k++)
- {
- SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[k];
- colorItemSet.Clear();
- }
- this.m_listBtnColorSet.Clear();
- for (int l = 0; l < this.m_listBtnGroupMember.Count; l++)
- {
- SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[l];
- menuItemSet2.Clear();
- }
- this.m_listBtnGroupMember.Clear();
- float num = -1f;
- if (this.highlightSelector != null)
- {
- this.highlightSelector.visible = false;
- }
- if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item || f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
- {
- if (!string.IsNullOrEmpty(this.last_select_category_name_))
- {
- if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
- {
- this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_MenuItem.gcScrollBar.value * 100f) / 100f;
- }
- if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
- {
- this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_SetItem.gcScrollBar.value * 100f) / 100f;
- }
- }
- if (this.backup_category_scroll_pos_.ContainsKey(f_pt.m_strPartsTypeName))
- {
- num = this.backup_category_scroll_pos_[f_pt.m_strPartsTypeName];
- }
- this.m_Panel_MenuItem.SetActive(false);
- this.m_Panel_SetItem.SetActive(false);
- SceneEdit.UIPanelSet uipanelSet = null;
- string f_strPrefabName = string.Empty;
- bool f_bSelectedFrame = false;
- if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item)
- {
- uipanelSet = this.m_Panel_MenuItem;
- f_strPrefabName = "ButtonItem";
- f_bSelectedFrame = true;
- }
- else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
- {
- uipanelSet = this.m_Panel_SetItem;
- f_strPrefabName = "ButtonSet";
- f_bSelectedFrame = false;
- this.customPartsWindowVisibleButton.windowVisible = false;
- this.customPartsWindowVisibleButton.visible = false;
- }
- this.m_Panel_SliderItem.SetActive(false);
- this.m_Panel_ColorSet.SetActive(false);
- this.m_Panel_GroupSet.SetActive(false);
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- uipanelSet.SetActive(true);
- for (int m = 0; m < f_pt.m_listMenu.Count; m++)
- {
- SceneEdit.SMenuItem smenuItem = f_pt.m_listMenu[m];
- bool flag = this.m_bUseGroup;
- if (smenuItem.m_mpn == MPN.set_body)
- {
- flag = false;
- }
- if (!flag || !smenuItem.m_bMember)
- {
- if (f_pt.m_ePartsType == "set_collabo" && m == 0)
- {
- SceneEdit.SPartsType spartsType = this.m_listCategory[5].m_listPartsType.Find((SceneEdit.SPartsType val) => val.m_ePartsType == "set_mywear");
- SceneEdit.SMenuItem smenuItem2 = null;
- if (spartsType != null)
- {
- smenuItem2 = spartsType.m_listMenu[0];
- }
- if (smenuItem2 != null)
- {
- SceneEdit.MenuItemSet menuItemSet3 = new SceneEdit.MenuItemSet(uipanelSet.goGrid, smenuItem2, f_strPrefabName, f_bSelectedFrame);
- if (smenuItem2.m_boDelOnly)
- {
- this.m_misDelOnly = menuItemSet3;
- }
- if (menuItemSet3.mi.m_strCateName.IndexOf("set_") != -1 && menuItemSet3.mi.m_bGroupLeader && flag)
- {
- EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallbackFromSetGroup));
- }
- else
- {
- EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
- }
- if (smenuItem.m_bGroupLeader && flag)
- {
- EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallbackOnGroup));
- }
- else
- {
- EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
- }
- EventDelegate.Add(menuItemSet3.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
- this.m_listBtnMenuItem.Add(menuItemSet3);
- }
- }
- SceneEdit.MenuItemSet menuItemSet4 = new SceneEdit.MenuItemSet(uipanelSet.goGrid, smenuItem, f_strPrefabName, f_bSelectedFrame);
- if (smenuItem.m_boDelOnly)
- {
- this.m_misDelOnly = menuItemSet4;
- }
- if (menuItemSet4.mi.m_strCateName.IndexOf("set_") != -1 && menuItemSet4.mi.m_bGroupLeader && flag)
- {
- EventDelegate.Add(menuItemSet4.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallbackFromSetGroup));
- }
- else
- {
- EventDelegate.Add(menuItemSet4.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
- }
- if (smenuItem.m_bGroupLeader && flag)
- {
- EventDelegate.Add(menuItemSet4.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallbackOnGroup));
- }
- else
- {
- EventDelegate.Add(menuItemSet4.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
- }
- EventDelegate.Add(menuItemSet4.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
- this.m_listBtnMenuItem.Add(menuItemSet4);
- }
- }
- uipanelSet.gcUIGrid.GetComponent<UIGrid>().enabled = true;
- if (f_pt.m_mpn == MPN.eye_hi && this.highlightSelector != null && this.isNewFace)
- {
- this.highlightSelector.visible = true;
- }
- this.UpdateSelectedMenuItem(f_pt);
- this.last_select_category_name_ = f_pt.m_strPartsTypeName;
- }
- else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- this.customPartsWindowVisibleButton.visible = false;
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- this.m_Panel_MenuItem.SetActive(false);
- this.m_Panel_SetItem.SetActive(false);
- this.m_Panel_ColorSet.SetActive(false);
- this.m_Panel_GroupSet.SetActive(false);
- this.m_Panel_SliderItem.SetActive(true);
- bool flag2 = false;
- foreach (SceneEdit.SMenuItem smenuItem3 in f_pt.m_listMenu)
- {
- if ((!smenuItem3.m_requestNewFace || this.isNewFace) && (!smenuItem3.m_requestFBFace || this.isFBFace))
- {
- if (!Product.isPublic || smenuItem3.m_mpn != MPN.MuneYawaraka)
- {
- SceneEdit.SliderItemSet sliderItemSet2;
- if (smenuItem3.m_mpn == MPN.EarNone)
- {
- SceneEdit.SwitchItemSet switchItemSet = new SceneEdit.SwitchItemSet();
- switchItemSet.Create(this.m_Panel_SliderItem.goGrid, smenuItem3);
- switchItemSet.onClickEvent = delegate(bool earNone, SceneEdit.SMenuItem menu)
- {
- int num2 = (!earNone) ? 0 : 1;
- MaidProp prop = this.maid.GetProp(menu.m_strCateName);
- if (prop.value != num2)
- {
- this.maid.SetProp(menu.m_strCateName, num2, false);
- this.UpdateSliders();
- SceneEdit.AllProcPropSeqStart(this.maid);
- }
- };
- sliderItemSet2 = switchItemSet;
- }
- else
- {
- sliderItemSet2 = new SceneEdit.SliderItemSet();
- sliderItemSet2.Create(this.m_Panel_SliderItem.goGrid, smenuItem3);
- EventDelegate.Add(sliderItemSet2.gcSlider.onChange, new EventDelegate.Callback(this.SlideCallback));
- flag2 |= (smenuItem3.m_mpn == MPN.MuneYawaraka);
- }
- this.m_listSliderItem.Add(sliderItemSet2);
- }
- }
- }
- BaseMgr<BodyStatusMgr>.Instance.OpenPanel(flag2);
- this.UpdateSliders();
- }
- this.m_Panel_MenuItem.ResetScrollPos(0f);
- this.m_Panel_SetItem.ResetScrollPos(0f);
- this.m_Panel_SliderItem.ResetScrollPos(0f);
- if (num != -1f)
- {
- if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
- {
- this.m_Panel_MenuItem.gcScrollBar.value = num;
- }
- if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
- {
- this.m_Panel_SetItem.gcScrollBar.value = num;
- }
- }
- }
- private void UpdateSelectedMenuItem(SceneEdit.SPartsType f_pt)
- {
- Maid maid = this.m_maid;
- MaidProp prop = maid.GetProp(f_pt.m_mpn);
- NDebug.Assert(prop != null, "指定MPNが不正です。");
- SceneEdit.SMenuItem smenuItem = null;
- if (this.m_misDelOnly != null)
- {
- this.m_misDelOnly.Selected(false);
- }
- for (int i = 0; i < this.m_listBtnMenuItem.Count; i++)
- {
- this.m_listBtnMenuItem[i].Selected(false);
- }
- bool flag = false;
- HashSet<int> hashSet = new HashSet<int>();
- foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
- {
- if (subPropMpnData.mpn == f_pt.m_mpn)
- {
- subPropMpnData.manager.UpdateAllItem();
- flag = true;
- if (subPropMpnData.manager.sloatItems != null)
- {
- foreach (SubSlotEditItem subSlotEditItem in subPropMpnData.manager.sloatItems)
- {
- if (!(subSlotEditItem == null) && subSlotEditItem.menuItem != null)
- {
- if (!hashSet.Contains(subSlotEditItem.menuItem.m_nMenuFileRID))
- {
- hashSet.Add(subSlotEditItem.menuItem.m_nMenuFileRID);
- }
- }
- }
- }
- break;
- }
- }
- bool flag2 = f_pt.m_mpn == MPN.eye_hi && this.isNewFace;
- int num = (this.modeType != SceneEdit.ModeType.CostumeEdit) ? prop.nFileNameRID : prop.nTempFileNameRID;
- int num2 = (!flag2) ? -1 : maid.GetProp(MPN.eye_hi_r).nFileNameRID;
- if (num != 0)
- {
- for (int l = 0; l < this.m_listBtnMenuItem.Count; l++)
- {
- SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[l];
- SceneEdit.SMenuItem menuItem = menuItemSet.gcBtnEdit.m_MenuItem;
- if (!menuItem.m_bGroupLeader || !this.m_bUseGroup)
- {
- bool flag3 = menuItem.m_nMenuFileRID == num;
- if (flag && (!flag3 || hashSet.Count != 0))
- {
- flag3 = hashSet.Contains(menuItem.m_nMenuFileRID);
- }
- if (flag3)
- {
- menuItemSet.Selected(true);
- smenuItem = menuItem;
- bool flag4 = this.customPartsWindow.SetItem(menuItem);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- flag4 = false;
- }
- if (!flag4)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- this.customPartsWindowVisibleButton.visible = flag4;
- }
- else if (flag2 && menuItem.m_nMenuFileRID == num2)
- {
- menuItemSet.Selected(true);
- }
- }
- else
- {
- NDebug.Assert(hashSet.Count == 0, "SubPropとグループが競合しています");
- bool flag5 = false;
- int num3 = 0;
- while (num3 < menuItem.m_listMember.Count && !flag5)
- {
- flag5 |= (menuItem.m_listMember[num3].m_nMenuFileRID == num);
- num3++;
- }
- if (flag5)
- {
- menuItemSet.Selected(true);
- smenuItem = menuItem;
- bool flag6 = this.customPartsWindow.SetItem(menuItem);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- flag6 = false;
- }
- if (!flag6)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- this.customPartsWindowVisibleButton.visible = flag6;
- }
- }
- }
- }
- else
- {
- for (int m = 0; m < this.m_listBtnMenuItem.Count; m++)
- {
- SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnMenuItem[m];
- if (menuItemSet2.mi.m_listColorSet != null)
- {
- SceneEdit.SMenuItem smenuItem2;
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nTempFileNameRID);
- }
- else
- {
- smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nFileNameRID);
- }
- if (smenuItem2 != null)
- {
- menuItemSet2.Selected(true);
- smenuItem = menuItemSet2.mi;
- }
- }
- }
- }
- if (smenuItem == null && this.m_misDelOnly != null)
- {
- this.m_misDelOnly.Selected(true);
- }
- this.UpdatePanel_ColorSet(smenuItem);
- foreach (SceneEdit.SubPropMpnData subPropMpnData2 in this.subPropDatas)
- {
- subPropMpnData2.manager.visible = false;
- }
- this.UpdatePanel_GroupSet(smenuItem);
- if (smenuItem != null)
- {
- foreach (SceneEdit.SubPropMpnData subPropMpnData3 in this.subPropDatas)
- {
- if (subPropMpnData3.mpn == smenuItem.m_mpn)
- {
- this.m_Panel_GroupSet.SetActive(true);
- subPropMpnData3.manager.visible = true;
- subPropMpnData3.manager.UpdateAllItem();
- this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
- Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
- localPosition.x = 23f;
- this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
- this.m_Panel_GroupSet.ResetScrollPos(0f);
- }
- }
- }
- if (this.customPartsWindowVisibleButton.visible)
- {
- if (this.m_Panel_GroupSet.goMain.activeInHierarchy)
- {
- this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(119f, 406f, 0f);
- }
- else if (this.m_Panel_ColorSet.goMain.activeInHierarchy)
- {
- this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(60f, 406f, 0f);
- }
- else
- {
- this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(0f, 406f, 0f);
- }
- }
- }
- private void UpdatePanel_GroupSet(SceneEdit.SMenuItem f_miSelected)
- {
- if (f_miSelected == null || f_miSelected.m_mpn == MPN.set_body || !f_miSelected.m_bGroupLeader || !this.m_bUseGroup)
- {
- this.m_Panel_GroupSet.SetActive(false);
- return;
- }
- Maid maid = this.m_maid;
- MaidProp prop = maid.GetProp(f_miSelected.m_mpn);
- this.m_Panel_GroupSet.SetActive(true);
- bool flag = this.m_listBtnGroupMember.Count != f_miSelected.m_listMember.Count;
- if (!flag)
- {
- int num = 0;
- while (num < f_miSelected.m_listMember.Count && !flag)
- {
- if (this.m_listBtnGroupMember[num].mi != f_miSelected.m_listMember[num])
- {
- flag = true;
- }
- num++;
- }
- }
- bool flag2 = f_miSelected.m_strCateName.IndexOf("set_") != -1;
- if (flag)
- {
- for (int i = 0; i < this.m_listBtnGroupMember.Count; i++)
- {
- SceneEdit.MenuItemSet menuItemSet = this.m_listBtnGroupMember[i];
- menuItemSet.Clear();
- }
- this.m_listBtnGroupMember.Clear();
- for (int j = 0; j < f_miSelected.m_listMember.Count; j++)
- {
- SceneEdit.MenuItemSet menuItemSet2 = new SceneEdit.MenuItemSet(this.m_Panel_GroupSet.goGrid, f_miSelected.m_listMember[j], (!flag2) ? "ButtonItem" : "ButtonSet", true);
- if (flag2)
- {
- menuItemSet2.ToSmall();
- }
- EventDelegate.Add(menuItemSet2.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
- EventDelegate.Add(menuItemSet2.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
- EventDelegate.Add(menuItemSet2.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
- this.m_listBtnGroupMember.Add(menuItemSet2);
- if (!flag2)
- {
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- menuItemSet2.Selected(prop != null && prop.nTempFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
- }
- else
- {
- menuItemSet2.Selected(prop != null && prop.nFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
- }
- }
- }
- if (flag2)
- {
- this.m_Panel_GroupSet.gcUIGrid.cellHeight = 127f;
- Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
- localPosition.x = 117f;
- this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
- }
- else
- {
- this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
- Vector3 localPosition2 = this.m_Panel_GroupSet.goMain.transform.localPosition;
- localPosition2.x = 23f;
- this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition2;
- }
- this.m_Panel_GroupSet.ResetScrollPos(0f);
- }
- else if (!flag2)
- {
- for (int k = 0; k < this.m_listBtnGroupMember.Count; k++)
- {
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- this.m_listBtnGroupMember[k].Selected(prop != null && prop.nTempFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
- }
- else
- {
- this.m_listBtnGroupMember[k].Selected(prop != null && prop.nFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
- }
- }
- }
- }
- private void UpdatePanel_ColorSet(SceneEdit.SMenuItem f_miSelected)
- {
- this.colorPaletteMgr.Close();
- if (f_miSelected == null || f_miSelected.m_eColorSetMPN == MPN.null_mpn)
- {
- this.m_Panel_ColorSet.SetActive(false);
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- return;
- }
- if (f_miSelected.m_mpn == MPN.folder_mayu)
- {
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(true);
- this.m_CheckBoxMayuDrawPriority.check = this.m_maid.MayuDrawPriority;
- }
- if (this.modeType != SceneEdit.ModeType.CostumeEdit)
- {
- this.m_Panel_ColorSet.SetActive(true);
- }
- for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
- {
- this.m_listBtnColorSet[i].Clear();
- }
- this.m_listBtnColorSet.Clear();
- for (int j = 0; j < f_miSelected.m_listColorSet.Count; j++)
- {
- SceneEdit.SMenuItem f_mi = f_miSelected.m_listColorSet[j];
- SceneEdit.ColorItemSet colorItemSet = new SceneEdit.ColorItemSet(this.m_Panel_ColorSet.goGrid, f_mi);
- EventDelegate.Add(colorItemSet.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
- EventDelegate.Add(colorItemSet.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
- EventDelegate.Add(colorItemSet.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
- this.m_listBtnColorSet.Add(colorItemSet);
- }
- this.m_Panel_ColorSet.ResetScrollPos(0f);
- this.UpdateSelected_ColorSet(f_miSelected.m_eColorSetMPN);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- this.m_Panel_ColorSet.SetActive(false);
- }
- }
- private void UpdateSelected_ColorSet(MPN f_mpn)
- {
- Maid maid = this.m_maid;
- MaidProp prop = maid.GetProp(f_mpn);
- NDebug.Assert(prop != null, "指定MPNが不正です。");
- SceneEdit.SMenuItem smenuItem = null;
- if (prop.nFileNameRID != 0)
- {
- for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
- {
- SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[i];
- SceneEdit.SMenuItem menuItem = colorItemSet.gcBtnEdit.m_MenuItem;
- colorItemSet.Selected(false);
- if (menuItem.m_nMenuFileRID == prop.nFileNameRID)
- {
- colorItemSet.Selected(true);
- smenuItem = menuItem;
- }
- }
- if (smenuItem != null)
- {
- if (smenuItem.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE)
- {
- if (this.modeType != SceneEdit.ModeType.CostumeEdit)
- {
- this.colorPaletteMgr.Call(0, smenuItem.m_pcMultiColorID);
- }
- }
- else
- {
- this.colorPaletteMgr.Close();
- }
- }
- }
- }
- public void UpdateSliders()
- {
- for (int i = 0; i < this.m_listSliderItem.Count; i++)
- {
- SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
- Maid maid = this.m_maid;
- MaidProp prop = maid.GetProp(sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName);
- if (sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName == "MuneL")
- {
- MaidProp prop2 = maid.GetProp(MPN.MuneS);
- int num;
- if (0 <= prop2.value && prop.value == 0)
- {
- num = (int)System.Math.Round((double)(-30f * ((float)(prop2.value - prop2.min) / (float)(prop2.max - prop2.min))), MidpointRounding.AwayFromZero);
- }
- else
- {
- num = prop.value;
- }
- int num2 = prop.min - 30;
- sliderItemSet.SetValue((float)(num - num2) / (float)(prop.max - num2), num.ToString());
- }
- else
- {
- sliderItemSet.SetValue((float)(prop.value - prop.min) / (float)(prop.max - prop.min), prop.value.ToString());
- }
- if (MPN.EarNone < sliderItemSet.gcBtnEdit.m_SliderItem.m_mpn && sliderItemSet.gcBtnEdit.m_SliderItem.m_mpn <= MPN.EarScl)
- {
- bool isEnabled = maid.GetProp(MPN.EarNone).value == 0;
- sliderItemSet.isEnabled = isEnabled;
- }
- }
- BaseMgr<BodyStatusMgr>.Instance.UpdateBodyStatus();
- }
- public void CategoryUnSelect()
- {
- for (int i = 0; i < this.m_listBtnCate.Count; i++)
- {
- GameObject gameObject = this.m_listBtnCate[i];
- ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
- UISprite component = buttonEdit.m_goFrame.GetComponent<UISprite>();
- component.enabled = false;
- UIButton component2 = buttonEdit.GetComponent<UIButton>();
- component2.defaultColor = buttonEdit.m_colBtnDefault;
- }
- this.m_Panel_Category.VisibleArrow(false);
- }
- public void ProcMenuItem(SceneEdit.SMenuItem f_mi)
- {
- }
- public void PartsTypeWearMode(MPN f_eMpn)
- {
- TBody.MaskMode maskMode;
- if (SceneEditInfo.m_dicPartsTypeWearMode.TryGetValue(f_eMpn, out maskMode))
- {
- Maid maid = this.m_maid;
- maid.body0.SetMaskMode(maskMode);
- }
- }
- public void PartsTypeCamera(MPN f_eMpn)
- {
- SceneEditInfo.CamToBone camToBone;
- if (this.m_viewreset.GetVisibleAutoCam() && SceneEditInfo.m_dicPartsTypeCamera.TryGetValue(f_eMpn, out camToBone))
- {
- Maid maid = this.m_maid;
- if (string.IsNullOrEmpty(camToBone.bone))
- {
- this.CameraMoveTo(this.m_cameraMoveSupport.targetPosition, camToBone.distance, camToBone.angle, 0.5f);
- }
- else
- {
- Transform bone = maid.body0.GetBone(camToBone.bone);
- if (bone != null)
- {
- this.CameraMoveTo(bone.position, camToBone.distance, camToBone.angle, 0.5f);
- }
- }
- }
- }
- public void ClickCallbackFromSetGroup()
- {
- this.m_bOpenSetGroupPanel = true;
- this.ClickCallback();
- this.m_bOpenSetGroupPanel = false;
- }
- public void ClickCallback()
- {
- Maid maid = this.m_maid;
- if (maid.IsBusy)
- {
- return;
- }
- ButtonEdit componentInChildren = UIButton.current.GetComponentInChildren<ButtonEdit>();
- if (componentInChildren.m_MenuItem == null || !componentInChildren.m_MenuItem.m_bColor)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- if (componentInChildren.m_Category != null)
- {
- this.customPartsWindowVisibleButton.visible = false;
- this.m_Panel_Category.VisibleArrow(false);
- this.CategoryUnSelect();
- this.colorPaletteMgr.Close();
- UISprite component = componentInChildren.m_goFrame.GetComponent<UISprite>();
- component.enabled = true;
- UIButton component2 = componentInChildren.GetComponent<UIButton>();
- component2.defaultColor = new Color(component2.defaultColor.r, component2.defaultColor.g, component2.defaultColor.b, 1f);
- this.m_maid.OpenMouthLookTooth(false);
- this.m_Panel_PartsType.SetActive(false);
- this.m_Panel_MenuItem.SetActive(false);
- this.m_Panel_SetItem.SetActive(false);
- this.m_Panel_SliderItem.SetActive(false);
- this.m_Panel_ColorSet.SetActive(false);
- this.m_Panel_GroupSet.SetActive(false);
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- if (this.highlightSelector != null)
- {
- this.highlightSelector.visible = false;
- }
- BaseMgr<RandomPresetMgr>.Instance.CloseRandomPresetPanel();
- BaseMgr<PresetMgr>.Instance.ClosePresetPanel();
- BaseMgr<ProfileMgr>.Instance.CloseProfilePanel();
- BaseMgr<CostumePartsEnabledMgr>.Instance.CloseRandomPresetPanel();
- if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.ランダム)
- {
- if (this.m_viewreset.GetVisibleAutoCam())
- {
- this.CameraReset(0.5f);
- }
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- BaseMgr<RandomPresetMgr>.Instance.OpenRandomPresetPanel();
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- }
- else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プリセット)
- {
- if (this.m_viewreset.GetVisibleAutoCam())
- {
- this.CameraReset(0.5f);
- }
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- BaseMgr<PresetMgr>.Instance.OpenPresetPanel();
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- }
- else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
- {
- if (this.m_viewreset.GetVisibleAutoCam())
- {
- this.CameraReset(0.5f);
- }
- BaseMgr<ProfileMgr>.Instance.OpenProfilePanel();
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- }
- else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
- {
- if (this.m_viewreset.GetVisibleAutoCam())
- {
- this.CameraReset(0.5f);
- }
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- BaseMgr<CostumePartsEnabledMgr>.Instance.OpenRandomPresetPanel();
- this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
- BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
- }
- else
- {
- this.UpdatePanel_PartsType(componentInChildren.m_Category);
- }
- this.m_Panel_Category.VisibleArrow(true);
- this.m_Panel_Category.MoveArrow(componentInChildren.gameObject);
- this.m_nNowMPN = MPN.null_mpn;
- }
- if (componentInChildren.m_PartsType != null)
- {
- for (int k = 0; k < this.m_listBtnPartsType.Count; k++)
- {
- GameObject gameObject = this.m_listBtnPartsType[k];
- if (!(gameObject == null))
- {
- ButtonEdit componentInChildren2 = gameObject.GetComponentInChildren<ButtonEdit>();
- UISprite component3 = componentInChildren2.m_goFrame.GetComponent<UISprite>();
- component3.enabled = false;
- UIButton component4 = componentInChildren2.GetComponent<UIButton>();
- component4.defaultColor = componentInChildren2.m_colBtnDefault;
- }
- }
- UISprite component5 = componentInChildren.m_goFrame.GetComponent<UISprite>();
- component5.enabled = true;
- UIButton component6 = componentInChildren.GetComponent<UIButton>();
- component6.defaultColor = new Color(component6.defaultColor.r, component6.defaultColor.g, component6.defaultColor.b, 1f);
- this.colorPaletteMgr.Close();
- if (componentInChildren.m_PartsType.m_strPartsTypeName == "コラボ" && componentInChildren.m_PartsType.m_mpn == MPN.set_underwear)
- {
- componentInChildren.m_PartsType.m_mpn = MPN.set_maidwear;
- }
- this.PartsTypeWearMode(componentInChildren.m_PartsType.m_mpn);
- this.PartsTypeCamera(componentInChildren.m_PartsType.m_mpn);
- if (componentInChildren.m_PartsType.m_mpn == MPN.accha)
- {
- this.m_maid.OpenMouthLookTooth(true);
- }
- else
- {
- this.m_maid.OpenMouthLookTooth(false);
- }
- this.UpdatePanel_MenuItem(componentInChildren.m_PartsType);
- this.m_Panel_PartsType.VisibleArrow(true);
- this.m_Panel_PartsType.MoveArrow(componentInChildren.gameObject);
- this.m_EditMod.m_mpn = componentInChildren.m_PartsType.m_mpn;
- this.m_nNowMPN = componentInChildren.m_PartsType.m_mpn;
- }
- if (componentInChildren.m_MenuItem != null && !maid.boAllProcPropBUSY)
- {
- SceneEdit.SMenuItem smenuItem = null;
- MaidProp prop = maid.GetProp(componentInChildren.m_MenuItem.m_mpn);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- if (prop != null && this.m_menuRidDic.ContainsKey(prop.nTempFileNameRID))
- {
- smenuItem = this.m_menuRidDic[prop.nTempFileNameRID];
- }
- }
- else if (prop != null && this.m_menuRidDic.ContainsKey(prop.nFileNameRID))
- {
- smenuItem = this.m_menuRidDic[prop.nFileNameRID];
- }
- if (!this.m_bOpenSetGroupPanel)
- {
- if (!componentInChildren.m_MenuItem.m_bColor && this.modeType != SceneEdit.ModeType.CostumeEdit)
- {
- this.customPartsWindow.OnExecItemPrev(componentInChildren.m_MenuItem);
- }
- bool flag = false;
- foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
- {
- if (subPropMpnData.mpn == componentInChildren.m_MenuItem.m_mpn)
- {
- flag = true;
- subPropMpnData.manager.SetItem(componentInChildren.m_MenuItem);
- break;
- }
- }
- if (!flag)
- {
- if (componentInChildren.m_MenuItem.m_mpn == MPN.eye_hi && this.isNewFace)
- {
- if (this.highlightSelector.selectItem == HighlightSelector.SelectItem.EyeR || this.highlightSelector.selectItem == HighlightSelector.SelectItem.Eye)
- {
- maid.SetProp(MPN.eye_hi_r, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
- }
- if (this.highlightSelector.selectItem == HighlightSelector.SelectItem.EyeL || this.highlightSelector.selectItem == HighlightSelector.SelectItem.Eye)
- {
- maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
- }
- }
- else if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, true, false);
- }
- else
- {
- maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
- }
- }
- }
- if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.null_mpn)
- {
- if (componentInChildren.m_MenuItem.m_eColorSetMPN == MPN.haircolor)
- {
- MaidProp prop2 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
- if (string.IsNullOrEmpty(prop2.strFileName))
- {
- List<SceneEdit.SMenuItem> listColorSet = componentInChildren.m_MenuItem.m_listColorSet;
- if (listColorSet.Count != 0)
- {
- SceneEdit.SMenuItem smenuItem2 = listColorSet.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE);
- if (smenuItem2 == null)
- {
- smenuItem2 = listColorSet[0];
- }
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, true, false);
- }
- else
- {
- maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, false, false);
- }
- }
- }
- }
- else
- {
- bool flag2 = false;
- if (smenuItem != null)
- {
- MaidProp prop3 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
- int num = 0;
- foreach (SceneEdit.SMenuItem smenuItem3 in smenuItem.m_listColorSet)
- {
- if (smenuItem3.m_nMenuFileRID == prop3.nFileNameRID)
- {
- break;
- }
- num++;
- }
- if (num < componentInChildren.m_MenuItem.m_listColorSet.Count)
- {
- SceneEdit.SMenuItem smenuItem4 = componentInChildren.m_MenuItem.m_listColorSet[num];
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, true, false);
- }
- else
- {
- maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, false, false);
- }
- flag2 = true;
- }
- }
- if (!flag2)
- {
- List<SceneEdit.SMenuItem> listColorSet2 = componentInChildren.m_MenuItem.m_listColorSet;
- if (listColorSet2.Count != 0)
- {
- SceneEdit.SMenuItem smenuItem5 = listColorSet2[0];
- if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.eye)
- {
- smenuItem5 = listColorSet2.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID == MaidParts.PARTS_COLOR.NONE);
- if (smenuItem5 == null)
- {
- smenuItem5 = listColorSet2[0];
- }
- }
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, true, false);
- }
- else
- {
- maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, false, false);
- }
- }
- }
- }
- }
- SceneEdit.AllProcPropSeqStart(maid);
- if (componentInChildren.m_MenuItem.m_bColor)
- {
- this.UpdateSelected_ColorSet(componentInChildren.m_MenuItem.m_mpn);
- }
- else if (!this.m_bOpenSetGroupPanel)
- {
- if (componentInChildren.m_MenuItem.m_ParentPartsType.m_ePartsType == "set_collabo" && componentInChildren.m_MenuItem.m_mpn == MPN.set_mywear)
- {
- componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn = MPN.set_mywear;
- this.PartsTypeWearMode(componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn);
- }
- else if (componentInChildren.m_MenuItem.m_ParentPartsType.m_ePartsType == "set_collabo" && componentInChildren.m_MenuItem.m_mpn == MPN.set_maidwear)
- {
- componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn = MPN.set_maidwear;
- this.PartsTypeWearMode(componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn);
- }
- else if (componentInChildren.m_MenuItem.m_ParentPartsType.m_ePartsType == "set_collabo" && componentInChildren.m_MenuItem.m_mpn == MPN.set_underwear)
- {
- componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn = MPN.set_underwear;
- this.PartsTypeWearMode(componentInChildren.m_MenuItem.m_ParentPartsType.m_mpn);
- }
- this.UpdateSelectedMenuItem(componentInChildren.m_MenuItem.m_ParentPartsType);
- }
- else
- {
- this.UpdatePanel_GroupSet(componentInChildren.m_MenuItem);
- }
- }
- }
- public void HoverOverCallback()
- {
- ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
- SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
- Vector3 position = UIEventTrigger.current.transform.parent.position;
- this.m_info.Open(position, menuItem.m_texIconRef, menuItem.menuNameCurrentLanguage, menuItem.infoTextCurrentLanguage, 0);
- }
- public void HoverOverCallbackOnGroup()
- {
- ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
- SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
- Vector3 position = UIEventTrigger.current.transform.parent.position;
- this.m_info.Open(position, menuItem.m_texIconRef, menuItem.menuNameCurrentLanguage, menuItem.infoTextCurrentLanguage, (menuItem.m_listMember == null) ? 0 : menuItem.m_listMember.Count);
- }
- public void HoverOutCallback()
- {
- this.m_info.Close();
- }
- public void OnClickEditItemGroup()
- {
- this.m_bUseGroup = !this.m_bUseGroup;
- this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
- }
- public void OnClickEditTouchJump()
- {
- this.m_bUseTouchJump = !this.m_bUseTouchJump;
- this.EditTouchJumpSwitch.defaultColor = ((!this.m_bUseTouchJump) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
- }
- public void SlideCallback()
- {
- Maid maid = this.m_maid;
- ButtonEdit componentInChildren = UIProgressBar.current.GetComponentInChildren<ButtonEdit>();
- MaidProp prop = maid.GetProp(componentInChildren.m_SliderItem.m_strCateName);
- if (componentInChildren.m_SliderItem.m_strCateName == "MuneL")
- {
- int num = prop.min - 30;
- int num2 = (int)System.Math.Round((double)((float)num + (float)(prop.max - num) * UIProgressBar.current.value), MidpointRounding.AwayFromZero);
- if (0 <= num2)
- {
- maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, num2, false);
- maid.SetProp(MPN.MuneS, 0, false);
- }
- else
- {
- maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, 0, false);
- maid.SetProp(MPN.MuneS, (int)(100f * ((float)num2 / -30f) + 0.5f), false);
- }
- }
- else
- {
- int val = (int)((float)prop.min + (float)(prop.max - prop.min) * UIProgressBar.current.value + 0.5f);
- maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, val, false);
- }
- if (componentInChildren.m_SliderItem.m_mpn == MPN.MuneL)
- {
- MaidProp prop2 = maid.GetProp(MPN.MuneL);
- MaidProp prop3 = maid.GetProp(MPN.MuneTare);
- prop3.max = prop2.value;
- if (prop3.max < 1)
- {
- prop3.max = 1;
- prop3.value = 0;
- }
- maid.SetProp(MPN.MuneTare, prop3.value, false);
- }
- maid.AllProcProp();
- this.UpdateSliders();
- }
- public void OpenColorSet(SceneEdit.SMenuItem f_miSelected)
- {
- if (f_miSelected.m_eColorSetMPN == MPN.null_mpn)
- {
- this.m_Panel_ColorSet.SetActive(false);
- this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
- return;
- }
- }
- private IEnumerator CoPoseToCam(string f_lookBone, float f_cameraMoveTime, float f_waitTime = 0.2f)
- {
- if (f_waitTime != 0f)
- {
- yield return new WaitForSeconds(f_waitTime);
- }
- Maid maid = this.m_maid;
- Transform trBone = maid.body0.GetBone(f_lookBone);
- if (trBone != null)
- {
- this.m_cameraMoveSupport.SaveCameraPosition(trBone.position, 3f, new Vector2(-180f, 11.5528f));
- this.CameraReset(f_cameraMoveTime);
- }
- yield break;
- }
- public void Voice(SceneEdit.PVBInfo f_pvb)
- {
- Maid maid = this.m_maid;
- SceneEdit.VoiceInfo voiceInfo = f_pvb as SceneEdit.VoiceInfo;
- maid.AudioMan.LoadPlay(voiceInfo.strVoiceFileName, 0f, false, false);
- maid.FaceAnime(voiceInfo.strFace, 1f, 0);
- if (string.IsNullOrEmpty(voiceInfo.strFace2))
- {
- maid.FaceBlend("無し");
- }
- else
- {
- maid.FaceBlend(voiceInfo.strFace2);
- }
- }
- public void ToView()
- {
- if (GameMain.Instance.VRMode && !Input.GetKey(KeyCode.LeftShift))
- {
- Debug.Log("VRモードではViewモードになりません。");
- return;
- }
- this.m_eCamOffsBack = this.m_eCamOffsNow;
- this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
- for (int i = 0; i < this.m_listPanel.Count; i++)
- {
- this.m_listPanel[i].alpha = 0f;
- }
- this.m_uipViewCancel.gameObject.SetActive(true);
- this.m_uipViewCancel.alpha = 1f;
- this.customViewWindow.mgr.gameObject.SetActive(false);
- this.customPartsWindow.ViewMode(true);
- }
- public void FromView()
- {
- for (int i = 0; i < this.m_listPanel.Count; i++)
- {
- this.m_listPanel[i].alpha = 1f;
- }
- this.m_uipViewCancel.alpha = 0f;
- this.m_uipViewCancel.gameObject.SetActive(false);
- this.SetCameraOffset(this.m_eCamOffsBack);
- this.customViewWindow.mgr.gameObject.SetActive(true);
- this.customPartsWindow.ViewMode(false);
- }
- public void ClothesState(SceneEditInfo.ClothesState f_cs)
- {
- Maid maid = this.m_maid;
- if (f_cs == SceneEditInfo.ClothesState.Nude)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.Nude);
- }
- else if (f_cs == SceneEditInfo.ClothesState.Underwear)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.Underwear);
- }
- if (f_cs == SceneEditInfo.ClothesState.Wear)
- {
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- }
- }
- public void SetCameraOffset(SceneEdit.CAM_OFFS f_eCamOffs)
- {
- if (GameMain.Instance.MainCamera == null)
- {
- return;
- }
- if (f_eCamOffs == SceneEdit.CAM_OFFS.CENTER)
- {
- GameMain.Instance.MainCamera.SetTargetOffset(new Vector3(0f, 0f, 0f), true);
- }
- else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT)
- {
- GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 3f * 2f - (float)Screen.width / 2f, 0f, 0f), true);
- }
- else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT_MORE)
- {
- GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 256f * 183f - (float)Screen.width / 2f, 0f, 0f), true);
- }
- this.m_eCamOffsNow = f_eCamOffs;
- }
- public void CallHowToNameDialog()
- {
- FFNameDialog.OnClick value = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = false;
- this.m_maid.status.isFirstNameCall = false;
- this.Conform();
- };
- FFNameDialog.OnClick value2 = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = false;
- this.m_maid.status.isFirstNameCall = true;
- this.Conform();
- };
- FFNameDialog.OnClick value3 = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = true;
- this.Conform();
- };
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/苗字で呼ぶ", value);
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair2 = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/名前で呼ぶ", value2);
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair3 = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/ニックネームで呼ぶ", value3);
- if (Product.isEnglish)
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/呼び方を選択してください", keyValuePair2.Key, keyValuePair2.Value, keyValuePair.Key, keyValuePair.Value, keyValuePair3.Key, keyValuePair3.Value);
- }
- else
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", keyValuePair.Key, keyValuePair.Value, keyValuePair2.Key, keyValuePair2.Value);
- }
- }
- public void CallSettingNamePanel()
- {
- GameObject childObject = UTY.GetChildObject(this.m_goUIRoot, "NameSettingPanel", false);
- if (childObject != null)
- {
- SceneEditNameSettingPanel component = childObject.GetComponent<SceneEditNameSettingPanel>();
- if (component != null)
- {
- component.gameObject.SetActive(true);
- component.Call();
- }
- }
- }
- public void OnCharaLoadCompleted()
- {
- foreach (SceneEdit.SCategory scategory in this.m_listCategory)
- {
- foreach (SceneEdit.SPartsType spartsType in scategory.m_listPartsType)
- {
- bool flag = 0 < spartsType.m_listMenu.Count;
- bool flag2 = false;
- if (spartsType.m_eType == SceneEditInfo.CCateNameType.EType.Item)
- {
- flag = SceneEditInfo.m_dicPartsTypePair[spartsType.m_mpn].m_requestNewFace;
- flag2 = SceneEditInfo.m_dicPartsTypePair[spartsType.m_mpn].m_requestFBFace;
- }
- else
- {
- foreach (SceneEdit.SMenuItem smenuItem in spartsType.m_listMenu)
- {
- if (!smenuItem.m_requestNewFace)
- {
- flag = false;
- break;
- }
- if (!smenuItem.m_requestFBFace)
- {
- flag2 = false;
- break;
- }
- }
- }
- if (flag)
- {
- spartsType.m_isEnabled = this.isNewFace;
- }
- else if (flag2)
- {
- spartsType.m_isEnabled = this.isFBFace;
- }
- if (spartsType.m_mpn == MPN.accmimi)
- {
- spartsType.m_isEnabled = (this.maid.GetProp(MPN.EarNone).value == 0);
- if (!spartsType.m_isEnabled && !this.isNewFace)
- {
- spartsType.m_isEnabled = true;
- }
- }
- }
- }
- foreach (GameObject gameObject in this.m_listBtnPartsType)
- {
- if (!(gameObject == null))
- {
- ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
- SceneEdit.SPartsType partsType = buttonEdit.m_PartsType;
- if ((partsType.m_isFBFace && !this.isFBFace) || (partsType.m_isFBFace && this.isFBFace))
- {
- partsType.m_isEnabled = this.isFBFace;
- }
- UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
- uibutton.isEnabled = partsType.m_isEnabled;
- if (uibutton.isEnabled && (uibutton.onClick == null || uibutton.onClick.Count == 0))
- {
- EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
- }
- }
- }
- if (this.isNewFace && this.maid.GetProp(MPN.EarNone).value != 0)
- {
- MaidProp prop = this.maid.GetProp(MPN.accmimi);
- if (prop != null && prop.strFileName != CM3.dicDelItem[MPN.accmimi])
- {
- string text = CM3.dicDelItem[MPN.accmimi];
- int hashCode = text.ToLower().GetHashCode();
- this.maid.SetProp(MPN.accmimi, text, hashCode, false, false);
- SceneEdit.AllProcPropSeqStart(this.m_maid);
- return;
- }
- }
- this.customViewWindow.UpdateAllItem();
- }
- private void OnEditOk()
- {
- if (GameMain.Instance.SysDlg.IsDecided && !GameMain.Instance.CharacterMgr.IsBusy())
- {
- Maid maid = this.m_maid;
- if (this.customPartsWindowVisibleButton.visible)
- {
- this.customPartsWindowVisibleButton.windowVisible = false;
- }
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- if (this.modeType == SceneEdit.ModeType.OriginalChara || this.modeType == SceneEdit.ModeType.MainChara || this.modeType == SceneEdit.ModeType.ScoutChara)
- {
- FFNameDialog.OnClick value = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = false;
- this.m_maid.status.isFirstNameCall = false;
- this.Conform();
- };
- FFNameDialog.OnClick value2 = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = false;
- this.m_maid.status.isFirstNameCall = true;
- this.Conform();
- };
- FFNameDialog.OnClick value3 = delegate()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isNickNameCall = true;
- this.Conform();
- };
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/苗字で呼ぶ", value);
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair2 = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/名前で呼ぶ", value2);
- KeyValuePair<string, FFNameDialog.OnClick> keyValuePair3 = new KeyValuePair<string, FFNameDialog.OnClick>("Dialog/result/ニックネームで呼ぶ", value3);
- if (Product.isEnglish)
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/呼び方を選択してください", keyValuePair2.Key, keyValuePair2.Value, keyValuePair.Key, keyValuePair.Value, keyValuePair3.Key, keyValuePair3.Value);
- }
- else
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", keyValuePair.Key, keyValuePair.Value, keyValuePair2.Key, keyValuePair2.Value);
- }
- }
- else
- {
- this.OnEndDlgOk();
- }
- }
- }
- private void OnFFNameFirst()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isFirstNameCall = true;
- this.Conform();
- }
- private void OnFFNameFamily()
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isFirstNameCall = false;
- this.Conform();
- }
- private void Conform()
- {
- this.m_maid.boMabataki = false;
- GameMain.Instance.SysDlg.ShowFromLanguageTerm("Dialog/このメイドにしますか?", null, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.OnEndDlgOk), new SystemDialog.OnClick(this.OnEndDlgCancel));
- }
- private void OnEndDlgOk()
- {
- BaseMgr<ProfileMgr>.Instance.UpdateProfileData(true);
- GameMain.Instance.SysDlg.Close();
- UICamera.InputEnable = false;
- this.m_maid.ThumShotCamMove();
- this.m_maid.body0.trsLookTarget = GameMain.Instance.ThumCamera.transform;
- this.m_maid.boMabataki = false;
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- for (int i = 81; i <= 80; i++)
- {
- this.maid.ResetProp((MPN)i, true);
- }
- }
- base.StartCoroutine(this.CoWaitPutCloth());
- }
- private IEnumerator CoWaitPutCloth()
- {
- if (this.modeType == SceneEdit.ModeType.CostumeEdit || this.modeType == SceneEdit.ModeType.NpcEdit)
- {
- while (GameMain.Instance.CharacterMgr.IsBusy())
- {
- yield return null;
- }
- }
- for (int nF = 0; nF < 90; nF++)
- {
- yield return null;
- }
- GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit)
- {
- this.m_maid.ThumShotCustom(GameMain.Instance.FacilityMgr.tempSelectFacility.GetFacilityEditCostumeThumbnailName(), true);
- }
- else if (this.modeType == SceneEdit.ModeType.NpcEdit)
- {
- byte[] data = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(this.m_maid, CharacterMgr.PresetType.All);
- if (NPCCharaSelect.editTargetNPCData != null)
- {
- SaveData.SetPreset(NPCCharaSelect.editTargetNPCData.id, data);
- }
- }
- else
- {
- this.m_maid.ThumShot();
- }
- this.m_maid.boMabataki = true;
- this.m_maid.body0.trsLookTarget = null;
- this.m_currentScriptFile = GameMain.Instance.ScriptMgr.adv_kag.kag.GetCurrentFileName();
- GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.CreateKasizukiThumShot), true, default(Color));
- yield break;
- }
- private void OnEndDlgCancel()
- {
- GameMain.Instance.SysDlg.Close();
- this.m_maid.boMabataki = true;
- }
- private void OnEditCancel()
- {
- }
- private void CreateKasizukiThumShot()
- {
- GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
- if (this.modeType == SceneEdit.ModeType.CostumeEdit || this.modeType == SceneEdit.ModeType.NpcEdit)
- {
- this.OnEndScene();
- return;
- }
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- scriptMgr.adv_kag.LoadScriptFile("KasizukiThumShot.ks", string.Empty);
- scriptMgr.adv_kag.Exec();
- base.StartCoroutine(this.CoroutineKasizukiThumShot());
- }
- private IEnumerator CoroutineKasizukiThumShot()
- {
- for (int nF = 0; nF < 30; nF++)
- {
- yield return null;
- }
- Camera thumCamera = GameMain.Instance.ThumCamera;
- CameraMain mainCamera = GameMain.Instance.MainCamera;
- thumCamera.transform.position = mainCamera.transform.position;
- thumCamera.transform.rotation = mainCamera.transform.rotation;
- float backup = thumCamera.fieldOfView;
- thumCamera.fieldOfView = mainCamera.camera.fieldOfView;
- this.m_maid.body0.trsLookTarget = thumCamera.transform;
- for (int nF2 = 0; nF2 < 30; nF2++)
- {
- yield return null;
- }
- this.m_maid.ThumShotCustom(KasizukiManager.CreateMaidTmpThumbName(this.m_maid), false);
- thumCamera.fieldOfView = backup;
- this.OnEndScene();
- yield break;
- }
- private void OnEndScene()
- {
- if (GameMain.Instance.VRMode)
- {
- GameMain.Instance.CharacterMgr.ResetCharaPosAll();
- }
- UICamera.InputEnable = true;
- if (!string.IsNullOrEmpty(this.m_strScriptArg))
- {
- Debug.Log("OnEndScene JumpTo " + this.m_strScriptArg);
- GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_currentScriptFile, this.m_strScriptArg);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- }
- public bool ClickEmulate(SceneEditInfo.EMenuCategory category, bool forceViewOff = false)
- {
- UIButton current = UIButton.current;
- for (int i = 0; i < this.m_listCategory.Count; i++)
- {
- if (this.m_listCategory[i].m_eCategory == category && i < this.m_listBtnCate.Count)
- {
- UIButton componentInChildren = this.m_listBtnCate[i].GetComponentInChildren<UIButton>();
- if (componentInChildren != null)
- {
- UIButton.current = componentInChildren;
- bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
- if (forceViewOff && visibleAutoCam)
- {
- this.m_viewreset.SetVisibleAutoCam(false);
- }
- this.ClickCallback();
- if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
- {
- this.m_viewreset.SetVisibleAutoCam(false);
- }
- UIButton.current = current;
- return true;
- }
- }
- }
- return false;
- }
- public bool isEnabledButton(MPN mpn)
- {
- switch (mpn)
- {
- case MPN.skin:
- mpn = MPN.folder_skin;
- break;
- default:
- switch (mpn)
- {
- case MPN.eyewhite:
- mpn = MPN.folder_eyewhite;
- break;
- case MPN.matsuge_up:
- mpn = MPN.folder_matsuge_up;
- break;
- case MPN.matsuge_low:
- mpn = MPN.folder_matsuge_low;
- break;
- case MPN.futae:
- mpn = MPN.folder_futae;
- break;
- }
- break;
- case MPN.underhair:
- mpn = MPN.folder_underhair;
- break;
- case MPN.mayu:
- mpn = MPN.folder_mayu;
- break;
- case MPN.eye:
- mpn = MPN.folder_eye;
- break;
- }
- if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
- {
- return false;
- }
- SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
- SceneEditInfo.EMenuCategory eMenuCate = ccateNameType.m_eMenuCate;
- string ePartsType = ccateNameType.m_ePartsType;
- SceneEdit.SCategory scategory = null;
- int num = 0;
- while (num < this.m_listCategory.Count && scategory == null)
- {
- if (this.m_listCategory[num].m_eCategory == eMenuCate)
- {
- scategory = this.m_listCategory[num];
- }
- num++;
- }
- for (int i = 0; i < scategory.m_listPartsType.Count; i++)
- {
- if (scategory.m_listPartsType[i].m_ePartsType == ePartsType)
- {
- return scategory.m_listPartsType[i].m_isEnabled;
- }
- }
- return false;
- }
- public bool ClickEmulate(MPN mpn, bool forceViewOff = false)
- {
- switch (mpn)
- {
- case MPN.skin:
- mpn = MPN.folder_skin;
- break;
- default:
- switch (mpn)
- {
- case MPN.eyewhite:
- mpn = MPN.folder_eyewhite;
- break;
- case MPN.matsuge_up:
- mpn = MPN.folder_matsuge_up;
- break;
- case MPN.matsuge_low:
- mpn = MPN.folder_matsuge_low;
- break;
- case MPN.futae:
- mpn = MPN.folder_futae;
- break;
- }
- break;
- case MPN.underhair:
- mpn = MPN.folder_underhair;
- break;
- case MPN.mayu:
- mpn = MPN.folder_mayu;
- break;
- case MPN.eye:
- mpn = MPN.folder_eye;
- break;
- }
- if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
- {
- return false;
- }
- SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
- return this.ClickEmulate(ccateNameType.m_eMenuCate, ccateNameType.m_ePartsType, forceViewOff);
- }
- public bool ClickEmulate(SceneEditInfo.EMenuCategory category, string partsType, bool forceViewOff = false)
- {
- if (!this.ClickEmulate(category, false) || category == SceneEditInfo.EMenuCategory.プリセット || category == SceneEditInfo.EMenuCategory.ランダム || category == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
- {
- return false;
- }
- UIButton current = UIButton.current;
- SceneEdit.SCategory scategory = null;
- int num = 0;
- while (num < this.m_listCategory.Count && scategory == null)
- {
- if (this.m_listCategory[num].m_eCategory == category)
- {
- scategory = this.m_listCategory[num];
- }
- num++;
- }
- for (int i = 0; i < scategory.m_listPartsType.Count; i++)
- {
- if (scategory.m_listPartsType[i].m_ePartsType == partsType && i < this.m_listBtnPartsType.Count)
- {
- this.m_listBtnPartsType[i].name = partsType;
- UIButton componentInChildren = this.m_listBtnPartsType[i].GetComponentInChildren<UIButton>();
- if (componentInChildren != null)
- {
- UIButton.current = componentInChildren;
- bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
- if (forceViewOff && visibleAutoCam)
- {
- this.m_viewreset.SetVisibleAutoCam(false);
- }
- this.ClickCallback();
- if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
- {
- this.m_viewreset.SetVisibleAutoCam(false);
- }
- UIButton.current = current;
- return true;
- }
- }
- }
- return false;
- }
- private void OnClickViewReset()
- {
- this.CameraReset(0.5f);
- }
- private void OnTouchJump(SceneEdit.TouchType type)
- {
- if (GameMain.Instance.VRMode || this.customPartsWindowVisibleButton.windowVisible || this.colorPaletteMgr.gameObject.activeSelf || !UICamera.InputEnable || this.m_uipViewCancel.gameObject.activeSelf)
- {
- return;
- }
- if (UICamera.Raycast(Input.mousePosition))
- {
- return;
- }
- MPN mpn = MPN.HeadX;
- switch (type)
- {
- case SceneEdit.TouchType.Head:
- mpn = MPN.HeadX;
- break;
- case SceneEdit.TouchType.Bust:
- mpn = MPN.MuneL;
- break;
- case SceneEdit.TouchType.UpperBody:
- mpn = MPN.west;
- break;
- case SceneEdit.TouchType.LowerBody:
- mpn = MPN.koshi;
- break;
- case SceneEdit.TouchType.Leg:
- mpn = MPN.DouPer;
- break;
- }
- if (this.isEnabledButton(mpn))
- {
- this.ClickEmulate(mpn, false);
- }
- }
- private void OnClickAutoCam()
- {
- bool flag = !this.m_viewreset.GetVisibleAutoCam();
- this.m_viewreset.SetVisibleAutoCam(flag);
- GameMain.Instance.CMSystem.SConfig.EditAutoCam = flag;
- }
- private void OnClickEyeToCam()
- {
- Maid maid = this.m_maid;
- bool flag = !this.m_viewreset.GetVisibleEyeToCam();
- this.m_viewreset.SetVisibleEyeToCam(flag);
- GameMain.Instance.CMSystem.SConfig.EditEyeToCam = flag;
- if (this.m_viewreset.GetVisibleEyeToCam())
- {
- maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0.8f);
- }
- else
- {
- maid.EyeToCamera(Maid.EyeMoveType.無視する, 0.8f);
- }
- }
- private void CameraReset(float f_fTime = 0.5f)
- {
- this.m_cameraMoveSupport.moveTime = f_fTime;
- this.m_cameraMoveSupport.ResetCamera();
- }
- private void CameraMoveTo(Vector3 f_vTarget, float f_fDistance, Vector2 f_vAngle, float f_fTime = 0.5f)
- {
- this.m_cameraMoveSupport.moveTime = f_fTime;
- this.m_cameraMoveSupport.StartCameraPosition(f_vTarget, f_fDistance, f_vAngle);
- }
- public void OnDestroy()
- {
- if (GameMain.Instance.isQuitting)
- {
- return;
- }
- iTween.Stop(base.gameObject);
- foreach (KeyValuePair<Personal.Data, List<SceneEdit.PVBInfo>> keyValuePair in this.m_dicVoice)
- {
- foreach (SceneEdit.PVBInfo pvbinfo in keyValuePair.Value)
- {
- UnityEngine.Object.Destroy(pvbinfo.texIcon);
- }
- }
- CharacterMgr.EditModeLookHaveItem = false;
- GameMain.Instance.ScriptMgr.StopMotionScript();
- Maid maid = this.m_maid;
- if (maid != null)
- {
- MaidColliderCollect.RemoveColliderAll(maid);
- maid.body0.SetMaskMode(TBody.MaskMode.None);
- maid.OpenMouthLookTooth(false);
- maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- maid.Visible = false;
- }
- this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
- if (!this.m_bVRComMode)
- {
- GameMain.Instance.BgMgr.DeleteBg();
- }
- NUty.GCFree();
- }
- public void UpdateCurrentItemPanel(bool resetScrollBar)
- {
- if (this.m_Panel_PartsType.goMain.activeSelf && (this.m_Panel_MenuItem.goMain.activeSelf || this.m_Panel_SetItem.goMain.activeSelf))
- {
- ButtonEdit[] componentsInChildren = this.m_Panel_PartsType.goGrid.GetComponentsInChildren<ButtonEdit>();
- foreach (ButtonEdit buttonEdit in componentsInChildren)
- {
- if (buttonEdit.m_goFrame.GetComponent<UISprite>().enabled)
- {
- if (buttonEdit.m_PartsType != null)
- {
- UIButton component = buttonEdit.GetComponent<UIButton>();
- UIButton current = UIButton.current;
- UIButton.current = component;
- bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
- this.m_viewreset.SetVisibleAutoCam(false);
- this.ClickCallback();
- this.m_viewreset.SetVisibleAutoCam(visibleAutoCam);
- UIButton.current = current;
- if (resetScrollBar && this.m_Panel_MenuItem.goMain.activeSelf)
- {
- this.m_Panel_MenuItem.gcScrollBar.value = 0f;
- }
- else if (resetScrollBar && this.m_Panel_SetItem.goMain.activeSelf)
- {
- this.m_Panel_SetItem.gcScrollBar.value = 0f;
- }
- break;
- }
- }
- }
- }
- }
- public void Update()
- {
- if (GameMain.Instance.VRMode)
- {
- if (!this.m_bVRComMode)
- {
- if (Input.GetKeyUp(KeyCode.B))
- {
- this.bgIconWindow.NextBG();
- }
- if (Input.GetKeyUp(KeyCode.P))
- {
- this.pauseIconWindow.NextPose();
- }
- if (Input.GetKeyUp(KeyCode.F5) || Input.GetKeyUp(KeyCode.R))
- {
- GameMain.Instance.CharacterMgr.ResetCharaPosAll();
- }
- }
- if (Input.GetKey(KeyCode.LeftArrow))
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- if (maid != null)
- {
- maid.gameObject.transform.Rotate(new Vector3(0f, 60f, 0f) * Time.deltaTime);
- }
- }
- if (Input.GetKey(KeyCode.RightArrow))
- {
- Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(0);
- if (maid2 != null)
- {
- maid2.gameObject.transform.Rotate(new Vector3(0f, -60f, 0f) * Time.deltaTime);
- }
- }
- }
- if (GameMain.Instance.CharacterMgr.IsBusy() || this.customViewWindow == null || this.customViewWindow.itemList == null)
- {
- this.updateCustomViewFlag = true;
- return;
- }
- if (this.updateCustomViewFlag)
- {
- this.updateCustomViewFlag = false;
- this.OnCharaLoadCompleted();
- }
- }
- private bool updateCustomViewFlag;
- private List<CapsuleCollider> touchJumpColliderList = new List<CapsuleCollider>();
- private List<SceneEdit.SCategory> m_listCategory = new List<SceneEdit.SCategory>();
- private List<GameObject> m_listBtnCate = new List<GameObject>();
- private List<GameObject> m_listBtnPartsType = new List<GameObject>();
- private List<SceneEdit.MenuItemSet> m_listBtnMenuItem = new List<SceneEdit.MenuItemSet>();
- private List<SceneEdit.SliderItemSet> m_listSliderItem = new List<SceneEdit.SliderItemSet>();
- private List<SceneEdit.ColorItemSet> m_listBtnColorSet = new List<SceneEdit.ColorItemSet>();
- private List<SceneEdit.MenuItemSet> m_listBtnGroupMember = new List<SceneEdit.MenuItemSet>();
- public bool m_bOpenSetGroupPanel;
- public UIButton EditItemGroupSwitch;
- public UIButton EditTouchJumpSwitch;
- [SerializeField]
- public ColorPaletteManager colorPaletteMgr;
- [SerializeField]
- private WindowPartsWindowVisible customPartsWindowVisibleButton;
- [SerializeField]
- [Tooltip("ハイライト選択のゲームオブジェクト")]
- private HighlightSelector highlightSelector;
- [SerializeField]
- public SceneEdit.SubPropMpnData[] subPropDatas;
- private SceneEdit.UIPanelSet m_Panel_Category;
- private SceneEdit.UIPanelSet m_Panel_PartsType;
- private SceneEdit.UIPanelSet m_Panel_MenuItem;
- private SceneEdit.UIPanelSet m_Panel_SetItem;
- private SceneEdit.UIPanelSet m_Panel_SliderItem;
- private SceneEdit.UIPanelSet m_Panel_ColorSet;
- private SceneEdit.UIPanelSet m_Panel_GroupSet;
- private WFCheckBox m_CheckBoxMayuDrawPriority;
- public BetterList<UIKeyNavigation2> m_listNg2Cate = new BetterList<UIKeyNavigation2>();
- public BetterList<UIKeyNavigation2> m_listNg2PartsType = new BetterList<UIKeyNavigation2>();
- public BetterList<UIKeyNavigation2> m_listNg2MenuItem = new BetterList<UIKeyNavigation2>();
- public TextMesh m_tmDebugText;
- private SceneEdit.MenuItemSet m_misDelOnly;
- public Dictionary<MPN, List<SceneEdit.SMenuItem>> m_dicColor = new Dictionary<MPN, List<SceneEdit.SMenuItem>>();
- public Dictionary<int, SceneEdit.SMenuItem> m_menuRidDic;
- public Dictionary<Personal.Data, List<SceneEdit.PVBInfo>> m_dicVoice = new Dictionary<Personal.Data, List<SceneEdit.PVBInfo>>();
- public GameObject m_goUIRoot;
- private ItemInfoWnd m_info;
- private EditOkCancel m_okcancel;
- private EditViewReset m_viewreset;
- public List<UIPanel> m_listPanel = new List<UIPanel>();
- private UIPanel m_uipViewCancel;
- private WfCameraMoveSupport m_cameraMoveSupport;
- private Maid m_maid;
- private string m_strScriptArg;
- private string m_currentScriptFile;
- private bool m_bVRComMode;
- private FFNameDialog m_FFNameDlg;
- private EditMod m_EditMod;
- private string last_select_category_name_ = string.Empty;
- private Dictionary<string, float> backup_category_scroll_pos_ = new Dictionary<string, float>();
- private int m_nDemoBgNo;
- private MPN m_nNowMPN;
- private static byte[] m_byItemFileBuffer;
- private SceneEdit.CAM_OFFS m_eCamOffsNow;
- private SceneEdit.CAM_OFFS m_eCamOffsBack;
- public enum ModeType
- {
- OriginalChara,
- MainChara,
- AfterEdit,
- CostumeEdit,
- NpcEdit,
- ScoutChara
- }
- private enum TouchType
- {
- Head,
- Bust,
- UpperBody,
- LowerBody,
- Leg
- }
- public class SMenuItem : IDisposable
- {
- public string menuNameCurrentLanguage
- {
- get
- {
- string text = this.m_strMenuName;
- if (Product.systemLanguage != Product.Language.Japanese)
- {
- string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
- string translation = LocalizationManager.GetTranslation(str + "|name", true, 0, true, false, null, null);
- text = ((!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strMenuName);
- }
- return this.CountryReplace(text);
- }
- }
- public string infoTextCurrentLanguage
- {
- get
- {
- string text = this.m_strInfo;
- if (Product.systemLanguage != Product.Language.Japanese)
- {
- string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
- string translation = LocalizationManager.GetTranslation(str + "|info", true, 0, true, false, null, null);
- text = ((!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strInfo);
- }
- return this.CountryReplace(text);
- }
- }
- public Texture2D m_texIconRef
- {
- get
- {
- return (!(this.m_texIcon != null) && !(SceneEdit.Instance == null)) ? SceneEdit.Instance.editItemTextureCache.GetTexter(this.m_nMenuFileRID) : this.m_texIcon;
- }
- }
- public Texture2D m_texIconRandomColorRef
- {
- get
- {
- return this.m_texIconRef;
- }
- }
- public string CountryReplace(string text)
- {
- if (Product.isJapan)
- {
- return text;
- }
- string[][] array = new string[][]
- {
- new string[]
- {
- "ゴスロリ",
- "ピュアゴス"
- },
- new string[]
- {
- "ロリゴス",
- "プリティゴス"
- },
- new string[]
- {
- "ロリータ",
- "プリティ"
- }
- };
- foreach (string[] array3 in array)
- {
- text = text.Replace(array3[0], array3[1]);
- }
- return text;
- }
- public void Dispose()
- {
- UnityEngine.Object.DestroyImmediate(this.m_goButton);
- UnityEngine.Object.DestroyImmediate(this.m_texIcon);
- }
- public void SortColorItem()
- {
- this.m_listColorSet.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
- {
- if (x.m_fPriority == y.m_fPriority)
- {
- return 0;
- }
- if (x.m_fPriority < y.m_fPriority)
- {
- return -1;
- }
- if (x.m_fPriority > y.m_fPriority)
- {
- return 1;
- }
- return 0;
- });
- }
- public bool Compare(SceneEdit.SMenuItem item)
- {
- bool flag = true;
- flag |= (this.m_strMenuName == item.m_strMenuName);
- flag |= (this.m_strInfo == item.m_strInfo);
- flag |= (this.m_mpn == item.m_mpn);
- flag |= (this.m_strCateName == item.m_strCateName);
- flag |= (this.m_eColorSetMPN == item.m_eColorSetMPN);
- flag |= (this.m_strMenuNameInColorSet == item.m_strMenuNameInColorSet);
- flag |= (this.m_pcMultiColorID == item.m_pcMultiColorID);
- flag |= (this.m_boDelOnly == item.m_boDelOnly);
- flag |= (this.m_fPriority == item.m_fPriority);
- flag |= (this.m_bMan == item.m_bMan);
- return flag | this.m_bOld == item.m_bOld;
- }
- public SceneEdit.SPartsType m_ParentPartsType;
- public string m_strCateName;
- public string m_strMenuName = string.Empty;
- public bool m_requestNewFace;
- public bool m_requestFBFace;
- public MPN m_mpn;
- public bool m_bColor;
- public MPN m_eColorSetMPN;
- public string m_strMenuNameInColorSet;
- public List<SceneEdit.SMenuItem> m_listColorSet = new List<SceneEdit.SMenuItem>();
- public MaidParts.PARTS_COLOR m_pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
- public float m_fPriority;
- public bool m_bMan;
- public bool m_bOld;
- public bool m_boDelOnly;
- public string m_strInfo = string.Empty;
- public Texture2D m_texIcon;
- public Texture2D m_texIconRandomColor;
- public string m_strMenuFileName;
- public int m_nMenuFileRID;
- public int m_nSliderValue;
- public GameObject m_goButton;
- public bool m_bMod;
- public bool m_bGroupLeader;
- public List<SceneEdit.SMenuItem> m_listMember;
- public bool m_bMember;
- public SceneEdit.SMenuItem m_leaderMenu;
- }
- public class SPartsType : IDisposable
- {
- public SPartsType(SceneEditInfo.CCateNameType.EType f_eType, MPN f_mpn, string f_strPartsTypeName, string f_ePartsType, bool f_isGP01Face, bool f_isFBFace)
- {
- this.m_nIdx = SceneEditInfo.m_dicPartsTypePair[f_mpn].m_nIdx;
- this.m_eType = f_eType;
- this.m_mpn = f_mpn;
- this.m_strPartsTypeName = f_strPartsTypeName;
- this.m_ePartsType = f_ePartsType;
- this.m_isEnabled = true;
- this.m_isGP01Face = f_isGP01Face;
- this.m_isFBFace = f_isFBFace;
- }
- public void Dispose()
- {
- for (int i = 0; i < this.m_listMenu.Count; i++)
- {
- this.m_listMenu[i].Dispose();
- }
- UnityEngine.Object.DestroyImmediate(this.m_goButton);
- UnityEngine.Object.DestroyImmediate(this.m_goPanelMenu);
- }
- public void SortItem()
- {
- this.m_listMenu.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
- {
- if (x.m_fPriority == y.m_fPriority)
- {
- int num = x.m_strMenuName.CompareTo(y.m_strMenuName);
- if (num == 0)
- {
- return 0;
- }
- if (num > 0)
- {
- return 1;
- }
- if (num < 0)
- {
- return -1;
- }
- return 0;
- }
- else
- {
- if (x.m_fPriority > y.m_fPriority)
- {
- return 1;
- }
- if (x.m_fPriority < y.m_fPriority)
- {
- return -1;
- }
- return 0;
- }
- });
- for (int i = 0; i < this.m_listMenu.Count; i++)
- {
- this.m_listMenu[i].SortColorItem();
- }
- }
- public SceneEditInfo.CCateNameType.EType m_eType;
- public int m_nIdx;
- public string m_strPartsTypeName;
- public MPN m_mpn;
- public string m_ePartsType;
- public bool m_isEnabled;
- public bool m_isGP01Face;
- public bool m_isFBFace;
- public List<SceneEdit.SMenuItem> m_listMenu = new List<SceneEdit.SMenuItem>();
- public GameObject m_goButton;
- public GameObject m_goPanelMenu;
- }
- public class SCategory : IDisposable
- {
- public SCategory(string f_strCateName, SceneEditInfo.EMenuCategory f_eCategory)
- {
- this.m_strCateName = f_strCateName;
- this.m_eCategory = f_eCategory;
- this.m_isEnabled = true;
- }
- public void Dispose()
- {
- foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
- {
- spartsType.Dispose();
- }
- UnityEngine.Object.DestroyImmediate(this.m_goButton);
- UnityEngine.Object.DestroyImmediate(this.m_goPanelPartsType);
- }
- public void SortPartsType()
- {
- this.m_listPartsType.Sort(delegate(SceneEdit.SPartsType x, SceneEdit.SPartsType y)
- {
- if (x.m_nIdx == y.m_nIdx)
- {
- return 0;
- }
- if (x.m_nIdx < y.m_nIdx)
- {
- return -1;
- }
- if (x.m_nIdx > y.m_nIdx)
- {
- return 1;
- }
- return 0;
- });
- }
- public void SortItem()
- {
- foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
- {
- spartsType.SortItem();
- }
- }
- public SceneEditInfo.EMenuCategory m_eCategory;
- public string m_strCateName;
- public GameObject m_goButton;
- public GameObject m_goPanelPartsType;
- public bool m_isEnabled;
- public List<SceneEdit.SPartsType> m_listPartsType = new List<SceneEdit.SPartsType>();
- }
- private class UIPanelSet
- {
- public UIPanelSet(GameObject f_goUIRoot, string f_strPath)
- {
- this.goMain = UTY.GetChildObject(f_goUIRoot, f_strPath, false);
- GameObject childObject = UTY.GetChildObject(this.goMain, "Scroll View", false);
- this.gcScrollView = childObject.GetComponent<UIScrollView>();
- this.goGrid = UTY.GetChildObject(childObject, "UIGrid", false);
- this.gcUIGrid = this.goGrid.GetComponentsInChildren<UIGrid>(true)[0];
- this.goScrollBar = UTY.GetChildObject(this.goMain, "Scroll Bar", false);
- this.gcScrollBar = this.goScrollBar.GetComponent<UIScrollBar>();
- this.goDragMat = UTY.GetChildObject(this.goMain, "DragMat", false);
- this.goArrow = UTY.GetChildObject(this.goMain, "Arrow", false);
- this.goArrow.SetActive(false);
- }
- public void SetActive(bool f_bActive)
- {
- this.goMain.SetActive(f_bActive);
- }
- public void ResetScrollPos(float f_fPos = 0.5f)
- {
- this.gcUIGrid.Reposition();
- this.gcScrollView.ResetPosition();
- this.gcScrollBar.value = f_fPos;
- }
- public void VisibleArrow(bool f_bActive)
- {
- this.goArrow.SetActive(f_bActive);
- }
- public void MoveArrow(GameObject f_goCurrentBtn)
- {
- if (this.goArrow == null)
- {
- return;
- }
- Transform parent = f_goCurrentBtn.transform.parent;
- Vector3 position = parent.TransformPoint(new Vector3(0f, 0f, 0f));
- Vector3 localPosition = this.goMain.transform.InverseTransformPoint(position);
- localPosition.x = this.goArrow.transform.localPosition.x;
- localPosition.y += 18f;
- this.goArrow.transform.localPosition = localPosition;
- }
- public GameObject goMain;
- public GameObject goGrid;
- public UIGrid gcUIGrid;
- public GameObject goScrollBar;
- public UIScrollView gcScrollView;
- public UIScrollBar gcScrollBar;
- public GameObject goDragMat;
- private GameObject goArrow;
- }
- private class MenuItemSet
- {
- public MenuItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi, string f_strPrefabName, bool f_bSelectedFrame)
- {
- this.mi = f_mi;
- this.m_bSelectedFrame = f_bSelectedFrame;
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/" + f_strPrefabName);
- this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
- this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
- this.gcBtnEdit.m_MenuItem = f_mi;
- this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
- this.goFrame.SetActive(false);
- this.goOld = UTY.GetChildObject(this.goItem, "Old", false);
- this.goOld.SetActive(f_mi.m_bOld);
- this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
- this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
- if (f_mi.m_texIconRef != null)
- {
- 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));
- this.gcBtn.normalSprite2D = normalSprite2D;
- }
- }
- public void ToSmall()
- {
- if (this.gcBtnEdit.m_MenuItem.m_texIconRef.width == 138 && this.gcBtnEdit.m_MenuItem.m_texIconRef.height == 200)
- {
- this.gcBtn.GetComponent<UI2DSprite>().SetDimensions(80, 116);
- this.gcBtn.GetComponent<BoxCollider>().size = new Vector3(80f, 116f, 0f);
- this.goOld.GetComponent<UISprite>().ResetAnchors();
- }
- }
- public void Clear()
- {
- if (this.goItem != null)
- {
- UnityEngine.Object.DestroyImmediate(this.goItem);
- }
- }
- public void Selected(bool f_bSelect)
- {
- if (this.m_bSelectedFrame)
- {
- this.goFrame.SetActive(f_bSelect);
- }
- }
- public GameObject goItem;
- public ButtonEdit gcBtnEdit;
- private GameObject goFrame;
- private GameObject goOld;
- public UIButton gcBtn;
- public UIEventTrigger gcEvent;
- public SceneEdit.SMenuItem mi;
- private bool m_bSelectedFrame = true;
- }
- private class ColorItemSet
- {
- public ColorItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
- {
- this.mi = f_mi;
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonColor");
- this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
- this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
- this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
- this.gcBtnEdit.m_MenuItem = f_mi;
- this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
- this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
- NDebug.Assert(f_mi.m_texIconRef != null, "アイコンテクスチャがありません。" + f_mi.m_strMenuFileName);
- if (f_mi.m_texIconRef != null)
- {
- 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));
- this.gcBtn.normalSprite2D = normalSprite2D;
- }
- }
- public void Clear()
- {
- if (this.goItem != null)
- {
- UnityEngine.Object.DestroyImmediate(this.goItem);
- }
- }
- public void Selected(bool f_bSelect)
- {
- this.goFrame.SetActive(f_bSelect);
- }
- public GameObject goItem;
- public ButtonEdit gcBtnEdit;
- private GameObject goFrame;
- public UIButton gcBtn;
- public UIEventTrigger gcEvent;
- public SceneEdit.SMenuItem mi;
- }
- private class SliderItemSet
- {
- public virtual bool isEnabled
- {
- set
- {
- this.gcSlider.enabled = value;
- this.gcSlider.GetComponent<UIButton>().isEnabled = value;
- this.gcSlider.thumb.GetComponent<UIButton>().isEnabled = value;
- }
- }
- public virtual void Create(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
- {
- this.mpn = f_mi.m_mpn;
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/Slider");
- this.goMain = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
- this.gcSlider = this.goMain.GetComponentsInChildren<UISlider>(true)[0];
- GameObject childObject = UTY.GetChildObject(this.goMain, "CategoryTitle/Name", false);
- this.gcLabel = childObject.GetComponent<UILabel>();
- Localize localize = this.gcLabel.gameObject.AddComponent<Localize>();
- localize.SetTerm("SceneEdit/カテゴリー/スライダー/" + f_mi.m_strMenuName);
- GameObject childObject2 = UTY.GetChildObject(this.goMain, "CategoryTitle/Number/Value", false);
- this.gcValue = childObject2.GetComponent<UILabel>();
- this.gcValue.text = "000";
- this.goMain.name = this.goMain.name + f_mi.m_strMenuName;
- this.gcBtnEdit = this.goMain.GetComponentsInChildren<ButtonEdit>(true)[0];
- this.gcBtnEdit.m_SliderItem = f_mi;
- }
- public virtual void Clear()
- {
- if (this.goMain != null)
- {
- UnityEngine.Object.DestroyImmediate(this.goMain);
- }
- }
- public virtual void SetValue(float f_fValue, string f_strValue = null)
- {
- this.gcSlider.value = f_fValue;
- if (f_strValue == null)
- {
- this.gcValue.text = f_fValue.ToString();
- }
- else
- {
- this.gcValue.text = f_strValue;
- }
- }
- public GameObject goMain;
- public UISlider gcSlider;
- public UILabel gcLabel;
- public UILabel gcValue;
- public ButtonEdit gcBtnEdit;
- protected MPN mpn;
- }
- private class SwitchItemSet : SceneEdit.SliderItemSet
- {
- public override void Create(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
- {
- this.mpn = f_mi.m_mpn;
- this.goMain = Utility.CreatePrefab(f_goParentGrid, "SceneEdit/MainMenu/Prefab/Switch", true);
- this.gcBtnEdit = this.goMain.GetComponentsInChildren<ButtonEdit>(true)[0];
- this.tabPanel = UTY.GetChildObject(this.goMain, "CategoryBtns", false).GetComponent<UIWFTabPanel>();
- this.buttonAri = UTY.GetChildObject(this.tabPanel.gameObject, "ButtonAri/Button", false).GetComponent<UIWFTabButton>();
- this.buttonNasi = UTY.GetChildObject(this.tabPanel.gameObject, "ButtonNasi/Button", false).GetComponent<UIWFTabButton>();
- this.gcBtnEdit.m_SliderItem = f_mi;
- this.tabPanel.UpdateChildren();
- EventDelegate.Add(this.buttonAri.onClick, delegate()
- {
- if (this.onClickEvent != null)
- {
- this.onClickEvent(false, this.gcBtnEdit.m_SliderItem);
- }
- });
- EventDelegate.Add(this.buttonNasi.onClick, delegate()
- {
- if (this.onClickEvent != null)
- {
- this.onClickEvent(true, this.gcBtnEdit.m_SliderItem);
- }
- });
- GameObject childObject = UTY.GetChildObject(this.goMain, "CategoryTitle/Name", false);
- this.gcLabel = childObject.GetComponent<UILabel>();
- Localize localize = this.gcLabel.gameObject.AddComponent<Localize>();
- localize.SetTerm("SceneEdit/カテゴリー/スライダー/" + f_mi.m_strMenuName);
- }
- public override void SetValue(float f_fValue, string f_strValue = null)
- {
- UIWFTabButton uiwftabButton = (f_fValue != 0f) ? this.buttonNasi : this.buttonAri;
- if (!uiwftabButton.isSelected)
- {
- this.tabPanel.Select(uiwftabButton);
- }
- }
- private UIWFTabPanel tabPanel;
- private UIWFTabButton buttonAri;
- private UIWFTabButton buttonNasi;
- public Action<bool, SceneEdit.SMenuItem> onClickEvent;
- }
- [Serializable]
- public struct SubPropMpnData
- {
- public MPN mpn
- {
- get
- {
- return this.manager.targetMpn;
- }
- }
- public SubSlotEditManager manager;
- }
- public class PVBInfo
- {
- public string strIconName;
- public Texture2D texIcon;
- }
- public class VoiceInfo : SceneEdit.PVBInfo
- {
- public string strVoiceFileName;
- public Personal.Data personal;
- public string strFace;
- public string strFace2;
- }
- public enum CAM_OFFS
- {
- CENTER,
- RIGHT,
- RIGHT_MORE
- }
- }
|