blob: 7a82822f56f151c63eeb447e8ea899b6f0e921ec (
plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include <cstddef>
#include <string>
#include <vector>
#include <wx/arrstr.h>
#include <wx/dialog.h>
#include <wx/panel.h>
#include "Common/CommonTypes.h"
#include "Common/IniFile.h"
class wxButton;
class wxCheckBox;
class wxCheckListBox;
class wxChoice;
class wxCloseEvent;
class wxCommandEvent;
class wxEvent;
class wxListBox;
class wxNotebook;
class wxRadioButton;
class wxStaticBox;
class wxStaticText;
class wxTextCtrl;
class wxWindow;
namespace Gecko { class CodeConfigPanel; }
class CreateCodeDialog : public wxDialog
{
public:
CreateCodeDialog(wxWindow* const parent, const u32 address);
protected:
const u32 code_address;
wxTextCtrl *textctrl_name, *textctrl_code, *textctrl_value;
wxCheckBox *checkbox_use_hex;
void PressOK(wxCommandEvent&);
void PressCancel(wxCommandEvent&);
void OnEvent_Close(wxCloseEvent& ev);
};
class CheatSearchTab : public wxPanel
{
public:
CheatSearchTab(wxWindow* const parent);
protected:
class CheatSearchResult
{
public:
CheatSearchResult() : address(0), old_value(0) {}
u32 address;
u32 old_value;
};
std::vector<CheatSearchResult> search_results;
unsigned int search_type_size;
wxChoice* search_type;
wxListBox* lbox_search_results;
wxStaticText* label_results_count;
wxTextCtrl* textctrl_value_x;
wxButton *btnInitScan, *btnNextScan;
struct
{
wxRadioButton *rad_8, *rad_16, *rad_32;
} size_radiobtn;
struct
{
wxRadioButton *rad_oldvalue, *rad_uservalue;
} value_x_radiobtn;
void UpdateCheatSearchResultsList();
void StartNewSearch(wxCommandEvent& event);
void FilterCheatSearchResults(wxCommandEvent& event);
void CreateARCode(wxCommandEvent&);
void ApplyFocus(wxEvent&);
};
class wxCheatsWindow : public wxDialog
{
friend class CreateCodeDialog;
public:
wxCheatsWindow(wxWindow* const parent);
~wxCheatsWindow();
void UpdateGUI();
protected:
struct ARCodeIndex {
u32 uiIndex;
size_t index;
};
// --- GUI Controls ---
wxButton* button_apply;
wxNotebook *m_Notebook_Main;
wxPanel *m_Tab_Cheats;
wxPanel *m_Tab_Log;
wxCheckBox *m_CheckBox_LogAR;
wxStaticText *m_Label_Codename;
wxStaticText *m_Label_NumCodes;
wxCheckListBox *m_CheckListBox_CheatsList;
wxTextCtrl *m_TextCtrl_Log;
wxListBox *m_ListBox_CodesList;
wxStaticBox *m_GroupBox_Info;
wxArrayString m_CheatStringList;
std::vector<ARCodeIndex> indexList;
Gecko::CodeConfigPanel *m_geckocode_panel;
IniFile m_gameini_default;
IniFile m_gameini_local;
std::string m_gameini_local_path;
void Init_ChildControls();
void Load_ARCodes();
void Load_GeckoCodes();
// --- Wx Events Handlers ---
// $ Close Button
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
void OnEvent_Close(wxCloseEvent& ev);
// $ Cheats List
void OnEvent_CheatsList_ItemSelected(wxCommandEvent& event);
void OnEvent_CheatsList_ItemToggled(wxCommandEvent& event);
// $ Apply Changes Button
void OnEvent_ApplyChanges_Press(wxCommandEvent& event);
// $ Update Log Button
void OnEvent_ButtonUpdateLog_Press(wxCommandEvent& event);
// $ Enable Logging Checkbox
void OnEvent_CheckBoxEnableLogging_StateChange(wxCommandEvent& event);
};
|