12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022 |
- 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 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;
- }
- 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 (PluginData.IsEnabled("GP001") || Product.type == Product.Type.JpPublic)
- {
- uGUITutorialPanel.OpenTutorial("SceneEditGP01", null, false);
- GameMain.Instance.SysShortcut.strSceneHelpName = "SceneEditGP01";
- }
- 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;
- }
- while (!GameMain.Instance.MenuDataBase.JobFinished())
- {
- yield return null;
- }
- this.InitCategoryList();
- int fileCount = GameMain.Instance.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>>();
- MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
- 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
- });
- }
- }
- for (int nM = 0; nM < menuList.Count; nM++)
- {
- SceneEdit.SMenuItem mi = menuList[nM];
- 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 (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);
- 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 obj = this.m_listBtnPartsType[i];
- UnityEngine.Object.DestroyImmediate(obj);
- }
- 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 (MPN.EarNone > spartsType.m_mpn || spartsType.m_mpn > MPN.EarScl || PluginData.IsEnabled("GP001") || Product.type == Product.Type.JpPublic)
- {
- UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
- GameObject gameObject = NGUITools.AddChild(this.m_Panel_PartsType.goGrid, @object as GameObject);
- UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
- Localize component = uilabel.gameObject.GetComponent<Localize>();
- if (component != null)
- {
- component.SetTerm("SceneEdit/カテゴリー/サブ/" + spartsType.m_strPartsTypeName);
- }
- ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
- buttonEdit.m_PartsType = spartsType;
- UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
- uibutton.isEnabled = spartsType.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_listBtnPartsType.Add(gameObject);
- }
- }
- 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)
- {
- SceneEdit.MenuItemSet menuItemSet3 = new SceneEdit.MenuItemSet(uipanelSet.goGrid, smenuItem, f_strPrefabName, f_bSelectedFrame);
- if (smenuItem.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);
- }
- }
- 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 smenuItem2 in f_pt.m_listMenu)
- {
- if (!smenuItem2.m_requestNewFace || this.isNewFace)
- {
- if (!Product.isPublic || smenuItem2.m_mpn != MPN.MuneYawaraka)
- {
- SceneEdit.SliderItemSet sliderItemSet2;
- if (smenuItem2.m_mpn == MPN.EarNone)
- {
- SceneEdit.SwitchItemSet switchItemSet = new SceneEdit.SwitchItemSet();
- switchItemSet.Create(this.m_Panel_SliderItem.goGrid, smenuItem2);
- 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, smenuItem2);
- EventDelegate.Add(sliderItemSet2.gcSlider.onChange, new EventDelegate.Callback(this.SlideCallback));
- flag2 |= (smenuItem2.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];
- 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();
- 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)
- {
- 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;
- if (spartsType.m_eType == SceneEditInfo.CCateNameType.EType.Item)
- {
- flag = SceneEditInfo.m_dicPartsTypePair[spartsType.m_mpn].m_requestNewFace;
- }
- else
- {
- foreach (SceneEdit.SMenuItem smenuItem in spartsType.m_listMenu)
- {
- if (!smenuItem.m_requestNewFace)
- {
- flag = false;
- break;
- }
- }
- }
- if (flag)
- {
- spartsType.m_isEnabled = this.isNewFace;
- }
- 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)
- {
- ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
- SceneEdit.SPartsType partsType = buttonEdit.m_PartsType;
- 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)
- {
- 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 = 67; i <= 66; 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:
- if (mpn == MPN.eyewhite)
- {
- mpn = MPN.folder_eyewhite;
- }
- 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:
- if (mpn == MPN.eyewhite)
- {
- mpn = MPN.folder_eyewhite;
- }
- 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)
- {
- 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, false);
- maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, false);
- 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
- }
- private enum TouchType
- {
- Head,
- Bust,
- UpperBody,
- LowerBody,
- Leg
- }
- public class SMenuItem : IDisposable
- {
- public string menuNameCurrentLanguage
- {
- get
- {
- if (Product.systemLanguage == Product.Language.Japanese)
- {
- return this.m_strMenuName;
- }
- string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
- string translation = LocalizationManager.GetTranslation(str + "|name", true, 0, true, false, null, null);
- return (!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strMenuName;
- }
- }
- public string infoTextCurrentLanguage
- {
- get
- {
- if (Product.systemLanguage == Product.Language.Japanese)
- {
- return this.m_strInfo;
- }
- string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
- string translation = LocalizationManager.GetTranslation(str + "|info", true, 0, true, false, null, null);
- return (!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strInfo;
- }
- }
- 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 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 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)
- {
- 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;
- }
- 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 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
- }
- }
|