Menu.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Runtime.CompilerServices;
  7. using System.Text;
  8. using System.Text.RegularExpressions;
  9. using UnityEngine;
  10. public class Menu : MonoBehaviour
  11. {
  12. public static string[] GetModFiles()
  13. {
  14. string fullPath = Path.GetFullPath(".\\");
  15. string path = fullPath + "Mod";
  16. if (!Directory.Exists(path))
  17. {
  18. return null;
  19. }
  20. return Directory.GetFiles(path, "mod_*.mod", SearchOption.AllDirectories);
  21. }
  22. public static string GetModPathFileName(string f_strMenuFileName)
  23. {
  24. string[] modFiles = Menu.GetModFiles();
  25. if (modFiles == null)
  26. {
  27. NDebug.MessageBox("MODエラー", "MODフォルダが無いか、MODフォルダにMODファイルが1つもありません。\n" + f_strMenuFileName);
  28. return string.Empty;
  29. }
  30. string text = Array.Find<string>(modFiles, (string a) => Path.GetFileName(a).ToLower() == f_strMenuFileName.ToLower());
  31. if (string.IsNullOrEmpty(text))
  32. {
  33. NDebug.MessageBox("MODエラー", "MODフォルダにMODファイルが見つかりません。\n" + f_strMenuFileName);
  34. return string.Empty;
  35. }
  36. return text;
  37. }
  38. public static bool ProcScript(Maid maid, string filename, bool f_bTemp = false, SubProp f_SubProp = null)
  39. {
  40. bool flag = false;
  41. string text = string.Empty;
  42. byte[] array = null;
  43. if (filename.IndexOf("mod_") == 0)
  44. {
  45. flag = true;
  46. text = Menu.GetModPathFileName(filename);
  47. if (string.IsNullOrEmpty(text))
  48. {
  49. return false;
  50. }
  51. filename = Menu.GetBaseItemFromMod(text);
  52. try
  53. {
  54. using (FileStream fileStream = new FileStream(text, FileMode.Open))
  55. {
  56. if (fileStream == null)
  57. {
  58. Debug.LogWarning("MODアイテムメニューファイルが見つかりません。" + filename);
  59. return false;
  60. }
  61. array = new byte[fileStream.Length];
  62. fileStream.Read(array, 0, (int)fileStream.Length);
  63. }
  64. }
  65. catch (Exception ex)
  66. {
  67. Debug.LogError("ProcScript MODアイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
  68. return false;
  69. }
  70. }
  71. byte[] cd = null;
  72. try
  73. {
  74. using (AFileBase afileBase = GameUty.FileOpen(filename, null))
  75. {
  76. if (afileBase == null || !afileBase.IsValid())
  77. {
  78. Debug.LogError("アイテムメニューファイルが見つかりません。" + filename);
  79. return false;
  80. }
  81. cd = afileBase.ReadAll();
  82. }
  83. }
  84. catch (Exception ex2)
  85. {
  86. Debug.LogError("ProcScript アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex2.Message);
  87. return false;
  88. }
  89. Menu.ProcScriptBin(maid, cd, filename, f_bTemp, f_SubProp);
  90. if (flag)
  91. {
  92. Menu.ProcModScriptBin(maid, array, text, false);
  93. }
  94. return true;
  95. }
  96. private static void ProcScriptBin(Maid maid, byte[] cd, string filename, bool f_bTemp = false, SubProp f_SubProp = null)
  97. {
  98. TBody body = maid.body0;
  99. List<Menu.LastParam> list = new List<Menu.LastParam>();
  100. BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
  101. string text = binaryReader.ReadString();
  102. NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin 例外 : ヘッダーファイルが不正です。" + text);
  103. int num = binaryReader.ReadInt32();
  104. string str = binaryReader.ReadString();
  105. string text2 = binaryReader.ReadString();
  106. string text3 = binaryReader.ReadString();
  107. string text4 = binaryReader.ReadString();
  108. long num2 = (long)binaryReader.ReadInt32();
  109. bool flag = false;
  110. string text5 = string.Empty;
  111. string text6 = string.Empty;
  112. string text7 = string.Empty;
  113. string slotname = string.Empty;
  114. for (;;)
  115. {
  116. try
  117. {
  118. for (;;)
  119. {
  120. IL_90:
  121. int num3 = (int)binaryReader.ReadByte();
  122. text6 = text5;
  123. text5 = string.Empty;
  124. if (num3 == 0)
  125. {
  126. break;
  127. }
  128. for (int i = 0; i < num3; i++)
  129. {
  130. text5 = text5 + "\"" + binaryReader.ReadString() + "\" ";
  131. }
  132. if (!(text5 == string.Empty))
  133. {
  134. goto IL_F5;
  135. }
  136. }
  137. break;
  138. IL_F5:
  139. string stringCom = UTY.GetStringCom(text5);
  140. string[] stringList = UTY.GetStringList(text5);
  141. if (stringCom == "end")
  142. {
  143. break;
  144. }
  145. if (stringCom == "name")
  146. {
  147. goto IL_1013;
  148. }
  149. if (stringCom == "アイテム")
  150. {
  151. Menu.SetMaidItemTemp(maid, stringList[1], f_bTemp);
  152. goto IL_1013;
  153. }
  154. if (stringCom == "アイテム条件")
  155. {
  156. string slotname2 = stringList[1];
  157. if (stringList[2] == "に何か")
  158. {
  159. bool flag2 = false;
  160. TBodySkin slot = body.GetSlot(slotname2);
  161. if (stringList[3] == "有る")
  162. {
  163. if (slot.obj != null)
  164. {
  165. flag2 = true;
  166. }
  167. }
  168. else if (stringList[3] == "無い")
  169. {
  170. if (slot.obj == null)
  171. {
  172. flag2 = true;
  173. }
  174. }
  175. else
  176. {
  177. NDebug.Assert("アイテム条件が不正です。「有る」か「無い」かを指定してください。\n" + text5, false);
  178. }
  179. if (stringList[4] == "なら")
  180. {
  181. if (flag2)
  182. {
  183. Menu.SetMaidItemTemp(maid, stringList[5], f_bTemp);
  184. goto IL_222;
  185. }
  186. goto IL_222;
  187. IL_222:
  188. goto IL_239;
  189. }
  190. NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text5, false);
  191. goto IL_239;
  192. IL_239:
  193. goto IL_36D;
  194. }
  195. if (stringList[2] == "が")
  196. {
  197. bool flag3 = false;
  198. TBodySkin slot2 = body.GetSlot(slotname2);
  199. if (slot2.m_strModelFileName == stringList[3])
  200. {
  201. flag3 = true;
  202. }
  203. if (stringList[4] == "なら")
  204. {
  205. if (flag3)
  206. {
  207. Menu.SetMaidItemTemp(maid, stringList[5], f_bTemp);
  208. goto IL_29E;
  209. }
  210. goto IL_29E;
  211. IL_29E:
  212. goto IL_2B5;
  213. }
  214. NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text5, false);
  215. goto IL_2B5;
  216. IL_2B5:
  217. goto IL_36D;
  218. }
  219. if (!(stringList[2] == "のアイテムパラメータの"))
  220. {
  221. goto IL_36D;
  222. }
  223. bool flag4 = false;
  224. TBodySkin slot3 = body.GetSlot(slotname2);
  225. string param = slot3.GetParam(stringList[3].ToLower());
  226. if (stringList[4] == "が")
  227. {
  228. if (stringList[5].ToLower() == param)
  229. {
  230. flag4 = true;
  231. }
  232. }
  233. else
  234. {
  235. NDebug.Assert("アイテム条件が不正です。「が」が必要です。\n" + text5, false);
  236. }
  237. if (stringList[6] == "なら")
  238. {
  239. if (flag4)
  240. {
  241. Menu.SetMaidItemTemp(maid, stringList[7], f_bTemp);
  242. goto IL_356;
  243. }
  244. goto IL_356;
  245. IL_356:
  246. goto IL_36D;
  247. }
  248. NDebug.Assert("アイテム条件が不正です。「なら」が必要です。\n" + text5, false);
  249. goto IL_36D;
  250. IL_36D:
  251. goto IL_1013;
  252. }
  253. if (stringCom == "アイテムパラメータ")
  254. {
  255. if (stringList.Length == 4)
  256. {
  257. string text8 = stringList[1];
  258. string text9 = stringList[2].ToLower();
  259. string text10 = stringList[3].ToLower();
  260. list.Add(new Menu.LastParam(0, stringCom, new string[]
  261. {
  262. text8,
  263. text9,
  264. text10
  265. }));
  266. goto IL_3E2;
  267. }
  268. Debug.LogError("アイテムパラメータ 命令の引数が不正です。SlotNameを明示的に指定しする必要があります。アイテムパラメータ <スロット名> <変数名> <値> の順です。" + text5);
  269. goto IL_3E2;
  270. IL_3E2:
  271. goto IL_1013;
  272. }
  273. if (stringCom == "半脱ぎ" || stringCom == "リソース参照")
  274. {
  275. string key;
  276. string value;
  277. if (stringCom == "半脱ぎ")
  278. {
  279. key = "半脱ぎ";
  280. value = stringList[1];
  281. }
  282. else
  283. {
  284. key = stringList[1];
  285. value = stringList[2];
  286. }
  287. int hashCode = Path.GetFileName(filename.ToLower()).ToLower().GetHashCode();
  288. SortedDictionary<string, string> sortedDictionary;
  289. if (Menu.m_dicResourceRef.TryGetValue(hashCode, out sortedDictionary))
  290. {
  291. string empty = string.Empty;
  292. if (sortedDictionary.TryGetValue(key, out empty))
  293. {
  294. sortedDictionary[key] = value;
  295. goto IL_494;
  296. }
  297. sortedDictionary.Add(key, value);
  298. goto IL_494;
  299. IL_494:
  300. goto IL_4B9;
  301. }
  302. sortedDictionary = new SortedDictionary<string, string>();
  303. sortedDictionary.Add(key, value);
  304. Menu.m_dicResourceRef.Add(hashCode, sortedDictionary);
  305. goto IL_4B9;
  306. IL_4B9:
  307. goto IL_1013;
  308. }
  309. if (stringCom == "set")
  310. {
  311. goto IL_1013;
  312. }
  313. if (stringCom == "setname")
  314. {
  315. goto IL_1013;
  316. }
  317. if (stringCom == "setslotitem")
  318. {
  319. string tag = stringList[1];
  320. uint val = uint.Parse(stringList[2]);
  321. maid.SetProp(tag, (int)val, false);
  322. goto IL_1013;
  323. }
  324. if (stringCom == "additem")
  325. {
  326. string text11 = text7;
  327. if (stringList.Length > 1)
  328. {
  329. text11 = stringList[2];
  330. }
  331. slotname = text11;
  332. if (text11 == "body")
  333. {
  334. body.LoadBody_R(stringList[1], maid);
  335. }
  336. string attachSlot = string.Empty;
  337. string attachName = string.Empty;
  338. if (stringList.Length == 6)
  339. {
  340. if (stringList[3] == "アタッチ")
  341. {
  342. attachSlot = stringList[4];
  343. attachName = stringList[5];
  344. }
  345. }
  346. else if (stringList.Length == 5 && stringList[3] == "ボーンにアタッチ")
  347. {
  348. attachSlot = "ボーンにアタッチ";
  349. attachName = stringList[4];
  350. }
  351. if (text11 == "handitemr")
  352. {
  353. attachSlot = "ボーンにアタッチ";
  354. attachName = "_IK_handR";
  355. }
  356. if (text11 == "handiteml")
  357. {
  358. attachSlot = "ボーンにアタッチ";
  359. attachName = "_IK_handL";
  360. }
  361. body.AddItem((MPN)Enum.Parse(typeof(MPN), text7, true), text11, stringList[1], attachSlot, attachName, f_bTemp);
  362. body.SetVisibleNodeSlot(text11, true, "_ALL_");
  363. goto IL_1013;
  364. }
  365. if (stringCom == "saveitem")
  366. {
  367. text3 = stringList[1];
  368. goto IL_1013;
  369. }
  370. if (stringCom == "category")
  371. {
  372. text7 = stringList[1];
  373. goto IL_1013;
  374. }
  375. if (stringCom == "maskitem")
  376. {
  377. if (stringList.Length > 1)
  378. {
  379. string maskslot = stringList[1];
  380. body.AddMask(text7, maskslot);
  381. goto IL_6A3;
  382. }
  383. goto IL_6A3;
  384. IL_6A3:
  385. goto IL_1013;
  386. }
  387. if (stringCom == "delitem")
  388. {
  389. string slotname3 = text7;
  390. if (stringList.Length > 1)
  391. {
  392. slotname3 = stringList[1];
  393. }
  394. body.DelItem((MPN)Enum.Parse(typeof(MPN), text7, true), slotname3);
  395. goto IL_1013;
  396. }
  397. if (stringCom == "node消去")
  398. {
  399. body.SetVisibleNodeSlot(text7, false, stringList[1]);
  400. goto IL_1013;
  401. }
  402. if (stringCom == "node表示")
  403. {
  404. body.SetVisibleNodeSlot(text7, true, stringList[1]);
  405. goto IL_1013;
  406. }
  407. if (stringCom == "パーツnode消去")
  408. {
  409. body.SetVisibleNodeSlotParts(text7, stringList[1], false, stringList[2]);
  410. goto IL_1013;
  411. }
  412. if (stringCom == "パーツnode表示")
  413. {
  414. body.SetVisibleNodeSlotParts(text7, stringList[1], true, stringList[2]);
  415. goto IL_1013;
  416. }
  417. if (stringCom == "color")
  418. {
  419. string name = stringList[1];
  420. int matno = int.Parse(stringList[2]);
  421. string prop_name = stringList[3];
  422. Color col = new Color(float.Parse(stringList[4]) / 255f, float.Parse(stringList[5]) / 255f, float.Parse(stringList[6]) / 255f, float.Parse(stringList[7]) / 255f);
  423. body.ChangeCol(name, matno, prop_name, col);
  424. goto IL_1013;
  425. }
  426. if (stringCom == "mancolor")
  427. {
  428. Color manColor = new Color(float.Parse(stringList[1]) / 255f, float.Parse(stringList[2]) / 255f, float.Parse(stringList[3]) / 255f, 1f);
  429. maid.ManColor = manColor;
  430. maid.ManColorUpdate();
  431. goto IL_1013;
  432. }
  433. if (stringCom == "tex" || stringCom == "テクスチャ変更")
  434. {
  435. string text12 = stringList[1];
  436. int matno2 = int.Parse(stringList[2]);
  437. string prop_name2 = stringList[3];
  438. string filename2 = stringList[4];
  439. MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
  440. if (stringList.Length == 6)
  441. {
  442. string text13 = stringList[5];
  443. try
  444. {
  445. parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text13.ToUpper());
  446. }
  447. catch
  448. {
  449. NDebug.Assert("無限色IDがありません。" + text13, false);
  450. }
  451. }
  452. body.ChangeTex(text12, matno2, prop_name2, filename2, null, parts_COLOR);
  453. if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
  454. {
  455. maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
  456. }
  457. if ((text7 == "skin" || text7 == "haircolor") && !flag)
  458. {
  459. body.RestoreShader(text12);
  460. goto IL_950;
  461. }
  462. goto IL_950;
  463. IL_950:
  464. goto IL_1013;
  465. }
  466. if (stringCom == "prop")
  467. {
  468. string tag2 = stringList[1];
  469. string s = stringList[2];
  470. maid.SetProp(tag2, int.Parse(s), false);
  471. goto IL_1013;
  472. }
  473. if (stringCom == "テクスチャ乗算")
  474. {
  475. goto IL_1013;
  476. }
  477. if (stringCom == "テクスチャ合成")
  478. {
  479. if (stringList.Length != 7)
  480. {
  481. NDebug.Assert("テクスチャ合成 の引数が不正です。" + stringList.Length, false);
  482. }
  483. if ((text7 == "accTatoo" || text7 == "hokuro") && !filename.Contains("_del"))
  484. {
  485. body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), true, 0, 0, 0f, 0f, true, f_SubProp, 1f, 1024);
  486. goto IL_AB3;
  487. }
  488. body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), false, 0, 0, 0f, 0f, false, null, 1f, 1024);
  489. goto IL_AB3;
  490. IL_AB3:
  491. goto IL_1013;
  492. }
  493. if (stringCom == "テクスチャセット合成")
  494. {
  495. if (stringList.Length != 7)
  496. {
  497. NDebug.Assert("テクスチャセット合成 の引数が不正です。" + stringList.Length, false);
  498. }
  499. body.MulTexSet(stringList[1], int.Parse(stringList[2]), stringList[3], int.Parse(stringList[4]), stringList[5], (GameUty.SystemMaterial)Enum.Parse(typeof(GameUty.SystemMaterial), stringList[6]), true, 0, 0, 0f, 0f, true, null, 1f, 1024);
  500. goto IL_1013;
  501. }
  502. if (stringCom == "マテリアル変更")
  503. {
  504. string f_strSlotName = stringList[1];
  505. int f_nMatNo = int.Parse(stringList[2]);
  506. string f_strFileName = stringList[3];
  507. body.ChangeMaterial(f_strSlotName, f_nMatNo, f_strFileName);
  508. goto IL_1013;
  509. }
  510. if (stringCom == "shader")
  511. {
  512. string f_strSlotName2 = stringList[1];
  513. int f_nMatNo2 = int.Parse(stringList[2]);
  514. string f_strShaderFileName = stringList[3];
  515. body.ChangeShader(f_strSlotName2, f_nMatNo2, f_strShaderFileName);
  516. flag = true;
  517. goto IL_1013;
  518. }
  519. if (stringCom == "アタッチポイントの設定")
  520. {
  521. if (stringList.Length < 5)
  522. {
  523. Debug.LogError("アタッチポイントの設定引数の数が不正です。 " + text5 + " " + str);
  524. goto IL_C76;
  525. }
  526. Vector3 v = new Vector3(float.Parse(stringList[2]), float.Parse(stringList[3]), float.Parse(stringList[4]));
  527. Quaternion q = Quaternion.identity;
  528. if (stringList.Length == 8)
  529. {
  530. q = Quaternion.Euler(float.Parse(stringList[5]), float.Parse(stringList[6]), float.Parse(stringList[7]));
  531. }
  532. else
  533. {
  534. Debug.LogError("アタッチポイントの設定引数に角度指定がありません。 " + text5 + " " + str);
  535. }
  536. body.SetAttachPoint(slotname, stringList[1], v, q, f_bTemp);
  537. goto IL_C76;
  538. IL_C76:
  539. goto IL_1013;
  540. }
  541. if (stringCom == "blendset")
  542. {
  543. string blendSetName = stringList[1];
  544. int num4 = (stringList.Length - 2) / 2;
  545. body.Face.morph.NewBlendSet(blendSetName);
  546. for (int j = 0; j < num4; j++)
  547. {
  548. string tag3 = stringList[2 + j * 2].ToLower();
  549. float val2 = float.Parse(stringList[3 + j * 2]);
  550. body.Face.morph.SetValueBlendSet(blendSetName, tag3, val2);
  551. }
  552. goto IL_1013;
  553. }
  554. if (stringCom == "paramset")
  555. {
  556. body.Face.NewParamSet(text5);
  557. goto IL_1013;
  558. }
  559. if (stringCom == "commenttype")
  560. {
  561. if (!maid.status.partsDic.ContainsKey(stringList[1]))
  562. {
  563. maid.status.partsDic.Add(stringList[1], string.Empty);
  564. }
  565. maid.status.partsDic[stringList[1]] = stringList[2];
  566. goto IL_1013;
  567. }
  568. if (stringCom == "useredit")
  569. {
  570. if (stringList[2].ToLower() == "material")
  571. {
  572. body.SetMaterialProperty(text7, stringList[3], int.Parse(stringList[4]), stringList[5], stringList[6], stringList[7], false);
  573. goto IL_DCE;
  574. }
  575. goto IL_DCE;
  576. IL_DCE:
  577. goto IL_1013;
  578. }
  579. if (stringCom == "bonemorph")
  580. {
  581. if (stringList.Length < 9)
  582. {
  583. Debug.LogError("BoneMorpの設定引数の数が不正です。 " + text5 + " " + str);
  584. }
  585. body.bonemorph.ChangeMorphPosValue(stringList[1], stringList[2], new Vector3(float.Parse(stringList[3]), float.Parse(stringList[4]), float.Parse(stringList[5])), new Vector3(float.Parse(stringList[6]), float.Parse(stringList[7]), float.Parse(stringList[8])));
  586. goto IL_1013;
  587. }
  588. if (stringCom == "length")
  589. {
  590. if (stringList.Length != 11)
  591. {
  592. Debug.LogError("lengthの設定引数の数が不正です。 " + text5 + " " + str);
  593. }
  594. body.SetHairLengthDataList(stringList[1], stringList[2], stringList[3], stringList[4], new Vector3(float.Parse(stringList[5]), float.Parse(stringList[6]), float.Parse(stringList[7])), new Vector3(float.Parse(stringList[8]), float.Parse(stringList[9]), float.Parse(stringList[10])));
  595. goto IL_1013;
  596. }
  597. if (stringCom == "anime")
  598. {
  599. if (stringList.Length < 3)
  600. {
  601. Debug.LogError("animeの設定引数の数が不正です。 " + text5 + " " + str);
  602. }
  603. TBody.SlotID f_slot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
  604. body.ItemAnimationLoad(f_slot, stringList[2]);
  605. bool f_bLoop = false;
  606. if (3 < stringList.Length)
  607. {
  608. f_bLoop = (stringList[3] == "loop");
  609. }
  610. body.ItemAnimationPlay(f_slot, stringList[2], f_bLoop);
  611. goto IL_1013;
  612. }
  613. if (stringCom == "param2")
  614. {
  615. if (stringList.Length == 4)
  616. {
  617. string slotname4 = stringList[1];
  618. body.GetSlot(slotname4).SetParam2(stringList[2], stringList[3]);
  619. goto IL_FCD;
  620. }
  621. Debug.LogError("param2の設定引数の数が不正です。 " + text5 + " " + str);
  622. goto IL_FCD;
  623. IL_FCD:
  624. goto IL_1013;
  625. }
  626. if (stringCom == "animematerial")
  627. {
  628. TBody.SlotID f_slot2 = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
  629. string s2 = stringList[2];
  630. body.MaterialAnimatorAdd(f_slot2, int.Parse(s2));
  631. goto IL_1013;
  632. }
  633. goto IL_1013;
  634. IL_1013:
  635. goto IL_1096;
  636. }
  637. catch (Exception ex)
  638. {
  639. Debug.LogError(string.Concat(new string[]
  640. {
  641. "Exception ",
  642. Path.GetFileName(filename),
  643. " 現在処理中だった行 = ",
  644. text5,
  645. " 以前の行 = ",
  646. text6,
  647. " ",
  648. ex.Message,
  649. "StackTrace:\n",
  650. ex.StackTrace
  651. }));
  652. NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(filename), true);
  653. goto IL_1096;
  654. }
  655. IL_1096:
  656. goto IL_90;
  657. }
  658. list.Sort((Menu.LastParam a, Menu.LastParam b) => a.nOrder - a.nOrder);
  659. for (int k = 0; k < list.Count; k++)
  660. {
  661. Menu.LastParam lastParam = list[k];
  662. if (lastParam.strComm == "アイテムパラメータ")
  663. {
  664. TBodySkin slot4 = body.GetSlot(lastParam.aryArgs[0]);
  665. slot4.SetParam(lastParam.aryArgs[1], lastParam.aryArgs[2]);
  666. }
  667. }
  668. binaryReader.Close();
  669. binaryReader = null;
  670. }
  671. public static void SetMaidItemTemp(Maid maid, string filename, bool f_bTemp = false)
  672. {
  673. byte[] buffer = null;
  674. try
  675. {
  676. using (AFileBase afileBase = GameUty.FileOpen(filename, null))
  677. {
  678. if (!afileBase.IsValid())
  679. {
  680. NDebug.Assert("メニューファイルが見つかりません。" + filename, false);
  681. }
  682. buffer = afileBase.ReadAll();
  683. }
  684. }
  685. catch (Exception ex)
  686. {
  687. Debug.LogError("ProcScriptBin/SetMaidItemTemp アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
  688. }
  689. BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8);
  690. string text = binaryReader.ReadString();
  691. NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin/SetMaidItemTemp 例外 : " + filename + " のヘッダーが不正です。" + text);
  692. int num = binaryReader.ReadInt32();
  693. string text2 = binaryReader.ReadString();
  694. string text3 = binaryReader.ReadString();
  695. string text4 = binaryReader.ReadString();
  696. if (text4 == "acctatoo")
  697. {
  698. maid.DelProp(MPN.acctatoo, false);
  699. maid.SetSubProp(MPN.acctatoo, 0, filename, 0);
  700. }
  701. else if (text4 == "hokuro")
  702. {
  703. maid.DelProp(MPN.hokuro, false);
  704. maid.SetSubProp(MPN.hokuro, 0, filename, 0);
  705. }
  706. else
  707. {
  708. maid.SetProp(text4, filename, 0, f_bTemp, false);
  709. }
  710. }
  711. public static bool ExportModScript(Maid maid, string filename, bool f_bTemp = false)
  712. {
  713. byte[] cd = null;
  714. try
  715. {
  716. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(filename))
  717. {
  718. if (!afileBase.IsValid())
  719. {
  720. Debug.LogWarning("アイテムメニューファイルが見つかりません。" + filename);
  721. return false;
  722. }
  723. cd = afileBase.ReadAll();
  724. }
  725. }
  726. catch (Exception ex)
  727. {
  728. Debug.LogError("ExportModScript アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
  729. }
  730. string fullPath = Path.GetFullPath(".\\");
  731. string text = fullPath + "ModExport";
  732. if (!Directory.Exists(text))
  733. {
  734. Directory.CreateDirectory(text);
  735. }
  736. string text2 = "mod_" + Path.GetFileNameWithoutExtension(filename);
  737. text2 = text2.Trim();
  738. text = text + "\\" + text2;
  739. if (!Directory.Exists(text))
  740. {
  741. Directory.CreateDirectory(text);
  742. }
  743. StreamWriter streamWriter = new StreamWriter(text + "\\" + text2 + ".txt", false, Encoding.UTF8);
  744. streamWriter.WriteLine("出力バージョン\t" + 1150);
  745. streamWriter.WriteLine("基本アイテム\t" + filename.Replace(" ", ":"));
  746. try
  747. {
  748. Menu.ExportModScript(maid, cd, streamWriter, text + "\\" + text2, f_bTemp);
  749. NUty.WinMessageBox(NUty.GetWindowHandle(), string.Concat(new string[]
  750. {
  751. "MODテンプレート出力完了\n",
  752. text,
  753. "\\",
  754. text2,
  755. ".txt"
  756. }), "MOD Compile Completed", 0);
  757. }
  758. catch (Exception ex2)
  759. {
  760. Debug.LogError("ExportModScript 例外 : " + filename + " : " + ex2.Message);
  761. }
  762. finally
  763. {
  764. streamWriter.Close();
  765. streamWriter.Dispose();
  766. streamWriter = null;
  767. }
  768. return true;
  769. }
  770. public static void ExportModScript(Maid maid, byte[] cd, StreamWriter sw, string filename, bool f_bTemp = false)
  771. {
  772. TBody body = maid.body0;
  773. List<Menu.LastParam> list = new List<Menu.LastParam>();
  774. BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
  775. string text = binaryReader.ReadString();
  776. NDebug.Assert(text == "CM3D2_MENU", "ExportModScript 例外 : ヘッダーファイルが不正です。" + text);
  777. int num = binaryReader.ReadInt32();
  778. string path = binaryReader.ReadString();
  779. string str = binaryReader.ReadString();
  780. sw.WriteLine("アイテム名\t" + str);
  781. string str2 = binaryReader.ReadString();
  782. sw.WriteLine("カテゴリ名\t" + str2);
  783. string text2 = binaryReader.ReadString();
  784. sw.WriteLine("説明\t" + text2.Replace("\n", "《改行》"));
  785. sw.WriteLine("アイコン\t" + Path.GetFileName(filename + ".png"));
  786. long num2 = (long)binaryReader.ReadInt32();
  787. bool flag = false;
  788. List<string> list2 = new List<string>();
  789. string text3 = string.Empty;
  790. string text4 = string.Empty;
  791. string empty = string.Empty;
  792. string empty2 = string.Empty;
  793. try
  794. {
  795. for (;;)
  796. {
  797. int num3 = (int)binaryReader.ReadByte();
  798. text4 = text3;
  799. text3 = string.Empty;
  800. if (num3 == 0)
  801. {
  802. break;
  803. }
  804. for (int i = 0; i < num3; i++)
  805. {
  806. text3 = text3 + "\"" + binaryReader.ReadString() + "\" ";
  807. }
  808. if (!(text3 == string.Empty))
  809. {
  810. string stringCom = UTY.GetStringCom(text3);
  811. string[] stringList = UTY.GetStringList(text3);
  812. if (stringCom == "end")
  813. {
  814. break;
  815. }
  816. if (!(stringCom == "name"))
  817. {
  818. if (stringCom == "icon" || stringCom == "icons")
  819. {
  820. string f_strFileName = stringList[1];
  821. Texture2D texture2D = ImportCM.CreateTexture(f_strFileName);
  822. if (texture2D != null)
  823. {
  824. UTY.SaveImage(texture2D, filename + ".png");
  825. }
  826. }
  827. else if (stringCom == "additem")
  828. {
  829. sw.WriteLine("アイテム変更");
  830. string text5 = empty;
  831. if (stringList.Length > 1)
  832. {
  833. text5 = stringList[2];
  834. }
  835. list2.Add(text5);
  836. sw.WriteLine("\tスロット名\t" + text5);
  837. TBodySkin slot = maid.body0.GetSlot(text5);
  838. foreach (Transform transform in slot.obj.GetComponentsInChildren<Transform>(true))
  839. {
  840. Renderer component = transform.GetComponent<Renderer>();
  841. if (!(component == null) && component.materials != null)
  842. {
  843. Material[] materials = component.materials;
  844. for (int k = 0; k < materials.Length; k++)
  845. {
  846. Material f_mat = materials[k];
  847. sw.WriteLine("\t\tマテリアル番号\t" + k);
  848. Menu.ModMaterial(f_mat, sw);
  849. }
  850. }
  851. }
  852. }
  853. else if (!(stringCom == "color"))
  854. {
  855. if (stringCom == "tex" || stringCom == "テクスチャ変更")
  856. {
  857. string text6 = stringList[1];
  858. int num4 = int.Parse(stringList[2]);
  859. string str3 = stringList[3];
  860. string text7 = stringList[4];
  861. string text8 = (6 > stringList.Length) ? null : stringList[5];
  862. if (!list2.Contains(text6))
  863. {
  864. string text9 = "テクスチャ変更";
  865. text9 = text9 + "\t" + text6;
  866. text9 = text9 + "\t" + num4;
  867. text9 = text9 + "\t" + str3;
  868. text9 = text9 + "\t" + text7;
  869. if (!string.IsNullOrEmpty(text8))
  870. {
  871. text9 = text9 + "\t" + text8;
  872. }
  873. if (text7.Contains("*"))
  874. {
  875. string text10 = string.Empty;
  876. TBodySkin slot2 = maid.body0.GetSlot(text6);
  877. if (slot2 != null)
  878. {
  879. text10 += "参考)出力時のモデル名は ";
  880. text10 += Path.GetFileNameWithoutExtension(slot2.m_strModelFileName);
  881. text10 += " です。";
  882. }
  883. sw.WriteLine("// * の部分は現在装着されているモデル名に置換されます。" + text10);
  884. }
  885. if (!string.IsNullOrEmpty(text8) && !flag)
  886. {
  887. string text11 = "// 無限色ID群 ";
  888. IEnumerator enumerator = Enum.GetValues(typeof(MaidParts.PARTS_COLOR)).GetEnumerator();
  889. try
  890. {
  891. while (enumerator.MoveNext())
  892. {
  893. object obj = enumerator.Current;
  894. text11 = text11 + ((MaidParts.PARTS_COLOR)obj).ToString() + " ";
  895. }
  896. }
  897. finally
  898. {
  899. IDisposable disposable;
  900. if ((disposable = (enumerator as IDisposable)) != null)
  901. {
  902. disposable.Dispose();
  903. }
  904. }
  905. sw.WriteLine(text11);
  906. flag = true;
  907. }
  908. sw.WriteLine(text9);
  909. }
  910. }
  911. else if (stringCom == "テクスチャ合成")
  912. {
  913. string item = stringList[1];
  914. int num5 = int.Parse(stringList[2]);
  915. string text12 = stringList[3];
  916. string text13 = stringList[4];
  917. if (!list2.Contains(item))
  918. {
  919. }
  920. }
  921. else if (stringCom == "マテリアル変更")
  922. {
  923. string text14 = stringList[1];
  924. int num6 = int.Parse(stringList[2]);
  925. string text15 = stringList[3];
  926. if (!list2.Contains(text14))
  927. {
  928. sw.WriteLine("マテリアル変更");
  929. sw.WriteLine("\tスロット名\t" + text14);
  930. TBodySkin slot3 = maid.body0.GetSlot(text14);
  931. foreach (Transform transform2 in slot3.obj.GetComponentsInChildren<Transform>(true))
  932. {
  933. Renderer component2 = transform2.GetComponent<Renderer>();
  934. if (!(component2 == null) && component2.materials != null)
  935. {
  936. Material[] materials2 = component2.materials;
  937. for (int m = 0; m < materials2.Length; m++)
  938. {
  939. Material f_mat2 = materials2[m];
  940. sw.WriteLine("\t\tマテリアル番号\t" + m);
  941. Menu.ModMaterial(f_mat2, sw);
  942. }
  943. }
  944. }
  945. }
  946. }
  947. else if (stringCom == "color_set")
  948. {
  949. if (stringList.Length >= 3)
  950. {
  951. string text16 = stringList[2];
  952. text16 = "mod_" + Path.GetFileNameWithoutExtension(text16) + ".mod";
  953. sw.WriteLine("色セット\t" + stringList[1] + "\t" + text16);
  954. }
  955. else
  956. {
  957. sw.WriteLine("色セット\t" + stringList[1]);
  958. }
  959. MPN f_mpn = (MPN)Enum.Parse(typeof(MPN), stringList[1].ToLower());
  960. maid.ExportModBaseMenu(f_mpn);
  961. }
  962. }
  963. }
  964. }
  965. }
  966. }
  967. catch (Exception ex)
  968. {
  969. Debug.LogError(string.Concat(new string[]
  970. {
  971. "Exception ",
  972. Path.GetFileName(path),
  973. " 現在処理中だった行 = ",
  974. text3,
  975. " 以前の行 = ",
  976. text4,
  977. " ",
  978. ex.Message,
  979. "StackTrace:\n",
  980. ex.StackTrace
  981. }));
  982. NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(path), false);
  983. if (binaryReader != null)
  984. {
  985. binaryReader.Close();
  986. binaryReader = null;
  987. }
  988. throw ex;
  989. }
  990. if (binaryReader != null)
  991. {
  992. binaryReader.Close();
  993. binaryReader = null;
  994. }
  995. }
  996. public static string[] NeedTextureWildCard(string f_strTexName)
  997. {
  998. string[] array;
  999. if (f_strTexName.Contains("*"))
  1000. {
  1001. string strTexName = f_strTexName;
  1002. strTexName = strTexName.Replace("*", ".*");
  1003. if (Menu.m_strAllTexInFileSys == null)
  1004. {
  1005. Menu.m_strAllTexInFileSys = GameUty.FileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
  1006. }
  1007. array = Array.FindAll<string>(Menu.m_strAllTexInFileSys, (string i) => new Regex(strTexName).IsMatch(i));
  1008. array = Array.FindAll<string>(array, (string i) => new Regex("^((?!_i_).)*$").IsMatch(i));
  1009. IEnumerable<string> source = array;
  1010. if (Menu.<>f__mg$cache0 == null)
  1011. {
  1012. Menu.<>f__mg$cache0 = new Func<string, string>(Path.GetFileName);
  1013. }
  1014. array = source.Select(Menu.<>f__mg$cache0).ToArray<string>();
  1015. string strMatchGroup = strTexName.Replace(".*", "(?<WILD>.*)");
  1016. array = array.Select(delegate(string i)
  1017. {
  1018. Match match = new Regex(strMatchGroup).Match(i);
  1019. if (match.Success)
  1020. {
  1021. return match.Groups["WILD"].Value;
  1022. }
  1023. return i;
  1024. }).ToArray<string>();
  1025. }
  1026. else
  1027. {
  1028. array = new string[]
  1029. {
  1030. Path.GetFileName(f_strTexName)
  1031. };
  1032. }
  1033. return array;
  1034. }
  1035. private static void ModMaterial(Material f_mat, StreamWriter f_sw)
  1036. {
  1037. for (int i = 0; i < Menu.material_properties.GetLength(0); i++)
  1038. {
  1039. if (f_mat.HasProperty(Menu.material_properties[i, 0]))
  1040. {
  1041. if (Menu.material_properties[i, 1] == "tex")
  1042. {
  1043. Texture texture = f_mat.GetTexture(Menu.material_properties[i, 0]);
  1044. f_sw.WriteLine("\t\t\tテクスチャ設定\t" + Menu.material_properties[i, 0] + "\t" + texture.name);
  1045. }
  1046. else if (Menu.material_properties[i, 1] == "col")
  1047. {
  1048. Color color = f_mat.GetColor(Menu.material_properties[i, 0]);
  1049. f_sw.WriteLine(string.Concat(new object[]
  1050. {
  1051. "\t\t\t色設定\t",
  1052. Menu.material_properties[i, 0],
  1053. "\t",
  1054. (int)(255f * color.r),
  1055. "\t",
  1056. (int)(255f * color.g),
  1057. "\t",
  1058. (int)(255f * color.b),
  1059. "\t",
  1060. (int)(255f * color.a)
  1061. }));
  1062. }
  1063. else if (Menu.material_properties[i, 1] == "f")
  1064. {
  1065. float @float = f_mat.GetFloat(Menu.material_properties[i, 0]);
  1066. f_sw.WriteLine(string.Concat(new object[]
  1067. {
  1068. "\t\t\t数値設定\t",
  1069. Menu.material_properties[i, 0],
  1070. "\t",
  1071. @float
  1072. }));
  1073. }
  1074. }
  1075. }
  1076. }
  1077. private static string GetBaseItemFromMod(string f_strModMenu)
  1078. {
  1079. string empty = string.Empty;
  1080. FileStream fileStream = new FileStream(f_strModMenu, FileMode.Open);
  1081. if (fileStream == null)
  1082. {
  1083. return string.Empty;
  1084. }
  1085. BinaryReader binaryReader = new BinaryReader(fileStream);
  1086. string a = binaryReader.ReadString();
  1087. NDebug.Assert(a == "CM3D2_MOD", "セーブデータファイルのヘッダーが不正です。_MOD");
  1088. int num = binaryReader.ReadInt32();
  1089. string text = binaryReader.ReadString();
  1090. string text2 = binaryReader.ReadString();
  1091. text2 = text2.Replace(":", " ");
  1092. string text3 = binaryReader.ReadString();
  1093. string text4 = binaryReader.ReadString();
  1094. string text5 = binaryReader.ReadString();
  1095. binaryReader.Close();
  1096. fileStream.Close();
  1097. fileStream.Dispose();
  1098. return text2;
  1099. }
  1100. private static void ProcModScriptBin(Maid maid, byte[] cd, string filename, bool f_bTemp = false)
  1101. {
  1102. BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
  1103. string text = binaryReader.ReadString();
  1104. NDebug.Assert(text == "CM3D2_MOD", "ProcModScriptBin 例外 : ヘッダーファイルが不正です。" + text);
  1105. int num = binaryReader.ReadInt32();
  1106. string text2 = binaryReader.ReadString();
  1107. string text3 = binaryReader.ReadString();
  1108. string text4 = binaryReader.ReadString();
  1109. string text5 = binaryReader.ReadString();
  1110. string text6 = binaryReader.ReadString();
  1111. string text7 = binaryReader.ReadString();
  1112. MPN mpn = MPN.null_mpn;
  1113. try
  1114. {
  1115. mpn = (MPN)Enum.Parse(typeof(MPN), text7);
  1116. }
  1117. catch
  1118. {
  1119. NDebug.Assert("カテゴリがありません。" + text7, false);
  1120. }
  1121. string text8 = string.Empty;
  1122. if (mpn != MPN.null_mpn)
  1123. {
  1124. text8 = binaryReader.ReadString();
  1125. }
  1126. string s = binaryReader.ReadString();
  1127. int num2 = binaryReader.ReadInt32();
  1128. Dictionary<string, byte[]> dictionary = new Dictionary<string, byte[]>();
  1129. for (int i = 0; i < num2; i++)
  1130. {
  1131. string key = binaryReader.ReadString();
  1132. int count = binaryReader.ReadInt32();
  1133. byte[] value = binaryReader.ReadBytes(count);
  1134. dictionary.Add(key, value);
  1135. }
  1136. binaryReader.Close();
  1137. binaryReader = null;
  1138. using (StringReader stringReader = new StringReader(s))
  1139. {
  1140. Menu.IMode mode = Menu.IMode.Non;
  1141. string slotname = string.Empty;
  1142. int num3 = 0;
  1143. TBodySkin tbodySkin = null;
  1144. Material material = null;
  1145. string text9;
  1146. while ((text9 = stringReader.ReadLine()) != null)
  1147. {
  1148. string[] array = text9.Split(new char[]
  1149. {
  1150. '\t',
  1151. ' '
  1152. }, StringSplitOptions.RemoveEmptyEntries);
  1153. if (array[0] == "アイテム変更" || array[0] == "マテリアル変更")
  1154. {
  1155. mode = Menu.IMode.ItemChange;
  1156. }
  1157. else if (array[0] == "テクスチャ変更")
  1158. {
  1159. mode = Menu.IMode.TexChange;
  1160. }
  1161. if (mode == Menu.IMode.ItemChange)
  1162. {
  1163. if (array[0] == "スロット名")
  1164. {
  1165. slotname = array[1];
  1166. tbodySkin = maid.body0.GetSlot(slotname);
  1167. }
  1168. if (tbodySkin != null)
  1169. {
  1170. if (array[0] == "マテリアル番号")
  1171. {
  1172. num3 = int.Parse(array[1]);
  1173. foreach (Transform transform in tbodySkin.obj.GetComponentsInChildren<Transform>(true))
  1174. {
  1175. Renderer component = transform.GetComponent<Renderer>();
  1176. if (!(component == null) && component.materials != null)
  1177. {
  1178. Material[] materials = component.materials;
  1179. for (int k = 0; k < materials.Length; k++)
  1180. {
  1181. if (k == num3)
  1182. {
  1183. material = materials[k];
  1184. break;
  1185. }
  1186. }
  1187. }
  1188. }
  1189. }
  1190. if (material != null)
  1191. {
  1192. if (array[0] == "テクスチャ設定")
  1193. {
  1194. maid.body0.ChangeTex(slotname, num3, array[1], array[2].ToLower(), dictionary, MaidParts.PARTS_COLOR.NONE);
  1195. }
  1196. else if (array[0] == "色設定")
  1197. {
  1198. material.SetColor(array[1], new Color(float.Parse(array[2]) / 255f, float.Parse(array[3]) / 255f, float.Parse(array[4]) / 255f, float.Parse(array[5]) / 255f));
  1199. }
  1200. else if (array[0] == "数値設定")
  1201. {
  1202. material.SetFloat(array[1], float.Parse(array[2]));
  1203. }
  1204. }
  1205. }
  1206. }
  1207. else if (mode == Menu.IMode.TexChange)
  1208. {
  1209. MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
  1210. if (array.Length == 6)
  1211. {
  1212. string text10 = array[5];
  1213. try
  1214. {
  1215. parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text10.ToUpper());
  1216. }
  1217. catch
  1218. {
  1219. NDebug.Assert("無限色IDがありません。" + text10, false);
  1220. }
  1221. }
  1222. maid.body0.ChangeTex(array[1], int.Parse(array[2]), array[3], array[4].ToLower(), dictionary, parts_COLOR);
  1223. if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
  1224. {
  1225. maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
  1226. }
  1227. }
  1228. }
  1229. }
  1230. }
  1231. static Menu()
  1232. {
  1233. // Note: this type is marked as 'beforefieldinit'.
  1234. string[,] array = new string[31, 2];
  1235. array[0, 0] = "_MainTex";
  1236. array[0, 1] = "tex";
  1237. array[1, 0] = "_BumpMap";
  1238. array[1, 1] = "tex";
  1239. array[2, 0] = "_ToonRamp";
  1240. array[2, 1] = "tex";
  1241. array[3, 0] = "_ShadowTex";
  1242. array[3, 1] = "tex";
  1243. array[4, 0] = "_ShadowRateToon";
  1244. array[4, 1] = "tex";
  1245. array[5, 0] = "_SpecularTex";
  1246. array[5, 1] = "tex";
  1247. array[6, 0] = "_AnisoTex";
  1248. array[6, 1] = "tex";
  1249. array[7, 0] = "_RenderTex";
  1250. array[7, 1] = "tex";
  1251. array[8, 0] = "_HiTex";
  1252. array[8, 1] = "tex";
  1253. array[9, 0] = "_OutlineTex";
  1254. array[9, 1] = "tex";
  1255. array[10, 0] = "_OutlineToonRamp";
  1256. array[10, 1] = "tex";
  1257. array[11, 0] = "_Color";
  1258. array[11, 1] = "col";
  1259. array[12, 0] = "_ShadowColor";
  1260. array[12, 1] = "col";
  1261. array[13, 0] = "_RimColor";
  1262. array[13, 1] = "col";
  1263. array[14, 0] = "_SpecColor";
  1264. array[14, 1] = "col";
  1265. array[15, 0] = "_Emission";
  1266. array[15, 1] = "col";
  1267. array[16, 0] = "_ReflectColor";
  1268. array[16, 1] = "col";
  1269. array[17, 0] = "_OutlineColor";
  1270. array[17, 1] = "col";
  1271. array[18, 0] = "_MyLightColor0";
  1272. array[18, 1] = "col";
  1273. array[19, 0] = "_MyLightColor1";
  1274. array[19, 1] = "col";
  1275. array[20, 0] = "_TintColor";
  1276. array[20, 1] = "col";
  1277. array[21, 0] = "_ShadowColor";
  1278. array[21, 1] = "col";
  1279. array[22, 0] = "_Shininess";
  1280. array[22, 1] = "f";
  1281. array[23, 0] = "_FurLength";
  1282. array[23, 1] = "f";
  1283. array[24, 0] = "_OutlineWidth";
  1284. array[24, 1] = "f";
  1285. array[25, 0] = "_Cutoff";
  1286. array[25, 1] = "f";
  1287. array[26, 0] = "_AnisoOffset";
  1288. array[26, 1] = "f";
  1289. array[27, 0] = "_RimPower";
  1290. array[27, 1] = "f";
  1291. array[28, 0] = "_RimShift";
  1292. array[28, 1] = "f";
  1293. array[29, 0] = "_HiRate";
  1294. array[29, 1] = "f";
  1295. array[30, 0] = "_HiPow";
  1296. array[30, 1] = "f";
  1297. Menu.material_properties = array;
  1298. }
  1299. public static SortedDictionary<int, SortedDictionary<string, string>> m_dicResourceRef = new SortedDictionary<int, SortedDictionary<string, string>>();
  1300. private static string[] m_strAllTexInFileSys = null;
  1301. private static string[,] material_properties;
  1302. [CompilerGenerated]
  1303. private static Func<string, string> <>f__mg$cache0;
  1304. private class LastParam
  1305. {
  1306. public LastParam(int f_nOrder, string f_strComm, params string[] f_argArgs)
  1307. {
  1308. this.nOrder = f_nOrder;
  1309. this.strComm = f_strComm;
  1310. this.aryArgs = new string[f_argArgs.Length];
  1311. f_argArgs.CopyTo(this.aryArgs, 0);
  1312. }
  1313. public int nOrder;
  1314. public string strComm = string.Empty;
  1315. public string[] aryArgs;
  1316. }
  1317. private enum IMode
  1318. {
  1319. Non,
  1320. ItemChange,
  1321. TexChange
  1322. }
  1323. }