GameUty.cs 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7. using I2.Loc;
  8. using UnityEngine;
  9. using wf;
  10. public class GameUty
  11. {
  12. public static AFileSystemBase FileSystem
  13. {
  14. get
  15. {
  16. return GameUty.m_FileSystem;
  17. }
  18. }
  19. public static AFileSystemBase FileSystemOld
  20. {
  21. get
  22. {
  23. return GameUty.m_FileSystemOld;
  24. }
  25. }
  26. public static AFileSystemBase FileSystemMod
  27. {
  28. get
  29. {
  30. return GameUty.m_ModFileSystem;
  31. }
  32. }
  33. public static bool IsEnabledCompatibilityMode
  34. {
  35. get
  36. {
  37. return 0 < GameUty.PathListOld.Count && Product.type == Product.Type.JpAdult;
  38. }
  39. }
  40. public static HashSet<string> loadArchiveList { get; private set; }
  41. public static string[] MenuFiles
  42. {
  43. get
  44. {
  45. return GameUty.m_aryMenuFiles;
  46. }
  47. }
  48. public static string[] ModOnlysMenuFiles
  49. {
  50. get
  51. {
  52. return GameUty.m_aryModOnlysMenuFiles;
  53. }
  54. }
  55. public static Dictionary<int, string> RidMenuDic
  56. {
  57. get
  58. {
  59. return GameUty.rid_menu_dic_;
  60. }
  61. }
  62. public static Dictionary<string, AFileSystemBase> BgFiles { get; private set; }
  63. public static float MillisecondToSecond(int millisecond)
  64. {
  65. return (float)millisecond / 1000f;
  66. }
  67. public static Material GetSystemMaterial(GameUty.SystemMaterial f_mat)
  68. {
  69. Material material = GameUty.m_matSystem[(int)f_mat];
  70. if (material == null)
  71. {
  72. UnityEngine.Object original = Resources.Load(GameUty.m_strSystemMaterialName[(int)f_mat]);
  73. material = (UnityEngine.Object.Instantiate(original) as Material);
  74. GameUty.m_matSystem[(int)f_mat] = material;
  75. }
  76. return material;
  77. }
  78. public static GameObject LoadAssetBundle(string file_name)
  79. {
  80. if (GameUty.FileSystem == null || !GameUty.FileSystem.IsExistentFile(file_name))
  81. {
  82. return null;
  83. }
  84. UnityEngine.Object original = null;
  85. if (!GameUty.asset_bundle_dic.ContainsKey(file_name))
  86. {
  87. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
  88. {
  89. AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
  90. if (assetBundle.mainAsset != null)
  91. {
  92. original = assetBundle.mainAsset;
  93. }
  94. else
  95. {
  96. original = assetBundle.LoadAllAssets<GameObject>()[0];
  97. }
  98. GameUty.asset_bundle_dic.Add(file_name, assetBundle);
  99. }
  100. }
  101. else
  102. {
  103. original = GameUty.asset_bundle_dic[file_name].mainAsset;
  104. }
  105. GameObject gameObject = UnityEngine.Object.Instantiate(original) as GameObject;
  106. gameObject.name = gameObject.name.Replace("(Clone)", string.Empty);
  107. return gameObject;
  108. }
  109. public static void DeviceInitialize()
  110. {
  111. }
  112. public static void Init()
  113. {
  114. GameUty.m_FileSystem = new FileSystemArchive();
  115. GameUty.m_FileSystemOld = new FileSystemArchive();
  116. GameUty.loadArchiveList = new HashSet<string>();
  117. GameUty.PathListOld = new List<string>();
  118. if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
  119. {
  120. GameUty.PathListOld = GameUty.ReadAutoPathFile("[2.0]", GameMain.Instance.CMSystem.CM3D2Path + "\\GameData\\paths.dat");
  121. if (GameUty.PathListOld == null)
  122. {
  123. GameUty.PathListOld = new List<string>();
  124. }
  125. }
  126. GameUty.UpdateFileSystemPath();
  127. GameUty.UpdateFileSystemPathOld();
  128. PluginData.CreateData(GameUty.m_FileSystem, (!GameUty.IsEnabledCompatibilityMode) ? null : GameUty.m_FileSystemOld);
  129. Debug.Log("■■■■■■■■ Plugin Check ■■■■■■■■");
  130. foreach (string text in PluginData.GetAllUniqueNames())
  131. {
  132. Debug.Log(string.Concat(new string[]
  133. {
  134. "[",
  135. PluginData.uniqueNameToId(text).ToString(),
  136. "]",
  137. text,
  138. " : ",
  139. (!PluginData.IsEnabled(text)) ? "×" : "○"
  140. }));
  141. }
  142. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  143. string windowTitel = Product.windowTitel;
  144. if (!string.IsNullOrEmpty(windowTitel))
  145. {
  146. DllBase.Win32.SetWindowText(DllBase.Win32.GetActiveWindow(), windowTitel);
  147. }
  148. }
  149. public static void Finish()
  150. {
  151. foreach (KeyValuePair<string, AssetBundle> keyValuePair in GameUty.asset_bundle_dic)
  152. {
  153. keyValuePair.Value.Unload(true);
  154. }
  155. GameUty.asset_bundle_dic.Clear();
  156. GameUty.m_FileSystem.Dispose();
  157. GameUty.m_FileSystem = null;
  158. if (GameUty.m_FileSystemOld != null)
  159. {
  160. GameUty.m_FileSystemOld.Dispose();
  161. GameUty.m_FileSystemOld = null;
  162. }
  163. if (GameUty.m_ModFileSystem != null)
  164. {
  165. GameUty.m_ModFileSystem.Dispose();
  166. GameUty.m_ModFileSystem = null;
  167. }
  168. }
  169. public static Dictionary<string, HashSet<string>> GetGameDataResourceList(string gameDataPath)
  170. {
  171. string[] array = new string[]
  172. {
  173. "script_cbl",
  174. "motion_cbl",
  175. "voice_cbl"
  176. };
  177. int length = (gameDataPath + "\\").Length;
  178. string[] directories = Directory.GetDirectories(gameDataPath);
  179. Dictionary<string, HashSet<string>> dictionary = new Dictionary<string, HashSet<string>>();
  180. for (int i = 0; i < directories.Length; i++)
  181. {
  182. string text = directories[i].Substring(length, directories[i].Length - length).ToLower();
  183. int startIndex = 0;
  184. foreach (string text2 in array)
  185. {
  186. if (text.IndexOf(text2) == 0)
  187. {
  188. startIndex = text2.Length;
  189. break;
  190. }
  191. }
  192. int num = text.IndexOf('_', startIndex);
  193. if (0 <= num)
  194. {
  195. string text3 = text.Substring(0, num);
  196. if (!string.IsNullOrEmpty(text3))
  197. {
  198. string text4 = text.Substring(text3.Length + 1, text.Length - (text3.Length + 1));
  199. if (!string.IsNullOrEmpty(text4))
  200. {
  201. if (!dictionary.ContainsKey(text3))
  202. {
  203. dictionary.Add(text3, new HashSet<string>());
  204. }
  205. if (!dictionary[text3].Contains(text4))
  206. {
  207. dictionary[text3].Add(text4);
  208. }
  209. else
  210. {
  211. Debug.LogWarning(text3 + "_" + text4 + "は既にリストに存在します");
  212. }
  213. }
  214. }
  215. }
  216. else if (!dictionary.ContainsKey(text))
  217. {
  218. dictionary.Add(text, new HashSet<string>());
  219. }
  220. else
  221. {
  222. Debug.LogWarning(text + "は既にリストに存在します");
  223. }
  224. }
  225. return dictionary;
  226. }
  227. public static List<string> ReadAutoPathFile(string uniqueName, string filePath)
  228. {
  229. if (!File.Exists(filePath))
  230. {
  231. return null;
  232. }
  233. List<string> list = new List<string>();
  234. using (FileStream fileStream = new FileStream(filePath, FileMode.Open))
  235. {
  236. using (BinaryReader binaryReader = new BinaryReader(fileStream))
  237. {
  238. string a = binaryReader.ReadString();
  239. NDebug.Assert(a == "CM3D2_PATHS", "パスファイルのヘッダーが不正です。");
  240. int num = binaryReader.ReadInt32();
  241. int num2 = binaryReader.ReadInt32();
  242. for (int i = 0; i < num2; i++)
  243. {
  244. string item = binaryReader.ReadString();
  245. list.Add(item);
  246. }
  247. }
  248. }
  249. return list;
  250. }
  251. public static void UpdateFileSystemPath()
  252. {
  253. string fullPath = Path.GetFullPath(".\\");
  254. string gameDataPath = "GameData";
  255. int check_ver_no = 3;
  256. Func<string, bool> AddFolderOrArchive = delegate(string name)
  257. {
  258. bool flag3 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
  259. if (flag3)
  260. {
  261. Debug.Log(string.Concat(new string[]
  262. {
  263. "[",
  264. gameDataPath,
  265. "\\",
  266. name,
  267. ".arc]を読み込みました"
  268. }));
  269. }
  270. if (flag3)
  271. {
  272. GameUty.loadArchiveList.Add(name.ToLower());
  273. }
  274. return flag3;
  275. };
  276. HashSet<string> addedLegacyArchives = new HashSet<string>();
  277. Action<string> action = delegate(string name)
  278. {
  279. foreach (string text29 in GameUty.PathList)
  280. {
  281. string text30 = name + "_" + text29;
  282. bool flag3 = AddFolderOrArchive(text30);
  283. if (flag3 && !addedLegacyArchives.Contains(text30))
  284. {
  285. addedLegacyArchives.Add(text30);
  286. }
  287. if (flag3)
  288. {
  289. if (name == "csv")
  290. {
  291. GameUty.ExistCsvPathList.Add(text29);
  292. }
  293. for (int num15 = 2; num15 <= check_ver_no; num15++)
  294. {
  295. AddFolderOrArchive(text30 + "_" + num15);
  296. }
  297. }
  298. }
  299. };
  300. Action<string> action2 = delegate(string name)
  301. {
  302. foreach (string text29 in GameUty.PathList)
  303. {
  304. string text30 = name + "_" + text29;
  305. bool flag3 = AddFolderOrArchive(text30);
  306. if (!flag3 && addedLegacyArchives.Contains(text30))
  307. {
  308. flag3 = true;
  309. }
  310. if (flag3)
  311. {
  312. if (name == "csv")
  313. {
  314. GameUty.ExistCsvPathList.Add(text29);
  315. }
  316. for (int num15 = 2; num15 <= check_ver_no; num15++)
  317. {
  318. AddFolderOrArchive(string.Concat(new object[]
  319. {
  320. name,
  321. "_",
  322. text29,
  323. "_",
  324. num15
  325. }));
  326. }
  327. }
  328. }
  329. };
  330. Action<string> action3 = delegate(string name)
  331. {
  332. foreach (string text29 in GameUty.PathList)
  333. {
  334. if (AddFolderOrArchive(name + "_" + text29))
  335. {
  336. if (name == "csv")
  337. {
  338. GameUty.ExistCsvPathList.Add(text29);
  339. }
  340. for (int num15 = 2; num15 <= check_ver_no; num15++)
  341. {
  342. AddFolderOrArchive(string.Concat(new object[]
  343. {
  344. name,
  345. "_",
  346. text29,
  347. "_",
  348. num15
  349. }));
  350. }
  351. }
  352. }
  353. };
  354. string str = string.Empty;
  355. str = "必用アーカイブがありません。GameData\\";
  356. GameUty.m_FileSystem.SetBaseDirectory(fullPath);
  357. AddFolderOrArchive("product");
  358. Product.Initialize(GameUty.m_FileSystem);
  359. Debug.Log("IsEnabledCompatibilityMode:" + GameUty.IsEnabledCompatibilityMode.ToString());
  360. string gameTitle = Product.gameTitle;
  361. string str2 = "カスタムメイド3D 2";
  362. Debug.Log(string.Concat(new string[]
  363. {
  364. gameTitle,
  365. " GameVersion ",
  366. GameUty.GetGameVersionText(),
  367. "(BuildVersion : ",
  368. GameUty.GetBuildVersionText(),
  369. ")"
  370. }));
  371. if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
  372. {
  373. Debug.Log(str2 + " GameVersion " + GameUty.GetLegacyGameVersionText());
  374. }
  375. if (Product.type != Product.Type.JpAdult)
  376. {
  377. GameUty.UpdateFileSystemPathToNewProduct();
  378. }
  379. else
  380. {
  381. StopWatch stopWatch = new StopWatch();
  382. if (GameUty.IsEnabledCompatibilityMode)
  383. {
  384. Debug.Log("■■■■■■■■ Archive Log[2.0] (CM3D2 GameData) ■■■■■■■■");
  385. GameUty.m_FileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  386. GameUty.PathList = GameUty.PathListOld;
  387. AddFolderOrArchive("material");
  388. foreach (string text in GameUty.PathListOld)
  389. {
  390. string str3 = "material";
  391. if (text == "denkigai2015wTowelR")
  392. {
  393. AddFolderOrArchive(str3 + "_denkigai2015wTowel");
  394. }
  395. string text2 = str3 + "_" + text;
  396. bool flag = AddFolderOrArchive(text2);
  397. if (flag && !addedLegacyArchives.Contains(text2))
  398. {
  399. addedLegacyArchives.Add(text2);
  400. }
  401. if (flag)
  402. {
  403. for (int i2 = 2; i2 <= check_ver_no; i2++)
  404. {
  405. AddFolderOrArchive(text2 + "_" + i2);
  406. }
  407. }
  408. }
  409. AddFolderOrArchive("material2");
  410. AddFolderOrArchive("menu");
  411. action("menu");
  412. AddFolderOrArchive("menu2");
  413. AddFolderOrArchive("model");
  414. action("model");
  415. AddFolderOrArchive("model2");
  416. AddFolderOrArchive("texture");
  417. action("texture");
  418. AddFolderOrArchive("texture2");
  419. AddFolderOrArchive("texture3");
  420. AddFolderOrArchive("prioritymaterial");
  421. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  422. }
  423. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  424. gameDataPath = "GameData_20";
  425. GameUty.m_FileSystem.SetBaseDirectory(fullPath);
  426. if (GameUty.IsEnabledCompatibilityMode)
  427. {
  428. GameUty.m_FileSystem.AddPatchDecryptPreferredSearchDirectory(GameMain.Instance.CMSystem.CM3D2Path + "\\GameData");
  429. }
  430. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", fullPath + gameDataPath + "\\paths.dat");
  431. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  432. {
  433. foreach (string text3 in GameUty.PathList)
  434. {
  435. string text4 = "material";
  436. if (text3 == "denkigai2015wTowelR")
  437. {
  438. AddFolderOrArchive(text4 + "_denkigai2015wTowel");
  439. }
  440. string text5 = text4 + "_" + text3;
  441. bool flag2 = AddFolderOrArchive(text5);
  442. if (!flag2 && addedLegacyArchives.Contains(text5))
  443. {
  444. flag2 = true;
  445. }
  446. if (flag2)
  447. {
  448. for (int j = 2; j <= check_ver_no; j++)
  449. {
  450. AddFolderOrArchive(string.Concat(new object[]
  451. {
  452. text4,
  453. "_",
  454. text3,
  455. "_",
  456. j
  457. }));
  458. }
  459. }
  460. }
  461. action2("menu");
  462. action2("model");
  463. action2("texture");
  464. AddFolderOrArchive("prioritymaterial");
  465. List<string> pathList = GameUty.PathList;
  466. GameUty.PathList = new List<string>();
  467. GameUty.PathList.Add("vp001");
  468. action2("bg");
  469. action2("motion");
  470. GameUty.PathList = pathList;
  471. }
  472. GameUty.m_FileSystem.ClearPatchDecryptPreferredSearchDirectory();
  473. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  474. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  475. gameDataPath = "GameData";
  476. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", fullPath + gameDataPath + "\\paths.dat");
  477. if (GameUty.PathList == null)
  478. {
  479. GameUty.PathList = new List<string>();
  480. NDebug.Assert("paths.datを読み込めませんでした", false);
  481. }
  482. AddFolderOrArchive("csv");
  483. foreach (string text6 in GameUty.PathList)
  484. {
  485. string text7 = "csv";
  486. if (AddFolderOrArchive(text7 + "_" + text6))
  487. {
  488. for (int k = 2; k <= check_ver_no; k++)
  489. {
  490. AddFolderOrArchive(string.Concat(new object[]
  491. {
  492. text7,
  493. "_",
  494. text6,
  495. "_",
  496. k
  497. }));
  498. }
  499. }
  500. }
  501. AddFolderOrArchive("prioritymaterial");
  502. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  503. foreach (string text8 in GameUty.PathList)
  504. {
  505. string text9 = "motion";
  506. if (AddFolderOrArchive(text9 + "_" + text8))
  507. {
  508. for (int l = 2; l <= check_ver_no; l++)
  509. {
  510. AddFolderOrArchive(string.Concat(new object[]
  511. {
  512. text9,
  513. "_",
  514. text8,
  515. "_",
  516. l
  517. }));
  518. }
  519. }
  520. }
  521. AddFolderOrArchive("motion2");
  522. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  523. foreach (string text10 in GameUty.PathList)
  524. {
  525. string text11 = "script";
  526. if (AddFolderOrArchive(text11 + "_" + text10))
  527. {
  528. for (int m = 2; m <= check_ver_no; m++)
  529. {
  530. AddFolderOrArchive(string.Concat(new object[]
  531. {
  532. text11,
  533. "_",
  534. text10,
  535. "_",
  536. m
  537. }));
  538. }
  539. }
  540. }
  541. AddFolderOrArchive("script_share");
  542. foreach (string text12 in GameUty.PathList)
  543. {
  544. string text13 = "script_share";
  545. if (AddFolderOrArchive(text13 + "_" + text12))
  546. {
  547. for (int n = 2; n <= check_ver_no; n++)
  548. {
  549. AddFolderOrArchive(string.Concat(new object[]
  550. {
  551. text13,
  552. "_",
  553. text12,
  554. "_",
  555. n
  556. }));
  557. }
  558. }
  559. }
  560. AddFolderOrArchive("script_share2");
  561. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  562. foreach (string text14 in GameUty.PathList)
  563. {
  564. string text15 = "sound";
  565. if (AddFolderOrArchive(text15 + "_" + text14))
  566. {
  567. for (int num = 2; num <= check_ver_no; num++)
  568. {
  569. AddFolderOrArchive(string.Concat(new object[]
  570. {
  571. text15,
  572. "_",
  573. text14,
  574. "_",
  575. num
  576. }));
  577. }
  578. }
  579. }
  580. AddFolderOrArchive("sound2");
  581. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  582. foreach (string text16 in GameUty.PathList)
  583. {
  584. string text17 = "system";
  585. if (AddFolderOrArchive(text17 + "_" + text16))
  586. {
  587. for (int num2 = 2; num2 <= check_ver_no; num2++)
  588. {
  589. AddFolderOrArchive(string.Concat(new object[]
  590. {
  591. text17,
  592. "_",
  593. text16,
  594. "_",
  595. num2
  596. }));
  597. }
  598. }
  599. }
  600. AddFolderOrArchive("system2");
  601. AddFolderOrArchive("language");
  602. foreach (string text18 in GameUty.PathList)
  603. {
  604. string text19 = "language";
  605. if (AddFolderOrArchive(text19 + "_" + text18))
  606. {
  607. for (int num3 = 2; num3 <= check_ver_no; num3++)
  608. {
  609. AddFolderOrArchive(string.Concat(new object[]
  610. {
  611. text19,
  612. "_",
  613. text18,
  614. "_",
  615. num3
  616. }));
  617. }
  618. }
  619. }
  620. foreach (string text20 in GameUty.PathList)
  621. {
  622. string text21 = "bg";
  623. if (AddFolderOrArchive(text21 + "_" + text20))
  624. {
  625. for (int num4 = 2; num4 <= check_ver_no; num4++)
  626. {
  627. AddFolderOrArchive(string.Concat(new object[]
  628. {
  629. text21,
  630. "_",
  631. text20,
  632. "_",
  633. num4
  634. }));
  635. }
  636. }
  637. }
  638. if (Product.isEnglish && !Product.isPublic)
  639. {
  640. string text22 = "bg-en";
  641. NDebug.Assert(AddFolderOrArchive(text22), str + text22);
  642. foreach (string text23 in GameUty.PathList)
  643. {
  644. if (AddFolderOrArchive(text22 + "_" + text23))
  645. {
  646. for (int num5 = 2; num5 <= check_ver_no; num5++)
  647. {
  648. AddFolderOrArchive(string.Concat(new object[]
  649. {
  650. text22,
  651. "_",
  652. text23,
  653. "_",
  654. num5
  655. }));
  656. }
  657. }
  658. }
  659. AddFolderOrArchive("bg-en2");
  660. }
  661. AddFolderOrArchive("voice");
  662. for (int num6 = 0; num6 < 25; num6++)
  663. {
  664. string arg = "voice";
  665. string arg2 = arg + "_" + (char)(97 + num6);
  666. AddFolderOrArchive(arg2);
  667. }
  668. foreach (string text24 in GameUty.PathList)
  669. {
  670. string text25 = "voice";
  671. if (AddFolderOrArchive(text25 + "_" + text24))
  672. {
  673. for (int num7 = 2; num7 <= check_ver_no; num7++)
  674. {
  675. AddFolderOrArchive(string.Concat(new object[]
  676. {
  677. text25,
  678. "_",
  679. text24,
  680. "_",
  681. num7
  682. }));
  683. }
  684. }
  685. }
  686. for (int num8 = 2; num8 <= check_ver_no; num8++)
  687. {
  688. string arg3 = "voice";
  689. AddFolderOrArchive(arg3 + num8);
  690. }
  691. string text26 = "parts";
  692. NDebug.Assert(AddFolderOrArchive(text26), str + text26);
  693. foreach (string text27 in GameUty.PathList)
  694. {
  695. if (AddFolderOrArchive(text26 + "_" + text27))
  696. {
  697. for (int num9 = 2; num9 <= check_ver_no; num9++)
  698. {
  699. AddFolderOrArchive(string.Concat(new object[]
  700. {
  701. text26,
  702. "_",
  703. text27,
  704. "_",
  705. num9
  706. }));
  707. }
  708. }
  709. }
  710. AddFolderOrArchive("parts2");
  711. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  712. }
  713. GameUty.m_FileSystem.AddAutoPathForAllFolder();
  714. GameUty.BgFiles = new Dictionary<string, AFileSystemBase>();
  715. string[] list = GameUty.m_FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  716. if (list != null && 0 < list.Length)
  717. {
  718. foreach (string path in list)
  719. {
  720. string fileName = Path.GetFileName(path);
  721. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  722. {
  723. GameUty.BgFiles.Add(fileName, GameUty.m_FileSystem);
  724. }
  725. }
  726. }
  727. if (Product.supportMultiLanguage)
  728. {
  729. list = GameUty.m_FileSystem.GetList("language", AFileSystemBase.ListType.AllFile);
  730. if (list != null && 0 < list.Length)
  731. {
  732. foreach (string path2 in list)
  733. {
  734. string fileName2 = Path.GetFileName(path2);
  735. if (!(Path.GetExtension(fileName2) != ".asset_language"))
  736. {
  737. using (AFileBase afileBase = GameUty.m_FileSystem.FileOpen(fileName2))
  738. {
  739. AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
  740. LanguageSource languageSource = UnityEngine.Object.Instantiate<LanguageSource>(assetBundle.LoadAllAssets<GameObject>()[0].GetComponent<LanguageSource>());
  741. if (GameMain.Instance.transform.Find("Language") == null)
  742. {
  743. new GameObject("Language").transform.SetParent(GameMain.Instance.transform);
  744. }
  745. languageSource.transform.SetParent(GameMain.Instance.transform.Find("Language"));
  746. assetBundle.Unload(true);
  747. }
  748. }
  749. }
  750. }
  751. foreach (LanguageSource languageSource2 in LocalizationManager.Sources)
  752. {
  753. languageSource2.LoadAllLanguages(false);
  754. }
  755. }
  756. if (Directory.Exists(fullPath + "Mod"))
  757. {
  758. GameUty.m_ModFileSystem = new FileSystemWindows();
  759. GameUty.m_ModFileSystem.SetBaseDirectory(fullPath);
  760. GameUty.m_ModFileSystem.AddFolder("Mod");
  761. string[] list2 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFolder);
  762. foreach (string text28 in list2)
  763. {
  764. if (!GameUty.m_ModFileSystem.AddAutoPath(text28))
  765. {
  766. Debug.Log("m_ModFileSystemのAddAutoPathには既に " + text28 + " がありました。");
  767. }
  768. }
  769. }
  770. string[] fileListAtExtension = GameUty.m_FileSystem.GetFileListAtExtension(".menu");
  771. List<string> list3 = new List<string>();
  772. foreach (string path3 in fileListAtExtension)
  773. {
  774. list3.Add(Path.GetFileName(path3));
  775. }
  776. GameUty.m_aryMenuFiles = list3.ToArray();
  777. if (GameUty.m_ModFileSystem != null)
  778. {
  779. string[] list4 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
  780. GameUty.m_aryModOnlysMenuFiles = Array.FindAll<string>(list4, (string i) => new Regex(".*\\.menu$").IsMatch(i));
  781. GameUty.m_aryMenuFiles = GameUty.m_aryMenuFiles.Concat(GameUty.m_aryModOnlysMenuFiles).ToArray<string>();
  782. }
  783. if (GameUty.m_aryModOnlysMenuFiles != null && GameUty.m_aryModOnlysMenuFiles.Length != 0)
  784. {
  785. GameUty.ModPriorityToModFolderInfo = string.Empty;
  786. Debug.Log(GameUty.ModPriorityToModFolderInfo + "■MOD有り。MODフォルダ優先モード" + GameUty.ModPriorityToModFolder.ToString());
  787. }
  788. if (GameUty.rid_menu_dic_.Count == 0)
  789. {
  790. string[] menuFiles = GameUty.MenuFiles;
  791. GameUty.rid_menu_dic_ = new Dictionary<int, string>();
  792. for (int num14 = 0; num14 < menuFiles.Length; num14++)
  793. {
  794. string fileName3 = Path.GetFileName(menuFiles[num14]);
  795. int hashCode = fileName3.ToLower().GetHashCode();
  796. if (!GameUty.rid_menu_dic_.ContainsKey(hashCode))
  797. {
  798. GameUty.rid_menu_dic_.Add(hashCode, fileName3);
  799. }
  800. else
  801. {
  802. NDebug.Assert(fileName3 == GameUty.rid_menu_dic_[hashCode], string.Concat(new string[]
  803. {
  804. "[",
  805. fileName3,
  806. "]と[",
  807. GameUty.rid_menu_dic_[hashCode],
  808. "]は同じハッシュキーです"
  809. }));
  810. }
  811. }
  812. }
  813. }
  814. public static void UpdateFileSystemPathToNewProduct()
  815. {
  816. string fullPath = Path.GetFullPath(".\\");
  817. string gameDataPath = "GameData";
  818. string str = string.Empty;
  819. str = "必用アーカイブがありません。GameData" + Product.gameDataPath + "\\";
  820. int check_ver_no = 3;
  821. Func<string, bool> AddFolderOrArchive = delegate(string name)
  822. {
  823. string gameDataPath = gameDataPath;
  824. bool flag2 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
  825. if (flag2)
  826. {
  827. Debug.Log(string.Concat(new string[]
  828. {
  829. "[",
  830. gameDataPath,
  831. "\\",
  832. name,
  833. ".arc]を読み込みました"
  834. }));
  835. }
  836. if (flag2)
  837. {
  838. GameUty.loadArchiveList.Add(name.ToLower());
  839. }
  840. return flag2;
  841. };
  842. Action<string> action = delegate(string name)
  843. {
  844. foreach (string text27 in GameUty.PathList)
  845. {
  846. string arg5 = name + "_" + text27;
  847. bool flag2 = AddFolderOrArchive(arg5);
  848. if (flag2)
  849. {
  850. if (name == "csv")
  851. {
  852. GameUty.ExistCsvPathList.Add(text27);
  853. }
  854. for (int num10 = 2; num10 <= check_ver_no; num10++)
  855. {
  856. AddFolderOrArchive(string.Concat(new object[]
  857. {
  858. name,
  859. "_",
  860. text27,
  861. "_",
  862. num10
  863. }));
  864. }
  865. }
  866. }
  867. };
  868. Action<string> action2 = delegate(string name)
  869. {
  870. foreach (string text27 in GameUty.PathList)
  871. {
  872. if (AddFolderOrArchive(name + "_" + text27))
  873. {
  874. if (name == "csv")
  875. {
  876. GameUty.ExistCsvPathList.Add(text27);
  877. }
  878. for (int num10 = 2; num10 <= check_ver_no; num10++)
  879. {
  880. AddFolderOrArchive(string.Concat(new object[]
  881. {
  882. name,
  883. "_",
  884. text27,
  885. "_",
  886. num10
  887. }));
  888. }
  889. }
  890. }
  891. };
  892. StopWatch stopWatch = new StopWatch();
  893. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  894. gameDataPath = "GameData_20";
  895. GameUty.m_FileSystem.SetBaseDirectory(fullPath);
  896. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", fullPath + gameDataPath + "\\paths.dat");
  897. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  898. {
  899. foreach (string text in GameUty.PathList)
  900. {
  901. string text2 = "material";
  902. if (text == "denkigai2015wTowelR")
  903. {
  904. AddFolderOrArchive(text2 + "_denkigai2015wTowel");
  905. }
  906. string arg = text2 + "_" + text;
  907. bool flag = AddFolderOrArchive(arg);
  908. if (flag)
  909. {
  910. for (int i = 2; i <= check_ver_no; i++)
  911. {
  912. AddFolderOrArchive(string.Concat(new object[]
  913. {
  914. text2,
  915. "_",
  916. text,
  917. "_",
  918. i
  919. }));
  920. }
  921. }
  922. }
  923. action("menu");
  924. action("model");
  925. action("texture");
  926. AddFolderOrArchive("prioritymaterial");
  927. List<string> pathList = GameUty.PathList;
  928. GameUty.PathList = new List<string>();
  929. GameUty.PathList.Add("vp001");
  930. action("bg");
  931. action("motion");
  932. GameUty.PathList = pathList;
  933. }
  934. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  935. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  936. gameDataPath = "GameData";
  937. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", fullPath + gameDataPath + "\\paths.dat");
  938. if (GameUty.PathList == null)
  939. {
  940. GameUty.PathList = new List<string>();
  941. NDebug.Assert("paths.datを読み込めませんでした", false);
  942. }
  943. GameUty.PathList.Add(Product.gameDataPath.Replace("_", string.Empty));
  944. AddFolderOrArchive("csv");
  945. foreach (string text3 in GameUty.PathList)
  946. {
  947. string text4 = "csv";
  948. if (AddFolderOrArchive(text4 + "_" + text3))
  949. {
  950. for (int j = 2; j <= check_ver_no; j++)
  951. {
  952. AddFolderOrArchive(string.Concat(new object[]
  953. {
  954. text4,
  955. "_",
  956. text3,
  957. "_",
  958. j
  959. }));
  960. }
  961. }
  962. }
  963. AddFolderOrArchive("prioritymaterial");
  964. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  965. foreach (string text5 in GameUty.PathList)
  966. {
  967. string text6 = "motion";
  968. if (AddFolderOrArchive(text6 + "_" + text5))
  969. {
  970. for (int k = 2; k <= check_ver_no; k++)
  971. {
  972. AddFolderOrArchive(string.Concat(new object[]
  973. {
  974. text6,
  975. "_",
  976. text5,
  977. "_",
  978. k
  979. }));
  980. }
  981. }
  982. }
  983. AddFolderOrArchive("motion2");
  984. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  985. foreach (string text7 in GameUty.PathList)
  986. {
  987. string text8 = "script";
  988. if (AddFolderOrArchive(text8 + "_" + text7))
  989. {
  990. for (int l = 2; l <= check_ver_no; l++)
  991. {
  992. AddFolderOrArchive(string.Concat(new object[]
  993. {
  994. text8,
  995. "_",
  996. text7,
  997. "_",
  998. l
  999. }));
  1000. }
  1001. }
  1002. }
  1003. AddFolderOrArchive("script_share");
  1004. foreach (string text9 in GameUty.PathList)
  1005. {
  1006. string text10 = "script_share";
  1007. if (AddFolderOrArchive(text10 + "_" + text9))
  1008. {
  1009. for (int m = 2; m <= check_ver_no; m++)
  1010. {
  1011. AddFolderOrArchive(string.Concat(new object[]
  1012. {
  1013. text10,
  1014. "_",
  1015. text9,
  1016. "_",
  1017. m
  1018. }));
  1019. }
  1020. }
  1021. }
  1022. AddFolderOrArchive("script_share2");
  1023. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  1024. foreach (string text11 in GameUty.PathList)
  1025. {
  1026. string text12 = "sound";
  1027. if (AddFolderOrArchive(text12 + "_" + text11))
  1028. {
  1029. for (int n = 2; n <= check_ver_no; n++)
  1030. {
  1031. AddFolderOrArchive(string.Concat(new object[]
  1032. {
  1033. text12,
  1034. "_",
  1035. text11,
  1036. "_",
  1037. n
  1038. }));
  1039. }
  1040. }
  1041. }
  1042. AddFolderOrArchive("sound2");
  1043. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  1044. foreach (string text13 in GameUty.PathList)
  1045. {
  1046. string text14 = "system";
  1047. if (AddFolderOrArchive(text14 + "_" + text13))
  1048. {
  1049. for (int num = 2; num <= check_ver_no; num++)
  1050. {
  1051. AddFolderOrArchive(string.Concat(new object[]
  1052. {
  1053. text14,
  1054. "_",
  1055. text13,
  1056. "_",
  1057. num
  1058. }));
  1059. }
  1060. }
  1061. }
  1062. AddFolderOrArchive("system2");
  1063. AddFolderOrArchive("language");
  1064. foreach (string text15 in GameUty.PathList)
  1065. {
  1066. string text16 = "language";
  1067. if (AddFolderOrArchive(text16 + "_" + text15))
  1068. {
  1069. for (int num2 = 2; num2 <= check_ver_no; num2++)
  1070. {
  1071. AddFolderOrArchive(string.Concat(new object[]
  1072. {
  1073. text16,
  1074. "_",
  1075. text15,
  1076. "_",
  1077. num2
  1078. }));
  1079. }
  1080. }
  1081. }
  1082. foreach (string text17 in GameUty.PathList)
  1083. {
  1084. string text18 = "bg";
  1085. if (AddFolderOrArchive(text18 + "_" + text17))
  1086. {
  1087. for (int num3 = 2; num3 <= check_ver_no; num3++)
  1088. {
  1089. AddFolderOrArchive(string.Concat(new object[]
  1090. {
  1091. text18,
  1092. "_",
  1093. text17,
  1094. "_",
  1095. num3
  1096. }));
  1097. }
  1098. }
  1099. }
  1100. if (Product.isEnglish && !Product.isPublic)
  1101. {
  1102. string text19 = "bg-en";
  1103. NDebug.Assert(AddFolderOrArchive(text19), str + text19);
  1104. foreach (string text20 in GameUty.PathList)
  1105. {
  1106. if (AddFolderOrArchive(text19 + "_" + text20))
  1107. {
  1108. for (int num4 = 2; num4 <= check_ver_no; num4++)
  1109. {
  1110. AddFolderOrArchive(string.Concat(new object[]
  1111. {
  1112. text19,
  1113. "_",
  1114. text20,
  1115. "_",
  1116. num4
  1117. }));
  1118. }
  1119. }
  1120. }
  1121. AddFolderOrArchive("bg-en2");
  1122. }
  1123. AddFolderOrArchive("voice");
  1124. for (int num5 = 0; num5 < 25; num5++)
  1125. {
  1126. string arg2 = "voice";
  1127. string arg3 = arg2 + "_" + (char)(97 + num5);
  1128. AddFolderOrArchive(arg3);
  1129. }
  1130. foreach (string text21 in GameUty.PathList)
  1131. {
  1132. string text22 = "voice";
  1133. if (AddFolderOrArchive(text22 + "_" + text21))
  1134. {
  1135. for (int num6 = 2; num6 <= check_ver_no; num6++)
  1136. {
  1137. AddFolderOrArchive(string.Concat(new object[]
  1138. {
  1139. text22,
  1140. "_",
  1141. text21,
  1142. "_",
  1143. num6
  1144. }));
  1145. }
  1146. }
  1147. }
  1148. for (int num7 = 2; num7 <= check_ver_no; num7++)
  1149. {
  1150. string arg4 = "voice";
  1151. AddFolderOrArchive(arg4 + num7);
  1152. }
  1153. string text23 = "parts";
  1154. NDebug.Assert(AddFolderOrArchive(text23), str + text23);
  1155. foreach (string text24 in GameUty.PathList)
  1156. {
  1157. if (AddFolderOrArchive(text23 + "_" + text24))
  1158. {
  1159. for (int num8 = 2; num8 <= check_ver_no; num8++)
  1160. {
  1161. AddFolderOrArchive(string.Concat(new object[]
  1162. {
  1163. text23,
  1164. "_",
  1165. text24,
  1166. "_",
  1167. num8
  1168. }));
  1169. }
  1170. }
  1171. }
  1172. AddFolderOrArchive("parts2");
  1173. if (Product.isEnglish && !Product.isPublic)
  1174. {
  1175. string text25 = "parts-en";
  1176. NDebug.Assert(AddFolderOrArchive(text25), str + text25);
  1177. foreach (string text26 in GameUty.PathList)
  1178. {
  1179. if (AddFolderOrArchive(text25 + "_" + text26))
  1180. {
  1181. for (int num9 = 2; num9 <= check_ver_no; num9++)
  1182. {
  1183. AddFolderOrArchive(string.Concat(new object[]
  1184. {
  1185. text25,
  1186. "_",
  1187. text26,
  1188. "_",
  1189. num9
  1190. }));
  1191. }
  1192. }
  1193. }
  1194. AddFolderOrArchive("parts-en2");
  1195. }
  1196. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  1197. }
  1198. public static void UpdateFileSystemPathOld()
  1199. {
  1200. if (!GameUty.IsEnabledCompatibilityMode)
  1201. {
  1202. return;
  1203. }
  1204. FileSystemArchive fileSystem = GameUty.m_FileSystemOld;
  1205. Debug.Log("■■■■■■■■ Archive Log[Legacy]■■■■■■■■");
  1206. Func<string, bool> AddFolderOrArchive = delegate(string name)
  1207. {
  1208. bool flag = fileSystem.AddArchive("GameData\\" + name + ".arc");
  1209. if (flag)
  1210. {
  1211. Debug.Log("[GameData\\" + name + ".arc]を読み込みました");
  1212. }
  1213. return flag;
  1214. };
  1215. int check_ver_no = 3;
  1216. Action<string> action = delegate(string name)
  1217. {
  1218. foreach (string text2 in GameUty.PathListOld)
  1219. {
  1220. if (AddFolderOrArchive(name + "_" + text2))
  1221. {
  1222. if (name == "csv")
  1223. {
  1224. GameUty.ExistCsvPathListOld.Add(text2);
  1225. }
  1226. for (int m = 2; m <= check_ver_no; m++)
  1227. {
  1228. AddFolderOrArchive(string.Concat(new object[]
  1229. {
  1230. name,
  1231. "_",
  1232. text2,
  1233. "_",
  1234. m
  1235. }));
  1236. }
  1237. }
  1238. }
  1239. };
  1240. fileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  1241. AddFolderOrArchive("csv");
  1242. action("csv");
  1243. AddFolderOrArchive("motion");
  1244. action("motion");
  1245. AddFolderOrArchive("motion2");
  1246. AddFolderOrArchive("script");
  1247. action("script");
  1248. action("script_share");
  1249. AddFolderOrArchive("script_share2");
  1250. AddFolderOrArchive("sound");
  1251. action("sound");
  1252. AddFolderOrArchive("sound2");
  1253. AddFolderOrArchive("texture");
  1254. action("texture");
  1255. AddFolderOrArchive("texture2");
  1256. AddFolderOrArchive("texture3");
  1257. AddFolderOrArchive("system");
  1258. action("system");
  1259. action("bg");
  1260. AddFolderOrArchive("voice");
  1261. AddFolderOrArchive("voice_a");
  1262. AddFolderOrArchive("voice_b");
  1263. AddFolderOrArchive("voice_c");
  1264. foreach (string str in GameUty.PathListOld)
  1265. {
  1266. string str2 = "voice";
  1267. string text = str2 + "_" + str;
  1268. if (AddFolderOrArchive(text))
  1269. {
  1270. for (int i = 2; i <= check_ver_no; i++)
  1271. {
  1272. AddFolderOrArchive(text + "_" + i);
  1273. }
  1274. }
  1275. text = str2 + "_" + str + "a";
  1276. if (AddFolderOrArchive(text))
  1277. {
  1278. for (int j = 2; j <= check_ver_no; j++)
  1279. {
  1280. AddFolderOrArchive(text + "_" + j);
  1281. }
  1282. }
  1283. text = str2 + "_" + str + "b";
  1284. if (AddFolderOrArchive(text))
  1285. {
  1286. for (int k = 2; k <= check_ver_no; k++)
  1287. {
  1288. AddFolderOrArchive(text + "_" + k);
  1289. }
  1290. }
  1291. }
  1292. AddFolderOrArchive("voice2");
  1293. AddFolderOrArchive("voice3");
  1294. fileSystem.AddAutoPathForAllFolder();
  1295. string[] list = fileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  1296. if (list != null && 0 < list.Length)
  1297. {
  1298. foreach (string path in list)
  1299. {
  1300. string fileName = Path.GetFileName(path);
  1301. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  1302. {
  1303. GameUty.BgFiles.Add(fileName, fileSystem);
  1304. }
  1305. }
  1306. }
  1307. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  1308. }
  1309. public static AFileBase FileOpen(string fileName, AFileSystemBase priorityFileSystem = null)
  1310. {
  1311. if (priorityFileSystem == null)
  1312. {
  1313. priorityFileSystem = GameUty.m_FileSystem;
  1314. }
  1315. AFileSystemBase[] array;
  1316. if (GameUty.ModPriorityToModFolder)
  1317. {
  1318. array = new AFileSystemBase[]
  1319. {
  1320. GameUty.m_ModFileSystem,
  1321. priorityFileSystem
  1322. };
  1323. }
  1324. else
  1325. {
  1326. array = new AFileSystemBase[]
  1327. {
  1328. priorityFileSystem,
  1329. GameUty.m_ModFileSystem
  1330. };
  1331. }
  1332. AFileBase result = null;
  1333. foreach (AFileSystemBase afileSystemBase in array)
  1334. {
  1335. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1336. {
  1337. result = afileSystemBase.FileOpen(fileName);
  1338. break;
  1339. }
  1340. }
  1341. return result;
  1342. }
  1343. public static bool IsExistFile(string fileName, AFileSystemBase priorityFileSystem = null)
  1344. {
  1345. if (priorityFileSystem == null)
  1346. {
  1347. priorityFileSystem = GameUty.m_FileSystem;
  1348. }
  1349. AFileSystemBase[] array;
  1350. if (GameUty.ModPriorityToModFolder)
  1351. {
  1352. array = new AFileSystemBase[]
  1353. {
  1354. GameUty.m_ModFileSystem,
  1355. priorityFileSystem
  1356. };
  1357. }
  1358. else
  1359. {
  1360. array = new AFileSystemBase[]
  1361. {
  1362. priorityFileSystem,
  1363. GameUty.m_ModFileSystem
  1364. };
  1365. }
  1366. foreach (AFileSystemBase afileSystemBase in array)
  1367. {
  1368. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1369. {
  1370. return true;
  1371. }
  1372. }
  1373. return false;
  1374. }
  1375. public static string GetBuildVersionText()
  1376. {
  1377. int num = 1300;
  1378. return (num >= 1000) ? ((float)num / 1000f).ToString("F2") : ((float)num / 100f).ToString("F2");
  1379. }
  1380. public static string GetGameVersionText()
  1381. {
  1382. string text = "COM3D2x64.exe";
  1383. int num = 1300;
  1384. string path = Path.GetFullPath(".\\") + "update.lst";
  1385. string[] array = new string[0];
  1386. if (File.Exists(path))
  1387. {
  1388. try
  1389. {
  1390. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1391. }
  1392. catch (Exception ex)
  1393. {
  1394. Debug.LogError(ex.Message);
  1395. array = new string[0];
  1396. }
  1397. }
  1398. foreach (string text2 in array)
  1399. {
  1400. if (!string.IsNullOrEmpty(text2))
  1401. {
  1402. string[] array3 = text2.Split(new char[]
  1403. {
  1404. ','
  1405. });
  1406. if (array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1407. {
  1408. int.TryParse(array3[1].Trim(), out num);
  1409. break;
  1410. }
  1411. }
  1412. }
  1413. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1414. if (text3.Length == 5)
  1415. {
  1416. text3 = text3.Insert(4, ".");
  1417. }
  1418. return text3;
  1419. }
  1420. public static string GetLegacyGameVersionText()
  1421. {
  1422. if (!GameUty.IsEnabledCompatibilityMode)
  1423. {
  1424. return "0.0";
  1425. }
  1426. string text = "CM3D2x64.exe";
  1427. string path = GameMain.Instance.CMSystem.CM3D2Path + "\\update.lst";
  1428. string[] array = new string[0];
  1429. if (File.Exists(path))
  1430. {
  1431. try
  1432. {
  1433. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1434. }
  1435. catch (Exception ex)
  1436. {
  1437. Debug.LogError(ex.Message);
  1438. array = new string[0];
  1439. }
  1440. }
  1441. int num = 0;
  1442. foreach (string text2 in array)
  1443. {
  1444. if (!string.IsNullOrEmpty(text2))
  1445. {
  1446. string[] array3 = text2.Split(new char[]
  1447. {
  1448. ','
  1449. });
  1450. if (array3 != null && array3.Length == 2 && array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1451. {
  1452. int.TryParse(array3[1].Trim(), out num);
  1453. break;
  1454. }
  1455. }
  1456. }
  1457. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1458. if (text3.Length == 5)
  1459. {
  1460. text3 = text3.Insert(4, ".");
  1461. }
  1462. return text3;
  1463. }
  1464. private static FileSystemArchive m_FileSystem = null;
  1465. private static FileSystemArchive m_FileSystemOld = null;
  1466. private static FileSystemWindows m_ModFileSystem = null;
  1467. public static List<string> PathList = new List<string>();
  1468. public static List<string> ExistCsvPathList = new List<string>();
  1469. public static List<string> PathListOld = new List<string>();
  1470. public static List<string> ExistCsvPathListOld = new List<string>();
  1471. private static string[] m_aryMenuFiles = null;
  1472. private static string[] m_aryModOnlysMenuFiles = new string[0];
  1473. private static Dictionary<int, string> rid_menu_dic_ = new Dictionary<int, string>();
  1474. private static Dictionary<string, AssetBundle> asset_bundle_dic = new Dictionary<string, AssetBundle>();
  1475. private static string ModPriorityToModFolderInfo = "以下のフラグをtrueにするとMODフォルダのファイルが優先されるが、モザイクも安易に外すことが可能になる為に現在はオミット。";
  1476. public static bool ModPriorityToModFolder = false;
  1477. private static string[] m_strSystemMaterialName = new string[]
  1478. {
  1479. "System/Material/2dAlpha",
  1480. "System/Material/2dMultiply",
  1481. "System/Material/InfinityColor",
  1482. "System/Material/TexTo8bitTex"
  1483. };
  1484. private static Material[] m_matSystem = new Material[4];
  1485. public enum SystemMaterial
  1486. {
  1487. Alpha,
  1488. Multiply,
  1489. InfinityColor,
  1490. TexTo8bitTex,
  1491. Max
  1492. }
  1493. }