SceneEdit.cs 113 KB

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