SceneEdit.cs 119 KB

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