mirror of
https://github.com/rvtr/TwlToolsRED.git
synced 2025-10-31 06:41:18 -04:00
エラー情報の表示を用途によって分岐するしくみを作成。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@423 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
parent
1486894918
commit
6566da27d9
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5038,6 +5038,9 @@ private: System::Windows::Forms::TextBox^ tboxPurposeInError;
|
||||
RCMrcError^ makeErrorMsg(
|
||||
System::Boolean isAffectRom, System::String ^labeltag, System::String ^msgtag, ... cli::array<System::String^> ^args );
|
||||
|
||||
// 用途のラジオボタンの状態によって表示するかどうかを振り分ける
|
||||
bool isDisplayOneGridErrorForPurpose( RCMrcError ^err );
|
||||
|
||||
// 読み込み時エラーの登録
|
||||
void setGridError( void );
|
||||
void setGridWarn( void );
|
||||
|
||||
@ -46,6 +46,11 @@ void Form1::changeFormInput( System::String ^langname )
|
||||
this->tboxNTSC1->Enabled = true;
|
||||
this->tboxFurigana2->Enabled = true;
|
||||
this->tboxNTSC2->Enabled = true;
|
||||
this->tboxFurigana1->Visible = true;
|
||||
this->tboxNTSC1->Visible = true;
|
||||
this->tboxFurigana2->Visible = true;
|
||||
this->tboxNTSC2->Visible = true;
|
||||
|
||||
this->labFurigana1->Visible = true;
|
||||
this->labNTSC1Pre->Visible = true;
|
||||
this->labNTSC1Sur->Visible = true;
|
||||
@ -70,6 +75,15 @@ void Form1::changeFormInput( System::String ^langname )
|
||||
this->tboxNTSC1->Enabled = false;
|
||||
this->tboxFurigana2->Enabled = false;
|
||||
this->tboxNTSC2->Enabled = false;
|
||||
this->tboxFurigana1->Visible = false;
|
||||
this->tboxNTSC1->Visible = false;
|
||||
this->tboxFurigana2->Visible = false;
|
||||
this->tboxNTSC2->Visible = false;
|
||||
this->tboxFurigana1->Clear();
|
||||
this->tboxNTSC1->Clear();
|
||||
this->tboxFurigana2->Clear();
|
||||
this->tboxNTSC2->Clear();
|
||||
|
||||
this->labFurigana1->Visible = false;
|
||||
this->labNTSC1Pre->Visible = false;
|
||||
this->labNTSC1Sur->Visible = false;
|
||||
|
||||
@ -31,7 +31,7 @@ System::Boolean Form1::checkTextForm( System::String ^formtext, System::String ^
|
||||
System::String ^labelE = this->hMsg->getMessage(tag,"E");
|
||||
System::String ^msgJ = this->hMsg->getMessage("TextBoxInput", "J");
|
||||
System::String ^msgE = this->hMsg->getMessage("TextBoxInput", "E");
|
||||
this->hErrorList->Add( gcnew RCMrcError( labelJ, 0, 0, msgJ, labelE, msgE, true, false ) );
|
||||
this->hErrorList->Add( gcnew RCMrcError( labelJ, 0, 0, msgJ, labelE, msgE, true, false, RCMrcError::PurposeType::Common ) );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -45,7 +45,7 @@ System::Boolean Form1::checkNumRange( System::Int32 val, System::Int32 min, Syst
|
||||
System::String ^labelE = this->hMsg->getMessage(tag,"E");
|
||||
System::String ^msgJ = this->hMsg->getMessage("NumRangeInput", "J");
|
||||
System::String ^msgE = this->hMsg->getMessage("NumRangeInput", "E");
|
||||
this->hErrorList->Add( gcnew RCMrcError( labelJ, 0, 0, msgJ, labelE, msgE, true, false ) );
|
||||
this->hErrorList->Add( gcnew RCMrcError( labelJ, 0, 0, msgJ, labelE, msgE, true, false, RCMrcError::PurposeType::Common ) );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -73,7 +73,7 @@ System::Boolean Form1::checkComboBoxIndex( System::Windows::Forms::ComboBox ^box
|
||||
System::String ^msgJ = this->hMsg->getMessage("ComboBoxInput", "J");
|
||||
System::String ^msgE = this->hMsg->getMessage("ComboBoxInput", "E");
|
||||
this->hErrorList->Add( gcnew RCMrcError(
|
||||
labelJ, 0, 0, msgJ, labelE, msgE, true, isAffectRom ) );
|
||||
labelJ, 0, 0, msgJ, labelE, msgE, true, isAffectRom, RCMrcError::PurposeType::Common ) );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -95,9 +95,42 @@ RCMrcError^ Form1::makeErrorMsg( System::Boolean isAffectRom, System::String ^la
|
||||
System::String ^fmtE = this->hMsg->getMessage( msgtag, "E" );
|
||||
System::String ^msgE = System::String::Format( fmtE, args );
|
||||
|
||||
return (gcnew RCMrcError( nameJ, 0, 0, msgJ, nameE, msgE, true, isAffectRom ));
|
||||
return (gcnew RCMrcError( nameJ, 0, 0, msgJ, nameE, msgE, true, isAffectRom, RCMrcError::PurposeType::Common )); // 修正可能なエラーとして作成
|
||||
}
|
||||
|
||||
// 用途のラジオボタンの状態によって表示するかどうかを振り分ける
|
||||
bool Form1::isDisplayOneGridErrorForPurpose( RCMrcError ^err )
|
||||
{
|
||||
bool is_display = false;
|
||||
|
||||
if( ((err->Purpose & RCMrcError::PurposeType::Production) != (RCMrcError::PurposeType)0) &&
|
||||
(this->rPurposeCardProduction->Checked || this->rPurposeDSiWare->Checked || this->rPurposeOther->Checked) )
|
||||
{
|
||||
is_display = true;
|
||||
}
|
||||
if( ((err->Purpose & RCMrcError::PurposeType::CardDistribution) != (RCMrcError::PurposeType)0) &&
|
||||
this->rPurposeCardDistribution->Checked )
|
||||
{
|
||||
is_display = true;
|
||||
}
|
||||
if( ((err->Purpose & RCMrcError::PurposeType::CardKiosk) != (RCMrcError::PurposeType)0) &&
|
||||
this->rPurposeCardKiosk->Checked )
|
||||
{
|
||||
is_display = true;
|
||||
}
|
||||
if( ((err->Purpose & RCMrcError::PurposeType::DSStation) != (RCMrcError::PurposeType)0) &&
|
||||
this->rPurposeDSStation->Checked )
|
||||
{
|
||||
is_display = true;
|
||||
}
|
||||
if( ((err->Purpose & RCMrcError::PurposeType::Zone) != (RCMrcError::PurposeType)0) &&
|
||||
this->rPurposeZone->Checked )
|
||||
{
|
||||
is_display = true;
|
||||
}
|
||||
return is_display;
|
||||
} //isDisplayOneGridErrorForPurpose()
|
||||
|
||||
// 読み込み時エラーの登録
|
||||
void Form1::setGridError( void )
|
||||
{
|
||||
@ -106,8 +139,11 @@ void Form1::setGridError( void )
|
||||
{
|
||||
for each( RCMrcError ^err in this->hSrl->hErrorList )
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -119,8 +155,11 @@ void Form1::setGridWarn( void )
|
||||
{
|
||||
for each( RCMrcError ^err in this->hSrl->hWarnList )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,8 +174,11 @@ void Form1::overloadGridError( void )
|
||||
{
|
||||
if( !err->IsEnableModify ) // 修正可能な情報は表示しない
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,8 +186,11 @@ void Form1::overloadGridError( void )
|
||||
{
|
||||
for each( RCMrcError ^err in this->hErrorList )
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridError->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridError( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -158,8 +203,11 @@ void Form1::overloadGridWarn( void )
|
||||
{
|
||||
if( !err->IsEnableModify )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -167,8 +215,11 @@ void Form1::overloadGridWarn( void )
|
||||
{
|
||||
for each( RCMrcError ^err in this->hWarnList )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
if( this->isDisplayOneGridErrorForPurpose( err ) )
|
||||
{
|
||||
this->gridWarn->Rows->Add( err->getAll(this->isJapanese()) );
|
||||
this->colorGridWarn( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1033,15 +1033,16 @@ void RCSrl::calcNandUsedSize(FILE *fp)
|
||||
// -------------------------------------------------------------------
|
||||
RCMrcError^ RCSrl::makeMrcError( System::String ^tag, ... cli::array<System::String^> ^args )
|
||||
{
|
||||
// パラメータも取得(日本語版から)
|
||||
// パラメータも取得(パラメータは英語版にも日本語版にも登録されておりどちらでもよいが日本語版のものにしておく)
|
||||
System::UInt32 beg = System::UInt32::Parse( this->hMrcMsg->getMessage( tag+"/begin", "J" ), System::Globalization::NumberStyles::HexNumber );
|
||||
System::UInt32 end = System::UInt32::Parse( this->hMrcMsg->getMessage( tag+"/end", "J" ), System::Globalization::NumberStyles::HexNumber );
|
||||
System::Boolean isEnableModify = System::Boolean::Parse( this->hMrcMsg->getMessage( tag+"/modify", "J" ) );
|
||||
System::Boolean isAffectRom = System::Boolean::Parse( this->hMrcMsg->getMessage( tag+"/affect", "J" ) );
|
||||
|
||||
return (this->makeMrcError( beg, end, isEnableModify, isAffectRom, tag, args ));
|
||||
return (this->makeMrcError( beg, end, isEnableModify, isAffectRom, RCMrcError::PurposeType::Common, tag, args )); // 共通エラー
|
||||
}
|
||||
RCMrcError^ RCSrl::makeMrcError( System::UInt32 beg, System::UInt32 end, System::Boolean isEnableModify, System::Boolean isAffectRom,
|
||||
RCMrcError::PurposeType purpose,
|
||||
System::String ^tag, ... cli::array<System::String^> ^args )
|
||||
{
|
||||
// 外部ファイルから項目名を取得
|
||||
@ -1053,5 +1054,5 @@ RCMrcError^ RCSrl::makeMrcError( System::UInt32 beg, System::UInt32 end, System:
|
||||
System::String ^fmtE = this->hMrcMsg->getMessage( tag+"/sentence", "E" );
|
||||
System::String ^msgE = System::String::Format( fmtE, args );
|
||||
|
||||
return (gcnew RCMrcError( nameJ, beg, end, msgJ, nameE, msgE, isEnableModify, isAffectRom ));
|
||||
return (gcnew RCMrcError( nameJ, beg, end, msgJ, nameE, msgE, isEnableModify, isAffectRom, purpose ));
|
||||
}
|
||||
|
||||
@ -191,6 +191,7 @@ namespace MasterEditorTWL
|
||||
// MRCメッセージを追加
|
||||
RCMrcError^ makeMrcError( System::String ^tag, ... cli::array<System::String^> ^args );
|
||||
RCMrcError^ makeMrcError( System::UInt32 beg, System::UInt32 end, System::Boolean isEnableModify, System::Boolean isAffectRom,
|
||||
RCMrcError::PurposeType purpose,
|
||||
System::String ^tag, ... cli::array<System::String^> ^args );
|
||||
|
||||
}; // end of ref class RCSrl
|
||||
|
||||
@ -266,6 +266,17 @@ namespace MasterEditorTWL
|
||||
// -------------------------------------------------------------------
|
||||
public ref class RCMrcError
|
||||
{
|
||||
public:
|
||||
enum class PurposeType : System::UInt32 // 型指定
|
||||
{
|
||||
Production = 1 << 0, // 一般販売用(カード/NAND)
|
||||
CardDistribution = 1 << 1, // データ配信用カード
|
||||
CardKiosk = 1 << 2, // 店頭試遊台(単独型)
|
||||
DSStation = 1 << 3, // DS Station
|
||||
Zone = 1 << 4, // Nintendo Zone
|
||||
|
||||
Common = 0xFFFFFFFF, // すべての用途で共通のエラー
|
||||
};
|
||||
private:
|
||||
System::String ^hName; // 項目名
|
||||
System::UInt32 begin; // 開始アドレス
|
||||
@ -275,12 +286,13 @@ namespace MasterEditorTWL
|
||||
System::String ^hMsgE;
|
||||
System::Boolean isEnableModify; // マスタエディタで修正可能かどうか
|
||||
System::Boolean isAffectRom; // 変更するとSRL(ROMバイナリ)が変更されるか
|
||||
PurposeType purpose;
|
||||
private:
|
||||
RCMrcError(){} // 封じる
|
||||
public:
|
||||
RCMrcError( // この形式でしかインスタンスを作成できない
|
||||
System::String ^name, System::UInt32 beg, System::UInt32 end, System::String ^msg,
|
||||
System::String ^nameE, System::String ^msgE, System::Boolean isEnableModify, System::Boolean isAffectRom )
|
||||
System::String ^nameE, System::String ^msgE, System::Boolean isEnableModify, System::Boolean isAffectRom, PurposeType purpose )
|
||||
{
|
||||
if( name == nullptr )
|
||||
this->hName = gcnew System::String("");
|
||||
@ -307,6 +319,8 @@ namespace MasterEditorTWL
|
||||
|
||||
this->isEnableModify = isEnableModify;
|
||||
this->isAffectRom = isAffectRom;
|
||||
|
||||
this->purpose = purpose;
|
||||
}
|
||||
public:
|
||||
property System::Boolean IsEnableModify
|
||||
@ -341,6 +355,10 @@ namespace MasterEditorTWL
|
||||
{
|
||||
System::UInt32 get(){ return this->end; }
|
||||
}
|
||||
property PurposeType Purpose
|
||||
{
|
||||
PurposeType get(){ return this->purpose; }
|
||||
}
|
||||
public:
|
||||
// gridViewの表示形式にあわせる
|
||||
cli::array<System::Object^>^ getAll( System::Boolean isJapanese )
|
||||
|
||||
@ -905,7 +905,7 @@ void RCSrl::mrcReservedArea(FILE *fp)
|
||||
}
|
||||
if( !bReserved )
|
||||
{
|
||||
this->hErrorList->Add( this->makeMrcError(begin, end, false, true, "ReservedArea") );
|
||||
this->hErrorList->Add( this->makeMrcError(begin, end, false, true, RCMrcError::PurposeType::Common, "ReservedArea") );
|
||||
}
|
||||
} //for each
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user