diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb index 52504e3..0fa3581 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo index d8a84e1..c3fde89 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm index ea6fd71..e1866f1 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h index ab97b10..5436ec1 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h @@ -62,6 +62,9 @@ namespace MasterEditorTWL { System::Boolean IsCheckedUGC; // 読み込み時にチェックされていたか System::Boolean IsCheckedPhotoEx; + // エラーメッセージ + RCMessageBank ^hMsg; + ///////////////////////////////////////////// // VC自動追加フィールド ///////////////////////////////////////////// @@ -3428,6 +3431,24 @@ private: System::Windows::Forms::Label^ labCountryCodeL; { return (this->getBinDir() + "tmp.srl"); } + // GUIメッセージファイル + System::String^ getGuiMessageFileJ(void) + { + return (this->getResDir() + "gui_msg_j.xml"); + } + System::String^ getGuiMessageFileE(void) + { + return (this->getResDir() + "gui_msg_e.xml"); + } + // MRCメッセージファイル + System::String^ getMrcMessageFileJ(void) + { + return (this->getResDir() + "mrc_msg_j.xml"); + } + System::String^ getMrcMessageFileE(void) + { + return (this->getResDir() + "mrc_msg_e.xml"); + } private: // ---------------------------------------------- @@ -3537,24 +3558,42 @@ private: System::Windows::Forms::Label^ labCountryCodeL; System::Boolean checkDeliverableForms(void); // ---------------------------------------------- - // ダイアログ + // メッセージダイアログ // ---------------------------------------------- - void sucMsg( System::String ^msgJ, System::String ^msgE ) + // @arg[in] 外部メッセージファイルのタグ(RCMessageBankに引き渡す) + // @arg[in] 引数がある場合は指定 (可変長引数) + void sucMsg( System::String ^tag, ... cli::array ^args ) { - if( this->isJapanese() ) - MessageBox::Show( msgJ, "Information", MessageBoxButtons::OK, MessageBoxIcon::None ); - else - MessageBox::Show( msgE, "Information", MessageBoxButtons::OK, MessageBoxIcon::None ); + this->sucMsgCore( this->makeMsg(tag, args) ); } - - // エラーメッセージを出力 - void errMsg( System::String ^msgJ, System::String ^msgE ) + void errMsg( System::String ^tag, ... cli::array ^args ) { + this->errMsgCore( this->makeMsg(tag, args) ); + } + System::String^ makeMsg( System::String ^tag, ... cli::array ^args ) + { + System::String ^lang; if( this->isJapanese() ) - MessageBox::Show( msgJ, "Error", MessageBoxButtons::OK, MessageBoxIcon::Error ); + { + lang = "J"; + } else - MessageBox::Show( msgE, "Error", MessageBoxButtons::OK, MessageBoxIcon::Error ); + { + lang = "E"; + } + System::String ^fmt = this->hMsg->getMessage( tag, lang ); // メッセージファイルから書式を取得 + System::String ^msg = System::String::Format( fmt, args ); // 書式をStringに展開 + return msg; + } + // 文字列を直に指定する + void errMsgCore( System::String ^msg ) + { + MessageBox::Show( msg, "Error", MessageBoxButtons::OK, MessageBoxIcon::Error ); + } + void sucMsgCore( System::String ^msg ) + { + MessageBox::Show( msg, "Information", MessageBoxButtons::OK, MessageBoxIcon::None ); } private: @@ -3637,7 +3676,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; // セーブするディレクトリをダイアログで取得 // @ret 取得したディレクトリ名(\\で終わるように調整される) エラーのときnullptr - System::String^ saveDirDlg( System::String ^msgJ, System::String ^msgE ); + System::String^ saveDirDlg( System::String ^msg ); // ファイルが存在するかを調べて上書き確認をする bool isOverwriteFile( System::String ^path ); @@ -3677,7 +3716,6 @@ private: System::Windows::Forms::Label^ labCountryCodeL; filename = this->openFileDlg( "rom format (*.srl;*.tad)|*.srl;*.tad|All files (*.*)|*.*" ); if( filename == nullptr ) { - //this->errMsg( "ROMデータファイルのオープンがキャンセルされました。", "Opening the ROM data file is canceled by user." ); return; } @@ -3688,7 +3726,6 @@ private: System::Windows::Forms::Label^ labCountryCodeL; } this->tboxFile->Text = filename; this->clearOtherForms(); // ROMヘッダには反映されない編集情報を更新 - //this->sucMsg( "ROMデータファイルのオープンに成功しました。", "The ROM data file is opened successfully." ); } //stripItemOpenRom_Click() private: @@ -3700,8 +3737,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; // SRLが読み込まれていないときにはリードさせない if( System::String::IsNullOrEmpty( this->tboxFile->Text ) ) { - this->errMsg( "ROMデータファイルが読み込まれていませんので、マスターROMの作成ができません。", - "ROM data file has not opened yet. A master ROM data can't be made." ); + this->errMsg( "E_SaveRom_Empty" ); return; } @@ -3710,8 +3746,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; this->hWarnList->Clear(); if( this->checkSrlForms() == false ) { - this->errMsg( "不正な設定があるためマスターROMの作成ができません。", - "Setting is illegal. A master ROM data can't be made." ); + this->errMsg( "E_SaveRom_Setting" ); return; } @@ -3720,20 +3755,13 @@ private: System::Windows::Forms::Label^ labCountryCodeL; System::String ^srlfile = prefix + ".SRL"; // 注意書き - this->sucMsg( - "以下のファイルが作成されます。\n\n" - + srlfile + " (マスターROM)\n", - - "Following file for submission will be made. \n\n" - + srlfile + " (Master ROM)\n" - ); + this->sucMsg( "SaveRom_Name", srlfile ); // ダイアログからSRLを保存するディレクトリを取得する - System::String ^dir = this->saveDirDlg( "保存先フォルダを選択してください。", "Please select a folder for saving the file" ); + System::String ^dir = this->saveDirDlg( this->makeMsg( "SaveRom_Folder" ) ); if( !dir ) { - this->errMsg( "フォルダの選択がキャンセルされましたのでマスターROMは作成されません。", - "A master ROM isn't made, since selecting folder is canceled." ); + this->errMsg( "E_SaveRom_FolderCancel" ); return; } srlfile = dir + srlfile; @@ -3741,8 +3769,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; // ファイルが存在するかを調べて上書き確認をする if( !this->isOverwriteFile(srlfile) ) { - this->errMsg( "ファイルの上書きがキャンセルされましたのでマスターROMは作成されません。", - "Since overwriting a file is canceled, a master ROM isn't made." ); + this->errMsg( "E_SaveRom_OWCancel" ); return; } @@ -3751,68 +3778,56 @@ private: System::Windows::Forms::Label^ labCountryCodeL; ECFormResult result = this->saveRom( srlfile ); if( result != ECFormResult::NOERROR ) { - System::String^ msgJ = "マスターROMの作成に失敗しました。作成を中止するため一部のファイルは作成されません。"; - System::String^ msgE = "Making a master ROM failed. Therefore, a part of files can't be made."; + System::String ^msg = this->makeMsg( "E_SaveSet_FileDefault" ); switch( result ) { case ECFormResult::ERROR_FILE_OPEN: - msgJ += "\n\n原因:\n出力ファイルのオープンに失敗しました。"; - msgE += "\n\nReason:\nOpening an output file is failed."; + msg += this->makeMsg( "E_SaveSet_FileOpen" ); break; case ECFormResult::ERROR_FILE_READ: - msgJ += "\n\n原因:\nファイルの読み込みに失敗しました。"; - msgE += "\n\nReason:\nReading the file is failed."; + msg += this->makeMsg( "E_SaveSet_FileRead" ); break; case ECFormResult::ERROR_FILE_WRITE: - msgJ += "\n\n原因:\n出力ファイルへの書き出しに失敗しました。"; - msgE += "\n\nReason:\nWriting the file is failed."; + msg += this->makeMsg( "E_SaveSet_FileWrite" ); break; case ECFormResult::ERROR_FILE_COPY: - msgJ += "\n\n原因:\n入力ROMデータファイルのコピーに失敗しました。"; - msgE += "\n\nReason:\nCopying the ROM data file failed."; + msg += this->makeMsg( "E_SaveSet_FileCopy" ); break; case ECFormResult::ERROR_FILE_EXIST: - msgJ += "\n\n原因:\n入力ROMデータファイルが元のフォルダに存在しないとき出力ファイルを作成できません。"; - msgE += "\n\nReason:\nWhen the input ROM data file doesn't exist in the original folder, output file can't be made."; + msg += this->makeMsg( "E_SaveSet_FileExist" ); break; case ECFormResult::ERROR_FILE_SIGN: - msgJ += "\n\n原因:\n出力ファイルのディジタル署名の計算に失敗しました。"; - msgE += "\n\nReason:\nCalculation the digital signature of the output file failed."; + msg += this->makeMsg( "E_SaveSet_FileSign" ); break; default: break; } - this->errMsg( msgJ, msgE ); + this->errMsgCore( msg ); return; } - this->sucMsg( "マスターROMの作成が成功しました。", "A master ROM is made successfully." ); + this->sucMsg( "SaveRom_Success" ); this->tboxFile->Text = srlfile; } catch( System::Exception ^ex ) { - System::String ^msgJ = "マスターROMの作成に失敗しました。"; - System::String ^msgE = "Making a master ROM failed. "; - msgJ += "\n\n例外:\n" + ex->ToString() + "\n" + ex->Message; - msgE += "\n\n例外:\n" + ex->ToString() + "\n" + ex->Message; - this->errMsg( msgJ, msgE ); + this->errMsg( "E_SaveRom_Exception", ex->ToString(), ex->Message ); return; } - u16 crc; // SRL全体のCRCを計算する + u16 crc; // 書き出したSRLを再読み込みするのでCRCを再計算する if( !getWholeCRCInFile( srlfile, &crc ) ) { - this->errMsg( "CRCの計算に失敗しました。", - "Calculating CRC is failed. " ); + this->errMsg( "E_SaveRom_CRC" ); return; } this->tboxWholeCRC->Clear(); this->tboxWholeCRC->AppendText( "0x" ); - this->tboxWholeCRC->AppendText( crc.ToString("X4") ); // 書き出したSRLを再読み込みするのでCRCを再計算する + this->tboxWholeCRC->AppendText( crc.ToString("X4") ); } //stripItemMasterRom_Click() @@ -3827,7 +3842,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; // SRLが読み込まれていないときにはリードさせない if( System::String::IsNullOrEmpty( this->tboxFile->Text ) ) { - this->errMsg( "ROMデータファイルが読み込まれていません。", "ROM file has not opened yet." ); + this->errMsg( "E_SaveSet_Empty" ); return; } @@ -3836,14 +3851,12 @@ private: System::Windows::Forms::Label^ labCountryCodeL; this->hWarnList->Clear(); if( this->checkSrlForms() == false ) { - this->errMsg( "不正な設定があるため提出データを作成できません。", - "Setting is illegal. Submission data can't be made." ); + this->errMsg( "E_SaveSet_Setting" ); return; } if( this->checkDeliverableForms() == false ) { - this->errMsg( "入力情報に不足があるため提出データを作成できません。", - "Input is not enough. Submission data can't be made." ); + this->errMsg( "E_SaveSet_Input" ); return; } @@ -3855,28 +3868,13 @@ private: System::Windows::Forms::Label^ labCountryCodeL; System::String ^middlefilePrint = prefix + "_MIDDLEWARE.HTML"; // 注意書き - this->sucMsg( - "以下の提出ファイルが一度に作成されます。\n\n" - + srlfile + " (マスターROM)\n" - + delivfile + " (マスターROM提出確認書)\n" - + middlefile + " (ミドルウェア一覧)\n" - + middlefilePrint + " (ミドルウェア一覧 印刷用)\n" - + "\n", - - "Following files for submission will be made. \n\n" - + srlfile + " (Master ROM)\n" - + delivfile + " (Submission Sheet)\n" - + middlefile + " (Middleware List)\n" - + middlefilePrint + " (Middleware List For Print)\n" - + "\n" - ); + this->sucMsg( "SaveSet_Name", srlfile, delivfile, middlefile, middlefilePrint ); // ダイアログからSRLを保存するディレクトリを取得する - System::String ^dir = this->saveDirDlg( "保存先フォルダを選択してください。", "Please select a folder for saving files" ); + System::String ^dir = this->saveDirDlg( this->makeMsg("SaveSet_Folder") ); if( !dir ) { - this->errMsg( "フォルダの選択がキャンセルされましたので提出データ一式は作成されません。", - "A set of submission data can not be made, since selecting folder is canceled." ); + this->errMsg( "E_SaveSet_FolderCancel" ); return; } srlfile = dir + srlfile; @@ -3888,8 +3886,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; if( !this->isOverwriteFile(srlfile) || !this->isOverwriteFile(delivfile) || !this->isOverwriteFile(middlefile) || !this->isOverwriteFile(middlefilePrint) ) { - this->errMsg( "ファイルの上書きがキャンセルされましたので提出データ一式は作成されません。", - "Since overwriting a file is canceled, a set of submission data can not be made." ); + this->errMsg( "E_SaveSet_OWCancel" ); return; } @@ -3903,62 +3900,50 @@ private: System::Windows::Forms::Label^ labCountryCodeL; ECFormResult result = this->saveRom( srlfile ); if( result != ECFormResult::NOERROR ) { - System::String^ msgJ = "マスターROMの作成に失敗しました。作成を中止するため一部のファイルは作成されません。"; - System::String^ msgE = "Making a master ROM failed. Therefore, a part of files can't be made."; + System::String ^msg = this->makeMsg( "E_SaveSet_FileDefault" ); switch( result ) { case ECFormResult::ERROR_FILE_OPEN: - msgJ += "\n\n原因:\n出力ファイルのオープンに失敗しました。"; - msgE += "\n\nReason:\nOpening an output file is failed."; + msg += this->makeMsg( "E_SaveSet_FileOpen" ); break; case ECFormResult::ERROR_FILE_READ: - msgJ += "\n\n原因:\nファイルの読み込みに失敗しました。"; - msgE += "\n\nReason:\nReading the file is failed."; + msg += this->makeMsg( "E_SaveSet_FileRead" ); break; case ECFormResult::ERROR_FILE_WRITE: - msgJ += "\n\n原因:\n出力ファイルへの書き出しに失敗しました。"; - msgE += "\n\nReason:\nWriting the file is failed."; + msg += this->makeMsg( "E_SaveSet_FileWrite" ); break; case ECFormResult::ERROR_FILE_COPY: - msgJ += "\n\n原因:\n入力ROMデータファイルのコピーに失敗しました。"; - msgE += "\n\nReason:\nCopying the ROM data file failed."; + msg += this->makeMsg( "E_SaveSet_FileCopy" ); break; case ECFormResult::ERROR_FILE_EXIST: - msgJ += "\n\n原因:\n入力ROMデータファイルが元のフォルダに存在しないとき出力ファイルを作成できません。"; - msgE += "\n\nReason:\nWhen the input ROM data file doesn't exist in the original folder, output file can't be made."; + msg += this->makeMsg( "E_SaveSet_FileExist" ); break; case ECFormResult::ERROR_FILE_SIGN: - msgJ += "\n\n原因:\n出力ファイルのディジタル署名の計算に失敗しました。"; - msgE += "\n\nReason:\nCalculation the digital signature of the output file failed."; + msg += this->makeMsg( "E_SaveSet_FileSign" ); break; default: break; } - this->errMsg( msgJ, msgE ); + this->errMsgCore( msg ); return; } this->tboxFile->Text = srlfile; // 成功してからテキストボックスに反映 } catch( System::Exception ^ex ) { - System::String ^msgJ = "マスターROMの作成に失敗しました。作成を中止するため一部のファイルは作成されません。"; - System::String ^msgE = "Making a master ROM failed. Therefore, a part of files can't be made."; - msgJ += "例外:\n" + ex->ToString() + "\n" + ex->Message; - msgE += "例外:\n" + ex->ToString() + "\n" + ex->Message; - this->errMsg( msgJ, msgE ); + this->errMsg( "E_SaveSet_Exception", ex->ToString(), ex->Message ); return; } u16 crc; // SRL全体のCRCを計算する(書類に記述するため) if( !getWholeCRCInFile( srlfile, &crc ) ) { - this->errMsg( "CRCの計算に失敗しました。作成を中止するため一部のファイルは作成されません。", - "Calculating CRC is failed. Therefore, a part of files can't be made." ); + this->errMsg( "E_SaveSet_CRC" ); return; } this->tboxWholeCRC->Clear(); @@ -3968,8 +3953,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; // ミドルウェアのリストを作成 if( !this->saveMiddlewareListXmlEmbeddedXsl( middlefile ) || !this->saveMiddlewareListHtml( middlefilePrint ) ) { - this->errMsg( "ミドルウェアのリストが作成できませんでした。作成を中止するため一部のファイルは作成されません。", - "Making a list of middleware failed. Therefore, a part of files can't be made."); + this->errMsg( "E_SaveSet_MWList" ); return; } @@ -3982,22 +3966,20 @@ private: System::Windows::Forms::Label^ labCountryCodeL; switch( result ) { case ECDeliverableResult::ERROR_FILE_OPEN: - this->errMsg( "提出確認書のテンプレートが開けなかったため、提出確認書の作成に失敗しました。", - "Since a templete of the submission sheet can't be opened, making the sheet is failed." ); + this->errMsg( "E_SaveSet_SheetTemplate" ); break; case ECDeliverableResult::ERROR_FILE_WRITE: - this->errMsg( "提出確認書にデータを書き込みできませんでした。同名ファイルがすでに開かれていないかご確認ください。", - "Writing data into a submission sheet failed. Please check that the file has been opened already." ); + this->errMsg( "E_SaveSet_SheetOpen" ); break; default: - this->errMsg( "提出確認書の作成に失敗しました。", "Making the submission sheet is failed." ); + this->errMsg( "E_SaveSet_Sheet_Default" ); break; } return; } - this->sucMsg( "提出データ一式の作成に成功しました。", "A set of submission data is made successfully." ); + this->sucMsg( "SaveSet_Success" ); } //stripItemSheet_Click() @@ -4037,7 +4019,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; { if( System::String::IsNullOrEmpty(this->tboxFile->Text) ) { - this->errMsg( "ROMデータファイルが読み込まれていません。", "ROM file has not opened yet." ); + this->errMsg( "E_MWList_Empty" ); return; } @@ -4045,7 +4027,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; if( !filename || !this->saveMiddlewareListXmlEmbeddedXsl(filename) ) { - this->errMsg( "ミドルウェアリストの作成に失敗しました。","Making a middleware list failed." ); + this->errMsg( "E_MWList_Default" ); } } //stripItemMiddlewareXml_Click() @@ -4057,7 +4039,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; { if( System::String::IsNullOrEmpty(this->tboxFile->Text) ) { - this->errMsg( "ROMデータファイルがオープンされていません。", "ROM file has not opened yet." ); + this->errMsg( "E_MWList_Empty" ); return; } @@ -4065,7 +4047,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; if( !filename || !this->saveMiddlewareListHtml(filename) ) { - this->errMsg( "ミドルウェアリストの作成に失敗しました。","Making a middleware list failed." ); + this->errMsg( "E_MWList_Default" ); } } //stripItemMiddlewareHtml_Click @@ -4092,8 +4074,7 @@ private: System::Windows::Forms::Label^ labCountryCodeL; if( System::IO::File::Exists(filename) == false ) { - this->errMsg( "ファイルが存在しませんので読み込むことができません。", - "File is not found. Therefore the file can not be opened." ); + this->errMsg( "E_LoadRom_Exist" ); return; } if( System::IO::Path::GetExtension(filename)->ToLower() == ".xml" ) @@ -4108,7 +4089,6 @@ private: System::Windows::Forms::Label^ labCountryCodeL; } this->tboxFile->Text = filename; this->clearOtherForms(); - //this->sucMsg( "ROMデータファイルのオープンに成功しました。", "The ROM data file is opened successfully." ); } } diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp index e60bbde..0c82b21 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp @@ -40,6 +40,7 @@ void Form1::construct(void) this->IsSpreadSheet = true; this->IsReadOnly = false; this->SizeGboxExFlags = this->gboxExFlags->Size; + this->hMsg = gcnew RCMessageBank( this->getGuiMessageFileJ(), this->getGuiMessageFileE() ); // バージョン情報を表示 //this->labAssemblyVersion->Text = System::Windows::Forms::Application::ProductVersion; @@ -50,8 +51,7 @@ void Form1::construct(void) //System::Diagnostics::Debug::WriteLine( this->getSplitTadTmpFile() ); if( System::IO::File::Exists( this->getSplitTadTmpFile() ) ) { - this->sucMsg( "本プログラムで作成する一時ファイルと同名のファイルが存在します。このファイルを削除します。", - "There is the file which has same name as temporary file made by this program. That file is deleted." ); + this->sucMsg( "E_Start_TmpExist" ); System::IO::File::Delete( this->getSplitTadTmpFile() ); } diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_file.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_file.cpp index 457447f..db25d2d 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_file.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_file.cpp @@ -87,7 +87,7 @@ System::Boolean Form1::loadTad( System::String ^tadfile ) System::String ^srlfile = this->getSplitTadTmpFile(); if( splitTad( tadfile, srlfile ) != 0 ) // 上書きで保存 { - this->errMsg( "TADファイルの読み込みに失敗しました。", "Reading TAD file failed." ); + this->errMsg( "E_LoadRom_Tad" ); return false; } System::Boolean result = this->loadSrl( srlfile ); // 一時保存したSRLを読み込み @@ -105,19 +105,16 @@ System::Boolean Form1::loadSrl( System::String ^srlfile ) switch( result ) { case ECSrlResult::ERROR_PLATFORM: - this->errMsg( "本ツールはTWL用です。NTR専用ROMなどのTWL非対応ROMを読み込むことはできません。", - "This tool can only read TWL ROM. This can't read an other data e.g. NTR limited ROM." ); + this->errMsg( "E_LoadRom_Platform" ); break; case ECSrlResult::ERROR_SIGN_DECRYPT: case ECSrlResult::ERROR_SIGN_VERIFY: - this->errMsg( "不正なROMデータです。TWL対応/専用ROMでないかROMデータが改ざんされている可能性があります。", - "Illegal ROM data. It is not for TWL ROM, or is altered illegally." ); + this->errMsg( "E_LoadRom_Sign" ); break; default: - this->errMsg( "ROMデータファイルの読み込みに失敗しました。\n再度ROMデータを読み込ませてください。", - "Reading the ROM data file failed. \nPlease read a ROM data file again, with \"Open a ROM data file\"" ); + this->errMsg( "E_LoadRom_Default" ); break; } return false; @@ -138,8 +135,7 @@ System::Boolean Form1::loadSrl( System::String ^srlfile ) u16 crc; if( !getWholeCRCInFile( srlfile, &crc ) ) { - this->errMsg( "ROMデータのCRC計算に失敗しました。ROMデータの読み込みはキャンセルされました。", - "Calculating CRC of the ROM data failed. Therefore reading ROM data is canceled." ); + this->errMsg( "E_LoadRom_CRC" ); return false; } System::UInt16 ^hcrc = gcnew System::UInt16( crc ); @@ -239,17 +235,13 @@ ECFormResult Form1::copyFile( System::String ^infile, System::String ^outfile ) FILE *ifp = NULL; if( fopen_s( &ifp, pchInfile, "rb" ) != NULL ) { - //this->errMsg( - // "ファイルコピーにおいて入力ファイルのオープンに失敗しました。", - // "In Copying file, the input file can't be opened." ); + //this->errMsgCore( "ファイルコピーにおいて入力ファイルのオープンに失敗しました。" ); return (ECFormResult::ERROR_FILE_OPEN); } FILE *ofp = NULL; if( fopen_s( &ofp, pchOutfile, "wb" ) != NULL ) // 同名ファイルを削除して新規にライト・バイナリ { - //this->errMsg( - // "ファイルコピーにおいて出力ファイルのオープンに失敗しました。", - // "In Copying file, the output file can't be opened." ); + //this->errMsg( "ファイルコピーにおいて出力ファイルのオープンに失敗しました。" ); fclose(ifp); return (ECFormResult::ERROR_FILE_OPEN); } @@ -268,18 +260,14 @@ ECFormResult Form1::copyFile( System::String ^infile, System::String ^outfile ) if( datasize != fread(buf, 1, datasize, ifp) ) { - //this->errMsg( - // "ファイルコピーにおいて入力ファイルからのデータリードに失敗しました。", - // "In Copying file, contents can't be read from the input file." ); + //this->errMsg( "ファイルコピーにおいて入力ファイルからのデータリードに失敗しました。" ); fclose(ofp); fclose(ifp); return ECFormResult::ERROR_FILE_READ; } if( datasize != fwrite(buf, 1, datasize, ofp) ) { - //this->errMsg( - // "ファイルコピーにおいて出力ファイルからのデータライトに失敗しました。", - // "In Copying file, contents can't be written to the output file." ); + //this->errMsg( "ファイルコピーにおいて出力ファイルからのデータライトに失敗しました。" ); fclose(ofp); fclose(ifp); return ECFormResult::ERROR_FILE_READ; diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_init.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_init.cpp index 8f68442..be87a23 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_init.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_init.cpp @@ -39,13 +39,13 @@ void Form1::loadInit(void) catch( System::IO::FileNotFoundException ^s ) { (void)s; - this->errMsg( "設定ファイルが見つかりません。", "Setting file is not found." ); + this->errMsg( "E_Start_InitExist" ); return; } catch( System::Exception ^s ) { (void)s; - this->errMsg( "設定ファイルを開くことができませんでした。", "Setting file can't be opened." ); + this->errMsg( "E_Start_InitOpen" ); return; } @@ -182,13 +182,13 @@ void Form1::loadAppendInit(void) catch( System::IO::FileNotFoundException ^s ) { (void)s; - this->errMsg( "追加設定ファイルが見つかりません。", "Setting file is not found." ); + this->errMsg( "E_Start_AppendExist" ); return; } catch( System::Exception ^s ) { (void)s; - this->errMsg( "追加設定ファイルを開くことができませんでした。", "Setting file can't be opened." ); + this->errMsg( "E_Start_AppendOpen" ); return; } System::Xml::XmlElement ^root = doc->DocumentElement; @@ -218,8 +218,7 @@ void Form1::loadAppendInit(void) catch ( System::Exception ^ex ) { (void)ex; - this->errMsg( "設定ファイル中のSDKバージョンが読み込めませんでした。バージョンは0とみなされます。", - "SDK ver. can't be read from setting file. Therefore it is set by 0." ); + this->errMsg( "E_Start_SDK" ); this->hSrl->hMrcExternalCheckItems->SDKVer = 0; } diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_srl.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_srl.cpp index 2fd7f48..186f6e9 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_srl.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_srl.cpp @@ -66,12 +66,6 @@ void Form1::setSrlForms(void) this->tboxHeaderCRC->AppendText( "0x" ); this->tboxHeaderCRC->AppendText( this->hSrl->HeaderCRC.ToString("X4") ); - if( this->hSrl->hPlatform == nullptr ) - { - this->errMsg( "プラットホーム指定が不正です。ROMデータのビルド設定を見直してください。", - "Illegal Platform: Please check build settings of the ROM data."); - } - // TWL拡張情報 this->tboxTitleIDLo->Text = this->hSrl->hTitleIDLo; this->tboxTitleIDHi->Text = this->hSrl->TitleIDHi.ToString("X8"); diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp index 469ad6a..5190fca 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp @@ -112,7 +112,7 @@ System::Void Form1::saveTmp( System::String ^filename ) catch( System::Exception ^ex ) { (void)ex; - this->errMsg( "一時情報の保存に失敗しました。", "Saving a temporary file failed." ); + this->errMsg( "E_SaveTemp" ); } } //saveTmp() @@ -129,7 +129,7 @@ void Form1::loadTmp( System::String ^filename ) catch( System::Exception ^ex ) { (void)ex; - this->errMsg( "一時情報の読み込みに失敗しました。", "Loading a temporary file failed." ); + this->errMsg( "E_LoadTemp" ); } System::Xml::XmlElement ^root = doc->DocumentElement; System::String ^text; diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_util.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_util.cpp index 5b77d77..b9c1eb1 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_util.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_util.cpp @@ -328,7 +328,7 @@ System::String^ Form1::saveFileDlg( System::String ^filter, System::String ^exte // セーブするディレクトリをダイアログで取得 // @ret 取得したディレクトリ名(\\で終わるように調整される) エラーのときnullptr -System::String^ Form1::saveDirDlg( System::String ^msgJ, System::String ^msgE ) +System::String^ Form1::saveDirDlg( System::String ^msg ) { System::String ^dir; System::Windows::Forms::FolderBrowserDialog ^dlg = gcnew (System::Windows::Forms::FolderBrowserDialog); @@ -344,16 +344,7 @@ System::String^ Form1::saveDirDlg( System::String ^msgJ, System::String ^msgE ) dlg->SelectedPath = this->prevDir; } dlg->ShowNewFolderButton = true; - - // ダイアログの上部に出るメッセージ - if( this->isEnglish() && msgE ) - { - dlg->Description = msgE; - } - else if( msgJ ) - { - dlg->Description = msgJ; - } + dlg->Description = msg; // ダイアログの上部に出るメッセージ if( dlg->ShowDialog() != System::Windows::Forms::DialogResult::OK ) { @@ -377,17 +368,7 @@ bool Form1::isOverwriteFile( System::String ^path ) { if( System::IO::File::Exists( path ) ) { - System::String ^msg; - if( this->isJapanese() ) - { - msg = gcnew System::String( path + "はすでに存在します。上書きしますか?" ); - } - else - { - msg = gcnew System::String( path + "already exists. Overwrite it?" ); - } - - if( MessageBox::Show( msg, "Information", MessageBoxButtons::YesNo, MessageBoxIcon::None ) + if( MessageBox::Show( this->makeMsg( "OverWrite", path ), "Information", MessageBoxButtons::YesNo, MessageBoxIcon::None ) == System::Windows::Forms::DialogResult::No ) { return false; diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/message_bank.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/message_bank.cpp index 319c3b8..e869158 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/message_bank.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/message_bank.cpp @@ -32,7 +32,7 @@ void RCMessageBank::loadMessage( System::String ^filepath, System::String ^lang System::Xml::XmlElement ^root = doc->DocumentElement; // 言語によってXMLルートの格納先を変更 - if( lang == "J" ) + if( lang->ToUpper() == "J" ) { this->rootJ = root; } @@ -48,7 +48,7 @@ void RCMessageBank::loadMessage( System::String ^filepath, System::String ^lang System::String^ RCMessageBank::getMessage( System::String ^tag, System::String ^lang ) { System::Xml::XmlElement ^root; - if( lang == "J" ) + if( lang->ToUpper() == "J" ) { root = this->rootJ; } diff --git a/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_e.xml b/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_e.xml index b71a831..afec4ba 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_e.xml +++ b/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_e.xml @@ -20,7 +20,7 @@ The reading of the TAD file has failed. -ROM data file has not been read +ROM data file has not been read. Submission data cannot be created due to illegal settings. Submission data cannot be created due to insufficient input information. The following submission files are all created at one time. @@ -33,7 +33,7 @@ Select a save-to folder. Submission data is not created because folder selection has been canceled. Submission data is not created because file overwrite has been canceled. -Failed to create Master ROM. Halted during creation, so some files were not created. +Failed to create Master ROM. Halted during creation, so some files were not created. Master ROM file not created due to failure to open the output file. Master ROM file not created due to failure to read the file. Master ROM file not created due to failure to write to the output file. @@ -60,7 +60,7 @@ Exception:{0} Select a save-to folder. The Master ROM was not created because folder selection has been canceled. Creation of Master ROM was canceled. -Failed to create Master ROM. +Failed to create Master ROM. Failed to create Master ROM. 萓句、:{0} diff --git a/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_j.xml b/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_j.xml index 1284f75..1fd44b8 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_j.xml +++ b/build/tools/MasterEditor/MasterEditorTWL/resource/gui_msg_j.xml @@ -33,22 +33,22 @@ 菫晏ュ伜医ヵ繧ゥ繝ォ繝繧帝∈謚槭@縺ヲ縺上□縺輔>縲 繝輔か繝ォ繝縺ョ驕ク謚槭′繧ュ繝」繝ウ繧サ繝ォ縺輔l縺セ縺励◆縺ョ縺ァ謠仙コ繝繝シ繧ソ荳蠑上ッ菴懈舌&繧後∪縺帙s縲 繝輔ぃ繧、繝ォ縺ョ荳頑嶌縺阪′繧ュ繝」繝ウ繧サ繝ォ縺輔l縺セ縺励◆縺ョ縺ァ謠仙コ繝繝シ繧ソ荳蠑上ッ菴懈舌&繧後∪縺帙s縲 -繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 +繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 蜴溷屏:蜃コ蜉帙ヵ繧。繧、繝ォ縺ョ繧ェ繝シ繝励Φ縺ォ螟ア謨励@縺セ縺励◆縲 蜴溷屏:繝輔ぃ繧、繝ォ縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲 蜴溷屏:蜃コ蜉帙ヵ繧。繧、繝ォ縺ク縺ョ譖ク縺榊コ縺励↓螟ア謨励@縺セ縺励◆縲 蜴溷屏:蜈・蜉娚OM繝繝シ繧ソ繝輔ぃ繧、繝ォ縺ョ繧ウ繝斐シ縺ォ螟ア謨励@縺セ縺励◆縲 蜴溷屏:蜈・蜉娚OM繝繝シ繧ソ繝輔ぃ繧、繝ォ縺悟縺ョ繝輔か繝ォ繝縺ォ蟄伜惠縺励↑縺縺ィ縺榊コ蜉帙ヵ繧。繧、繝ォ繧剃ス懈舌〒縺阪∪縺帙s縲 蜴溷屏:蜃コ蜉帙ヵ繧。繧、繝ォ縺ョ繝繧」繧ク繧ソ繝ォ鄂イ蜷阪ョ險育ョ励↓螟ア謨励@縺セ縺励◆縲 +CRC縺ョ險育ョ励↓螟ア謨励@縺セ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 +繝溘ラ繝ォ繧ヲ繧ァ繧「縺ョ繝ェ繧ケ繝医′菴懈舌〒縺阪∪縺帙s縺ァ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 萓句、:{0} {1} -CRC縺ョ險育ョ励↓螟ア謨励@縺セ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 -繝溘ラ繝ォ繧ヲ繧ァ繧「縺ョ繝ェ繧ケ繝医′菴懈舌〒縺阪∪縺帙s縺ァ縺励◆縲ゆス懈舌r荳ュ豁「縺吶k縺溘a荳驛ィ縺ョ繝輔ぃ繧、繝ォ縺ッ菴懈舌&繧後∪縺帙s縲 -謠仙コ遒コ隱肴嶌縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 謠仙コ遒コ隱肴嶌縺ョ繝繝ウ繝励Ξ繝シ繝医′髢九¢縺ェ縺九▲縺溘◆繧√∵署蜃コ遒コ隱肴嶌縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 謠仙コ遒コ隱肴嶌縺ォ繝繝シ繧ソ繧呈嶌縺崎セシ縺ソ縺ァ縺阪∪縺帙s縺ァ縺励◆縲ょ酔蜷阪ヵ繧。繧、繝ォ縺後☆縺ァ縺ォ髢九°繧後※縺縺ェ縺縺九#遒コ隱阪¥縺縺輔>縲 +謠仙コ遒コ隱肴嶌縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 謠仙コ繝繝シ繧ソ荳蠑上ョ菴懈舌↓謌仙粥縺励∪縺励◆縲 @@ -60,7 +60,7 @@ 菫晏ュ伜医ヵ繧ゥ繝ォ繝繧帝∈謚槭@縺ヲ縺上□縺輔>縲 繝輔か繝ォ繝縺ョ驕ク謚槭′繧ュ繝」繝ウ繧サ繝ォ縺輔l縺セ縺励◆縺ョ縺ァ繝槭せ繧ソ繝シROM縺ッ菴懈舌&繧後∪縺帙s縲 繝輔ぃ繧、繝ォ縺ョ荳頑嶌縺阪′繧ュ繝」繝ウ繧サ繝ォ縺輔l縺セ縺励◆縺ョ縺ァ繝槭せ繧ソ繝シROM縺ッ菴懈舌&繧後∪縺帙s縲 -繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 +繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 繝槭せ繧ソ繝シROM縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 萓句、:{0}