-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetHack_DLG.cpp
106 lines (103 loc) · 2.96 KB
/
SetHack_DLG.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include "SetHack_DLG.h"
SetHack_DLG::SetHack_DLG( wxWindow* parent )
:
cleanSetHack_DLG( parent )
{
xAStr array;
dIndex = -1;
// Set Code Types
array.SetCount( CT_COUNT );
array[ CT_WRITE ] = wxT( "Write" );
array[ CT_COPY ] = wxT( "Copy" );
array[ CT_INCREMENT ] = wxT( "Increment" );
array[ CT_DECREMENT ] = wxT( "Decrement" );
array[ CT_TEST ] = wxT( "Test" );
array[ CT_LIST ] = wxT( "List" );
dCodeType_D->Append( array );
dCodeType_D->Select( 0 );
// Set Sizes
dCodeSize_D->Append( gGetSizes() );
dCodeSize_D->Select( 0 );
// Set Ram
BIN bin = gGetBin();
dRamCount = bin.GetCount();
array.Clear();
array.SetCount( dRamCount );
for ( s8 i = 0; i < dRamCount; ++i )
{
array[ i ] = bin[ i ].name;
}
dCodeRam_D->Append( array );
dCodeRam_D->Select( 0 );
// Set Value Modes
array.Clear();
array = gGetValModes();
dCodeMode_D->Append( array );
dCodeMode_D->Select( 0 );
// Set Tests
array.Clear();
array.SetCount( QV_COUNT );
array[ QV_EQUAL ] = wxT( "Equal To ( == )" );
array[ QV_NOT ] = wxT( "Not Equal To ( != )" );
array[ QV_MT ] = wxT( "More Than ( > )" );
array[ QV_MTE ] = wxT( "More Than or Equal To ( >= )" );
array[ QV_LT ] = wxT( "Less Than ( < )" );
array[ QV_LTE ] = wxT( "Less Than or Equal To ( <= )" );
array[ QV_GOT ] = wxT( "Contains ( R&V>0 )" );
array[ QV_NOT_GOT ] = wxT( "Does Not Contain ( R&V=0 )" );
dCodeTest_D->Append( array );
dCodeTest_D->Select( 0 );
// Set Columns
wxListItem item;
item.SetId( 0 );
item.SetColumn( 0 );
item.SetText( wxT("Part 1") );
dCode_LC->InsertColumn( 0, item );
item.SetId( 1 );
item.SetColumn( 1 );
item.SetText( wxT("Part 2") );
dCode_LC->InsertColumn( 1, item );
// Get and Display Selected Hack
dGetHack();
}
void SetHack_DLG::dSetHack_OnClick( wxCommandEvent& event )
{
if ( dModified )
{
u32 mode = MB( wxT( "Do you wish to save the codelist?" ),
wxT( "Codelist Modified" ), wxYES_NO | wxCANCEL );
if ( mode == wxCANCEL ) return;
if ( mode == wxYES ) dSetHack();
}
gClose( this );
}
void SetHack_DLG::dLoadHack_OnClick( wxCommandEvent& event ) { dGetHack(); }
void SetHack_DLG::dSaveHack_OnClick( wxCommandEvent& event ) { dSetHack(); }
void SetHack_DLG::dNewCode_OnClick( wxCommandEvent& event )
{
dHack.NewCode( dGetCode() );
dModified = true;
dShowHack();
}
void SetHack_DLG::dSetCode_OnClick( wxCommandEvent& event )
{
if ( dIndex < 0 ) return;
dHack[ dIndex ] = dGetCode();
dModified = true;
dShowHack();
}
void SetHack_DLG::dGetCode_OnClick( wxCommandEvent& event ) { dShowCode(); }
void SetHack_DLG::dDelCode_OnClick( wxCommandEvent& event )
{
if ( dIndex < 0 ) return;
dHack.DelCode( dIndex );
dModified = true;
dIndex = -1;
dShowHack();
}
void SetHack_DLG::dCode_LCOnSelect( wxListEvent& event )
{
dIndex = event.GetIndex();
dIndex = dCode_LC->GetItemData( dIndex );
dShowCode();
}