1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970 |
- 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.VBA)
- {
- 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.BBB)
- {
- 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.BBB)
- {
- 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.VBA || 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()
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", "Dialog/result/苗字で呼ぶ", delegate
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isFirstNameCall = false;
- }, "Dialog/result/名前で呼ぶ", delegate
- {
- this.m_FFNameDlg.Close();
- this.m_maid.status.isFirstNameCall = true;
- });
- }
- 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)
- {
- this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", "Dialog/result/苗字で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFamily), "Dialog/result/名前で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFirst));
- }
- 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.WMZI == Product.Language.INKD)
- {
- 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.WMZI == Product.Language.INKD)
- {
- 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
- }
- }
|