SceneEdit.cs 126 KB

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