Ejemplo n.º 1
0
 public static void FileSystemWindowsAddFolderPost(FileSystemWindows fileSystem) //inject at start; pass invoke
 {
     // 公式の処理ではフォルダをひとつひとつAddAutoPathで追加していたが、フォルダが増えるたびにどんどん遅くなっていく
     // AddAutoPathForAllFolderの中身は見えないのでわからないが、使ってみたところ同じ結果を得られそうで、処理速度も大幅に速くなった
     // 現在は「Mod」フォルダのみAddFolderされているのでAddFolder後に処理を実行しているが、
     // もし今後「Mod」フォルダ以外にもAddFolderする場合があれば別の場所でまとめて実行したほうがいいと思われる
     fileSystem.AddAutoPathForAllFolder(true);
     while (!fileSystem.IsFinishedAddAutoPathJob(true))
     {
     }
     fileSystem.ReleaseAddAutoPathJob();
 }
        private void ModRefresh1()
        {
            if (isRunModreflash)
            {
                return;
            }

            isRunModreflash = true;
            Task.Factory.StartNew(() =>
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                MyLog.LogDarkBlue("modreflash1. start ", string.Format("{0:0.000} ", stopwatch.Elapsed.ToString()));

                FileSystemWindows m_ModFileSystem = (FileSystemWindows)GameUty.FileSystemMod;
                if (Directory.Exists(UTY.gameProjectPath + "\\Mod"))
                {
                    string[] list2 = m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFolder);
                    foreach (string text31 in list2)
                    {
                        if (m_ModFileSystem.AddAutoPath(text31))
                        {
                            UnityEngine.Debug.Log(text31 + " 파일 추가");
                        }
                    }
                }
                if (m_ModFileSystem != null)
                {
                    //string[] list3 = m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
                    //string[] m_aryModOnlysMenuFiles = GameUty.ModOnlysMenuFiles;
                    //m_aryModOnlysMenuFiles = Array.FindAll<string>(list3, (string i) => new Regex(".*\\.menu$").IsMatch(i));
                    typeof(GameUty).GetField("m_aryModOnlysMenuFiles").SetValue(null, Array.FindAll <string>(GameUty.FileSystemMod.GetList(string.Empty, AFileSystemBase.ListType.AllFile), (string i) => new Regex(".*\\.menu$").IsMatch(i)));
                }

                MyLog.LogDarkBlue("modreflash1. end ", string.Format("{0:0.000} ", stopwatch.Elapsed.ToString()));
                isRunModreflash = false;
            }
                                  );
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            //var builder = new WindowsMusicCollectionModelBuilder();
            //var consoleModel = new MusicCollectionMainModelConsole(builder);

            //Console.WriteLine("Tags");
            //foreach(var t in consoleModel.MainModel.MainTagManager.Tags)
            //{
            //	Console.WriteLine($"{t.guid} {t.Name}");
            //}

            //Console.WriteLine("--------------------------------------------");

            //Console.WriteLine("Tracks");
            //foreach (var tr in consoleModel.MainModel.MainTrackManager.Tracks)
            //{
            //	Console.WriteLine($"{tr.Name} {string.Concat(tr.Tags.Select(t=>t.Name))}");
            //}

            var fileSystem = new FileSystemWindows(directoryPath);

            fileSystem.ShowInerDirtectiry();
        }
 //[HarmonyPatch(typeof(GameUty), MethodType.Constructor), HarmonyPostfix]
 public static void GameUtyCtor(FileSystemWindows ___m_aryModOnlysMenuFiles)
 {
     m_aryModOnlysMenuFiles = ___m_aryModOnlysMenuFiles;
 }