SceneEdit.cs 121 KB

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