123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using UnityEngine;
- using wf;
- public class GameUty
- {
- public static AFileSystemBase FileSystem
- {
- get
- {
- return GameUty.m_FileSystem;
- }
- }
- public static AFileSystemBase FileSystemOld
- {
- get
- {
- return GameUty.m_FileSystemOld;
- }
- }
- public static AFileSystemBase FileSystemMod
- {
- get
- {
- return GameUty.m_ModFileSystem;
- }
- }
- public static bool IsEnabledCompatibilityMode
- {
- get
- {
- return 0 < GameUty.PathListOld.Count;
- }
- }
- public static string[] MenuFiles
- {
- get
- {
- return GameUty.m_aryMenuFiles;
- }
- }
- public static string[] ModOnlysMenuFiles
- {
- get
- {
- return GameUty.m_aryModOnlysMenuFiles;
- }
- }
- public static Dictionary<int, string> RidMenuDic
- {
- get
- {
- return GameUty.rid_menu_dic_;
- }
- }
- public static Dictionary<string, AFileSystemBase> BgFiles { get; private set; }
- public static float MillisecondToSecond(int millisecond)
- {
- return (float)millisecond / 1000f;
- }
- public static Material GetSystemMaterial(GameUty.SystemMaterial f_mat)
- {
- Material material = GameUty.m_matSystem[(int)f_mat];
- if (material == null)
- {
- UnityEngine.Object original = Resources.Load(GameUty.m_strSystemMaterialName[(int)f_mat]);
- material = (UnityEngine.Object.Instantiate(original) as Material);
- GameUty.m_matSystem[(int)f_mat] = material;
- }
- return material;
- }
- public static GameObject LoadAssetBundle(string file_name)
- {
- if (GameUty.FileSystem == null || !GameUty.FileSystem.IsExistentFile(file_name))
- {
- return null;
- }
- UnityEngine.Object original = null;
- if (!GameUty.asset_bundle_dic.ContainsKey(file_name))
- {
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
- {
- AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
- if (assetBundle.mainAsset != null)
- {
- original = assetBundle.mainAsset;
- }
- else
- {
- original = assetBundle.LoadAllAssets<GameObject>()[0];
- }
- GameUty.asset_bundle_dic.Add(file_name, assetBundle);
- }
- }
- else
- {
- original = GameUty.asset_bundle_dic[file_name].mainAsset;
- }
- GameObject gameObject = UnityEngine.Object.Instantiate(original) as GameObject;
- gameObject.name = gameObject.name.Replace("(Clone)", string.Empty);
- return gameObject;
- }
- public static void DeviceInitialize()
- {
- }
- public static void Init()
- {
- GameUty.m_FileSystem = new FileSystemArchive();
- GameUty.m_FileSystemOld = new FileSystemArchive();
- GameUty.PathListOld = new List<string>();
- if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
- {
- GameUty.PathListOld = GameUty.ReadAutoPathFile("[2.0]", GameMain.Instance.CMSystem.CM3D2Path + "\\GameData\\paths.dat");
- if (GameUty.PathListOld == null)
- {
- GameUty.PathListOld = new List<string>();
- }
- }
- GameUty.UpdateFileSystemPath();
- GameUty.UpdateFileSystemPathOld();
- PluginData.CreateData(GameUty.m_FileSystem, (!GameUty.IsEnabledCompatibilityMode) ? null : GameUty.m_FileSystemOld);
- Debug.Log("■■■■■■■■ Plugin Check ■■■■■■■■");
- foreach (string text in PluginData.GetAllUniqueNames())
- {
- Debug.Log(string.Concat(new string[]
- {
- "[",
- PluginData.uniqueNameToId(text).ToString(),
- "]",
- text,
- " : ",
- (!PluginData.IsEnabled(text)) ? "×" : "○"
- }));
- }
- Debug.Log("■■■■■■■■■■■■■■■■■■■■");
- }
- public static void Finish()
- {
- foreach (KeyValuePair<string, AssetBundle> keyValuePair in GameUty.asset_bundle_dic)
- {
- keyValuePair.Value.Unload(true);
- }
- GameUty.asset_bundle_dic.Clear();
- GameUty.m_FileSystem.Dispose();
- GameUty.m_FileSystem = null;
- if (GameUty.m_FileSystemOld != null)
- {
- GameUty.m_FileSystemOld.Dispose();
- GameUty.m_FileSystemOld = null;
- }
- if (GameUty.m_ModFileSystem != null)
- {
- GameUty.m_ModFileSystem.Dispose();
- GameUty.m_ModFileSystem = null;
- }
- }
- public static Dictionary<string, HashSet<string>> GetGameDataResourceList(string gameDataPath)
- {
- string[] array = new string[]
- {
- "script_cbl",
- "motion_cbl",
- "voice_cbl"
- };
- int length = (gameDataPath + "\\").Length;
- string[] directories = Directory.GetDirectories(gameDataPath);
- Dictionary<string, HashSet<string>> dictionary = new Dictionary<string, HashSet<string>>();
- for (int i = 0; i < directories.Length; i++)
- {
- string text = directories[i].Substring(length, directories[i].Length - length).ToLower();
- int startIndex = 0;
- foreach (string text2 in array)
- {
- if (text.IndexOf(text2) == 0)
- {
- startIndex = text2.Length;
- break;
- }
- }
- int num = text.IndexOf('_', startIndex);
- if (0 <= num)
- {
- string text3 = text.Substring(0, num);
- if (!string.IsNullOrEmpty(text3))
- {
- string text4 = text.Substring(text3.Length + 1, text.Length - (text3.Length + 1));
- if (!string.IsNullOrEmpty(text4))
- {
- if (!dictionary.ContainsKey(text3))
- {
- dictionary.Add(text3, new HashSet<string>());
- }
- if (!dictionary[text3].Contains(text4))
- {
- dictionary[text3].Add(text4);
- }
- else
- {
- Debug.LogWarning(text3 + "_" + text4 + "は既にリストに存在します");
- }
- }
- }
- }
- else if (!dictionary.ContainsKey(text))
- {
- dictionary.Add(text, new HashSet<string>());
- }
- else
- {
- Debug.LogWarning(text + "は既にリストに存在します");
- }
- }
- return dictionary;
- }
- public static List<string> ReadAutoPathFile(string uniqueName, string filePath)
- {
- if (!File.Exists(filePath))
- {
- return null;
- }
- List<string> list = new List<string>();
- using (FileStream fileStream = new FileStream(filePath, FileMode.Open))
- {
- using (BinaryReader binaryReader = new BinaryReader(fileStream))
- {
- string a = binaryReader.ReadString();
- NDebug.Assert(a == "CM3D2_PATHS", "パスファイルのヘッダーが不正です。");
- int num = binaryReader.ReadInt32();
- int num2 = binaryReader.ReadInt32();
- for (int i = 0; i < num2; i++)
- {
- string item = binaryReader.ReadString();
- list.Add(item);
- }
- }
- }
- return list;
- }
- public static void UpdateFileSystemPath()
- {
- string fullPath = Path.GetFullPath(".\\");
- string gameDataPath = "GameData";
- int check_ver_no = 3;
- Func<string, bool> AddFolderOrArchive = delegate(string name)
- {
- bool flag3 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
- if (flag3)
- {
- Debug.Log(string.Concat(new string[]
- {
- "[",
- gameDataPath,
- "\\",
- name,
- ".arc]を読み込みました"
- }));
- }
- return flag3;
- };
- HashSet<string> addedLegacyArchives = new HashSet<string>();
- int m;
- Action<string> action = delegate(string name)
- {
- foreach (string text7 in GameUty.PathList)
- {
- string text8 = name + "_" + text7;
- bool flag3 = AddFolderOrArchive(text8);
- if (flag3 && !addedLegacyArchives.Contains(text8))
- {
- addedLegacyArchives.Add(text8);
- }
- if (flag3)
- {
- if (name == "csv")
- {
- GameUty.ExistCsvPathList.Add(text7);
- }
- for (int m = 2; m <= check_ver_no; m++)
- {
- AddFolderOrArchive(text8 + "_" + m);
- }
- }
- }
- };
- Action<string> action2 = delegate(string name)
- {
- foreach (string text7 in GameUty.PathList)
- {
- string text8 = name + "_" + text7;
- bool flag3 = AddFolderOrArchive(text8);
- if (!flag3 && addedLegacyArchives.Contains(text8))
- {
- flag3 = true;
- }
- if (flag3)
- {
- if (name == "csv")
- {
- GameUty.ExistCsvPathList.Add(text7);
- }
- for (int m = 2; m <= check_ver_no; m++)
- {
- AddFolderOrArchive(string.Concat(new object[]
- {
- name,
- "_",
- text7,
- "_",
- m
- }));
- }
- }
- }
- };
- Action<string> action3 = delegate(string name)
- {
- foreach (string text7 in GameUty.PathList)
- {
- if (AddFolderOrArchive(name + "_" + text7))
- {
- if (name == "csv")
- {
- GameUty.ExistCsvPathList.Add(text7);
- }
- for (int m = 2; m <= check_ver_no; m++)
- {
- AddFolderOrArchive(string.Concat(new object[]
- {
- name,
- "_",
- text7,
- "_",
- m
- }));
- }
- }
- }
- };
- string common_error_text = string.Empty;
- common_error_text = "必用アーカイブがありません。GameData\\";
- StopWatch stopWatch = new StopWatch();
- Debug.Log("IsEnabledCompatibilityMode:" + GameUty.IsEnabledCompatibilityMode.ToString());
- string text = "カスタムオーダーメイド3D 2";
- string str = "カスタムメイド3D 2";
- text += " 翻訳評価版";
- Debug.Log(string.Concat(new string[]
- {
- text,
- " GameVersion ",
- GameUty.GetGameVersionText(),
- "(BuildVersion : ",
- GameUty.GetBuildVersionText(),
- ")"
- }));
- if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
- {
- Debug.Log(str + " GameVersion " + GameUty.GetLegacyGameVersionText());
- }
- if (GameUty.IsEnabledCompatibilityMode)
- {
- Debug.Log("■■■■■■■■ Archive Log[2.0] (CM3D2 GameData) ■■■■■■■■");
- GameUty.m_FileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
- GameUty.PathList = GameUty.PathListOld;
- AddFolderOrArchive("material");
- foreach (string text2 in GameUty.PathListOld)
- {
- string str2 = "material";
- if (text2 == "denkigai2015wTowelR")
- {
- AddFolderOrArchive(str2 + "_denkigai2015wTowel");
- }
- string text3 = str2 + "_" + text2;
- bool flag = AddFolderOrArchive(text3);
- if (flag && !addedLegacyArchives.Contains(text3))
- {
- addedLegacyArchives.Add(text3);
- }
- if (flag)
- {
- for (m = 2; m <= check_ver_no; m++)
- {
- AddFolderOrArchive(text3 + "_" + m);
- }
- }
- }
- AddFolderOrArchive("material2");
- AddFolderOrArchive("menu");
- action("menu");
- AddFolderOrArchive("menu2");
- AddFolderOrArchive("model");
- action("model");
- AddFolderOrArchive("model2");
- AddFolderOrArchive("texture");
- action("texture");
- AddFolderOrArchive("texture2");
- AddFolderOrArchive("texture3");
- AddFolderOrArchive("prioritymaterial");
- Debug.Log("■■■■■■■■■■■■■■■■■■■■");
- }
- Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
- gameDataPath = "GameData_20";
- GameUty.m_FileSystem.SetBaseDirectory(fullPath);
- if (GameUty.IsEnabledCompatibilityMode)
- {
- GameUty.m_FileSystem.AddPatchDecryptPreferredSearchDirectory(GameMain.Instance.CMSystem.CM3D2Path + "\\GameData");
- }
- GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", fullPath + gameDataPath + "\\paths.dat");
- if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
- {
- foreach (string text4 in GameUty.PathList)
- {
- string text5 = "material";
- if (text4 == "denkigai2015wTowelR")
- {
- AddFolderOrArchive(text5 + "_denkigai2015wTowel");
- }
- string text6 = text5 + "_" + text4;
- bool flag2 = AddFolderOrArchive(text6);
- if (!flag2 && addedLegacyArchives.Contains(text6))
- {
- flag2 = true;
- }
- if (flag2)
- {
- for (int j = 2; j <= check_ver_no; j++)
- {
- AddFolderOrArchive(string.Concat(new object[]
- {
- text5,
- "_",
- text4,
- "_",
- j
- }));
- }
- }
- }
- action2("menu");
- action2("model");
- action2("texture");
- AddFolderOrArchive("prioritymaterial");
- }
- GameUty.m_FileSystem.ClearPatchDecryptPreferredSearchDirectory();
- Debug.Log("■■■■■■■■■■■■■■■■■■■■");
- Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
- gameDataPath = "GameData";
- GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", fullPath + gameDataPath + "\\paths.dat");
- if (GameUty.PathList == null)
- {
- GameUty.PathList = new List<string>();
- NDebug.Assert("paths.datを読み込めませんでした", false);
- }
- NDebug.Assert(AddFolderOrArchive("prioritymaterial"), () => common_error_text + "prioritymaterial");
- NDebug.Assert(AddFolderOrArchive("script_en_try"), () => common_error_text + "script_en_try");
- NDebug.Assert(AddFolderOrArchive("csv_en_try"), () => common_error_text + "csv_en_try");
- NDebug.Assert(AddFolderOrArchive("motion_try"), () => common_error_text + "motion_try");
- NDebug.Assert(AddFolderOrArchive("sound_try"), () => common_error_text + "sound_try");
- NDebug.Assert(AddFolderOrArchive("system"), () => common_error_text + "system");
- NDebug.Assert(AddFolderOrArchive("system2"), () => common_error_text + "system2");
- NDebug.Assert(AddFolderOrArchive("voice_try"), () => common_error_text + "voice_try");
- NDebug.Assert(AddFolderOrArchive("parts_try"), () => common_error_text + "parts_try");
- GameUty.m_FileSystem.AddAutoPathForAllFolder();
- GameUty.BgFiles = new Dictionary<string, AFileSystemBase>();
- string[] fileListAtExtension = GameUty.m_FileSystem.GetFileListAtExtension(".menu");
- List<string> list = new List<string>();
- foreach (string path in fileListAtExtension)
- {
- list.Add(Path.GetFileName(path));
- }
- GameUty.m_aryMenuFiles = list.ToArray();
- if (GameUty.m_ModFileSystem != null)
- {
- string[] list2 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
- GameUty.m_aryModOnlysMenuFiles = Array.FindAll<string>(list2, (string i) => new Regex(".*\\.menu$").IsMatch(i));
- GameUty.m_aryMenuFiles = GameUty.m_aryMenuFiles.Concat(GameUty.m_aryModOnlysMenuFiles).ToArray<string>();
- }
- if (GameUty.m_aryModOnlysMenuFiles != null && GameUty.m_aryModOnlysMenuFiles.Length != 0)
- {
- GameUty.ModPriorityToModFolderInfo = string.Empty;
- Debug.Log(GameUty.ModPriorityToModFolderInfo + "■MOD有り。MODフォルダ優先モード" + GameUty.ModPriorityToModFolder.ToString());
- }
- if (GameUty.rid_menu_dic_.Count == 0)
- {
- string[] menuFiles = GameUty.MenuFiles;
- GameUty.rid_menu_dic_ = new Dictionary<int, string>();
- for (int l = 0; l < menuFiles.Length; l++)
- {
- string fileName = Path.GetFileName(menuFiles[l]);
- int hashCode = fileName.ToLower().GetHashCode();
- if (!GameUty.rid_menu_dic_.ContainsKey(hashCode))
- {
- GameUty.rid_menu_dic_.Add(hashCode, fileName);
- }
- else
- {
- NDebug.Assert(fileName == GameUty.rid_menu_dic_[hashCode], string.Concat(new string[]
- {
- "[",
- fileName,
- "]と[",
- GameUty.rid_menu_dic_[hashCode],
- "]は同じハッシュキーです"
- }));
- }
- }
- }
- }
- public static void UpdateFileSystemPathOld()
- {
- if (!GameUty.IsEnabledCompatibilityMode)
- {
- return;
- }
- FileSystemArchive fileSystem = GameUty.m_FileSystemOld;
- Debug.Log("■■■■■■■■ Archive Log[Legacy]■■■■■■■■");
- Func<string, bool> AddFolderOrArchive = delegate(string name)
- {
- bool flag = fileSystem.AddArchive("GameData\\" + name + ".arc");
- if (flag)
- {
- Debug.Log("[GameData\\" + name + ".arc]を読み込みました");
- }
- return flag;
- };
- int check_ver_no = 3;
- Action<string> action = delegate(string name)
- {
- foreach (string text2 in GameUty.PathListOld)
- {
- if (AddFolderOrArchive(name + "_" + text2))
- {
- if (name == "csv")
- {
- GameUty.ExistCsvPathListOld.Add(text2);
- }
- for (int m = 2; m <= check_ver_no; m++)
- {
- AddFolderOrArchive(string.Concat(new object[]
- {
- name,
- "_",
- text2,
- "_",
- m
- }));
- }
- }
- }
- };
- fileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
- AddFolderOrArchive("csv");
- action("csv");
- AddFolderOrArchive("motion");
- action("motion");
- AddFolderOrArchive("motion2");
- AddFolderOrArchive("script");
- action("script");
- action("script_share");
- AddFolderOrArchive("script_share2");
- AddFolderOrArchive("sound");
- action("sound");
- AddFolderOrArchive("sound2");
- AddFolderOrArchive("texture");
- action("texture");
- AddFolderOrArchive("texture2");
- AddFolderOrArchive("texture3");
- AddFolderOrArchive("system");
- action("system");
- action("bg");
- AddFolderOrArchive("voice");
- AddFolderOrArchive("voice_a");
- AddFolderOrArchive("voice_b");
- AddFolderOrArchive("voice_c");
- foreach (string str in GameUty.PathListOld)
- {
- string str2 = "voice";
- string text = str2 + "_" + str;
- if (AddFolderOrArchive(text))
- {
- for (int i = 2; i <= check_ver_no; i++)
- {
- AddFolderOrArchive(text + "_" + i);
- }
- }
- text = str2 + "_" + str + "a";
- if (AddFolderOrArchive(text))
- {
- for (int j = 2; j <= check_ver_no; j++)
- {
- AddFolderOrArchive(text + "_" + j);
- }
- }
- text = str2 + "_" + str + "b";
- if (AddFolderOrArchive(text))
- {
- for (int k = 2; k <= check_ver_no; k++)
- {
- AddFolderOrArchive(text + "_" + k);
- }
- }
- }
- AddFolderOrArchive("voice2");
- AddFolderOrArchive("voice3");
- fileSystem.AddAutoPathForAllFolder();
- string[] list = fileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
- if (list != null && 0 < list.Length)
- {
- foreach (string path in list)
- {
- string fileName = Path.GetFileName(path);
- if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
- {
- GameUty.BgFiles.Add(fileName, fileSystem);
- }
- }
- }
- Debug.Log("■■■■■■■■■■■■■■■■■■■■");
- }
- public static AFileBase FileOpen(string fileName, AFileSystemBase priorityFileSystem = null)
- {
- if (priorityFileSystem == null)
- {
- priorityFileSystem = GameUty.m_FileSystem;
- }
- AFileSystemBase[] array;
- if (GameUty.ModPriorityToModFolder)
- {
- array = new AFileSystemBase[]
- {
- GameUty.m_ModFileSystem,
- priorityFileSystem
- };
- }
- else
- {
- array = new AFileSystemBase[]
- {
- priorityFileSystem,
- GameUty.m_ModFileSystem
- };
- }
- AFileBase result = null;
- foreach (AFileSystemBase afileSystemBase in array)
- {
- if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
- {
- result = afileSystemBase.FileOpen(fileName);
- break;
- }
- }
- return result;
- }
- public static bool IsExistFile(string fileName, AFileSystemBase priorityFileSystem = null)
- {
- if (priorityFileSystem == null)
- {
- priorityFileSystem = GameUty.m_FileSystem;
- }
- AFileSystemBase[] array;
- if (GameUty.ModPriorityToModFolder)
- {
- array = new AFileSystemBase[]
- {
- GameUty.m_ModFileSystem,
- priorityFileSystem
- };
- }
- else
- {
- array = new AFileSystemBase[]
- {
- priorityFileSystem,
- GameUty.m_ModFileSystem
- };
- }
- foreach (AFileSystemBase afileSystemBase in array)
- {
- if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
- {
- return true;
- }
- }
- return false;
- }
- public static string GetBuildVersionText()
- {
- int num = 1170;
- return (num >= 1000) ? ((float)num / 1000f).ToString("F2") : ((float)num / 100f).ToString("F2");
- }
- public static string GetGameVersionText()
- {
- string text = "COM3D2x64.exe";
- int num = 1170;
- string path = Path.GetFullPath(".\\") + "update.lst";
- string[] array = new string[0];
- if (File.Exists(path))
- {
- try
- {
- array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
- }
- catch (Exception ex)
- {
- Debug.LogError(ex.Message);
- array = new string[0];
- }
- }
- foreach (string text2 in array)
- {
- if (!string.IsNullOrEmpty(text2))
- {
- string[] array3 = text2.Split(new char[]
- {
- ','
- });
- if (array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
- {
- int.TryParse(array3[1].Trim(), out num);
- break;
- }
- }
- }
- string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
- if (text3.Length == 5)
- {
- text3 = text3.Insert(4, ".");
- }
- return text3;
- }
- public static string GetLegacyGameVersionText()
- {
- if (!GameUty.IsEnabledCompatibilityMode)
- {
- return "0.0";
- }
- string text = "CM3D2x64.exe";
- string path = GameMain.Instance.CMSystem.CM3D2Path + "\\update.lst";
- string[] array = new string[0];
- if (File.Exists(path))
- {
- try
- {
- array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
- }
- catch (Exception ex)
- {
- Debug.LogError(ex.Message);
- array = new string[0];
- }
- }
- int num = 0;
- foreach (string text2 in array)
- {
- if (!string.IsNullOrEmpty(text2))
- {
- string[] array3 = text2.Split(new char[]
- {
- ','
- });
- if (array3 != null && array3.Length == 2 && array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
- {
- int.TryParse(array3[1].Trim(), out num);
- break;
- }
- }
- }
- string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
- if (text3.Length == 5)
- {
- text3 = text3.Insert(4, ".");
- }
- return text3;
- }
- private static FileSystemArchive m_FileSystem = null;
- private static FileSystemArchive m_FileSystemOld = null;
- private static FileSystemWindows m_ModFileSystem = null;
- public static List<string> PathList = new List<string>();
- public static List<string> ExistCsvPathList = new List<string>();
- public static List<string> PathListOld = new List<string>();
- public static List<string> ExistCsvPathListOld = new List<string>();
- private static string[] m_aryMenuFiles = null;
- private static string[] m_aryModOnlysMenuFiles = new string[0];
- private static Dictionary<int, string> rid_menu_dic_ = new Dictionary<int, string>();
- private static Dictionary<string, AssetBundle> asset_bundle_dic = new Dictionary<string, AssetBundle>();
- private static string ModPriorityToModFolderInfo = "以下のフラグをtrueにするとMODフォルダのファイルが優先されるが、モザイクも安易に外すことが可能になる為に現在はオミット。";
- public static bool ModPriorityToModFolder = false;
- private static string[] m_strSystemMaterialName = new string[]
- {
- "System/Material/2dAlpha",
- "System/Material/2dMultiply",
- "System/Material/InfinityColor",
- "System/Material/TexTo8bitTex"
- };
- private static Material[] m_matSystem = new Material[4];
- public enum SystemMaterial
- {
- Alpha,
- Multiply,
- InfinityColor,
- TexTo8bitTex,
- Max
- }
- }
|