Beispiel #1
0
        static bool ProcCommandLine()
        {
            if (ArgsDic.ContainsKey("--lint"))
            {//コマンドラインLint
                Program.IsCommandLine = true;
                Environment.Exit(ToolFELintForm.CommandLineLint());
                return(true);
            }
            if (ArgsDic.ContainsKey("--rebuild"))
            {//コマンドラインrebuild
                Program.IsCommandLine = true;
                Environment.Exit(ToolROMRebuildForm.ComandLineRebuild());
                return(true);
            }
            if (ArgsDic.ContainsKey("--pointercalc"))
            {//ポインタ変換
                Program.IsCommandLine = true;
                Environment.Exit(PointerToolForm.ComandLineSearch());
                return(true);
            }
            if (ArgsDic.ContainsKey("--translate"))
            {//ROM翻訳の実行
                Program.IsCommandLine = true;
                Environment.Exit(ToolTranslateROMForm.CommandLineTranslate());
                return(true);
            }
            if (ArgsDic.ContainsKey("--makeups"))
            {//UPSの作成
                Program.IsCommandLine = true;
                Environment.Exit(ToolUPSPatchSimpleForm.CommandLineMakeUPS());
                return(true);
            }
            if (ArgsDic.ContainsKey("--songexchange"))
            {//曲交換
                Program.IsCommandLine = true;
                Environment.Exit(SongExchangeForm.CommandLineImport());
                return(true);
            }

#if DEBUG
            //デバッグの場合はテストを実行
            DebugTESTRunner();

            if (ArgsDic.ContainsKey("--translate_batch"))
            {//翻訳を自動実行
                DevTranslateForm.CommandLineTranslateOnly();
            }
            if (ArgsDic.ContainsKey("--testonly"))
            {
                //フルテストの場合、終了する.
                Environment.Exit(0);
                return(true);
            }
#endif
            return(false);
        }
Beispiel #2
0
        public static int CommandLineMakeUPS()
        {
            U.echo("CommandLineMakeUPS");

            ToolUPSPatchSimpleForm f = (ToolUPSPatchSimpleForm)InputFormRef.JumpFormLow <ToolUPSPatchSimpleForm>();

            f.OnLoad(new EventArgs());
            string fromrom = U.at(Program.ArgsDic, "--fromrom");

            if (fromrom == "")
            {
                fromrom = U.at(Program.ArgsDic, "--target");
            }
            if (fromrom != "")
            {
                f.OrignalFilename.Text = fromrom;
            }

            string errorMessage = MainFormUtil.CheckOrignalROM(f.OrignalFilename.Text);

            if (errorMessage != "")
            {
                string error = R._("無改造ROMを指定してください。") + "\r\n" + errorMessage;
                f.OrignalFilename.ErrorMessage = error;
                R.ShowStopError(error);
                return(-2);
            }

            string makeups = U.at(Program.ArgsDic, "--makeups");

            if (makeups == "")
            {
                U.echo("保存するファイル名を選択してください");
                return(-2);
            }

            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(f))
            {
                UPSUtil.MakeUPS(f.OrignalFilename.Text, makeups);
            }
            //エクスプローラで選択しよう
            U.SelectFileByExplorer(makeups);

            return(0);
        }