Menu.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  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_1057;
  148. }
  149. if (stringCom == "アイテム")
  150. {
  151. Menu.SetMaidItemTemp(maid, stringList[1], f_bTemp);
  152. goto IL_1057;
  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_1057;
  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_1057;
  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_1057;
  308. }
  309. if (stringCom == "set")
  310. {
  311. goto IL_1057;
  312. }
  313. if (stringCom == "setname")
  314. {
  315. goto IL_1057;
  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_1057;
  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_1057;
  364. }
  365. if (stringCom == "nofloory")
  366. {
  367. TBody.SlotID index = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
  368. body.goSlot[(int)index].m_bHitFloorY = false;
  369. goto IL_1057;
  370. }
  371. if (stringCom == "saveitem")
  372. {
  373. text3 = stringList[1];
  374. goto IL_1057;
  375. }
  376. if (stringCom == "category")
  377. {
  378. text7 = stringList[1];
  379. goto IL_1057;
  380. }
  381. if (stringCom == "maskitem")
  382. {
  383. if (stringList.Length > 1)
  384. {
  385. string maskslot = stringList[1];
  386. body.AddMask(text7, maskslot);
  387. goto IL_6E7;
  388. }
  389. goto IL_6E7;
  390. IL_6E7:
  391. goto IL_1057;
  392. }
  393. if (stringCom == "delitem")
  394. {
  395. string slotname3 = text7;
  396. if (stringList.Length > 1)
  397. {
  398. slotname3 = stringList[1];
  399. }
  400. body.DelItem((MPN)Enum.Parse(typeof(MPN), text7, true), slotname3);
  401. goto IL_1057;
  402. }
  403. if (stringCom == "node消去")
  404. {
  405. body.SetVisibleNodeSlot(text7, false, stringList[1]);
  406. goto IL_1057;
  407. }
  408. if (stringCom == "node表示")
  409. {
  410. body.SetVisibleNodeSlot(text7, true, stringList[1]);
  411. goto IL_1057;
  412. }
  413. if (stringCom == "パーツnode消去")
  414. {
  415. body.SetVisibleNodeSlotParts(text7, stringList[1], false, stringList[2]);
  416. goto IL_1057;
  417. }
  418. if (stringCom == "パーツnode表示")
  419. {
  420. body.SetVisibleNodeSlotParts(text7, stringList[1], true, stringList[2]);
  421. goto IL_1057;
  422. }
  423. if (stringCom == "color")
  424. {
  425. string name = stringList[1];
  426. int matno = int.Parse(stringList[2]);
  427. string prop_name = stringList[3];
  428. Color col = new Color(float.Parse(stringList[4]) / 255f, float.Parse(stringList[5]) / 255f, float.Parse(stringList[6]) / 255f, float.Parse(stringList[7]) / 255f);
  429. body.ChangeCol(name, matno, prop_name, col);
  430. goto IL_1057;
  431. }
  432. if (stringCom == "mancolor")
  433. {
  434. Color manColor = new Color(float.Parse(stringList[1]) / 255f, float.Parse(stringList[2]) / 255f, float.Parse(stringList[3]) / 255f, 1f);
  435. maid.ManColor = manColor;
  436. maid.ManColorUpdate();
  437. goto IL_1057;
  438. }
  439. if (stringCom == "tex" || stringCom == "テクスチャ変更")
  440. {
  441. string text12 = stringList[1];
  442. int matno2 = int.Parse(stringList[2]);
  443. string prop_name2 = stringList[3];
  444. string filename2 = stringList[4];
  445. MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
  446. if (stringList.Length == 6)
  447. {
  448. string text13 = stringList[5];
  449. try
  450. {
  451. parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text13.ToUpper());
  452. }
  453. catch
  454. {
  455. NDebug.Assert("無限色IDがありません。" + text13, false);
  456. }
  457. }
  458. body.ChangeTex(text12, matno2, prop_name2, filename2, null, parts_COLOR);
  459. if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
  460. {
  461. maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
  462. }
  463. if ((text7 == "skin" || text7 == "haircolor") && !flag)
  464. {
  465. body.RestoreShader(text12);
  466. goto IL_994;
  467. }
  468. goto IL_994;
  469. IL_994:
  470. goto IL_1057;
  471. }
  472. if (stringCom == "prop")
  473. {
  474. string tag2 = stringList[1];
  475. string s = stringList[2];
  476. maid.SetProp(tag2, int.Parse(s), false);
  477. goto IL_1057;
  478. }
  479. if (stringCom == "テクスチャ乗算")
  480. {
  481. goto IL_1057;
  482. }
  483. if (stringCom == "テクスチャ合成")
  484. {
  485. if (stringList.Length != 7)
  486. {
  487. NDebug.Assert("テクスチャ合成 の引数が不正です。" + stringList.Length, false);
  488. }
  489. if ((text7 == "accTatoo" || text7 == "hokuro") && !filename.Contains("_del"))
  490. {
  491. 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);
  492. goto IL_AF7;
  493. }
  494. 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);
  495. goto IL_AF7;
  496. IL_AF7:
  497. goto IL_1057;
  498. }
  499. if (stringCom == "テクスチャセット合成")
  500. {
  501. if (stringList.Length != 7)
  502. {
  503. NDebug.Assert("テクスチャセット合成 の引数が不正です。" + stringList.Length, false);
  504. }
  505. 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);
  506. goto IL_1057;
  507. }
  508. if (stringCom == "マテリアル変更")
  509. {
  510. string f_strSlotName = stringList[1];
  511. int f_nMatNo = int.Parse(stringList[2]);
  512. string f_strFileName = stringList[3];
  513. body.ChangeMaterial(f_strSlotName, f_nMatNo, f_strFileName);
  514. goto IL_1057;
  515. }
  516. if (stringCom == "shader")
  517. {
  518. string f_strSlotName2 = stringList[1];
  519. int f_nMatNo2 = int.Parse(stringList[2]);
  520. string f_strShaderFileName = stringList[3];
  521. body.ChangeShader(f_strSlotName2, f_nMatNo2, f_strShaderFileName);
  522. flag = true;
  523. goto IL_1057;
  524. }
  525. if (stringCom == "アタッチポイントの設定")
  526. {
  527. if (stringList.Length < 5)
  528. {
  529. Debug.LogError("アタッチポイントの設定引数の数が不正です。 " + text5 + " " + str);
  530. goto IL_CBA;
  531. }
  532. Vector3 v = new Vector3(float.Parse(stringList[2]), float.Parse(stringList[3]), float.Parse(stringList[4]));
  533. Quaternion q = Quaternion.identity;
  534. if (stringList.Length == 8)
  535. {
  536. q = Quaternion.Euler(float.Parse(stringList[5]), float.Parse(stringList[6]), float.Parse(stringList[7]));
  537. }
  538. else
  539. {
  540. Debug.LogError("アタッチポイントの設定引数に角度指定がありません。 " + text5 + " " + str);
  541. }
  542. body.SetAttachPoint(slotname, stringList[1], v, q, f_bTemp);
  543. goto IL_CBA;
  544. IL_CBA:
  545. goto IL_1057;
  546. }
  547. if (stringCom == "blendset")
  548. {
  549. string blendSetName = stringList[1];
  550. int num4 = (stringList.Length - 2) / 2;
  551. body.Face.morph.NewBlendSet(blendSetName);
  552. for (int j = 0; j < num4; j++)
  553. {
  554. string tag3 = stringList[2 + j * 2].ToLower();
  555. float val2 = float.Parse(stringList[3 + j * 2]);
  556. body.Face.morph.SetValueBlendSet(blendSetName, tag3, val2);
  557. }
  558. goto IL_1057;
  559. }
  560. if (stringCom == "paramset")
  561. {
  562. body.Face.NewParamSet(text5);
  563. goto IL_1057;
  564. }
  565. if (stringCom == "commenttype")
  566. {
  567. if (!maid.status.partsDic.ContainsKey(stringList[1]))
  568. {
  569. maid.status.partsDic.Add(stringList[1], string.Empty);
  570. }
  571. maid.status.partsDic[stringList[1]] = stringList[2];
  572. goto IL_1057;
  573. }
  574. if (stringCom == "useredit")
  575. {
  576. if (stringList[2].ToLower() == "material")
  577. {
  578. body.SetMaterialProperty(text7, stringList[3], int.Parse(stringList[4]), stringList[5], stringList[6], stringList[7], false);
  579. goto IL_E12;
  580. }
  581. goto IL_E12;
  582. IL_E12:
  583. goto IL_1057;
  584. }
  585. if (stringCom == "bonemorph")
  586. {
  587. if (stringList.Length < 9)
  588. {
  589. Debug.LogError("BoneMorpの設定引数の数が不正です。 " + text5 + " " + str);
  590. }
  591. 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])));
  592. goto IL_1057;
  593. }
  594. if (stringCom == "length")
  595. {
  596. if (stringList.Length != 11)
  597. {
  598. Debug.LogError("lengthの設定引数の数が不正です。 " + text5 + " " + str);
  599. }
  600. 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])));
  601. goto IL_1057;
  602. }
  603. if (stringCom == "anime")
  604. {
  605. if (stringList.Length < 3)
  606. {
  607. Debug.LogError("animeの設定引数の数が不正です。 " + text5 + " " + str);
  608. }
  609. TBody.SlotID f_slot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
  610. body.ItemAnimationLoad(f_slot, stringList[2]);
  611. bool f_bLoop = false;
  612. if (3 < stringList.Length)
  613. {
  614. f_bLoop = (stringList[3] == "loop");
  615. }
  616. body.ItemAnimationPlay(f_slot, stringList[2], f_bLoop);
  617. goto IL_1057;
  618. }
  619. if (stringCom == "param2")
  620. {
  621. if (stringList.Length == 4)
  622. {
  623. string slotname4 = stringList[1];
  624. body.GetSlot(slotname4).SetParam2(stringList[2], stringList[3]);
  625. goto IL_1011;
  626. }
  627. Debug.LogError("param2の設定引数の数が不正です。 " + text5 + " " + str);
  628. goto IL_1011;
  629. IL_1011:
  630. goto IL_1057;
  631. }
  632. if (stringCom == "animematerial")
  633. {
  634. TBody.SlotID f_slot2 = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), stringList[1], true);
  635. string s2 = stringList[2];
  636. body.MaterialAnimatorAdd(f_slot2, int.Parse(s2));
  637. goto IL_1057;
  638. }
  639. goto IL_1057;
  640. IL_1057:
  641. goto IL_10DA;
  642. }
  643. catch (Exception ex)
  644. {
  645. Debug.LogError(string.Concat(new string[]
  646. {
  647. "Exception ",
  648. Path.GetFileName(filename),
  649. " 現在処理中だった行 = ",
  650. text5,
  651. " 以前の行 = ",
  652. text6,
  653. " ",
  654. ex.Message,
  655. "StackTrace:\n",
  656. ex.StackTrace
  657. }));
  658. NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(filename), true);
  659. goto IL_10DA;
  660. }
  661. IL_10DA:
  662. goto IL_90;
  663. }
  664. list.Sort((Menu.LastParam a, Menu.LastParam b) => a.nOrder - a.nOrder);
  665. for (int k = 0; k < list.Count; k++)
  666. {
  667. Menu.LastParam lastParam = list[k];
  668. if (lastParam.strComm == "アイテムパラメータ")
  669. {
  670. TBodySkin slot4 = body.GetSlot(lastParam.aryArgs[0]);
  671. slot4.SetParam(lastParam.aryArgs[1], lastParam.aryArgs[2]);
  672. }
  673. }
  674. binaryReader.Close();
  675. binaryReader = null;
  676. }
  677. public static void SetMaidItemTemp(Maid maid, string filename, bool f_bTemp = false)
  678. {
  679. byte[] buffer = null;
  680. try
  681. {
  682. using (AFileBase afileBase = GameUty.FileOpen(filename, null))
  683. {
  684. if (!afileBase.IsValid())
  685. {
  686. NDebug.Assert("メニューファイルが見つかりません。" + filename, false);
  687. }
  688. buffer = afileBase.ReadAll();
  689. }
  690. }
  691. catch (Exception ex)
  692. {
  693. Debug.LogError("ProcScriptBin/SetMaidItemTemp アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
  694. }
  695. BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer), Encoding.UTF8);
  696. string text = binaryReader.ReadString();
  697. NDebug.Assert(text == "CM3D2_MENU", "ProcScriptBin/SetMaidItemTemp 例外 : " + filename + " のヘッダーが不正です。" + text);
  698. int num = binaryReader.ReadInt32();
  699. string text2 = binaryReader.ReadString();
  700. string text3 = binaryReader.ReadString();
  701. string text4 = binaryReader.ReadString();
  702. if (text4 == "acctatoo")
  703. {
  704. maid.DelProp(MPN.acctatoo, false);
  705. maid.SetSubProp(MPN.acctatoo, 0, filename, 0);
  706. }
  707. else if (text4 == "hokuro")
  708. {
  709. maid.DelProp(MPN.hokuro, false);
  710. maid.SetSubProp(MPN.hokuro, 0, filename, 0);
  711. }
  712. else
  713. {
  714. maid.SetProp(text4, filename, 0, f_bTemp, false);
  715. }
  716. }
  717. public static bool ExportModScript(Maid maid, string filename, bool f_bTemp = false)
  718. {
  719. byte[] cd = null;
  720. try
  721. {
  722. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(filename))
  723. {
  724. if (!afileBase.IsValid())
  725. {
  726. Debug.LogWarning("アイテムメニューファイルが見つかりません。" + filename);
  727. return false;
  728. }
  729. cd = afileBase.ReadAll();
  730. }
  731. }
  732. catch (Exception ex)
  733. {
  734. Debug.LogError("ExportModScript アイテムメニューファイルが読み込めませんでした。 : " + filename + " : " + ex.Message);
  735. }
  736. string fullPath = Path.GetFullPath(".\\");
  737. string text = fullPath + "ModExport";
  738. if (!Directory.Exists(text))
  739. {
  740. Directory.CreateDirectory(text);
  741. }
  742. string text2 = "mod_" + Path.GetFileNameWithoutExtension(filename);
  743. text2 = text2.Trim();
  744. text = text + "\\" + text2;
  745. if (!Directory.Exists(text))
  746. {
  747. Directory.CreateDirectory(text);
  748. }
  749. StreamWriter streamWriter = new StreamWriter(text + "\\" + text2 + ".txt", false, Encoding.UTF8);
  750. streamWriter.WriteLine("出力バージョン\t" + 1200);
  751. streamWriter.WriteLine("基本アイテム\t" + filename.Replace(" ", ":"));
  752. try
  753. {
  754. Menu.ExportModScript(maid, cd, streamWriter, text + "\\" + text2, f_bTemp);
  755. NUty.WinMessageBox(NUty.GetWindowHandle(), string.Concat(new string[]
  756. {
  757. "MODテンプレート出力完了\n",
  758. text,
  759. "\\",
  760. text2,
  761. ".txt"
  762. }), "MOD Compile Completed", 0);
  763. }
  764. catch (Exception ex2)
  765. {
  766. Debug.LogError("ExportModScript 例外 : " + filename + " : " + ex2.Message);
  767. }
  768. finally
  769. {
  770. streamWriter.Close();
  771. streamWriter.Dispose();
  772. streamWriter = null;
  773. }
  774. return true;
  775. }
  776. public static void ExportModScript(Maid maid, byte[] cd, StreamWriter sw, string filename, bool f_bTemp = false)
  777. {
  778. TBody body = maid.body0;
  779. List<Menu.LastParam> list = new List<Menu.LastParam>();
  780. BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
  781. string text = binaryReader.ReadString();
  782. NDebug.Assert(text == "CM3D2_MENU", "ExportModScript 例外 : ヘッダーファイルが不正です。" + text);
  783. int num = binaryReader.ReadInt32();
  784. string path = binaryReader.ReadString();
  785. string str = binaryReader.ReadString();
  786. sw.WriteLine("アイテム名\t" + str);
  787. string str2 = binaryReader.ReadString();
  788. sw.WriteLine("カテゴリ名\t" + str2);
  789. string text2 = binaryReader.ReadString();
  790. sw.WriteLine("説明\t" + text2.Replace("\n", "《改行》"));
  791. sw.WriteLine("アイコン\t" + Path.GetFileName(filename + ".png"));
  792. long num2 = (long)binaryReader.ReadInt32();
  793. bool flag = false;
  794. List<string> list2 = new List<string>();
  795. string text3 = string.Empty;
  796. string text4 = string.Empty;
  797. string empty = string.Empty;
  798. string empty2 = string.Empty;
  799. try
  800. {
  801. for (;;)
  802. {
  803. int num3 = (int)binaryReader.ReadByte();
  804. text4 = text3;
  805. text3 = string.Empty;
  806. if (num3 == 0)
  807. {
  808. break;
  809. }
  810. for (int i = 0; i < num3; i++)
  811. {
  812. text3 = text3 + "\"" + binaryReader.ReadString() + "\" ";
  813. }
  814. if (!(text3 == string.Empty))
  815. {
  816. string stringCom = UTY.GetStringCom(text3);
  817. string[] stringList = UTY.GetStringList(text3);
  818. if (stringCom == "end")
  819. {
  820. break;
  821. }
  822. if (!(stringCom == "name"))
  823. {
  824. if (stringCom == "icon" || stringCom == "icons")
  825. {
  826. string f_strFileName = stringList[1];
  827. Texture2D texture2D = ImportCM.CreateTexture(f_strFileName);
  828. if (texture2D != null)
  829. {
  830. UTY.SaveImage(texture2D, filename + ".png");
  831. }
  832. }
  833. else if (stringCom == "additem")
  834. {
  835. sw.WriteLine("アイテム変更");
  836. string text5 = empty;
  837. if (stringList.Length > 1)
  838. {
  839. text5 = stringList[2];
  840. }
  841. list2.Add(text5);
  842. sw.WriteLine("\tスロット名\t" + text5);
  843. TBodySkin slot = maid.body0.GetSlot(text5);
  844. foreach (Transform transform in slot.obj.GetComponentsInChildren<Transform>(true))
  845. {
  846. Renderer component = transform.GetComponent<Renderer>();
  847. if (!(component == null) && component.materials != null)
  848. {
  849. Material[] materials = component.materials;
  850. for (int k = 0; k < materials.Length; k++)
  851. {
  852. Material f_mat = materials[k];
  853. sw.WriteLine("\t\tマテリアル番号\t" + k);
  854. Menu.ModMaterial(f_mat, sw);
  855. }
  856. }
  857. }
  858. }
  859. else if (!(stringCom == "color"))
  860. {
  861. if (stringCom == "tex" || stringCom == "テクスチャ変更")
  862. {
  863. string text6 = stringList[1];
  864. int num4 = int.Parse(stringList[2]);
  865. string str3 = stringList[3];
  866. string text7 = stringList[4];
  867. string text8 = (6 > stringList.Length) ? null : stringList[5];
  868. if (!list2.Contains(text6))
  869. {
  870. string text9 = "テクスチャ変更";
  871. text9 = text9 + "\t" + text6;
  872. text9 = text9 + "\t" + num4;
  873. text9 = text9 + "\t" + str3;
  874. text9 = text9 + "\t" + text7;
  875. if (!string.IsNullOrEmpty(text8))
  876. {
  877. text9 = text9 + "\t" + text8;
  878. }
  879. if (text7.Contains("*"))
  880. {
  881. string text10 = string.Empty;
  882. TBodySkin slot2 = maid.body0.GetSlot(text6);
  883. if (slot2 != null)
  884. {
  885. text10 += "参考)出力時のモデル名は ";
  886. text10 += Path.GetFileNameWithoutExtension(slot2.m_strModelFileName);
  887. text10 += " です。";
  888. }
  889. sw.WriteLine("// * の部分は現在装着されているモデル名に置換されます。" + text10);
  890. }
  891. if (!string.IsNullOrEmpty(text8) && !flag)
  892. {
  893. string text11 = "// 無限色ID群 ";
  894. IEnumerator enumerator = Enum.GetValues(typeof(MaidParts.PARTS_COLOR)).GetEnumerator();
  895. try
  896. {
  897. while (enumerator.MoveNext())
  898. {
  899. object obj = enumerator.Current;
  900. text11 = text11 + ((MaidParts.PARTS_COLOR)obj).ToString() + " ";
  901. }
  902. }
  903. finally
  904. {
  905. IDisposable disposable;
  906. if ((disposable = (enumerator as IDisposable)) != null)
  907. {
  908. disposable.Dispose();
  909. }
  910. }
  911. sw.WriteLine(text11);
  912. flag = true;
  913. }
  914. sw.WriteLine(text9);
  915. }
  916. }
  917. else if (stringCom == "テクスチャ合成")
  918. {
  919. string item = stringList[1];
  920. int num5 = int.Parse(stringList[2]);
  921. string text12 = stringList[3];
  922. string text13 = stringList[4];
  923. if (!list2.Contains(item))
  924. {
  925. }
  926. }
  927. else if (stringCom == "マテリアル変更")
  928. {
  929. string text14 = stringList[1];
  930. int num6 = int.Parse(stringList[2]);
  931. string text15 = stringList[3];
  932. if (!list2.Contains(text14))
  933. {
  934. sw.WriteLine("マテリアル変更");
  935. sw.WriteLine("\tスロット名\t" + text14);
  936. TBodySkin slot3 = maid.body0.GetSlot(text14);
  937. foreach (Transform transform2 in slot3.obj.GetComponentsInChildren<Transform>(true))
  938. {
  939. Renderer component2 = transform2.GetComponent<Renderer>();
  940. if (!(component2 == null) && component2.materials != null)
  941. {
  942. Material[] materials2 = component2.materials;
  943. for (int m = 0; m < materials2.Length; m++)
  944. {
  945. Material f_mat2 = materials2[m];
  946. sw.WriteLine("\t\tマテリアル番号\t" + m);
  947. Menu.ModMaterial(f_mat2, sw);
  948. }
  949. }
  950. }
  951. }
  952. }
  953. else if (stringCom == "color_set")
  954. {
  955. if (stringList.Length >= 3)
  956. {
  957. string text16 = stringList[2];
  958. text16 = "mod_" + Path.GetFileNameWithoutExtension(text16) + ".mod";
  959. sw.WriteLine("色セット\t" + stringList[1] + "\t" + text16);
  960. }
  961. else
  962. {
  963. sw.WriteLine("色セット\t" + stringList[1]);
  964. }
  965. MPN f_mpn = (MPN)Enum.Parse(typeof(MPN), stringList[1].ToLower());
  966. maid.ExportModBaseMenu(f_mpn);
  967. }
  968. }
  969. }
  970. }
  971. }
  972. }
  973. catch (Exception ex)
  974. {
  975. Debug.LogError(string.Concat(new string[]
  976. {
  977. "Exception ",
  978. Path.GetFileName(path),
  979. " 現在処理中だった行 = ",
  980. text3,
  981. " 以前の行 = ",
  982. text4,
  983. " ",
  984. ex.Message,
  985. "StackTrace:\n",
  986. ex.StackTrace
  987. }));
  988. NDebug.Assert("メニューファイル処理中にエラーが発生しました。" + Path.GetFileName(path), false);
  989. if (binaryReader != null)
  990. {
  991. binaryReader.Close();
  992. binaryReader = null;
  993. }
  994. throw ex;
  995. }
  996. if (binaryReader != null)
  997. {
  998. binaryReader.Close();
  999. binaryReader = null;
  1000. }
  1001. }
  1002. public static string[] NeedTextureWildCard(string f_strTexName)
  1003. {
  1004. string[] array;
  1005. if (f_strTexName.Contains("*"))
  1006. {
  1007. string strTexName = f_strTexName;
  1008. strTexName = strTexName.Replace("*", ".*");
  1009. if (Menu.m_strAllTexInFileSys == null)
  1010. {
  1011. Menu.m_strAllTexInFileSys = GameUty.FileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
  1012. }
  1013. array = Array.FindAll<string>(Menu.m_strAllTexInFileSys, (string i) => new Regex(strTexName).IsMatch(i));
  1014. array = Array.FindAll<string>(array, (string i) => new Regex("^((?!_i_).)*$").IsMatch(i));
  1015. IEnumerable<string> source = array;
  1016. if (Menu.<>f__mg$cache0 == null)
  1017. {
  1018. Menu.<>f__mg$cache0 = new Func<string, string>(Path.GetFileName);
  1019. }
  1020. array = source.Select(Menu.<>f__mg$cache0).ToArray<string>();
  1021. string strMatchGroup = strTexName.Replace(".*", "(?<WILD>.*)");
  1022. array = array.Select(delegate(string i)
  1023. {
  1024. Match match = new Regex(strMatchGroup).Match(i);
  1025. if (match.Success)
  1026. {
  1027. return match.Groups["WILD"].Value;
  1028. }
  1029. return i;
  1030. }).ToArray<string>();
  1031. }
  1032. else
  1033. {
  1034. array = new string[]
  1035. {
  1036. Path.GetFileName(f_strTexName)
  1037. };
  1038. }
  1039. return array;
  1040. }
  1041. private static void ModMaterial(Material f_mat, StreamWriter f_sw)
  1042. {
  1043. for (int i = 0; i < Menu.material_properties.GetLength(0); i++)
  1044. {
  1045. if (f_mat.HasProperty(Menu.material_properties[i, 0]))
  1046. {
  1047. if (Menu.material_properties[i, 1] == "tex")
  1048. {
  1049. Texture texture = f_mat.GetTexture(Menu.material_properties[i, 0]);
  1050. f_sw.WriteLine("\t\t\tテクスチャ設定\t" + Menu.material_properties[i, 0] + "\t" + texture.name);
  1051. }
  1052. else if (Menu.material_properties[i, 1] == "col")
  1053. {
  1054. Color color = f_mat.GetColor(Menu.material_properties[i, 0]);
  1055. f_sw.WriteLine(string.Concat(new object[]
  1056. {
  1057. "\t\t\t色設定\t",
  1058. Menu.material_properties[i, 0],
  1059. "\t",
  1060. (int)(255f * color.r),
  1061. "\t",
  1062. (int)(255f * color.g),
  1063. "\t",
  1064. (int)(255f * color.b),
  1065. "\t",
  1066. (int)(255f * color.a)
  1067. }));
  1068. }
  1069. else if (Menu.material_properties[i, 1] == "f")
  1070. {
  1071. float @float = f_mat.GetFloat(Menu.material_properties[i, 0]);
  1072. f_sw.WriteLine(string.Concat(new object[]
  1073. {
  1074. "\t\t\t数値設定\t",
  1075. Menu.material_properties[i, 0],
  1076. "\t",
  1077. @float
  1078. }));
  1079. }
  1080. }
  1081. }
  1082. }
  1083. private static string GetBaseItemFromMod(string f_strModMenu)
  1084. {
  1085. string empty = string.Empty;
  1086. FileStream fileStream = new FileStream(f_strModMenu, FileMode.Open);
  1087. if (fileStream == null)
  1088. {
  1089. return string.Empty;
  1090. }
  1091. BinaryReader binaryReader = new BinaryReader(fileStream);
  1092. string a = binaryReader.ReadString();
  1093. NDebug.Assert(a == "CM3D2_MOD", "セーブデータファイルのヘッダーが不正です。_MOD");
  1094. int num = binaryReader.ReadInt32();
  1095. string text = binaryReader.ReadString();
  1096. string text2 = binaryReader.ReadString();
  1097. text2 = text2.Replace(":", " ");
  1098. string text3 = binaryReader.ReadString();
  1099. string text4 = binaryReader.ReadString();
  1100. string text5 = binaryReader.ReadString();
  1101. binaryReader.Close();
  1102. fileStream.Close();
  1103. fileStream.Dispose();
  1104. return text2;
  1105. }
  1106. private static void ProcModScriptBin(Maid maid, byte[] cd, string filename, bool f_bTemp = false)
  1107. {
  1108. BinaryReader binaryReader = new BinaryReader(new MemoryStream(cd), Encoding.UTF8);
  1109. string text = binaryReader.ReadString();
  1110. NDebug.Assert(text == "CM3D2_MOD", "ProcModScriptBin 例外 : ヘッダーファイルが不正です。" + text);
  1111. int num = binaryReader.ReadInt32();
  1112. string text2 = binaryReader.ReadString();
  1113. string text3 = binaryReader.ReadString();
  1114. string text4 = binaryReader.ReadString();
  1115. string text5 = binaryReader.ReadString();
  1116. string text6 = binaryReader.ReadString();
  1117. string text7 = binaryReader.ReadString();
  1118. MPN mpn = MPN.null_mpn;
  1119. try
  1120. {
  1121. mpn = (MPN)Enum.Parse(typeof(MPN), text7);
  1122. }
  1123. catch
  1124. {
  1125. NDebug.Assert("カテゴリがありません。" + text7, false);
  1126. }
  1127. string text8 = string.Empty;
  1128. if (mpn != MPN.null_mpn)
  1129. {
  1130. text8 = binaryReader.ReadString();
  1131. }
  1132. string s = binaryReader.ReadString();
  1133. int num2 = binaryReader.ReadInt32();
  1134. Dictionary<string, byte[]> dictionary = new Dictionary<string, byte[]>();
  1135. for (int i = 0; i < num2; i++)
  1136. {
  1137. string key = binaryReader.ReadString();
  1138. int count = binaryReader.ReadInt32();
  1139. byte[] value = binaryReader.ReadBytes(count);
  1140. dictionary.Add(key, value);
  1141. }
  1142. binaryReader.Close();
  1143. binaryReader = null;
  1144. using (StringReader stringReader = new StringReader(s))
  1145. {
  1146. Menu.IMode mode = Menu.IMode.Non;
  1147. string slotname = string.Empty;
  1148. int num3 = 0;
  1149. TBodySkin tbodySkin = null;
  1150. Material material = null;
  1151. string text9;
  1152. while ((text9 = stringReader.ReadLine()) != null)
  1153. {
  1154. string[] array = text9.Split(new char[]
  1155. {
  1156. '\t',
  1157. ' '
  1158. }, StringSplitOptions.RemoveEmptyEntries);
  1159. if (array[0] == "アイテム変更" || array[0] == "マテリアル変更")
  1160. {
  1161. mode = Menu.IMode.ItemChange;
  1162. }
  1163. else if (array[0] == "テクスチャ変更")
  1164. {
  1165. mode = Menu.IMode.TexChange;
  1166. }
  1167. if (mode == Menu.IMode.ItemChange)
  1168. {
  1169. if (array[0] == "スロット名")
  1170. {
  1171. slotname = array[1];
  1172. tbodySkin = maid.body0.GetSlot(slotname);
  1173. }
  1174. if (tbodySkin != null)
  1175. {
  1176. if (array[0] == "マテリアル番号")
  1177. {
  1178. num3 = int.Parse(array[1]);
  1179. foreach (Transform transform in tbodySkin.obj.GetComponentsInChildren<Transform>(true))
  1180. {
  1181. Renderer component = transform.GetComponent<Renderer>();
  1182. if (!(component == null) && component.materials != null)
  1183. {
  1184. Material[] materials = component.materials;
  1185. for (int k = 0; k < materials.Length; k++)
  1186. {
  1187. if (k == num3)
  1188. {
  1189. material = materials[k];
  1190. break;
  1191. }
  1192. }
  1193. }
  1194. }
  1195. }
  1196. if (material != null)
  1197. {
  1198. if (array[0] == "テクスチャ設定")
  1199. {
  1200. maid.body0.ChangeTex(slotname, num3, array[1], array[2].ToLower(), dictionary, MaidParts.PARTS_COLOR.NONE);
  1201. }
  1202. else if (array[0] == "色設定")
  1203. {
  1204. 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));
  1205. }
  1206. else if (array[0] == "数値設定")
  1207. {
  1208. material.SetFloat(array[1], float.Parse(array[2]));
  1209. }
  1210. }
  1211. }
  1212. }
  1213. else if (mode == Menu.IMode.TexChange)
  1214. {
  1215. MaidParts.PARTS_COLOR parts_COLOR = MaidParts.PARTS_COLOR.NONE;
  1216. if (array.Length == 6)
  1217. {
  1218. string text10 = array[5];
  1219. try
  1220. {
  1221. parts_COLOR = (MaidParts.PARTS_COLOR)Enum.Parse(typeof(MaidParts.PARTS_COLOR), text10.ToUpper());
  1222. }
  1223. catch
  1224. {
  1225. NDebug.Assert("無限色IDがありません。" + text10, false);
  1226. }
  1227. }
  1228. maid.body0.ChangeTex(array[1], int.Parse(array[2]), array[3], array[4].ToLower(), dictionary, parts_COLOR);
  1229. if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
  1230. {
  1231. maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));
  1232. }
  1233. }
  1234. }
  1235. }
  1236. }
  1237. // Note: this type is marked as 'beforefieldinit'.
  1238. static Menu()
  1239. {
  1240. string[,] array = new string[31, 2];
  1241. array[0, 0] = "_MainTex";
  1242. array[0, 1] = "tex";
  1243. array[1, 0] = "_BumpMap";
  1244. array[1, 1] = "tex";
  1245. array[2, 0] = "_ToonRamp";
  1246. array[2, 1] = "tex";
  1247. array[3, 0] = "_ShadowTex";
  1248. array[3, 1] = "tex";
  1249. array[4, 0] = "_ShadowRateToon";
  1250. array[4, 1] = "tex";
  1251. array[5, 0] = "_SpecularTex";
  1252. array[5, 1] = "tex";
  1253. array[6, 0] = "_AnisoTex";
  1254. array[6, 1] = "tex";
  1255. array[7, 0] = "_RenderTex";
  1256. array[7, 1] = "tex";
  1257. array[8, 0] = "_HiTex";
  1258. array[8, 1] = "tex";
  1259. array[9, 0] = "_OutlineTex";
  1260. array[9, 1] = "tex";
  1261. array[10, 0] = "_OutlineToonRamp";
  1262. array[10, 1] = "tex";
  1263. array[11, 0] = "_Color";
  1264. array[11, 1] = "col";
  1265. array[12, 0] = "_ShadowColor";
  1266. array[12, 1] = "col";
  1267. array[13, 0] = "_RimColor";
  1268. array[13, 1] = "col";
  1269. array[14, 0] = "_SpecColor";
  1270. array[14, 1] = "col";
  1271. array[15, 0] = "_Emission";
  1272. array[15, 1] = "col";
  1273. array[16, 0] = "_ReflectColor";
  1274. array[16, 1] = "col";
  1275. array[17, 0] = "_OutlineColor";
  1276. array[17, 1] = "col";
  1277. array[18, 0] = "_MyLightColor0";
  1278. array[18, 1] = "col";
  1279. array[19, 0] = "_MyLightColor1";
  1280. array[19, 1] = "col";
  1281. array[20, 0] = "_TintColor";
  1282. array[20, 1] = "col";
  1283. array[21, 0] = "_ShadowColor";
  1284. array[21, 1] = "col";
  1285. array[22, 0] = "_Shininess";
  1286. array[22, 1] = "f";
  1287. array[23, 0] = "_FurLength";
  1288. array[23, 1] = "f";
  1289. array[24, 0] = "_OutlineWidth";
  1290. array[24, 1] = "f";
  1291. array[25, 0] = "_Cutoff";
  1292. array[25, 1] = "f";
  1293. array[26, 0] = "_AnisoOffset";
  1294. array[26, 1] = "f";
  1295. array[27, 0] = "_RimPower";
  1296. array[27, 1] = "f";
  1297. array[28, 0] = "_RimShift";
  1298. array[28, 1] = "f";
  1299. array[29, 0] = "_HiRate";
  1300. array[29, 1] = "f";
  1301. array[30, 0] = "_HiPow";
  1302. array[30, 1] = "f";
  1303. Menu.material_properties = array;
  1304. }
  1305. public static SortedDictionary<int, SortedDictionary<string, string>> m_dicResourceRef = new SortedDictionary<int, SortedDictionary<string, string>>();
  1306. private static string[] m_strAllTexInFileSys = null;
  1307. private static string[,] material_properties;
  1308. [CompilerGenerated]
  1309. private static Func<string, string> <>f__mg$cache0;
  1310. private class LastParam
  1311. {
  1312. public LastParam(int f_nOrder, string f_strComm, params string[] f_argArgs)
  1313. {
  1314. this.nOrder = f_nOrder;
  1315. this.strComm = f_strComm;
  1316. this.aryArgs = new string[f_argArgs.Length];
  1317. f_argArgs.CopyTo(this.aryArgs, 0);
  1318. }
  1319. public int nOrder;
  1320. public string strComm = string.Empty;
  1321. public string[] aryArgs;
  1322. }
  1323. private enum IMode
  1324. {
  1325. Non,
  1326. ItemChange,
  1327. TexChange
  1328. }
  1329. }