Ejemplo n.º 1
0
        private void LoadIni()
        {
            //            // スペシャルパワーアニメ
            //            buf = GeneralLib.ReadIni("Option", "SpecialPowerAnimation");
            //            if (string.IsNullOrEmpty(buf))
            //            {
            //                buf = GeneralLib.ReadIni("Option", "MindEffect");
            //                if (!string.IsNullOrEmpty(buf))
            //                {
            //                    SystemConfig.SetItem("Option", "SpecialPowerAnimation", buf);
            //                }
            //            }

            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    SpecialPowerAnimation = true;
            //                }
            //                else
            //                {
            //                    SpecialPowerAnimation = false;
            //                }
            //            }
            //            else if (SpecialPowerAnimation)
            //            {
            //                SystemConfig.SetItem("Option", "SpecialPowerAnimation", "On");
            //            }
            //            else
            //            {
            //                SystemConfig.SetItem("Option", "SpecialPowerAnimation", "Off");
            //            }

            //            // 戦闘アニメ
            //            buf = Strings.LCase(GeneralLib.ReadIni("Option", "BattleAnimation"));
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (buf == "on")
            //                {
            //                    BattleAnimation = true;
            //                }
            //                else
            //                {
            //                    BattleAnimation = false;
            //                }
            //            }
            //            else if (BattleAnimation)
            //            {
            //                SystemConfig.SetItem("Option", "BattleAnimation", "On");
            //            }
            //            else
            //            {
            //                SystemConfig.SetItem("Option", "BattleAnimation", "Off");
            //            }

            //            // 拡大戦闘アニメ
            //            buf = Strings.LCase(GeneralLib.ReadIni("Option", "ExtendedAnimation"));
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (buf == "on")
            //                {
            //                    ExtendedAnimation = true;
            //                }
            //                else
            //                {
            //                    ExtendedAnimation = false;
            //                }
            //            }
            //            else
            //            {
            //                ExtendedAnimation = true;
            //                SystemConfig.SetItem("Option", "ExtendedAnimation", "On");
            //            }

            //            // 武器準備アニメ
            //            buf = Strings.LCase(GeneralLib.ReadIni("Option", "WeaponAnimation"));
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (buf == "on")
            //                {
            //                    WeaponAnimation = true;
            //                }
            //                else
            //                {
            //                    WeaponAnimation = false;
            //                }
            //            }
            //            else
            //            {
            //                WeaponAnimation = true;
            //                SystemConfig.SetItem("Option", "WeaponAnimation", "On");
            //            }

            //            // 移動アニメ
            //            buf = Strings.LCase(GeneralLib.ReadIni("Option", "MoveAnimation"));
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (buf == "on")
            //                {
            //                    MoveAnimation = true;
            //                }
            //                else
            //                {
            //                    MoveAnimation = false;
            //                }
            //            }
            //            else
            //            {
            //                MoveAnimation = true;
            //                SystemConfig.SetItem("Option", "MoveAnimation", "On");
            //            }

            //            // メッセージ速度を設定
            //            buf = GeneralLib.ReadIni("Option", "MessageWait");
            //            if (Information.IsNumeric(buf))
            //            {
            //                GUI.MessageWait = Conversions.ToInteger(buf);
            //                if (GUI.MessageWait > 10000000)
            //                {
            //                    GUI.MessageWait = 10000000;
            //                }
            //            }
            //            else
            //            {
            //                GUI.MessageWait = 700;
            //                SystemConfig.SetItem("Option", "MessageWait", "700");
            //            }

            //            // マス目を表示するかどうか
            //            buf = GeneralLib.ReadIni("Option", "Square");
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    ShowSquareLine = true;
            //                }
            //                else
            //                {
            //                    ShowSquareLine = false;
            //                }
            //            }
            //            else
            //            {
            //                ShowSquareLine = false;
            //                SystemConfig.SetItem("Option", "Square", "Off");
            //            }

            //            // 敵ターンにBGMを変更するかどうか
            //            buf = GeneralLib.ReadIni("Option", "KeepEnemyBGM");
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    KeepEnemyBGM = true;
            //                }
            //                else
            //                {
            //                    KeepEnemyBGM = false;
            //                }
            //            }
            //            else
            //            {
            //                KeepEnemyBGM = false;
            //                SystemConfig.SetItem("Option", "KeepEnemyBGM", "Off");
            //            }

            //            // 音源のリセットデータの種類
            //            MidiResetType = GeneralLib.ReadIni("Option", "MidiReset");

            //            // 自動反撃モード
            //            buf = GeneralLib.ReadIni("Option", "AutoDefense");
            //            if (string.IsNullOrEmpty(buf))
            //            {
            //                buf = GeneralLib.ReadIni("Option", "AutoDeffence");
            //                if (!string.IsNullOrEmpty(buf))
            //                {
            //                    SystemConfig.SetItem("Option", "AutoDefense", buf);
            //                }
            //            }

            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    SystemConfig.AutoDefense = true;
            //                }
            //                else
            //                {
            //                    SystemConfig.AutoDefense = false;
            //                }
            //            }
            //            else
            //            {
            //                SystemConfig.AutoDefense = false;
            //                SystemConfig.SetItem("Option", "AutoDefense", "Off");
            //            }

            //            // カーソル自動移動
            //            buf = GeneralLib.ReadIni("Option", "AutoMoveCursor");
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    AutoMoveCursor = true;
            //                }
            //                else
            //                {
            //                    AutoMoveCursor = false;
            //                }
            //            }
            //            else
            //            {
            //                AutoMoveCursor = true;
            //                SystemConfig.SetItem("Option", "AutoMoveCursor", "On");
            //            }

            // 各ウィンドウをロード (メインウィンドウは先にロード済み)
            GUI.LoadForms();

            //            // 画像バッファの枚数
            //            buf = GeneralLib.ReadIni("Option", "ImageBufferNum");
            //            if (Information.IsNumeric(buf))
            //            {
            //                ImageBufferSize = Conversions.Toint(buf);
            //                if (ImageBufferSize < 5)
            //                {
            //                    // 最低でも5枚のバッファを使う
            //                    ImageBufferSize = 5;
            //                }
            //            }
            //            else
            //            {
            //                // デフォルトは64枚
            //                ImageBufferSize = 64;
            //                SystemConfig.SetItem("Option", "ImageBufferNum", "64");
            //            }

            //            // 画像バッファを作成
            //            GUI.MakePicBuf();

            //            // 画像バッファの最大サイズ
            //            buf = GeneralLib.ReadIni("Option", "MaxImageBufferSize");
            //            if (Information.IsNumeric(buf))
            //            {
            //                MaxImageBufferByteSize = (Conversions.ToDouble(buf) * 1024d * 1024d);
            //                if (MaxImageBufferByteSize < 1 * 1024 * 1024)
            //                {
            //                    // 最低でも1MBのバッファを使う
            //                    MaxImageBufferByteSize = 1 * 1024 * 1024;
            //                }
            //            }
            //            else
            //            {
            //                // デフォルトは8MB
            //                MaxImageBufferByteSize = 8 * 1024 * 1024;
            //                SystemConfig.SetItem("Option", "MaxImageBufferSize", "8");
            //            }

            //            // 拡大画像を画像バッファに保存するか
            //            buf = GeneralLib.ReadIni("Option", "KeepStretchedImage");
            //            if (!string.IsNullOrEmpty(buf))
            //            {
            //                if (Strings.LCase(buf) == "on")
            //                {
            //                    KeepStretchedImage = true;
            //                }
            //                else
            //                {
            //                    KeepStretchedImage = false;
            //                }
            //            }
            //            // UPGRADE_WARNING: オブジェクト IsBitBltFasterThanStretchBlt() の既定プロパティを解決できませんでした。 詳細については、'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' をクリックしてください。
            //            else if (Conversions.ToBoolean(IsBitBltFasterThanStretchBlt()))
            //            {
            //                KeepStretchedImage = true;
            //                SystemConfig.SetItem("Option", "KeepStretchedImage", "On");
            //            }
            //            else
            //            {
            //                KeepStretchedImage = false;
            //                SystemConfig.SetItem("Option", "KeepStretchedImage", "Off");
            //            }

            //            // 透過描画にUseTransparentBltを使用するか
            //            if (GeneralLib.GetWinVersion() >= 500)
            //            {
            //                buf = GeneralLib.ReadIni("Option", "UseTransparentBlt");
            //                if (!string.IsNullOrEmpty(buf))
            //                {
            //                    if (Strings.LCase(buf) == "on")
            //                    {
            //                        UseTransparentBlt = true;
            //                    }
            //                    else
            //                    {
            //                        UseTransparentBlt = false;
            //                    }
            //                }
            //                else
            //                {
            //                    UseTransparentBlt = true;
            //                    SystemConfig.SetItem("Option", "UseTransparentBlt", "On");
            //                }
            //            }


            //            // マウスボタンの利き腕設定
            //            if (GUI.GetSystemMetrics(GUI.SM_SWAPBUTTON) == 0)
            //            {
            //                // 右利き用
            //                GUI.RButtonID = 0x2;
            //                GUI.LButtonID = 0x1;
            //            }
            //            else
            //            {
            //                // 左利き用
            //                GUI.RButtonID = 0x1;
            //                GUI.LButtonID = 0x2;
            //            }

            //            GUI.ListItemComment = new string[1];

            //            // エリアスデータをロード
            //            bool localFileExists1() { string argfname = AppPath + @"Data\System\alias.txt"; var ret = FileSystem.FileExists(argfname); return ret; }

            //            if (FileSystem.FileExists(ScenarioPath + @"Data\System\alias.txt"))
            //            {
            //                ALDList.Load(ScenarioPath + @"Data\System\alias.txt");
            //            }
            //            else if (localFileExists1())
            //            {
            //                ALDList.Load(AppPath + @"Data\System\alias.txt");
            //            }

            // スペシャルパワーデータをロード
            var spFiles = new string[]
            {
                FileSystem.PathCombine(ScenarioPath, "Data", "System", "sp.txt"),
                FileSystem.PathCombine(ScenarioPath, "Data", "System", "mind.txt"),
                FileSystem.PathCombine(AppPath, "Data", "System", "sp.txt"),
                FileSystem.PathCombine(AppPath, "Data", "System", "mind.txt"),
            };

            foreach (var spFile in spFiles)
            {
                if (FileSystem.FileExists(spFile))
                {
                    SPDList.Load(spFile);
                    break;
                }
            }

            // 汎用アイテムデータをロード
            if (FileSystem.FileExists(ScenarioPath, @"Data\System\item.txt"))
            {
                IDList.Load(FileSystem.PathCombine(ScenarioPath, @"Data\System\item.txt"));
            }
            else if (FileSystem.FileExists(AppPath, @"Data\System\item.txt"))
            {
                IDList.Load(FileSystem.PathCombine(AppPath, @"Data\System\item.txt"));
            }
            // 地形データをロード
            string appTerrainPath = FileSystem.PathCombine(AppPath, "Data", "System", "terrain.txt");

            if (FileSystem.FileExists(appTerrainPath))
            {
                TDList.Load(appTerrainPath);
            }
            else
            {
                throw new TerminateException(@"地形データファイル「Data\System\terrain.txt」が見つかりません");
            }
            string scenarioTerrainPath = FileSystem.PathCombine(ScenarioPath, "Data", "System", "terrain.txt");

            if (FileSystem.FileExists(scenarioTerrainPath))
            {
                TDList.Load(scenarioTerrainPath);
            }

            // バトルコンフィグデータをロード
            var bcFiles = new string[]
            {
                FileSystem.PathCombine(ScenarioPath, "Data", "System", "battle.txt"),
                FileSystem.PathCombine(AppPath, "Data", "System", "battle.txt"),
            };

            foreach (var bcFile in bcFiles)
            {
                if (FileSystem.FileExists(bcFile))
                {
                    BCList.Load(bcFile);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void LoadDataDirectory(string fpath)
        {
            var aliasFilePath = FileSystem.PathCombine(fpath, "alias.txt");

            if (FileSystem.FileExists(aliasFilePath))
            {
                ALDList.Load(aliasFilePath);
            }

            var mindFilePath = FileSystem.PathCombine(fpath, "mind.txt");
            var spFilePath   = FileSystem.PathCombine(fpath, "sp.txt");

            if (FileSystem.FileExists(mindFilePath))
            {
                SPDList.Load(mindFilePath);
            }
            else if (FileSystem.FileExists(spFilePath))
            {
                SPDList.Load(spFilePath);
            }

            var pilotFilePath = FileSystem.PathCombine(fpath, "pilot.txt");

            if (FileSystem.FileExists(pilotFilePath))
            {
                PDList.Load(pilotFilePath);
            }

            var nonPilotFilePath = FileSystem.PathCombine(fpath, "non_pilot.txt");

            if (FileSystem.FileExists(nonPilotFilePath))
            {
                NPDList.Load(nonPilotFilePath);
            }

            var robotFilePath = FileSystem.PathCombine(fpath, "robot.txt");

            if (FileSystem.FileExists(robotFilePath))
            {
                UDList.Load(robotFilePath);
            }

            var unitFilePath = FileSystem.PathCombine(fpath, "unit.txt");

            if (FileSystem.FileExists(unitFilePath))
            {
                UDList.Load(unitFilePath);
            }

            //// ロードのインジケータ表示を行う
            //if (My.MyProject.Forms.frmNowLoading.Visible)
            //{
            //    GUI.DisplayLoadingProgress();
            //}

            var pilotMessageFilePath = FileSystem.PathCombine(fpath, "pilot_message.txt");

            if (FileSystem.FileExists(pilotMessageFilePath))
            {
                MDList.Load(pilotMessageFilePath, false);
            }

            var pilotDialogFilePath = FileSystem.PathCombine(fpath, "pilot_dialog.txt");

            if (FileSystem.FileExists(pilotDialogFilePath))
            {
                DDList.Load(pilotDialogFilePath);
            }

            var effectFilePath = FileSystem.PathCombine(fpath, "effect.txt");

            if (FileSystem.FileExists(effectFilePath))
            {
                EDList.Load(effectFilePath, true);
            }

            var animationFilePath = FileSystem.PathCombine(fpath, "animation.txt");

            if (FileSystem.FileExists(animationFilePath))
            {
                ADList.Load(animationFilePath, false);
            }

            var ext_animationFilePath = FileSystem.PathCombine(fpath, "ext_animation.txt");

            if (FileSystem.FileExists(ext_animationFilePath))
            {
                EADList.Load(ext_animationFilePath, false);
            }

            var itemFilePath = FileSystem.PathCombine(fpath, "item.txt");

            if (FileSystem.FileExists(itemFilePath))
            {
                IDList.Load(itemFilePath);
            }
        }