SceneEdit.cs 125 KB

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