diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb index a0f49fb..dbe49f1 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 46959e4..aced8af 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 745d106..9e715f4 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 53e0078..0a86caf 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form1.h @@ -29,7 +29,9 @@ namespace MasterEditorTWL { /// public ref class Form1 : public System::Windows::Forms::Form { + ///////////////////////////////////////////// // 独自追加フィールド + ///////////////////////////////////////////// private: // SRL情報(ROMヘッダを含む) RCSrl ^hSrl; @@ -54,7 +56,9 @@ namespace MasterEditorTWL { System::Boolean IsCheckedUGC; // 読み込み時にチェックされていたか System::Boolean IsCheckedPhotoEx; + ///////////////////////////////////////////// // VC自動追加フィールド + ///////////////////////////////////////////// private: System::Windows::Forms::GroupBox^ gboxCRC; private: System::Windows::Forms::TextBox^ tboxWholeCRC; @@ -707,77 +711,7 @@ private: System::Windows::Forms::CheckBox^ cboxIsUnnecessaryRating; // //TODO: ここにコンストラクタ コードを追加します // - this->hSrl = gcnew (RCSrl); - this->hDeliv = gcnew (RCDeliverable); - this->IsLoadTad = false; - this->hErrorList = gcnew System::Collections::Generic::List(); - this->hErrorList->Clear(); - this->hWarnList = gcnew System::Collections::Generic::List(); - this->hWarnList->Clear(); - this->IsCheckedUGC = false; - this->IsCheckedPhotoEx = false; - - // バージョン情報を表示 - //this->labAssemblyVersion->Text = System::Windows::Forms::Application::ProductVersion; - System::Reflection::Assembly ^ass = System::Reflection::Assembly::GetEntryAssembly(); - this->labAssemblyVersion->Text = "ver." + this->getVersion(); - - // TAD読み込みの際に作成される一時ファイルと同名ファイルがあった場合には削除してよいか確認 - 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." ); - System::IO::File::Delete( this->getSplitTadTmpFile() ); - } - - // デフォルト値 - this->IsSpreadSheet = true; - this->IsReadOnly = false; - this->dateRelease->Value = System::DateTime::Now; - this->dateSubmit->Value = System::DateTime::Now; -#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) - this->combRegion->Items->Add( gcnew System::String( L"全リージョン" ) ); -#endif - - // アプリ種別をつける - System::String ^appstr = nullptr; -#ifdef METWL_VER_APPTYPE_LAUNCHER - appstr += "Launcher/"; -#endif -#ifdef METWL_VER_APPTYPE_SECURE - appstr += "Secure/"; -#endif -#ifdef METWL_VER_APPTYPE_SYSTEM - appstr += "System/"; -#endif - if( appstr != nullptr) - { - this->Text += " [ Supported App: " + appstr + "User ]"; - } - - // 複数行表示の改行を挿入 - this->tboxGuideRomEditInfo->Text = this->tboxGuideRomEditInfo->Text->Replace( "", "\r\n" ); - this->tboxGuideErrorInfo->Text = this->tboxGuideErrorInfo->Text->Replace( "", "\r\n" ); - - // 言語バージョンにあわせてメニューにチェックを入れる - if( System::Threading::Thread::CurrentThread->CurrentUICulture->Name->StartsWith( "ja" ) ) - { - this->stripItemJapanese->Checked = true; - this->stripItemEnglish->Checked = false; - } - else - { - this->stripItemJapanese->Checked = false; - this->stripItemEnglish->Checked = true; - } - - // 非表示項目 - this->changeVisibleForms( false ); - - // 設定ファイルの読み込み - this->loadInit(); - this->loadAppendInit(); // 追加設定ファイル + this->construct(); } protected: @@ -786,12 +720,7 @@ private: System::Windows::Forms::CheckBox^ cboxIsUnnecessaryRating; /// ~Form1() { - // TAD読み出しの際に作成される一時SRLファイルを削除(書き出しをせずに終了したときに起こりうる) - System::String ^srlfile = this->getSplitTadTmpFile(); - if( System::IO::File::Exists( srlfile ) ) - { - System::IO::File::Delete( srlfile ); // すでに存在する場合は削除 - } + this->destruct(); if (components) { @@ -2826,6 +2755,15 @@ private: System::Windows::Forms::CheckBox^ cboxIsUnnecessaryRating; ///////////////////////////////////////////// // 内部メソッド ///////////////////////////////////////////// + private: + // ---------------------------------------------- + // 初期処理 / 終了処理 + // ---------------------------------------------- + + void construct(void); + void destruct(void); + void handleArgs(void); // コマンドライン引数処理 + private: // ---------------------------------------------- // 設定ファイルの読み込み @@ -2910,7 +2848,7 @@ private: System::Windows::Forms::CheckBox^ cboxIsUnnecessaryRating; private: // ---------------------------------------------- - // フォームの初期設定 + // フォームの設定変更 // ---------------------------------------------- // 非表示項目の表示切替 diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp new file mode 100644 index 0000000..f121071 --- /dev/null +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_constructor.cpp @@ -0,0 +1,155 @@ +// ---------------------------------------------- +// 初期処理 / 終了処理 +// ---------------------------------------------- + +#include "stdafx.h" +#include +#include "common.h" +#include "srl.h" +#include "deliverable.h" +#include "crc_whole.h" +#include "utility.h" +#include "lang.h" +#include "FormError.h" +#include "Form1.h" + +using namespace System; +using namespace System::ComponentModel; +using namespace System::Collections; +using namespace System::Windows::Forms; +using namespace System::Data; +using namespace System::Drawing; +using namespace MasterEditorTWL; + + +// ---------------------------------------------- +// コンストラクタから呼ばれる初期処理 +// ---------------------------------------------- +void Form1::construct(void) +{ + // フィールド初期化 + this->hSrl = gcnew (RCSrl); + this->hDeliv = gcnew (RCDeliverable); + this->IsLoadTad = false; + this->hErrorList = gcnew System::Collections::Generic::List(); + this->hErrorList->Clear(); + this->hWarnList = gcnew System::Collections::Generic::List(); + this->hWarnList->Clear(); + this->IsCheckedUGC = false; + this->IsCheckedPhotoEx = false; + this->IsSpreadSheet = true; + this->IsReadOnly = false; + + // バージョン情報を表示 + //this->labAssemblyVersion->Text = System::Windows::Forms::Application::ProductVersion; + System::Reflection::Assembly ^ass = System::Reflection::Assembly::GetEntryAssembly(); + this->labAssemblyVersion->Text = "ver." + this->getVersion(); + + // TAD読み込みの際に作成される一時ファイルと同名ファイルがあった場合には削除してよいか確認 + //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." ); + System::IO::File::Delete( this->getSplitTadTmpFile() ); + } + + // 日付フォームの初期設定を現在の時刻にする + this->dateRelease->Value = System::DateTime::Now; + this->dateSubmit->Value = System::DateTime::Now; + + // システム版のときにはリージョンに全リージョンの項目を追加 +#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) + this->combRegion->Items->Add( gcnew System::String( L"全リージョン" ) ); +#endif + + // アプリ種別をつける + System::String ^appstr = nullptr; +#ifdef METWL_VER_APPTYPE_LAUNCHER + appstr += "Launcher/"; +#endif +#ifdef METWL_VER_APPTYPE_SECURE + appstr += "Secure/"; +#endif +#ifdef METWL_VER_APPTYPE_SYSTEM + appstr += "System/"; +#endif + if( appstr != nullptr) + { + this->Text += " [ Supported App: " + appstr + "User ]"; + } + + // 複数行表示の改行を挿入 + this->tboxGuideRomEditInfo->Text = this->tboxGuideRomEditInfo->Text->Replace( "", "\r\n" ); + this->tboxGuideErrorInfo->Text = this->tboxGuideErrorInfo->Text->Replace( "", "\r\n" ); + + // 言語バージョンにあわせてメニューにチェックを入れる + if( System::Threading::Thread::CurrentThread->CurrentUICulture->Name->StartsWith( "ja" ) ) + { + this->stripItemJapanese->Checked = true; + this->stripItemEnglish->Checked = false; + } + else + { + this->stripItemJapanese->Checked = false; + this->stripItemEnglish->Checked = true; + } + + // 非表示項目 + this->changeVisibleForms( false ); + + // 設定ファイルの読み込み + this->loadInit(); + this->loadAppendInit(); // 追加設定ファイル + + // 引数処理 + this->handleArgs(); + //System::Diagnostics::Debug::WriteLine( "constructed" ); +} + + +// ---------------------------------------------- +// デストラクタから呼ばれる終了処理 +// ---------------------------------------------- +void Form1::destruct(void) +{ + // TAD読み出しの際に作成される一時SRLファイルを削除(書き出しをせずに終了したときに起こりうる) + System::String ^srlfile = this->getSplitTadTmpFile(); + if( System::IO::File::Exists( srlfile ) ) + { + System::IO::File::Delete( srlfile ); // すでに存在する場合は削除 + } +} + + +// ---------------------------------------------- +// コマンドライン引数処理 +// ---------------------------------------------- +void Form1::handleArgs(void) +{ + cli::array ^args = System::Environment::GetCommandLineArgs(); + if( args->Length < 2 ) + { + return; + } + + // 引数でsrlが指定されているときは読み込む + System::String ^romfile = args[1]; + if( !this->loadRom( romfile ) ) + { + return; + } + System::String ^rompath; + { + // 表示のために絶対パスに変換 + System::String ^currdir = System::Environment::CurrentDirectory; + if( !currdir->EndsWith( "\\" ) ) + { + currdir = currdir + "\\"; + } + rompath = romfile->Replace( '/', '\\' ); + rompath = currdir + rompath; + } + this->tboxFile->Text = rompath; + this->clearOtherForms(); +} diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp index dd99062..ac9fbf6 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_tmp.cpp @@ -135,6 +135,7 @@ void Form1::loadTmp( System::String ^filename ) { this->loadRom(text); // tad/srl両対応 this->tboxFile->Text = text; + this->clearOtherForms(); } // 言語 diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj index f030682..464200c 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj @@ -211,6 +211,10 @@ RelativePath=".\deliverable.cpp" > + +