Exemple #1
0
        /// <summary>
        /// 指定したパスの surfaces.txt を読み込む
        /// </summary>
        public static SurfacesText Load(string path)
        {
            var surfaces = new SurfacesText()
            {
                Path = path
            };

            surfaces.Load();
            return(surfaces);
        }
Exemple #2
0
        /// <summary>
        /// ファイルを検索してシェル情報を読み込む
        /// </summary>
        protected virtual void LoadFiles()
        {
            // descript.txt 読み込み
            Descript = DescriptText.Load(DescriptPath);

            // sakura側、kero側それぞれのbindgroup情報 (着せ替え情報) 読み込み
            var sakuraEnabledBindGroupIds = GetEnabledBindGroupIds("sakura");
            var keroEnabledBindGroupIds   = GetEnabledBindGroupIds("kero");

            // 存在する surfaces*.txt を全て読み込み
            SurfacesTextList = new List <SurfacesText>();
            var surfaceTxtPathList = Directory.GetFiles(DirPath, "surface*.txt").OrderBy(path => path); // ファイル名順ソート

            foreach (var surfaceTextPath in surfaceTxtPathList)
            {
                var surfaceText = SurfacesText.Load(surfaceTextPath);
                SurfacesTextList.Add(surfaceText);
            }

            // descript.txt, surface.txt の情報を元に、sakura側とkero側それぞれの
            // サーフェス情報 (使用する画像のファイルパス、ファイル更新日時など) を読み込む
            try
            {
                SakuraSurfaceModel = LoadSurfaceModel(SakuraSurfaceId, "sakura", sakuraEnabledBindGroupIds);
            }
            catch (UnhandlableShellException ex)
            {
                ex.Scope = 0; // sakura側のエラー

                Debug.WriteLine(ex.ToString());
                throw ex; // エラーメッセージを表示するため外に投げる
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }

            try
            {
                KeroSurfaceModel = LoadSurfaceModel(KeroSurfaceId, "kero", keroEnabledBindGroupIds);
            }
            catch (UnhandlableShellException ex)
            {
                ex.Scope = 1; // kero側のエラー

                Debug.WriteLine(ex.ToString());
                throw ex; // エラーメッセージを表示するため外に投げる
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }
        }