SceneEdit.cs 122 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970
  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.VBA)
  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.BBB)
  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 obj = this.m_listBtnPartsType[i];
  1473. UnityEngine.Object.DestroyImmediate(obj);
  1474. }
  1475. this.m_listBtnPartsType.Clear();
  1476. for (int j = 0; j < this.m_listSliderItem.Count; j++)
  1477. {
  1478. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[j];
  1479. sliderItemSet.Clear();
  1480. }
  1481. this.m_listSliderItem.Clear();
  1482. for (int k = 0; k < this.m_listBtnMenuItem.Count; k++)
  1483. {
  1484. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[k];
  1485. menuItemSet.Clear();
  1486. }
  1487. this.m_listBtnMenuItem.Clear();
  1488. for (int l = 0; l < this.m_listBtnColorSet.Count; l++)
  1489. {
  1490. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[l];
  1491. colorItemSet.Clear();
  1492. }
  1493. this.m_listBtnColorSet.Clear();
  1494. for (int m = 0; m < this.m_listBtnGroupMember.Count; m++)
  1495. {
  1496. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[m];
  1497. menuItemSet2.Clear();
  1498. }
  1499. this.m_listBtnGroupMember.Clear();
  1500. for (int n = 0; n < f_cate.m_listPartsType.Count; n++)
  1501. {
  1502. SceneEdit.SPartsType spartsType = f_cate.m_listPartsType[n];
  1503. if (MPN.EarNone > spartsType.m_mpn || spartsType.m_mpn > MPN.EarScl || PluginData.IsEnabled("GP001") || Product.type == Product.Type.BBB)
  1504. {
  1505. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonCate");
  1506. GameObject gameObject = NGUITools.AddChild(this.m_Panel_PartsType.goGrid, @object as GameObject);
  1507. UILabel uilabel = gameObject.GetComponentsInChildren<UILabel>(true)[0];
  1508. Localize component = uilabel.gameObject.GetComponent<Localize>();
  1509. if (component != null)
  1510. {
  1511. component.SetTerm("SceneEdit/カテゴリー/サブ/" + spartsType.m_strPartsTypeName);
  1512. }
  1513. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  1514. buttonEdit.m_PartsType = spartsType;
  1515. UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
  1516. uibutton.isEnabled = spartsType.m_isEnabled;
  1517. if (uibutton.isEnabled)
  1518. {
  1519. EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
  1520. }
  1521. buttonEdit.m_goFrame = gameObject.transform.Find("Frame").gameObject;
  1522. buttonEdit.m_goFrame.transform.GetComponent<UISprite>().enabled = false;
  1523. UIButton component2 = buttonEdit.GetComponent<UIButton>();
  1524. buttonEdit.m_colBtnDefault = component2.defaultColor;
  1525. this.m_listBtnPartsType.Add(gameObject);
  1526. }
  1527. }
  1528. this.m_Panel_PartsType.ResetScrollPos(0.5f);
  1529. this.m_Panel_MenuItem.ResetScrollPos(0f);
  1530. this.m_Panel_SetItem.ResetScrollPos(0f);
  1531. this.m_Panel_SliderItem.ResetScrollPos(0f);
  1532. }
  1533. private void UpdatePanel_MenuItem(SceneEdit.SPartsType f_pt)
  1534. {
  1535. 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")
  1536. {
  1537. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT_MORE);
  1538. }
  1539. else
  1540. {
  1541. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  1542. }
  1543. this.m_misDelOnly = null;
  1544. this.m_info.Close();
  1545. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  1546. for (int i = 0; i < this.m_listSliderItem.Count; i++)
  1547. {
  1548. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
  1549. sliderItemSet.Clear();
  1550. }
  1551. this.m_listSliderItem.Clear();
  1552. for (int j = 0; j < this.m_listBtnMenuItem.Count; j++)
  1553. {
  1554. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[j];
  1555. menuItemSet.Clear();
  1556. }
  1557. this.m_listBtnMenuItem.Clear();
  1558. for (int k = 0; k < this.m_listBtnColorSet.Count; k++)
  1559. {
  1560. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[k];
  1561. colorItemSet.Clear();
  1562. }
  1563. this.m_listBtnColorSet.Clear();
  1564. for (int l = 0; l < this.m_listBtnGroupMember.Count; l++)
  1565. {
  1566. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnGroupMember[l];
  1567. menuItemSet2.Clear();
  1568. }
  1569. this.m_listBtnGroupMember.Clear();
  1570. float num = -1f;
  1571. if (this.highlightSelector != null)
  1572. {
  1573. this.highlightSelector.visible = false;
  1574. }
  1575. if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item || f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
  1576. {
  1577. if (!string.IsNullOrEmpty(this.last_select_category_name_))
  1578. {
  1579. if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1580. {
  1581. this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_MenuItem.gcScrollBar.value * 100f) / 100f;
  1582. }
  1583. if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1584. {
  1585. this.backup_category_scroll_pos_[this.last_select_category_name_] = Mathf.Round(this.m_Panel_SetItem.gcScrollBar.value * 100f) / 100f;
  1586. }
  1587. }
  1588. if (this.backup_category_scroll_pos_.ContainsKey(f_pt.m_strPartsTypeName))
  1589. {
  1590. num = this.backup_category_scroll_pos_[f_pt.m_strPartsTypeName];
  1591. }
  1592. this.m_Panel_MenuItem.SetActive(false);
  1593. this.m_Panel_SetItem.SetActive(false);
  1594. SceneEdit.UIPanelSet uipanelSet = null;
  1595. string f_strPrefabName = string.Empty;
  1596. bool f_bSelectedFrame = false;
  1597. if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Item)
  1598. {
  1599. uipanelSet = this.m_Panel_MenuItem;
  1600. f_strPrefabName = "ButtonItem";
  1601. f_bSelectedFrame = true;
  1602. }
  1603. else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Set)
  1604. {
  1605. uipanelSet = this.m_Panel_SetItem;
  1606. f_strPrefabName = "ButtonSet";
  1607. f_bSelectedFrame = false;
  1608. this.customPartsWindowVisibleButton.windowVisible = false;
  1609. this.customPartsWindowVisibleButton.visible = false;
  1610. }
  1611. this.m_Panel_SliderItem.SetActive(false);
  1612. this.m_Panel_ColorSet.SetActive(false);
  1613. this.m_Panel_GroupSet.SetActive(false);
  1614. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1615. uipanelSet.SetActive(true);
  1616. for (int m = 0; m < f_pt.m_listMenu.Count; m++)
  1617. {
  1618. SceneEdit.SMenuItem smenuItem = f_pt.m_listMenu[m];
  1619. bool flag = this.m_bUseGroup;
  1620. if (smenuItem.m_mpn == MPN.set_body)
  1621. {
  1622. flag = false;
  1623. }
  1624. if (!flag || !smenuItem.m_bMember)
  1625. {
  1626. SceneEdit.MenuItemSet menuItemSet3 = new SceneEdit.MenuItemSet(uipanelSet.goGrid, smenuItem, f_strPrefabName, f_bSelectedFrame);
  1627. if (smenuItem.m_boDelOnly)
  1628. {
  1629. this.m_misDelOnly = menuItemSet3;
  1630. }
  1631. if (menuItemSet3.mi.m_strCateName.IndexOf("set_") != -1 && menuItemSet3.mi.m_bGroupLeader && flag)
  1632. {
  1633. EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallbackFromSetGroup));
  1634. }
  1635. else
  1636. {
  1637. EventDelegate.Add(menuItemSet3.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  1638. }
  1639. if (smenuItem.m_bGroupLeader && flag)
  1640. {
  1641. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallbackOnGroup));
  1642. }
  1643. else
  1644. {
  1645. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  1646. }
  1647. EventDelegate.Add(menuItemSet3.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  1648. this.m_listBtnMenuItem.Add(menuItemSet3);
  1649. }
  1650. }
  1651. uipanelSet.gcUIGrid.GetComponent<UIGrid>().enabled = true;
  1652. if (f_pt.m_mpn == MPN.eye_hi && this.highlightSelector != null && this.isNewFace)
  1653. {
  1654. this.highlightSelector.visible = true;
  1655. }
  1656. this.UpdateSelectedMenuItem(f_pt);
  1657. this.last_select_category_name_ = f_pt.m_strPartsTypeName;
  1658. }
  1659. else if (f_pt.m_eType == SceneEditInfo.CCateNameType.EType.Slider)
  1660. {
  1661. this.customPartsWindowVisibleButton.windowVisible = false;
  1662. this.customPartsWindowVisibleButton.visible = false;
  1663. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1664. this.m_Panel_MenuItem.SetActive(false);
  1665. this.m_Panel_SetItem.SetActive(false);
  1666. this.m_Panel_ColorSet.SetActive(false);
  1667. this.m_Panel_GroupSet.SetActive(false);
  1668. this.m_Panel_SliderItem.SetActive(true);
  1669. bool flag2 = false;
  1670. foreach (SceneEdit.SMenuItem smenuItem2 in f_pt.m_listMenu)
  1671. {
  1672. if (!smenuItem2.m_requestNewFace || this.isNewFace)
  1673. {
  1674. if (!Product.VBA || smenuItem2.m_mpn != MPN.MuneYawaraka)
  1675. {
  1676. SceneEdit.SliderItemSet sliderItemSet2;
  1677. if (smenuItem2.m_mpn == MPN.EarNone)
  1678. {
  1679. SceneEdit.SwitchItemSet switchItemSet = new SceneEdit.SwitchItemSet();
  1680. switchItemSet.Create(this.m_Panel_SliderItem.goGrid, smenuItem2);
  1681. switchItemSet.onClickEvent = delegate(bool earNone, SceneEdit.SMenuItem menu)
  1682. {
  1683. int num2 = (!earNone) ? 0 : 1;
  1684. MaidProp prop = this.maid.GetProp(menu.m_strCateName);
  1685. if (prop.value != num2)
  1686. {
  1687. this.maid.SetProp(menu.m_strCateName, num2, false);
  1688. this.UpdateSliders();
  1689. SceneEdit.AllProcPropSeqStart(this.maid);
  1690. }
  1691. };
  1692. sliderItemSet2 = switchItemSet;
  1693. }
  1694. else
  1695. {
  1696. sliderItemSet2 = new SceneEdit.SliderItemSet();
  1697. sliderItemSet2.Create(this.m_Panel_SliderItem.goGrid, smenuItem2);
  1698. EventDelegate.Add(sliderItemSet2.gcSlider.onChange, new EventDelegate.Callback(this.SlideCallback));
  1699. flag2 |= (smenuItem2.m_mpn == MPN.MuneYawaraka);
  1700. }
  1701. this.m_listSliderItem.Add(sliderItemSet2);
  1702. }
  1703. }
  1704. }
  1705. BaseMgr<BodyStatusMgr>.Instance.OpenPanel(flag2);
  1706. this.UpdateSliders();
  1707. }
  1708. this.m_Panel_MenuItem.ResetScrollPos(0f);
  1709. this.m_Panel_SetItem.ResetScrollPos(0f);
  1710. this.m_Panel_SliderItem.ResetScrollPos(0f);
  1711. if (num != -1f)
  1712. {
  1713. if (this.m_Panel_MenuItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1714. {
  1715. this.m_Panel_MenuItem.gcScrollBar.value = num;
  1716. }
  1717. if (this.m_Panel_SetItem.gcScrollBar.transform.parent.gameObject.activeSelf)
  1718. {
  1719. this.m_Panel_SetItem.gcScrollBar.value = num;
  1720. }
  1721. }
  1722. }
  1723. private void UpdateSelectedMenuItem(SceneEdit.SPartsType f_pt)
  1724. {
  1725. Maid maid = this.m_maid;
  1726. MaidProp prop = maid.GetProp(f_pt.m_mpn);
  1727. NDebug.Assert(prop != null, "指定MPNが不正です。");
  1728. SceneEdit.SMenuItem smenuItem = null;
  1729. if (this.m_misDelOnly != null)
  1730. {
  1731. this.m_misDelOnly.Selected(false);
  1732. }
  1733. for (int i = 0; i < this.m_listBtnMenuItem.Count; i++)
  1734. {
  1735. this.m_listBtnMenuItem[i].Selected(false);
  1736. }
  1737. bool flag = false;
  1738. HashSet<int> hashSet = new HashSet<int>();
  1739. foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
  1740. {
  1741. if (subPropMpnData.mpn == f_pt.m_mpn)
  1742. {
  1743. subPropMpnData.manager.UpdateAllItem();
  1744. flag = true;
  1745. if (subPropMpnData.manager.sloatItems != null)
  1746. {
  1747. foreach (SubSlotEditItem subSlotEditItem in subPropMpnData.manager.sloatItems)
  1748. {
  1749. if (!(subSlotEditItem == null) && subSlotEditItem.menuItem != null)
  1750. {
  1751. if (!hashSet.Contains(subSlotEditItem.menuItem.m_nMenuFileRID))
  1752. {
  1753. hashSet.Add(subSlotEditItem.menuItem.m_nMenuFileRID);
  1754. }
  1755. }
  1756. }
  1757. }
  1758. break;
  1759. }
  1760. }
  1761. bool flag2 = f_pt.m_mpn == MPN.eye_hi && this.isNewFace;
  1762. int num = (this.modeType != SceneEdit.ModeType.CostumeEdit) ? prop.nFileNameRID : prop.nTempFileNameRID;
  1763. int num2 = (!flag2) ? -1 : maid.GetProp(MPN.eye_hi_r).nFileNameRID;
  1764. if (num != 0)
  1765. {
  1766. for (int l = 0; l < this.m_listBtnMenuItem.Count; l++)
  1767. {
  1768. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnMenuItem[l];
  1769. SceneEdit.SMenuItem menuItem = menuItemSet.gcBtnEdit.m_MenuItem;
  1770. if (!menuItem.m_bGroupLeader || !this.m_bUseGroup)
  1771. {
  1772. bool flag3 = menuItem.m_nMenuFileRID == num;
  1773. if (flag && (!flag3 || hashSet.Count != 0))
  1774. {
  1775. flag3 = hashSet.Contains(menuItem.m_nMenuFileRID);
  1776. }
  1777. if (flag3)
  1778. {
  1779. menuItemSet.Selected(true);
  1780. smenuItem = menuItem;
  1781. bool flag4 = this.customPartsWindow.SetItem(menuItem);
  1782. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1783. {
  1784. flag4 = false;
  1785. }
  1786. if (!flag4)
  1787. {
  1788. this.customPartsWindowVisibleButton.windowVisible = false;
  1789. }
  1790. this.customPartsWindowVisibleButton.visible = flag4;
  1791. }
  1792. else if (flag2 && menuItem.m_nMenuFileRID == num2)
  1793. {
  1794. menuItemSet.Selected(true);
  1795. }
  1796. }
  1797. else
  1798. {
  1799. NDebug.Assert(hashSet.Count == 0, "SubPropとグループが競合しています");
  1800. bool flag5 = false;
  1801. int num3 = 0;
  1802. while (num3 < menuItem.m_listMember.Count && !flag5)
  1803. {
  1804. flag5 |= (menuItem.m_listMember[num3].m_nMenuFileRID == num);
  1805. num3++;
  1806. }
  1807. if (flag5)
  1808. {
  1809. menuItemSet.Selected(true);
  1810. smenuItem = menuItem;
  1811. bool flag6 = this.customPartsWindow.SetItem(menuItem);
  1812. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1813. {
  1814. flag6 = false;
  1815. }
  1816. if (!flag6)
  1817. {
  1818. this.customPartsWindowVisibleButton.windowVisible = false;
  1819. }
  1820. this.customPartsWindowVisibleButton.visible = flag6;
  1821. }
  1822. }
  1823. }
  1824. }
  1825. else
  1826. {
  1827. for (int m = 0; m < this.m_listBtnMenuItem.Count; m++)
  1828. {
  1829. SceneEdit.MenuItemSet menuItemSet2 = this.m_listBtnMenuItem[m];
  1830. if (menuItemSet2.mi.m_listColorSet != null)
  1831. {
  1832. SceneEdit.SMenuItem smenuItem2;
  1833. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1834. {
  1835. smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nTempFileNameRID);
  1836. }
  1837. else
  1838. {
  1839. smenuItem2 = menuItemSet2.mi.m_listColorSet.Find((SceneEdit.SMenuItem c) => c.m_nMenuFileRID == maid.GetProp(c.m_mpn).nFileNameRID);
  1840. }
  1841. if (smenuItem2 != null)
  1842. {
  1843. menuItemSet2.Selected(true);
  1844. smenuItem = menuItemSet2.mi;
  1845. }
  1846. }
  1847. }
  1848. }
  1849. if (smenuItem == null && this.m_misDelOnly != null)
  1850. {
  1851. this.m_misDelOnly.Selected(true);
  1852. }
  1853. this.UpdatePanel_ColorSet(smenuItem);
  1854. foreach (SceneEdit.SubPropMpnData subPropMpnData2 in this.subPropDatas)
  1855. {
  1856. subPropMpnData2.manager.visible = false;
  1857. }
  1858. this.UpdatePanel_GroupSet(smenuItem);
  1859. if (smenuItem != null)
  1860. {
  1861. foreach (SceneEdit.SubPropMpnData subPropMpnData3 in this.subPropDatas)
  1862. {
  1863. if (subPropMpnData3.mpn == smenuItem.m_mpn)
  1864. {
  1865. this.m_Panel_GroupSet.SetActive(true);
  1866. subPropMpnData3.manager.visible = true;
  1867. subPropMpnData3.manager.UpdateAllItem();
  1868. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
  1869. Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1870. localPosition.x = 23f;
  1871. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
  1872. this.m_Panel_GroupSet.ResetScrollPos(0f);
  1873. }
  1874. }
  1875. }
  1876. if (this.customPartsWindowVisibleButton.visible)
  1877. {
  1878. if (this.m_Panel_GroupSet.goMain.activeInHierarchy)
  1879. {
  1880. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(119f, 406f, 0f);
  1881. }
  1882. else if (this.m_Panel_ColorSet.goMain.activeInHierarchy)
  1883. {
  1884. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(60f, 406f, 0f);
  1885. }
  1886. else
  1887. {
  1888. this.customPartsWindowVisibleButton.transform.localPosition = new Vector3(0f, 406f, 0f);
  1889. }
  1890. }
  1891. }
  1892. private void UpdatePanel_GroupSet(SceneEdit.SMenuItem f_miSelected)
  1893. {
  1894. if (f_miSelected == null || f_miSelected.m_mpn == MPN.set_body || !f_miSelected.m_bGroupLeader || !this.m_bUseGroup)
  1895. {
  1896. this.m_Panel_GroupSet.SetActive(false);
  1897. return;
  1898. }
  1899. Maid maid = this.m_maid;
  1900. MaidProp prop = maid.GetProp(f_miSelected.m_mpn);
  1901. this.m_Panel_GroupSet.SetActive(true);
  1902. bool flag = this.m_listBtnGroupMember.Count != f_miSelected.m_listMember.Count;
  1903. if (!flag)
  1904. {
  1905. int num = 0;
  1906. while (num < f_miSelected.m_listMember.Count && !flag)
  1907. {
  1908. if (this.m_listBtnGroupMember[num].mi != f_miSelected.m_listMember[num])
  1909. {
  1910. flag = true;
  1911. }
  1912. num++;
  1913. }
  1914. }
  1915. bool flag2 = f_miSelected.m_strCateName.IndexOf("set_") != -1;
  1916. if (flag)
  1917. {
  1918. for (int i = 0; i < this.m_listBtnGroupMember.Count; i++)
  1919. {
  1920. SceneEdit.MenuItemSet menuItemSet = this.m_listBtnGroupMember[i];
  1921. menuItemSet.Clear();
  1922. }
  1923. this.m_listBtnGroupMember.Clear();
  1924. for (int j = 0; j < f_miSelected.m_listMember.Count; j++)
  1925. {
  1926. SceneEdit.MenuItemSet menuItemSet2 = new SceneEdit.MenuItemSet(this.m_Panel_GroupSet.goGrid, f_miSelected.m_listMember[j], (!flag2) ? "ButtonItem" : "ButtonSet", true);
  1927. if (flag2)
  1928. {
  1929. menuItemSet2.ToSmall();
  1930. }
  1931. EventDelegate.Add(menuItemSet2.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  1932. EventDelegate.Add(menuItemSet2.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  1933. EventDelegate.Add(menuItemSet2.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  1934. this.m_listBtnGroupMember.Add(menuItemSet2);
  1935. if (!flag2)
  1936. {
  1937. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1938. {
  1939. menuItemSet2.Selected(prop != null && prop.nTempFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
  1940. }
  1941. else
  1942. {
  1943. menuItemSet2.Selected(prop != null && prop.nFileNameRID == f_miSelected.m_listMember[j].m_nMenuFileRID);
  1944. }
  1945. }
  1946. }
  1947. if (flag2)
  1948. {
  1949. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 127f;
  1950. Vector3 localPosition = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1951. localPosition.x = 117f;
  1952. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition;
  1953. }
  1954. else
  1955. {
  1956. this.m_Panel_GroupSet.gcUIGrid.cellHeight = 100f;
  1957. Vector3 localPosition2 = this.m_Panel_GroupSet.goMain.transform.localPosition;
  1958. localPosition2.x = 23f;
  1959. this.m_Panel_GroupSet.goMain.transform.localPosition = localPosition2;
  1960. }
  1961. this.m_Panel_GroupSet.ResetScrollPos(0f);
  1962. }
  1963. else if (!flag2)
  1964. {
  1965. for (int k = 0; k < this.m_listBtnGroupMember.Count; k++)
  1966. {
  1967. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  1968. {
  1969. this.m_listBtnGroupMember[k].Selected(prop != null && prop.nTempFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
  1970. }
  1971. else
  1972. {
  1973. this.m_listBtnGroupMember[k].Selected(prop != null && prop.nFileNameRID == this.m_listBtnGroupMember[k].mi.m_nMenuFileRID);
  1974. }
  1975. }
  1976. }
  1977. }
  1978. private void UpdatePanel_ColorSet(SceneEdit.SMenuItem f_miSelected)
  1979. {
  1980. this.colorPaletteMgr.Close();
  1981. if (f_miSelected == null || f_miSelected.m_eColorSetMPN == MPN.null_mpn)
  1982. {
  1983. this.m_Panel_ColorSet.SetActive(false);
  1984. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  1985. return;
  1986. }
  1987. if (f_miSelected.m_mpn == MPN.folder_mayu)
  1988. {
  1989. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(true);
  1990. this.m_CheckBoxMayuDrawPriority.check = this.m_maid.MayuDrawPriority;
  1991. }
  1992. if (this.modeType != SceneEdit.ModeType.CostumeEdit)
  1993. {
  1994. this.m_Panel_ColorSet.SetActive(true);
  1995. }
  1996. for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
  1997. {
  1998. this.m_listBtnColorSet[i].Clear();
  1999. }
  2000. this.m_listBtnColorSet.Clear();
  2001. for (int j = 0; j < f_miSelected.m_listColorSet.Count; j++)
  2002. {
  2003. SceneEdit.SMenuItem f_mi = f_miSelected.m_listColorSet[j];
  2004. SceneEdit.ColorItemSet colorItemSet = new SceneEdit.ColorItemSet(this.m_Panel_ColorSet.goGrid, f_mi);
  2005. EventDelegate.Add(colorItemSet.gcBtn.onClick, new EventDelegate.Callback(this.ClickCallback));
  2006. EventDelegate.Add(colorItemSet.gcEvent.onHoverOver, new EventDelegate.Callback(this.HoverOverCallback));
  2007. EventDelegate.Add(colorItemSet.gcEvent.onHoverOut, new EventDelegate.Callback(this.HoverOutCallback));
  2008. this.m_listBtnColorSet.Add(colorItemSet);
  2009. }
  2010. this.m_Panel_ColorSet.ResetScrollPos(0f);
  2011. this.UpdateSelected_ColorSet(f_miSelected.m_eColorSetMPN);
  2012. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2013. {
  2014. this.m_Panel_ColorSet.SetActive(false);
  2015. }
  2016. }
  2017. private void UpdateSelected_ColorSet(MPN f_mpn)
  2018. {
  2019. Maid maid = this.m_maid;
  2020. MaidProp prop = maid.GetProp(f_mpn);
  2021. NDebug.Assert(prop != null, "指定MPNが不正です。");
  2022. SceneEdit.SMenuItem smenuItem = null;
  2023. if (prop.nFileNameRID != 0)
  2024. {
  2025. for (int i = 0; i < this.m_listBtnColorSet.Count; i++)
  2026. {
  2027. SceneEdit.ColorItemSet colorItemSet = this.m_listBtnColorSet[i];
  2028. SceneEdit.SMenuItem menuItem = colorItemSet.gcBtnEdit.m_MenuItem;
  2029. colorItemSet.Selected(false);
  2030. if (menuItem.m_nMenuFileRID == prop.nFileNameRID)
  2031. {
  2032. colorItemSet.Selected(true);
  2033. smenuItem = menuItem;
  2034. }
  2035. }
  2036. if (smenuItem != null)
  2037. {
  2038. if (smenuItem.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE)
  2039. {
  2040. if (this.modeType != SceneEdit.ModeType.CostumeEdit)
  2041. {
  2042. this.colorPaletteMgr.Call(0, smenuItem.m_pcMultiColorID);
  2043. }
  2044. }
  2045. else
  2046. {
  2047. this.colorPaletteMgr.Close();
  2048. }
  2049. }
  2050. }
  2051. }
  2052. public void UpdateSliders()
  2053. {
  2054. for (int i = 0; i < this.m_listSliderItem.Count; i++)
  2055. {
  2056. SceneEdit.SliderItemSet sliderItemSet = this.m_listSliderItem[i];
  2057. Maid maid = this.m_maid;
  2058. MaidProp prop = maid.GetProp(sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName);
  2059. if (sliderItemSet.gcBtnEdit.m_SliderItem.m_strCateName == "MuneL")
  2060. {
  2061. MaidProp prop2 = maid.GetProp(MPN.MuneS);
  2062. int num;
  2063. if (0 <= prop2.value && prop.value == 0)
  2064. {
  2065. num = (int)System.Math.Round((double)(-30f * ((float)(prop2.value - prop2.min) / (float)(prop2.max - prop2.min))), MidpointRounding.AwayFromZero);
  2066. }
  2067. else
  2068. {
  2069. num = prop.value;
  2070. }
  2071. int num2 = prop.min - 30;
  2072. sliderItemSet.SetValue((float)(num - num2) / (float)(prop.max - num2), num.ToString());
  2073. }
  2074. else
  2075. {
  2076. sliderItemSet.SetValue((float)(prop.value - prop.min) / (float)(prop.max - prop.min), prop.value.ToString());
  2077. }
  2078. if (MPN.EarNone < sliderItemSet.gcBtnEdit.m_SliderItem.m_mpn && sliderItemSet.gcBtnEdit.m_SliderItem.m_mpn <= MPN.EarScl)
  2079. {
  2080. bool isEnabled = maid.GetProp(MPN.EarNone).value == 0;
  2081. sliderItemSet.isEnabled = isEnabled;
  2082. }
  2083. }
  2084. BaseMgr<BodyStatusMgr>.Instance.UpdateBodyStatus();
  2085. }
  2086. public void CategoryUnSelect()
  2087. {
  2088. for (int i = 0; i < this.m_listBtnCate.Count; i++)
  2089. {
  2090. GameObject gameObject = this.m_listBtnCate[i];
  2091. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  2092. UISprite component = buttonEdit.m_goFrame.GetComponent<UISprite>();
  2093. component.enabled = false;
  2094. UIButton component2 = buttonEdit.GetComponent<UIButton>();
  2095. component2.defaultColor = buttonEdit.m_colBtnDefault;
  2096. }
  2097. this.m_Panel_Category.VisibleArrow(false);
  2098. }
  2099. public void ProcMenuItem(SceneEdit.SMenuItem f_mi)
  2100. {
  2101. }
  2102. public void PartsTypeWearMode(MPN f_eMpn)
  2103. {
  2104. TBody.MaskMode maskMode;
  2105. if (SceneEditInfo.m_dicPartsTypeWearMode.TryGetValue(f_eMpn, out maskMode))
  2106. {
  2107. Maid maid = this.m_maid;
  2108. maid.body0.SetMaskMode(maskMode);
  2109. }
  2110. }
  2111. public void PartsTypeCamera(MPN f_eMpn)
  2112. {
  2113. SceneEditInfo.CamToBone camToBone;
  2114. if (this.m_viewreset.GetVisibleAutoCam() && SceneEditInfo.m_dicPartsTypeCamera.TryGetValue(f_eMpn, out camToBone))
  2115. {
  2116. Maid maid = this.m_maid;
  2117. if (string.IsNullOrEmpty(camToBone.bone))
  2118. {
  2119. this.CameraMoveTo(this.m_cameraMoveSupport.targetPosition, camToBone.distance, camToBone.angle, 0.5f);
  2120. }
  2121. else
  2122. {
  2123. Transform bone = maid.body0.GetBone(camToBone.bone);
  2124. if (bone != null)
  2125. {
  2126. this.CameraMoveTo(bone.position, camToBone.distance, camToBone.angle, 0.5f);
  2127. }
  2128. }
  2129. }
  2130. }
  2131. public void ClickCallbackFromSetGroup()
  2132. {
  2133. this.m_bOpenSetGroupPanel = true;
  2134. this.ClickCallback();
  2135. this.m_bOpenSetGroupPanel = false;
  2136. }
  2137. public void ClickCallback()
  2138. {
  2139. Maid maid = this.m_maid;
  2140. if (maid.IsBusy)
  2141. {
  2142. return;
  2143. }
  2144. ButtonEdit componentInChildren = UIButton.current.GetComponentInChildren<ButtonEdit>();
  2145. if (componentInChildren.m_MenuItem == null || !componentInChildren.m_MenuItem.m_bColor)
  2146. {
  2147. this.customPartsWindowVisibleButton.windowVisible = false;
  2148. }
  2149. if (componentInChildren.m_Category != null)
  2150. {
  2151. this.customPartsWindowVisibleButton.visible = false;
  2152. this.m_Panel_Category.VisibleArrow(false);
  2153. this.CategoryUnSelect();
  2154. this.colorPaletteMgr.Close();
  2155. UISprite component = componentInChildren.m_goFrame.GetComponent<UISprite>();
  2156. component.enabled = true;
  2157. UIButton component2 = componentInChildren.GetComponent<UIButton>();
  2158. component2.defaultColor = new Color(component2.defaultColor.r, component2.defaultColor.g, component2.defaultColor.b, 1f);
  2159. this.m_maid.OpenMouthLookTooth(false);
  2160. this.m_Panel_PartsType.SetActive(false);
  2161. this.m_Panel_MenuItem.SetActive(false);
  2162. this.m_Panel_SetItem.SetActive(false);
  2163. this.m_Panel_SliderItem.SetActive(false);
  2164. this.m_Panel_ColorSet.SetActive(false);
  2165. this.m_Panel_GroupSet.SetActive(false);
  2166. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  2167. if (this.highlightSelector != null)
  2168. {
  2169. this.highlightSelector.visible = false;
  2170. }
  2171. BaseMgr<RandomPresetMgr>.Instance.CloseRandomPresetPanel();
  2172. BaseMgr<PresetMgr>.Instance.ClosePresetPanel();
  2173. BaseMgr<ProfileMgr>.Instance.CloseProfilePanel();
  2174. BaseMgr<CostumePartsEnabledMgr>.Instance.CloseRandomPresetPanel();
  2175. if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.ランダム)
  2176. {
  2177. if (this.m_viewreset.GetVisibleAutoCam())
  2178. {
  2179. this.CameraReset(0.5f);
  2180. }
  2181. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2182. BaseMgr<RandomPresetMgr>.Instance.OpenRandomPresetPanel();
  2183. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2184. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2185. }
  2186. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プリセット)
  2187. {
  2188. if (this.m_viewreset.GetVisibleAutoCam())
  2189. {
  2190. this.CameraReset(0.5f);
  2191. }
  2192. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2193. BaseMgr<PresetMgr>.Instance.OpenPresetPanel();
  2194. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2195. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2196. }
  2197. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
  2198. {
  2199. if (this.m_viewreset.GetVisibleAutoCam())
  2200. {
  2201. this.CameraReset(0.5f);
  2202. }
  2203. BaseMgr<ProfileMgr>.Instance.OpenProfilePanel();
  2204. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2205. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2206. }
  2207. else if (componentInChildren.m_Category.m_eCategory == SceneEditInfo.EMenuCategory.着衣設定)
  2208. {
  2209. if (this.m_viewreset.GetVisibleAutoCam())
  2210. {
  2211. this.CameraReset(0.5f);
  2212. }
  2213. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2214. BaseMgr<CostumePartsEnabledMgr>.Instance.OpenRandomPresetPanel();
  2215. this.SetCameraOffset(SceneEdit.CAM_OFFS.RIGHT);
  2216. BaseMgr<BodyStatusMgr>.Instance.ClosePanel();
  2217. }
  2218. else
  2219. {
  2220. this.UpdatePanel_PartsType(componentInChildren.m_Category);
  2221. }
  2222. this.m_Panel_Category.VisibleArrow(true);
  2223. this.m_Panel_Category.MoveArrow(componentInChildren.gameObject);
  2224. this.m_nNowMPN = MPN.null_mpn;
  2225. }
  2226. if (componentInChildren.m_PartsType != null)
  2227. {
  2228. for (int k = 0; k < this.m_listBtnPartsType.Count; k++)
  2229. {
  2230. GameObject gameObject = this.m_listBtnPartsType[k];
  2231. ButtonEdit componentInChildren2 = gameObject.GetComponentInChildren<ButtonEdit>();
  2232. UISprite component3 = componentInChildren2.m_goFrame.GetComponent<UISprite>();
  2233. component3.enabled = false;
  2234. UIButton component4 = componentInChildren2.GetComponent<UIButton>();
  2235. component4.defaultColor = componentInChildren2.m_colBtnDefault;
  2236. }
  2237. UISprite component5 = componentInChildren.m_goFrame.GetComponent<UISprite>();
  2238. component5.enabled = true;
  2239. UIButton component6 = componentInChildren.GetComponent<UIButton>();
  2240. component6.defaultColor = new Color(component6.defaultColor.r, component6.defaultColor.g, component6.defaultColor.b, 1f);
  2241. this.colorPaletteMgr.Close();
  2242. this.PartsTypeWearMode(componentInChildren.m_PartsType.m_mpn);
  2243. this.PartsTypeCamera(componentInChildren.m_PartsType.m_mpn);
  2244. if (componentInChildren.m_PartsType.m_mpn == MPN.accha)
  2245. {
  2246. this.m_maid.OpenMouthLookTooth(true);
  2247. }
  2248. else
  2249. {
  2250. this.m_maid.OpenMouthLookTooth(false);
  2251. }
  2252. this.UpdatePanel_MenuItem(componentInChildren.m_PartsType);
  2253. this.m_Panel_PartsType.VisibleArrow(true);
  2254. this.m_Panel_PartsType.MoveArrow(componentInChildren.gameObject);
  2255. this.m_EditMod.m_mpn = componentInChildren.m_PartsType.m_mpn;
  2256. this.m_nNowMPN = componentInChildren.m_PartsType.m_mpn;
  2257. }
  2258. if (componentInChildren.m_MenuItem != null && !maid.boAllProcPropBUSY)
  2259. {
  2260. SceneEdit.SMenuItem smenuItem = null;
  2261. MaidProp prop = maid.GetProp(componentInChildren.m_MenuItem.m_mpn);
  2262. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2263. {
  2264. if (prop != null && this.m_menuRidDic.ContainsKey(prop.nTempFileNameRID))
  2265. {
  2266. smenuItem = this.m_menuRidDic[prop.nTempFileNameRID];
  2267. }
  2268. }
  2269. else if (prop != null && this.m_menuRidDic.ContainsKey(prop.nFileNameRID))
  2270. {
  2271. smenuItem = this.m_menuRidDic[prop.nFileNameRID];
  2272. }
  2273. if (!this.m_bOpenSetGroupPanel)
  2274. {
  2275. if (!componentInChildren.m_MenuItem.m_bColor && this.modeType != SceneEdit.ModeType.CostumeEdit)
  2276. {
  2277. this.customPartsWindow.OnExecItemPrev(componentInChildren.m_MenuItem);
  2278. }
  2279. bool flag = false;
  2280. foreach (SceneEdit.SubPropMpnData subPropMpnData in this.subPropDatas)
  2281. {
  2282. if (subPropMpnData.mpn == componentInChildren.m_MenuItem.m_mpn)
  2283. {
  2284. flag = true;
  2285. subPropMpnData.manager.SetItem(componentInChildren.m_MenuItem);
  2286. break;
  2287. }
  2288. }
  2289. if (!flag)
  2290. {
  2291. if (componentInChildren.m_MenuItem.m_mpn == MPN.eye_hi && this.isNewFace)
  2292. {
  2293. if (this.highlightSelector.selectItem == HighlightSelector.SelectItem.EyeR || this.highlightSelector.selectItem == HighlightSelector.SelectItem.Eye)
  2294. {
  2295. maid.SetProp(MPN.eye_hi_r, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
  2296. }
  2297. if (this.highlightSelector.selectItem == HighlightSelector.SelectItem.EyeL || this.highlightSelector.selectItem == HighlightSelector.SelectItem.Eye)
  2298. {
  2299. maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
  2300. }
  2301. }
  2302. else if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2303. {
  2304. maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, true, false);
  2305. }
  2306. else
  2307. {
  2308. maid.SetProp(componentInChildren.m_MenuItem.m_strCateName, componentInChildren.m_MenuItem.m_strMenuFileName, componentInChildren.m_MenuItem.m_nMenuFileRID, false, false);
  2309. }
  2310. }
  2311. }
  2312. if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.null_mpn)
  2313. {
  2314. if (componentInChildren.m_MenuItem.m_eColorSetMPN == MPN.haircolor)
  2315. {
  2316. MaidProp prop2 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
  2317. if (string.IsNullOrEmpty(prop2.strFileName))
  2318. {
  2319. List<SceneEdit.SMenuItem> listColorSet = componentInChildren.m_MenuItem.m_listColorSet;
  2320. if (listColorSet.Count != 0)
  2321. {
  2322. SceneEdit.SMenuItem smenuItem2 = listColorSet.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID != MaidParts.PARTS_COLOR.NONE);
  2323. if (smenuItem2 == null)
  2324. {
  2325. smenuItem2 = listColorSet[0];
  2326. }
  2327. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2328. {
  2329. maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, true, false);
  2330. }
  2331. else
  2332. {
  2333. maid.SetProp(smenuItem2.m_strCateName, smenuItem2.m_strMenuFileName, smenuItem2.m_nMenuFileRID, false, false);
  2334. }
  2335. }
  2336. }
  2337. }
  2338. else
  2339. {
  2340. bool flag2 = false;
  2341. if (smenuItem != null)
  2342. {
  2343. MaidProp prop3 = maid.GetProp(componentInChildren.m_MenuItem.m_eColorSetMPN);
  2344. int num = 0;
  2345. foreach (SceneEdit.SMenuItem smenuItem3 in smenuItem.m_listColorSet)
  2346. {
  2347. if (smenuItem3.m_nMenuFileRID == prop3.nFileNameRID)
  2348. {
  2349. break;
  2350. }
  2351. num++;
  2352. }
  2353. if (num < componentInChildren.m_MenuItem.m_listColorSet.Count)
  2354. {
  2355. SceneEdit.SMenuItem smenuItem4 = componentInChildren.m_MenuItem.m_listColorSet[num];
  2356. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2357. {
  2358. maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, true, false);
  2359. }
  2360. else
  2361. {
  2362. maid.SetProp(smenuItem4.m_strCateName, smenuItem4.m_strMenuFileName, smenuItem4.m_nMenuFileRID, false, false);
  2363. }
  2364. flag2 = true;
  2365. }
  2366. }
  2367. if (!flag2)
  2368. {
  2369. List<SceneEdit.SMenuItem> listColorSet2 = componentInChildren.m_MenuItem.m_listColorSet;
  2370. if (listColorSet2.Count != 0)
  2371. {
  2372. SceneEdit.SMenuItem smenuItem5 = listColorSet2[0];
  2373. if (componentInChildren.m_MenuItem.m_eColorSetMPN != MPN.eye)
  2374. {
  2375. smenuItem5 = listColorSet2.Find((SceneEdit.SMenuItem i) => i.m_pcMultiColorID == MaidParts.PARTS_COLOR.NONE);
  2376. if (smenuItem5 == null)
  2377. {
  2378. smenuItem5 = listColorSet2[0];
  2379. }
  2380. }
  2381. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2382. {
  2383. maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, true, false);
  2384. }
  2385. else
  2386. {
  2387. maid.SetProp(smenuItem5.m_strCateName, smenuItem5.m_strMenuFileName, smenuItem5.m_nMenuFileRID, false, false);
  2388. }
  2389. }
  2390. }
  2391. }
  2392. }
  2393. SceneEdit.AllProcPropSeqStart(maid);
  2394. if (componentInChildren.m_MenuItem.m_bColor)
  2395. {
  2396. this.UpdateSelected_ColorSet(componentInChildren.m_MenuItem.m_mpn);
  2397. }
  2398. else if (!this.m_bOpenSetGroupPanel)
  2399. {
  2400. this.UpdateSelectedMenuItem(componentInChildren.m_MenuItem.m_ParentPartsType);
  2401. }
  2402. else
  2403. {
  2404. this.UpdatePanel_GroupSet(componentInChildren.m_MenuItem);
  2405. }
  2406. }
  2407. }
  2408. public void HoverOverCallback()
  2409. {
  2410. ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
  2411. SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
  2412. Vector3 position = UIEventTrigger.current.transform.parent.position;
  2413. this.m_info.Open(position, menuItem.m_texIconRef, menuItem.menuNameCurrentLanguage, menuItem.infoTextCurrentLanguage, 0);
  2414. }
  2415. public void HoverOverCallbackOnGroup()
  2416. {
  2417. ButtonEdit componentInChildren = UIEventTrigger.current.GetComponentInChildren<ButtonEdit>();
  2418. SceneEdit.SMenuItem menuItem = componentInChildren.m_MenuItem;
  2419. Vector3 position = UIEventTrigger.current.transform.parent.position;
  2420. this.m_info.Open(position, menuItem.m_texIconRef, menuItem.menuNameCurrentLanguage, menuItem.infoTextCurrentLanguage, (menuItem.m_listMember == null) ? 0 : menuItem.m_listMember.Count);
  2421. }
  2422. public void HoverOutCallback()
  2423. {
  2424. this.m_info.Close();
  2425. }
  2426. public void OnClickEditItemGroup()
  2427. {
  2428. this.m_bUseGroup = !this.m_bUseGroup;
  2429. this.EditItemGroupSwitch.defaultColor = ((!this.m_bUseGroup) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  2430. }
  2431. public void OnClickEditTouchJump()
  2432. {
  2433. this.m_bUseTouchJump = !this.m_bUseTouchJump;
  2434. this.EditTouchJumpSwitch.defaultColor = ((!this.m_bUseTouchJump) ? new Color(0.4f, 0.4f, 0.4f, 0.85f) : Color.white);
  2435. }
  2436. public void SlideCallback()
  2437. {
  2438. Maid maid = this.m_maid;
  2439. ButtonEdit componentInChildren = UIProgressBar.current.GetComponentInChildren<ButtonEdit>();
  2440. MaidProp prop = maid.GetProp(componentInChildren.m_SliderItem.m_strCateName);
  2441. if (componentInChildren.m_SliderItem.m_strCateName == "MuneL")
  2442. {
  2443. int num = prop.min - 30;
  2444. int num2 = (int)System.Math.Round((double)((float)num + (float)(prop.max - num) * UIProgressBar.current.value), MidpointRounding.AwayFromZero);
  2445. if (0 <= num2)
  2446. {
  2447. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, num2, false);
  2448. maid.SetProp(MPN.MuneS, 0, false);
  2449. }
  2450. else
  2451. {
  2452. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, 0, false);
  2453. maid.SetProp(MPN.MuneS, (int)(100f * ((float)num2 / -30f) + 0.5f), false);
  2454. }
  2455. }
  2456. else
  2457. {
  2458. int val = (int)((float)prop.min + (float)(prop.max - prop.min) * UIProgressBar.current.value + 0.5f);
  2459. maid.SetProp(componentInChildren.m_SliderItem.m_strCateName, val, false);
  2460. }
  2461. if (componentInChildren.m_SliderItem.m_mpn == MPN.MuneL)
  2462. {
  2463. MaidProp prop2 = maid.GetProp(MPN.MuneL);
  2464. MaidProp prop3 = maid.GetProp(MPN.MuneTare);
  2465. prop3.max = prop2.value;
  2466. if (prop3.max < 1)
  2467. {
  2468. prop3.max = 1;
  2469. prop3.value = 0;
  2470. }
  2471. maid.SetProp(MPN.MuneTare, prop3.value, false);
  2472. }
  2473. maid.AllProcProp();
  2474. this.UpdateSliders();
  2475. }
  2476. public void OpenColorSet(SceneEdit.SMenuItem f_miSelected)
  2477. {
  2478. if (f_miSelected.m_eColorSetMPN == MPN.null_mpn)
  2479. {
  2480. this.m_Panel_ColorSet.SetActive(false);
  2481. this.m_CheckBoxMayuDrawPriority.gameObject.SetActive(false);
  2482. return;
  2483. }
  2484. }
  2485. private IEnumerator CoPoseToCam(string f_lookBone, float f_cameraMoveTime, float f_waitTime = 0.2f)
  2486. {
  2487. if (f_waitTime != 0f)
  2488. {
  2489. yield return new WaitForSeconds(f_waitTime);
  2490. }
  2491. Maid maid = this.m_maid;
  2492. Transform trBone = maid.body0.GetBone(f_lookBone);
  2493. if (trBone != null)
  2494. {
  2495. this.m_cameraMoveSupport.SaveCameraPosition(trBone.position, 3f, new Vector2(-180f, 11.5528f));
  2496. this.CameraReset(f_cameraMoveTime);
  2497. }
  2498. yield break;
  2499. }
  2500. public void Voice(SceneEdit.PVBInfo f_pvb)
  2501. {
  2502. Maid maid = this.m_maid;
  2503. SceneEdit.VoiceInfo voiceInfo = f_pvb as SceneEdit.VoiceInfo;
  2504. maid.AudioMan.LoadPlay(voiceInfo.strVoiceFileName, 0f, false, false);
  2505. maid.FaceAnime(voiceInfo.strFace, 1f, 0);
  2506. if (string.IsNullOrEmpty(voiceInfo.strFace2))
  2507. {
  2508. maid.FaceBlend("無し");
  2509. }
  2510. else
  2511. {
  2512. maid.FaceBlend(voiceInfo.strFace2);
  2513. }
  2514. }
  2515. public void ToView()
  2516. {
  2517. if (GameMain.Instance.VRMode && !Input.GetKey(KeyCode.LeftShift))
  2518. {
  2519. Debug.Log("VRモードではViewモードになりません。");
  2520. return;
  2521. }
  2522. this.m_eCamOffsBack = this.m_eCamOffsNow;
  2523. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  2524. for (int i = 0; i < this.m_listPanel.Count; i++)
  2525. {
  2526. this.m_listPanel[i].alpha = 0f;
  2527. }
  2528. this.m_uipViewCancel.gameObject.SetActive(true);
  2529. this.m_uipViewCancel.alpha = 1f;
  2530. this.customViewWindow.mgr.gameObject.SetActive(false);
  2531. this.customPartsWindow.ViewMode(true);
  2532. }
  2533. public void FromView()
  2534. {
  2535. for (int i = 0; i < this.m_listPanel.Count; i++)
  2536. {
  2537. this.m_listPanel[i].alpha = 1f;
  2538. }
  2539. this.m_uipViewCancel.alpha = 0f;
  2540. this.m_uipViewCancel.gameObject.SetActive(false);
  2541. this.SetCameraOffset(this.m_eCamOffsBack);
  2542. this.customViewWindow.mgr.gameObject.SetActive(true);
  2543. this.customPartsWindow.ViewMode(false);
  2544. }
  2545. public void ClothesState(SceneEditInfo.ClothesState f_cs)
  2546. {
  2547. Maid maid = this.m_maid;
  2548. if (f_cs == SceneEditInfo.ClothesState.Nude)
  2549. {
  2550. maid.body0.SetMaskMode(TBody.MaskMode.Nude);
  2551. }
  2552. else if (f_cs == SceneEditInfo.ClothesState.Underwear)
  2553. {
  2554. maid.body0.SetMaskMode(TBody.MaskMode.Underwear);
  2555. }
  2556. if (f_cs == SceneEditInfo.ClothesState.Wear)
  2557. {
  2558. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2559. }
  2560. }
  2561. public void SetCameraOffset(SceneEdit.CAM_OFFS f_eCamOffs)
  2562. {
  2563. if (GameMain.Instance.MainCamera == null)
  2564. {
  2565. return;
  2566. }
  2567. if (f_eCamOffs == SceneEdit.CAM_OFFS.CENTER)
  2568. {
  2569. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3(0f, 0f, 0f), true);
  2570. }
  2571. else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT)
  2572. {
  2573. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 3f * 2f - (float)Screen.width / 2f, 0f, 0f), true);
  2574. }
  2575. else if (f_eCamOffs == SceneEdit.CAM_OFFS.RIGHT_MORE)
  2576. {
  2577. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 256f * 183f - (float)Screen.width / 2f, 0f, 0f), true);
  2578. }
  2579. this.m_eCamOffsNow = f_eCamOffs;
  2580. }
  2581. public void CallHowToNameDialog()
  2582. {
  2583. this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", "Dialog/result/苗字で呼ぶ", delegate
  2584. {
  2585. this.m_FFNameDlg.Close();
  2586. this.m_maid.status.isFirstNameCall = false;
  2587. }, "Dialog/result/名前で呼ぶ", delegate
  2588. {
  2589. this.m_FFNameDlg.Close();
  2590. this.m_maid.status.isFirstNameCall = true;
  2591. });
  2592. }
  2593. public void CallSettingNamePanel()
  2594. {
  2595. GameObject childObject = UTY.GetChildObject(this.m_goUIRoot, "NameSettingPanel", false);
  2596. if (childObject != null)
  2597. {
  2598. SceneEditNameSettingPanel component = childObject.GetComponent<SceneEditNameSettingPanel>();
  2599. if (component != null)
  2600. {
  2601. component.gameObject.SetActive(true);
  2602. component.Call();
  2603. }
  2604. }
  2605. }
  2606. public void OnCharaLoadCompleted()
  2607. {
  2608. foreach (SceneEdit.SCategory scategory in this.m_listCategory)
  2609. {
  2610. foreach (SceneEdit.SPartsType spartsType in scategory.m_listPartsType)
  2611. {
  2612. bool flag = 0 < spartsType.m_listMenu.Count;
  2613. if (spartsType.m_eType == SceneEditInfo.CCateNameType.EType.Item)
  2614. {
  2615. flag = SceneEditInfo.m_dicPartsTypePair[spartsType.m_mpn].m_requestNewFace;
  2616. }
  2617. else
  2618. {
  2619. foreach (SceneEdit.SMenuItem smenuItem in spartsType.m_listMenu)
  2620. {
  2621. if (!smenuItem.m_requestNewFace)
  2622. {
  2623. flag = false;
  2624. break;
  2625. }
  2626. }
  2627. }
  2628. if (flag)
  2629. {
  2630. spartsType.m_isEnabled = this.isNewFace;
  2631. }
  2632. if (spartsType.m_mpn == MPN.accmimi)
  2633. {
  2634. spartsType.m_isEnabled = (this.maid.GetProp(MPN.EarNone).value == 0);
  2635. if (!spartsType.m_isEnabled && !this.isNewFace)
  2636. {
  2637. spartsType.m_isEnabled = true;
  2638. }
  2639. }
  2640. }
  2641. }
  2642. foreach (GameObject gameObject in this.m_listBtnPartsType)
  2643. {
  2644. ButtonEdit buttonEdit = gameObject.GetComponentsInChildren<ButtonEdit>(true)[0];
  2645. SceneEdit.SPartsType partsType = buttonEdit.m_PartsType;
  2646. UIButton uibutton = gameObject.GetComponentsInChildren<UIButton>(true)[0];
  2647. uibutton.isEnabled = partsType.m_isEnabled;
  2648. if (uibutton.isEnabled && (uibutton.onClick == null || uibutton.onClick.Count == 0))
  2649. {
  2650. EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.ClickCallback));
  2651. }
  2652. }
  2653. if (this.isNewFace && this.maid.GetProp(MPN.EarNone).value != 0)
  2654. {
  2655. MaidProp prop = this.maid.GetProp(MPN.accmimi);
  2656. if (prop != null && prop.strFileName != CM3.dicDelItem[MPN.accmimi])
  2657. {
  2658. string text = CM3.dicDelItem[MPN.accmimi];
  2659. int hashCode = text.ToLower().GetHashCode();
  2660. this.maid.SetProp(MPN.accmimi, text, hashCode, false, false);
  2661. SceneEdit.AllProcPropSeqStart(this.m_maid);
  2662. return;
  2663. }
  2664. }
  2665. this.customViewWindow.UpdateAllItem();
  2666. }
  2667. private void OnEditOk()
  2668. {
  2669. if (GameMain.Instance.SysDlg.IsDecided && !GameMain.Instance.CharacterMgr.IsBusy())
  2670. {
  2671. Maid maid = this.m_maid;
  2672. if (this.customPartsWindowVisibleButton.visible)
  2673. {
  2674. this.customPartsWindowVisibleButton.windowVisible = false;
  2675. }
  2676. maid.body0.SetMaskMode(TBody.MaskMode.None);
  2677. if (this.modeType == SceneEdit.ModeType.OriginalChara || this.modeType == SceneEdit.ModeType.MainChara)
  2678. {
  2679. this.m_FFNameDlg.ShowFromLanguageTerm("Dialog/名前と苗字のどちらで呼びますか?", "Dialog/result/苗字で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFamily), "Dialog/result/名前で呼ぶ", new FFNameDialog.OnClick(this.OnFFNameFirst));
  2680. }
  2681. else
  2682. {
  2683. this.OnEndDlgOk();
  2684. }
  2685. }
  2686. }
  2687. private void OnFFNameFirst()
  2688. {
  2689. this.m_FFNameDlg.Close();
  2690. this.m_maid.status.isFirstNameCall = true;
  2691. this.Conform();
  2692. }
  2693. private void OnFFNameFamily()
  2694. {
  2695. this.m_FFNameDlg.Close();
  2696. this.m_maid.status.isFirstNameCall = false;
  2697. this.Conform();
  2698. }
  2699. private void Conform()
  2700. {
  2701. this.m_maid.boMabataki = false;
  2702. GameMain.Instance.SysDlg.ShowFromLanguageTerm("Dialog/このメイドにしますか?", null, SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(this.OnEndDlgOk), new SystemDialog.OnClick(this.OnEndDlgCancel));
  2703. }
  2704. private void OnEndDlgOk()
  2705. {
  2706. BaseMgr<ProfileMgr>.Instance.UpdateProfileData(true);
  2707. GameMain.Instance.SysDlg.Close();
  2708. UICamera.InputEnable = false;
  2709. this.m_maid.ThumShotCamMove();
  2710. this.m_maid.body0.trsLookTarget = GameMain.Instance.ThumCamera.transform;
  2711. this.m_maid.boMabataki = false;
  2712. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2713. {
  2714. for (int i = 67; i <= 66; i++)
  2715. {
  2716. this.maid.ResetProp((MPN)i, true);
  2717. }
  2718. }
  2719. base.StartCoroutine(this.CoWaitPutCloth());
  2720. }
  2721. private IEnumerator CoWaitPutCloth()
  2722. {
  2723. if (this.modeType == SceneEdit.ModeType.CostumeEdit || this.modeType == SceneEdit.ModeType.NpcEdit)
  2724. {
  2725. while (GameMain.Instance.CharacterMgr.IsBusy())
  2726. {
  2727. yield return null;
  2728. }
  2729. }
  2730. for (int nF = 0; nF < 90; nF++)
  2731. {
  2732. yield return null;
  2733. }
  2734. GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
  2735. if (this.modeType == SceneEdit.ModeType.CostumeEdit)
  2736. {
  2737. this.m_maid.ThumShotCustom(GameMain.Instance.FacilityMgr.tempSelectFacility.GetFacilityEditCostumeThumbnailName(), true);
  2738. }
  2739. else if (this.modeType == SceneEdit.ModeType.NpcEdit)
  2740. {
  2741. byte[] data = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(this.m_maid, CharacterMgr.PresetType.All);
  2742. if (NPCCharaSelect.editTargetNPCData != null)
  2743. {
  2744. SaveData.SetPreset(NPCCharaSelect.editTargetNPCData.id, data);
  2745. }
  2746. }
  2747. else
  2748. {
  2749. this.m_maid.ThumShot();
  2750. }
  2751. this.m_maid.boMabataki = true;
  2752. this.m_maid.body0.trsLookTarget = null;
  2753. this.m_currentScriptFile = GameMain.Instance.ScriptMgr.adv_kag.kag.GetCurrentFileName();
  2754. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.CreateKasizukiThumShot), true, default(Color));
  2755. yield break;
  2756. }
  2757. private void OnEndDlgCancel()
  2758. {
  2759. GameMain.Instance.SysDlg.Close();
  2760. this.m_maid.boMabataki = true;
  2761. }
  2762. private void OnEditCancel()
  2763. {
  2764. }
  2765. private void CreateKasizukiThumShot()
  2766. {
  2767. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  2768. if (this.modeType == SceneEdit.ModeType.CostumeEdit || this.modeType == SceneEdit.ModeType.NpcEdit)
  2769. {
  2770. this.OnEndScene();
  2771. return;
  2772. }
  2773. ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
  2774. scriptMgr.adv_kag.LoadScriptFile("KasizukiThumShot.ks", string.Empty);
  2775. scriptMgr.adv_kag.Exec();
  2776. base.StartCoroutine(this.CoroutineKasizukiThumShot());
  2777. }
  2778. private IEnumerator CoroutineKasizukiThumShot()
  2779. {
  2780. for (int nF = 0; nF < 30; nF++)
  2781. {
  2782. yield return null;
  2783. }
  2784. Camera thumCamera = GameMain.Instance.ThumCamera;
  2785. CameraMain mainCamera = GameMain.Instance.MainCamera;
  2786. thumCamera.transform.position = mainCamera.transform.position;
  2787. thumCamera.transform.rotation = mainCamera.transform.rotation;
  2788. float backup = thumCamera.fieldOfView;
  2789. thumCamera.fieldOfView = mainCamera.camera.fieldOfView;
  2790. this.m_maid.body0.trsLookTarget = thumCamera.transform;
  2791. for (int nF2 = 0; nF2 < 30; nF2++)
  2792. {
  2793. yield return null;
  2794. }
  2795. this.m_maid.ThumShotCustom(KasizukiManager.CreateMaidTmpThumbName(this.m_maid), false);
  2796. thumCamera.fieldOfView = backup;
  2797. this.OnEndScene();
  2798. yield break;
  2799. }
  2800. private void OnEndScene()
  2801. {
  2802. if (GameMain.Instance.VRMode)
  2803. {
  2804. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  2805. }
  2806. UICamera.InputEnable = true;
  2807. if (!string.IsNullOrEmpty(this.m_strScriptArg))
  2808. {
  2809. Debug.Log("OnEndScene JumpTo " + this.m_strScriptArg);
  2810. GameMain.Instance.ScriptMgr.adv_kag.LoadScriptFile(this.m_currentScriptFile, this.m_strScriptArg);
  2811. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  2812. }
  2813. }
  2814. public bool ClickEmulate(SceneEditInfo.EMenuCategory category, bool forceViewOff = false)
  2815. {
  2816. UIButton current = UIButton.current;
  2817. for (int i = 0; i < this.m_listCategory.Count; i++)
  2818. {
  2819. if (this.m_listCategory[i].m_eCategory == category && i < this.m_listBtnCate.Count)
  2820. {
  2821. UIButton componentInChildren = this.m_listBtnCate[i].GetComponentInChildren<UIButton>();
  2822. if (componentInChildren != null)
  2823. {
  2824. UIButton.current = componentInChildren;
  2825. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  2826. if (forceViewOff && visibleAutoCam)
  2827. {
  2828. this.m_viewreset.SetVisibleAutoCam(false);
  2829. }
  2830. this.ClickCallback();
  2831. if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
  2832. {
  2833. this.m_viewreset.SetVisibleAutoCam(false);
  2834. }
  2835. UIButton.current = current;
  2836. return true;
  2837. }
  2838. }
  2839. }
  2840. return false;
  2841. }
  2842. public bool isEnabledButton(MPN mpn)
  2843. {
  2844. switch (mpn)
  2845. {
  2846. case MPN.skin:
  2847. mpn = MPN.folder_skin;
  2848. break;
  2849. default:
  2850. if (mpn == MPN.eyewhite)
  2851. {
  2852. mpn = MPN.folder_eyewhite;
  2853. }
  2854. break;
  2855. case MPN.underhair:
  2856. mpn = MPN.folder_underhair;
  2857. break;
  2858. case MPN.mayu:
  2859. mpn = MPN.folder_mayu;
  2860. break;
  2861. case MPN.eye:
  2862. mpn = MPN.folder_eye;
  2863. break;
  2864. }
  2865. if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
  2866. {
  2867. return false;
  2868. }
  2869. SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
  2870. SceneEditInfo.EMenuCategory eMenuCate = ccateNameType.m_eMenuCate;
  2871. string ePartsType = ccateNameType.m_ePartsType;
  2872. SceneEdit.SCategory scategory = null;
  2873. int num = 0;
  2874. while (num < this.m_listCategory.Count && scategory == null)
  2875. {
  2876. if (this.m_listCategory[num].m_eCategory == eMenuCate)
  2877. {
  2878. scategory = this.m_listCategory[num];
  2879. }
  2880. num++;
  2881. }
  2882. for (int i = 0; i < scategory.m_listPartsType.Count; i++)
  2883. {
  2884. if (scategory.m_listPartsType[i].m_ePartsType == ePartsType)
  2885. {
  2886. return scategory.m_listPartsType[i].m_isEnabled;
  2887. }
  2888. }
  2889. return false;
  2890. }
  2891. public bool ClickEmulate(MPN mpn, bool forceViewOff = false)
  2892. {
  2893. switch (mpn)
  2894. {
  2895. case MPN.skin:
  2896. mpn = MPN.folder_skin;
  2897. break;
  2898. default:
  2899. if (mpn == MPN.eyewhite)
  2900. {
  2901. mpn = MPN.folder_eyewhite;
  2902. }
  2903. break;
  2904. case MPN.underhair:
  2905. mpn = MPN.folder_underhair;
  2906. break;
  2907. case MPN.mayu:
  2908. mpn = MPN.folder_mayu;
  2909. break;
  2910. case MPN.eye:
  2911. mpn = MPN.folder_eye;
  2912. break;
  2913. }
  2914. if (!SceneEditInfo.m_dicPartsTypePair.ContainsKey(mpn))
  2915. {
  2916. return false;
  2917. }
  2918. SceneEditInfo.CCateNameType ccateNameType = SceneEditInfo.m_dicPartsTypePair[mpn];
  2919. return this.ClickEmulate(ccateNameType.m_eMenuCate, ccateNameType.m_ePartsType, forceViewOff);
  2920. }
  2921. public bool ClickEmulate(SceneEditInfo.EMenuCategory category, string partsType, bool forceViewOff = false)
  2922. {
  2923. if (!this.ClickEmulate(category, false) || category == SceneEditInfo.EMenuCategory.プリセット || category == SceneEditInfo.EMenuCategory.ランダム || category == SceneEditInfo.EMenuCategory.プロフィ\u30FCル)
  2924. {
  2925. return false;
  2926. }
  2927. UIButton current = UIButton.current;
  2928. SceneEdit.SCategory scategory = null;
  2929. int num = 0;
  2930. while (num < this.m_listCategory.Count && scategory == null)
  2931. {
  2932. if (this.m_listCategory[num].m_eCategory == category)
  2933. {
  2934. scategory = this.m_listCategory[num];
  2935. }
  2936. num++;
  2937. }
  2938. for (int i = 0; i < scategory.m_listPartsType.Count; i++)
  2939. {
  2940. if (scategory.m_listPartsType[i].m_ePartsType == partsType && i < this.m_listBtnPartsType.Count)
  2941. {
  2942. UIButton componentInChildren = this.m_listBtnPartsType[i].GetComponentInChildren<UIButton>();
  2943. if (componentInChildren != null)
  2944. {
  2945. UIButton.current = componentInChildren;
  2946. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  2947. if (forceViewOff && visibleAutoCam)
  2948. {
  2949. this.m_viewreset.SetVisibleAutoCam(false);
  2950. }
  2951. this.ClickCallback();
  2952. if (visibleAutoCam != this.m_viewreset.GetVisibleAutoCam())
  2953. {
  2954. this.m_viewreset.SetVisibleAutoCam(false);
  2955. }
  2956. UIButton.current = current;
  2957. return true;
  2958. }
  2959. }
  2960. }
  2961. return false;
  2962. }
  2963. private void OnClickViewReset()
  2964. {
  2965. this.CameraReset(0.5f);
  2966. }
  2967. private void OnTouchJump(SceneEdit.TouchType type)
  2968. {
  2969. if (GameMain.Instance.VRMode || this.customPartsWindowVisibleButton.windowVisible || this.colorPaletteMgr.gameObject.activeSelf || !UICamera.InputEnable || this.m_uipViewCancel.gameObject.activeSelf)
  2970. {
  2971. return;
  2972. }
  2973. if (UICamera.Raycast(Input.mousePosition))
  2974. {
  2975. return;
  2976. }
  2977. MPN mpn = MPN.HeadX;
  2978. switch (type)
  2979. {
  2980. case SceneEdit.TouchType.Head:
  2981. mpn = MPN.HeadX;
  2982. break;
  2983. case SceneEdit.TouchType.Bust:
  2984. mpn = MPN.MuneL;
  2985. break;
  2986. case SceneEdit.TouchType.UpperBody:
  2987. mpn = MPN.west;
  2988. break;
  2989. case SceneEdit.TouchType.LowerBody:
  2990. mpn = MPN.koshi;
  2991. break;
  2992. case SceneEdit.TouchType.Leg:
  2993. mpn = MPN.DouPer;
  2994. break;
  2995. }
  2996. if (this.isEnabledButton(mpn))
  2997. {
  2998. this.ClickEmulate(mpn, false);
  2999. }
  3000. }
  3001. private void OnClickAutoCam()
  3002. {
  3003. bool flag = !this.m_viewreset.GetVisibleAutoCam();
  3004. this.m_viewreset.SetVisibleAutoCam(flag);
  3005. GameMain.Instance.CMSystem.SConfig.EditAutoCam = flag;
  3006. }
  3007. private void OnClickEyeToCam()
  3008. {
  3009. Maid maid = this.m_maid;
  3010. bool flag = !this.m_viewreset.GetVisibleEyeToCam();
  3011. this.m_viewreset.SetVisibleEyeToCam(flag);
  3012. GameMain.Instance.CMSystem.SConfig.EditEyeToCam = flag;
  3013. if (this.m_viewreset.GetVisibleEyeToCam())
  3014. {
  3015. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0.8f);
  3016. }
  3017. else
  3018. {
  3019. maid.EyeToCamera(Maid.EyeMoveType.無視する, 0.8f);
  3020. }
  3021. }
  3022. private void CameraReset(float f_fTime = 0.5f)
  3023. {
  3024. this.m_cameraMoveSupport.moveTime = f_fTime;
  3025. this.m_cameraMoveSupport.ResetCamera();
  3026. }
  3027. private void CameraMoveTo(Vector3 f_vTarget, float f_fDistance, Vector2 f_vAngle, float f_fTime = 0.5f)
  3028. {
  3029. this.m_cameraMoveSupport.moveTime = f_fTime;
  3030. this.m_cameraMoveSupport.StartCameraPosition(f_vTarget, f_fDistance, f_vAngle);
  3031. }
  3032. public void OnDestroy()
  3033. {
  3034. if (GameMain.Instance.isQuitting)
  3035. {
  3036. return;
  3037. }
  3038. iTween.Stop(base.gameObject);
  3039. foreach (KeyValuePair<Personal.Data, List<SceneEdit.PVBInfo>> keyValuePair in this.m_dicVoice)
  3040. {
  3041. foreach (SceneEdit.PVBInfo pvbinfo in keyValuePair.Value)
  3042. {
  3043. UnityEngine.Object.Destroy(pvbinfo.texIcon);
  3044. }
  3045. }
  3046. CharacterMgr.EditModeLookHaveItem = false;
  3047. GameMain.Instance.ScriptMgr.StopMotionScript();
  3048. Maid maid = this.m_maid;
  3049. if (maid != null)
  3050. {
  3051. MaidColliderCollect.RemoveColliderAll(maid);
  3052. maid.body0.SetMaskMode(TBody.MaskMode.None);
  3053. maid.OpenMouthLookTooth(false);
  3054. maid.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, false);
  3055. maid.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, false);
  3056. maid.Visible = false;
  3057. }
  3058. this.SetCameraOffset(SceneEdit.CAM_OFFS.CENTER);
  3059. if (!this.m_bVRComMode)
  3060. {
  3061. GameMain.Instance.BgMgr.DeleteBg();
  3062. }
  3063. NUty.GCFree();
  3064. }
  3065. public void UpdateCurrentItemPanel(bool resetScrollBar)
  3066. {
  3067. if (this.m_Panel_PartsType.goMain.activeSelf && (this.m_Panel_MenuItem.goMain.activeSelf || this.m_Panel_SetItem.goMain.activeSelf))
  3068. {
  3069. ButtonEdit[] componentsInChildren = this.m_Panel_PartsType.goGrid.GetComponentsInChildren<ButtonEdit>();
  3070. foreach (ButtonEdit buttonEdit in componentsInChildren)
  3071. {
  3072. if (buttonEdit.m_goFrame.GetComponent<UISprite>().enabled)
  3073. {
  3074. if (buttonEdit.m_PartsType != null)
  3075. {
  3076. UIButton component = buttonEdit.GetComponent<UIButton>();
  3077. UIButton current = UIButton.current;
  3078. UIButton.current = component;
  3079. bool visibleAutoCam = this.m_viewreset.GetVisibleAutoCam();
  3080. this.m_viewreset.SetVisibleAutoCam(false);
  3081. this.ClickCallback();
  3082. this.m_viewreset.SetVisibleAutoCam(visibleAutoCam);
  3083. UIButton.current = current;
  3084. if (resetScrollBar && this.m_Panel_MenuItem.goMain.activeSelf)
  3085. {
  3086. this.m_Panel_MenuItem.gcScrollBar.value = 0f;
  3087. }
  3088. else if (resetScrollBar && this.m_Panel_SetItem.goMain.activeSelf)
  3089. {
  3090. this.m_Panel_SetItem.gcScrollBar.value = 0f;
  3091. }
  3092. break;
  3093. }
  3094. }
  3095. }
  3096. }
  3097. }
  3098. public void Update()
  3099. {
  3100. if (GameMain.Instance.VRMode)
  3101. {
  3102. if (!this.m_bVRComMode)
  3103. {
  3104. if (Input.GetKeyUp(KeyCode.B))
  3105. {
  3106. this.bgIconWindow.NextBG();
  3107. }
  3108. if (Input.GetKeyUp(KeyCode.P))
  3109. {
  3110. this.pauseIconWindow.NextPose();
  3111. }
  3112. if (Input.GetKeyUp(KeyCode.F5) || Input.GetKeyUp(KeyCode.R))
  3113. {
  3114. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  3115. }
  3116. }
  3117. if (Input.GetKey(KeyCode.LeftArrow))
  3118. {
  3119. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  3120. if (maid != null)
  3121. {
  3122. maid.gameObject.transform.Rotate(new Vector3(0f, 60f, 0f) * Time.deltaTime);
  3123. }
  3124. }
  3125. if (Input.GetKey(KeyCode.RightArrow))
  3126. {
  3127. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(0);
  3128. if (maid2 != null)
  3129. {
  3130. maid2.gameObject.transform.Rotate(new Vector3(0f, -60f, 0f) * Time.deltaTime);
  3131. }
  3132. }
  3133. }
  3134. if (GameMain.Instance.CharacterMgr.IsBusy() || this.customViewWindow == null || this.customViewWindow.itemList == null)
  3135. {
  3136. this.updateCustomViewFlag = true;
  3137. return;
  3138. }
  3139. if (this.updateCustomViewFlag)
  3140. {
  3141. this.updateCustomViewFlag = false;
  3142. this.OnCharaLoadCompleted();
  3143. }
  3144. }
  3145. private bool updateCustomViewFlag;
  3146. private List<CapsuleCollider> touchJumpColliderList = new List<CapsuleCollider>();
  3147. private List<SceneEdit.SCategory> m_listCategory = new List<SceneEdit.SCategory>();
  3148. private List<GameObject> m_listBtnCate = new List<GameObject>();
  3149. private List<GameObject> m_listBtnPartsType = new List<GameObject>();
  3150. private List<SceneEdit.MenuItemSet> m_listBtnMenuItem = new List<SceneEdit.MenuItemSet>();
  3151. private List<SceneEdit.SliderItemSet> m_listSliderItem = new List<SceneEdit.SliderItemSet>();
  3152. private List<SceneEdit.ColorItemSet> m_listBtnColorSet = new List<SceneEdit.ColorItemSet>();
  3153. private List<SceneEdit.MenuItemSet> m_listBtnGroupMember = new List<SceneEdit.MenuItemSet>();
  3154. public bool m_bOpenSetGroupPanel;
  3155. public UIButton EditItemGroupSwitch;
  3156. public UIButton EditTouchJumpSwitch;
  3157. [SerializeField]
  3158. public ColorPaletteManager colorPaletteMgr;
  3159. [SerializeField]
  3160. private WindowPartsWindowVisible customPartsWindowVisibleButton;
  3161. [SerializeField]
  3162. [Tooltip("ハイライト選択のゲームオブジェクト")]
  3163. private HighlightSelector highlightSelector;
  3164. [SerializeField]
  3165. public SceneEdit.SubPropMpnData[] subPropDatas;
  3166. private SceneEdit.UIPanelSet m_Panel_Category;
  3167. private SceneEdit.UIPanelSet m_Panel_PartsType;
  3168. private SceneEdit.UIPanelSet m_Panel_MenuItem;
  3169. private SceneEdit.UIPanelSet m_Panel_SetItem;
  3170. private SceneEdit.UIPanelSet m_Panel_SliderItem;
  3171. private SceneEdit.UIPanelSet m_Panel_ColorSet;
  3172. private SceneEdit.UIPanelSet m_Panel_GroupSet;
  3173. private WFCheckBox m_CheckBoxMayuDrawPriority;
  3174. public BetterList<UIKeyNavigation2> m_listNg2Cate = new BetterList<UIKeyNavigation2>();
  3175. public BetterList<UIKeyNavigation2> m_listNg2PartsType = new BetterList<UIKeyNavigation2>();
  3176. public BetterList<UIKeyNavigation2> m_listNg2MenuItem = new BetterList<UIKeyNavigation2>();
  3177. public TextMesh m_tmDebugText;
  3178. private SceneEdit.MenuItemSet m_misDelOnly;
  3179. public Dictionary<MPN, List<SceneEdit.SMenuItem>> m_dicColor = new Dictionary<MPN, List<SceneEdit.SMenuItem>>();
  3180. public Dictionary<int, SceneEdit.SMenuItem> m_menuRidDic;
  3181. public Dictionary<Personal.Data, List<SceneEdit.PVBInfo>> m_dicVoice = new Dictionary<Personal.Data, List<SceneEdit.PVBInfo>>();
  3182. public GameObject m_goUIRoot;
  3183. private ItemInfoWnd m_info;
  3184. private EditOkCancel m_okcancel;
  3185. private EditViewReset m_viewreset;
  3186. public List<UIPanel> m_listPanel = new List<UIPanel>();
  3187. private UIPanel m_uipViewCancel;
  3188. private WfCameraMoveSupport m_cameraMoveSupport;
  3189. private Maid m_maid;
  3190. private string m_strScriptArg;
  3191. private string m_currentScriptFile;
  3192. private bool m_bVRComMode;
  3193. private FFNameDialog m_FFNameDlg;
  3194. private EditMod m_EditMod;
  3195. private string last_select_category_name_ = string.Empty;
  3196. private Dictionary<string, float> backup_category_scroll_pos_ = new Dictionary<string, float>();
  3197. private int m_nDemoBgNo;
  3198. private MPN m_nNowMPN;
  3199. private static byte[] m_byItemFileBuffer;
  3200. private SceneEdit.CAM_OFFS m_eCamOffsNow;
  3201. private SceneEdit.CAM_OFFS m_eCamOffsBack;
  3202. public enum ModeType
  3203. {
  3204. OriginalChara,
  3205. MainChara,
  3206. AfterEdit,
  3207. CostumeEdit,
  3208. NpcEdit
  3209. }
  3210. private enum TouchType
  3211. {
  3212. Head,
  3213. Bust,
  3214. UpperBody,
  3215. LowerBody,
  3216. Leg
  3217. }
  3218. public class SMenuItem : IDisposable
  3219. {
  3220. public string menuNameCurrentLanguage
  3221. {
  3222. get
  3223. {
  3224. if (Product.WMZI == Product.Language.INKD)
  3225. {
  3226. return this.m_strMenuName;
  3227. }
  3228. string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
  3229. string translation = LocalizationManager.GetTranslation(str + "|name", true, 0, true, false, null, null);
  3230. return (!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strMenuName;
  3231. }
  3232. }
  3233. public string infoTextCurrentLanguage
  3234. {
  3235. get
  3236. {
  3237. if (Product.WMZI == Product.Language.INKD)
  3238. {
  3239. return this.m_strInfo;
  3240. }
  3241. string str = this.m_strCateName + "/" + Path.GetFileNameWithoutExtension(this.m_strMenuFileName).ToLower();
  3242. string translation = LocalizationManager.GetTranslation(str + "|info", true, 0, true, false, null, null);
  3243. return (!string.IsNullOrEmpty(translation)) ? translation.Replace("《改行》", "\n") : this.m_strInfo;
  3244. }
  3245. }
  3246. public Texture2D m_texIconRef
  3247. {
  3248. get
  3249. {
  3250. return (!(this.m_texIcon != null) && !(SceneEdit.Instance == null)) ? SceneEdit.Instance.editItemTextureCache.GetTexter(this.m_nMenuFileRID) : this.m_texIcon;
  3251. }
  3252. }
  3253. public Texture2D m_texIconRandomColorRef
  3254. {
  3255. get
  3256. {
  3257. return this.m_texIconRef;
  3258. }
  3259. }
  3260. public void Dispose()
  3261. {
  3262. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3263. UnityEngine.Object.DestroyImmediate(this.m_texIcon);
  3264. }
  3265. public void SortColorItem()
  3266. {
  3267. this.m_listColorSet.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
  3268. {
  3269. if (x.m_fPriority == y.m_fPriority)
  3270. {
  3271. return 0;
  3272. }
  3273. if (x.m_fPriority < y.m_fPriority)
  3274. {
  3275. return -1;
  3276. }
  3277. if (x.m_fPriority > y.m_fPriority)
  3278. {
  3279. return 1;
  3280. }
  3281. return 0;
  3282. });
  3283. }
  3284. public bool Compare(SceneEdit.SMenuItem item)
  3285. {
  3286. bool flag = true;
  3287. flag |= (this.m_strMenuName == item.m_strMenuName);
  3288. flag |= (this.m_strInfo == item.m_strInfo);
  3289. flag |= (this.m_mpn == item.m_mpn);
  3290. flag |= (this.m_strCateName == item.m_strCateName);
  3291. flag |= (this.m_eColorSetMPN == item.m_eColorSetMPN);
  3292. flag |= (this.m_strMenuNameInColorSet == item.m_strMenuNameInColorSet);
  3293. flag |= (this.m_pcMultiColorID == item.m_pcMultiColorID);
  3294. flag |= (this.m_boDelOnly == item.m_boDelOnly);
  3295. flag |= (this.m_fPriority == item.m_fPriority);
  3296. flag |= (this.m_bMan == item.m_bMan);
  3297. return flag | this.m_bOld == item.m_bOld;
  3298. }
  3299. public SceneEdit.SPartsType m_ParentPartsType;
  3300. public string m_strCateName;
  3301. public string m_strMenuName = string.Empty;
  3302. public bool m_requestNewFace;
  3303. public MPN m_mpn;
  3304. public bool m_bColor;
  3305. public MPN m_eColorSetMPN;
  3306. public string m_strMenuNameInColorSet;
  3307. public List<SceneEdit.SMenuItem> m_listColorSet = new List<SceneEdit.SMenuItem>();
  3308. public MaidParts.PARTS_COLOR m_pcMultiColorID = MaidParts.PARTS_COLOR.NONE;
  3309. public float m_fPriority;
  3310. public bool m_bMan;
  3311. public bool m_bOld;
  3312. public bool m_boDelOnly;
  3313. public string m_strInfo = string.Empty;
  3314. public Texture2D m_texIcon;
  3315. public Texture2D m_texIconRandomColor;
  3316. public string m_strMenuFileName;
  3317. public int m_nMenuFileRID;
  3318. public int m_nSliderValue;
  3319. public GameObject m_goButton;
  3320. public bool m_bMod;
  3321. public bool m_bGroupLeader;
  3322. public List<SceneEdit.SMenuItem> m_listMember;
  3323. public bool m_bMember;
  3324. public SceneEdit.SMenuItem m_leaderMenu;
  3325. }
  3326. public class SPartsType : IDisposable
  3327. {
  3328. public SPartsType(SceneEditInfo.CCateNameType.EType f_eType, MPN f_mpn, string f_strPartsTypeName, string f_ePartsType)
  3329. {
  3330. this.m_nIdx = SceneEditInfo.m_dicPartsTypePair[f_mpn].m_nIdx;
  3331. this.m_eType = f_eType;
  3332. this.m_mpn = f_mpn;
  3333. this.m_strPartsTypeName = f_strPartsTypeName;
  3334. this.m_ePartsType = f_ePartsType;
  3335. this.m_isEnabled = true;
  3336. }
  3337. public void Dispose()
  3338. {
  3339. for (int i = 0; i < this.m_listMenu.Count; i++)
  3340. {
  3341. this.m_listMenu[i].Dispose();
  3342. }
  3343. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3344. UnityEngine.Object.DestroyImmediate(this.m_goPanelMenu);
  3345. }
  3346. public void SortItem()
  3347. {
  3348. this.m_listMenu.Sort(delegate(SceneEdit.SMenuItem x, SceneEdit.SMenuItem y)
  3349. {
  3350. if (x.m_fPriority == y.m_fPriority)
  3351. {
  3352. int num = x.m_strMenuName.CompareTo(y.m_strMenuName);
  3353. if (num == 0)
  3354. {
  3355. return 0;
  3356. }
  3357. if (num > 0)
  3358. {
  3359. return 1;
  3360. }
  3361. if (num < 0)
  3362. {
  3363. return -1;
  3364. }
  3365. return 0;
  3366. }
  3367. else
  3368. {
  3369. if (x.m_fPriority > y.m_fPriority)
  3370. {
  3371. return 1;
  3372. }
  3373. if (x.m_fPriority < y.m_fPriority)
  3374. {
  3375. return -1;
  3376. }
  3377. return 0;
  3378. }
  3379. });
  3380. for (int i = 0; i < this.m_listMenu.Count; i++)
  3381. {
  3382. this.m_listMenu[i].SortColorItem();
  3383. }
  3384. }
  3385. public SceneEditInfo.CCateNameType.EType m_eType;
  3386. public int m_nIdx;
  3387. public string m_strPartsTypeName;
  3388. public MPN m_mpn;
  3389. public string m_ePartsType;
  3390. public bool m_isEnabled;
  3391. public List<SceneEdit.SMenuItem> m_listMenu = new List<SceneEdit.SMenuItem>();
  3392. public GameObject m_goButton;
  3393. public GameObject m_goPanelMenu;
  3394. }
  3395. public class SCategory : IDisposable
  3396. {
  3397. public SCategory(string f_strCateName, SceneEditInfo.EMenuCategory f_eCategory)
  3398. {
  3399. this.m_strCateName = f_strCateName;
  3400. this.m_eCategory = f_eCategory;
  3401. this.m_isEnabled = true;
  3402. }
  3403. public void Dispose()
  3404. {
  3405. foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
  3406. {
  3407. spartsType.Dispose();
  3408. }
  3409. UnityEngine.Object.DestroyImmediate(this.m_goButton);
  3410. UnityEngine.Object.DestroyImmediate(this.m_goPanelPartsType);
  3411. }
  3412. public void SortPartsType()
  3413. {
  3414. this.m_listPartsType.Sort(delegate(SceneEdit.SPartsType x, SceneEdit.SPartsType y)
  3415. {
  3416. if (x.m_nIdx == y.m_nIdx)
  3417. {
  3418. return 0;
  3419. }
  3420. if (x.m_nIdx < y.m_nIdx)
  3421. {
  3422. return -1;
  3423. }
  3424. if (x.m_nIdx > y.m_nIdx)
  3425. {
  3426. return 1;
  3427. }
  3428. return 0;
  3429. });
  3430. }
  3431. public void SortItem()
  3432. {
  3433. foreach (SceneEdit.SPartsType spartsType in this.m_listPartsType)
  3434. {
  3435. spartsType.SortItem();
  3436. }
  3437. }
  3438. public SceneEditInfo.EMenuCategory m_eCategory;
  3439. public string m_strCateName;
  3440. public GameObject m_goButton;
  3441. public GameObject m_goPanelPartsType;
  3442. public bool m_isEnabled;
  3443. public List<SceneEdit.SPartsType> m_listPartsType = new List<SceneEdit.SPartsType>();
  3444. }
  3445. private class UIPanelSet
  3446. {
  3447. public UIPanelSet(GameObject f_goUIRoot, string f_strPath)
  3448. {
  3449. this.goMain = UTY.GetChildObject(f_goUIRoot, f_strPath, false);
  3450. GameObject childObject = UTY.GetChildObject(this.goMain, "Scroll View", false);
  3451. this.gcScrollView = childObject.GetComponent<UIScrollView>();
  3452. this.goGrid = UTY.GetChildObject(childObject, "UIGrid", false);
  3453. this.gcUIGrid = this.goGrid.GetComponentsInChildren<UIGrid>(true)[0];
  3454. this.goScrollBar = UTY.GetChildObject(this.goMain, "Scroll Bar", false);
  3455. this.gcScrollBar = this.goScrollBar.GetComponent<UIScrollBar>();
  3456. this.goDragMat = UTY.GetChildObject(this.goMain, "DragMat", false);
  3457. this.goArrow = UTY.GetChildObject(this.goMain, "Arrow", false);
  3458. this.goArrow.SetActive(false);
  3459. }
  3460. public void SetActive(bool f_bActive)
  3461. {
  3462. this.goMain.SetActive(f_bActive);
  3463. }
  3464. public void ResetScrollPos(float f_fPos = 0.5f)
  3465. {
  3466. this.gcUIGrid.Reposition();
  3467. this.gcScrollView.ResetPosition();
  3468. this.gcScrollBar.value = f_fPos;
  3469. }
  3470. public void VisibleArrow(bool f_bActive)
  3471. {
  3472. this.goArrow.SetActive(f_bActive);
  3473. }
  3474. public void MoveArrow(GameObject f_goCurrentBtn)
  3475. {
  3476. if (this.goArrow == null)
  3477. {
  3478. return;
  3479. }
  3480. Transform parent = f_goCurrentBtn.transform.parent;
  3481. Vector3 position = parent.TransformPoint(new Vector3(0f, 0f, 0f));
  3482. Vector3 localPosition = this.goMain.transform.InverseTransformPoint(position);
  3483. localPosition.x = this.goArrow.transform.localPosition.x;
  3484. localPosition.y += 18f;
  3485. this.goArrow.transform.localPosition = localPosition;
  3486. }
  3487. public GameObject goMain;
  3488. public GameObject goGrid;
  3489. public UIGrid gcUIGrid;
  3490. public GameObject goScrollBar;
  3491. public UIScrollView gcScrollView;
  3492. public UIScrollBar gcScrollBar;
  3493. public GameObject goDragMat;
  3494. private GameObject goArrow;
  3495. }
  3496. private class MenuItemSet
  3497. {
  3498. public MenuItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi, string f_strPrefabName, bool f_bSelectedFrame)
  3499. {
  3500. this.mi = f_mi;
  3501. this.m_bSelectedFrame = f_bSelectedFrame;
  3502. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/" + f_strPrefabName);
  3503. this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3504. this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
  3505. this.gcBtnEdit.m_MenuItem = f_mi;
  3506. this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
  3507. this.goFrame.SetActive(false);
  3508. this.goOld = UTY.GetChildObject(this.goItem, "Old", false);
  3509. this.goOld.SetActive(f_mi.m_bOld);
  3510. this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
  3511. this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
  3512. if (f_mi.m_texIconRef != null)
  3513. {
  3514. 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));
  3515. this.gcBtn.normalSprite2D = normalSprite2D;
  3516. }
  3517. }
  3518. public void ToSmall()
  3519. {
  3520. if (this.gcBtnEdit.m_MenuItem.m_texIconRef.width == 138 && this.gcBtnEdit.m_MenuItem.m_texIconRef.height == 200)
  3521. {
  3522. this.gcBtn.GetComponent<UI2DSprite>().SetDimensions(80, 116);
  3523. this.gcBtn.GetComponent<BoxCollider>().size = new Vector3(80f, 116f, 0f);
  3524. this.goOld.GetComponent<UISprite>().ResetAnchors();
  3525. }
  3526. }
  3527. public void Clear()
  3528. {
  3529. if (this.goItem != null)
  3530. {
  3531. UnityEngine.Object.DestroyImmediate(this.goItem);
  3532. }
  3533. }
  3534. public void Selected(bool f_bSelect)
  3535. {
  3536. if (this.m_bSelectedFrame)
  3537. {
  3538. this.goFrame.SetActive(f_bSelect);
  3539. }
  3540. }
  3541. public GameObject goItem;
  3542. public ButtonEdit gcBtnEdit;
  3543. private GameObject goFrame;
  3544. private GameObject goOld;
  3545. public UIButton gcBtn;
  3546. public UIEventTrigger gcEvent;
  3547. public SceneEdit.SMenuItem mi;
  3548. private bool m_bSelectedFrame = true;
  3549. }
  3550. private class ColorItemSet
  3551. {
  3552. public ColorItemSet(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
  3553. {
  3554. this.mi = f_mi;
  3555. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/ButtonColor");
  3556. this.goItem = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3557. this.goFrame = UTY.GetChildObject(this.goItem, "Frame", false);
  3558. this.gcBtnEdit = this.goItem.GetComponentsInChildren<ButtonEdit>(true)[0];
  3559. this.gcBtnEdit.m_MenuItem = f_mi;
  3560. this.gcBtn = this.goItem.GetComponentsInChildren<UIButton>(true)[0];
  3561. this.gcEvent = this.goItem.GetComponentsInChildren<UIEventTrigger>(true)[0];
  3562. NDebug.Assert(f_mi.m_texIconRef != null, "アイコンテクスチャがありません。" + f_mi.m_strMenuFileName);
  3563. if (f_mi.m_texIconRef != null)
  3564. {
  3565. 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));
  3566. this.gcBtn.normalSprite2D = normalSprite2D;
  3567. }
  3568. }
  3569. public void Clear()
  3570. {
  3571. if (this.goItem != null)
  3572. {
  3573. UnityEngine.Object.DestroyImmediate(this.goItem);
  3574. }
  3575. }
  3576. public void Selected(bool f_bSelect)
  3577. {
  3578. this.goFrame.SetActive(f_bSelect);
  3579. }
  3580. public GameObject goItem;
  3581. public ButtonEdit gcBtnEdit;
  3582. private GameObject goFrame;
  3583. public UIButton gcBtn;
  3584. public UIEventTrigger gcEvent;
  3585. public SceneEdit.SMenuItem mi;
  3586. }
  3587. private class SliderItemSet
  3588. {
  3589. public virtual bool isEnabled
  3590. {
  3591. set
  3592. {
  3593. this.gcSlider.enabled = value;
  3594. this.gcSlider.GetComponent<UIButton>().isEnabled = value;
  3595. this.gcSlider.thumb.GetComponent<UIButton>().isEnabled = value;
  3596. }
  3597. }
  3598. public virtual void Create(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
  3599. {
  3600. this.mpn = f_mi.m_mpn;
  3601. UnityEngine.Object @object = Resources.Load("SceneEdit/MainMenu/Prefab/Slider");
  3602. this.goMain = NGUITools.AddChild(f_goParentGrid, @object as GameObject);
  3603. this.gcSlider = this.goMain.GetComponentsInChildren<UISlider>(true)[0];
  3604. GameObject childObject = UTY.GetChildObject(this.goMain, "CategoryTitle/Name", false);
  3605. this.gcLabel = childObject.GetComponent<UILabel>();
  3606. Localize localize = this.gcLabel.gameObject.AddComponent<Localize>();
  3607. localize.SetTerm("SceneEdit/カテゴリー/スライダー/" + f_mi.m_strMenuName);
  3608. GameObject childObject2 = UTY.GetChildObject(this.goMain, "CategoryTitle/Number/Value", false);
  3609. this.gcValue = childObject2.GetComponent<UILabel>();
  3610. this.gcValue.text = "000";
  3611. this.goMain.name = this.goMain.name + f_mi.m_strMenuName;
  3612. this.gcBtnEdit = this.goMain.GetComponentsInChildren<ButtonEdit>(true)[0];
  3613. this.gcBtnEdit.m_SliderItem = f_mi;
  3614. }
  3615. public virtual void Clear()
  3616. {
  3617. if (this.goMain != null)
  3618. {
  3619. UnityEngine.Object.DestroyImmediate(this.goMain);
  3620. }
  3621. }
  3622. public virtual void SetValue(float f_fValue, string f_strValue = null)
  3623. {
  3624. this.gcSlider.value = f_fValue;
  3625. if (f_strValue == null)
  3626. {
  3627. this.gcValue.text = f_fValue.ToString();
  3628. }
  3629. else
  3630. {
  3631. this.gcValue.text = f_strValue;
  3632. }
  3633. }
  3634. public GameObject goMain;
  3635. public UISlider gcSlider;
  3636. public UILabel gcLabel;
  3637. public UILabel gcValue;
  3638. public ButtonEdit gcBtnEdit;
  3639. protected MPN mpn;
  3640. }
  3641. private class SwitchItemSet : SceneEdit.SliderItemSet
  3642. {
  3643. public override void Create(GameObject f_goParentGrid, SceneEdit.SMenuItem f_mi)
  3644. {
  3645. this.mpn = f_mi.m_mpn;
  3646. this.goMain = Utility.CreatePrefab(f_goParentGrid, "SceneEdit/MainMenu/Prefab/Switch", true);
  3647. this.gcBtnEdit = this.goMain.GetComponentsInChildren<ButtonEdit>(true)[0];
  3648. this.tabPanel = UTY.GetChildObject(this.goMain, "CategoryBtns", false).GetComponent<UIWFTabPanel>();
  3649. this.buttonAri = UTY.GetChildObject(this.tabPanel.gameObject, "ButtonAri/Button", false).GetComponent<UIWFTabButton>();
  3650. this.buttonNasi = UTY.GetChildObject(this.tabPanel.gameObject, "ButtonNasi/Button", false).GetComponent<UIWFTabButton>();
  3651. this.gcBtnEdit.m_SliderItem = f_mi;
  3652. this.tabPanel.UpdateChildren();
  3653. EventDelegate.Add(this.buttonAri.onClick, delegate()
  3654. {
  3655. if (this.onClickEvent != null)
  3656. {
  3657. this.onClickEvent(false, this.gcBtnEdit.m_SliderItem);
  3658. }
  3659. });
  3660. EventDelegate.Add(this.buttonNasi.onClick, delegate()
  3661. {
  3662. if (this.onClickEvent != null)
  3663. {
  3664. this.onClickEvent(true, this.gcBtnEdit.m_SliderItem);
  3665. }
  3666. });
  3667. GameObject childObject = UTY.GetChildObject(this.goMain, "CategoryTitle/Name", false);
  3668. this.gcLabel = childObject.GetComponent<UILabel>();
  3669. Localize localize = this.gcLabel.gameObject.AddComponent<Localize>();
  3670. localize.SetTerm("SceneEdit/カテゴリー/スライダー/" + f_mi.m_strMenuName);
  3671. }
  3672. public override void SetValue(float f_fValue, string f_strValue = null)
  3673. {
  3674. UIWFTabButton uiwftabButton = (f_fValue != 0f) ? this.buttonNasi : this.buttonAri;
  3675. if (!uiwftabButton.isSelected)
  3676. {
  3677. this.tabPanel.Select(uiwftabButton);
  3678. }
  3679. }
  3680. private UIWFTabPanel tabPanel;
  3681. private UIWFTabButton buttonAri;
  3682. private UIWFTabButton buttonNasi;
  3683. public Action<bool, SceneEdit.SMenuItem> onClickEvent;
  3684. }
  3685. [Serializable]
  3686. public struct SubPropMpnData
  3687. {
  3688. public MPN mpn
  3689. {
  3690. get
  3691. {
  3692. return this.manager.targetMpn;
  3693. }
  3694. }
  3695. public SubSlotEditManager manager;
  3696. }
  3697. public class PVBInfo
  3698. {
  3699. public string strIconName;
  3700. public Texture2D texIcon;
  3701. }
  3702. public class VoiceInfo : SceneEdit.PVBInfo
  3703. {
  3704. public string strVoiceFileName;
  3705. public Personal.Data personal;
  3706. public string strFace;
  3707. public string strFace2;
  3708. }
  3709. public enum CAM_OFFS
  3710. {
  3711. CENTER,
  3712. RIGHT,
  3713. RIGHT_MORE
  3714. }
  3715. }