2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#ifndef __CHEATSWINDOW_H__
|
|
|
|
#define __CHEATSWINDOW_H__
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/filepicker.h>
|
|
|
|
#include <wx/statbmp.h>
|
|
|
|
#include <wx/imaglist.h>
|
|
|
|
#include <wx/treectrl.h>
|
|
|
|
#include <wx/gbsizer.h>
|
2010-07-18 04:13:16 +00:00
|
|
|
#include <wx/textctrl.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/mimetype.h>
|
|
|
|
#include <wx/colour.h>
|
|
|
|
#include <wx/listbox.h>
|
2010-07-18 04:13:16 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <string>
|
2010-07-18 04:13:16 +00:00
|
|
|
#include <vector>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#include "ActionReplay.h"
|
|
|
|
|
2010-07-22 01:48:48 +00:00
|
|
|
#include "GeckoCodeDiag.h"
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
#include "Filesystem.h"
|
|
|
|
#include "IniFile.h"
|
|
|
|
|
2010-07-18 04:13:16 +00:00
|
|
|
class CreateCodeDialog : public wxDialog
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2010-07-18 04:13:16 +00:00
|
|
|
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&);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CheatSearchTab : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CheatSearchTab(wxWindow* const parent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
class CheatSearchResult
|
|
|
|
{
|
2008-12-08 04:46:09 +00:00
|
|
|
public:
|
2010-07-18 04:13:16 +00:00
|
|
|
CheatSearchResult() : address(0), old_value(0) {}
|
|
|
|
|
|
|
|
u32 address;
|
|
|
|
u32 old_value;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<CheatSearchResult> search_results;
|
|
|
|
unsigned int search_type_size;
|
|
|
|
|
2010-07-22 05:28:24 +00:00
|
|
|
wxChoice* search_type;
|
2010-07-18 04:13:16 +00:00
|
|
|
wxListBox* lbox_search_results;
|
|
|
|
wxStaticText* label_results_count;
|
2010-07-22 05:28:24 +00:00
|
|
|
wxTextCtrl* textctrl_value_x;
|
|
|
|
wxButton *btnInitScan, *btnNextScan;
|
2010-07-18 04:13:16 +00:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
wxRadioButton *rad_8, *rad_16, *rad_32;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-07-18 04:13:16 +00:00
|
|
|
} size_radiobtn;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2010-07-18 04:13:16 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
wxRadioButton *rad_oldvalue, *rad_uservalue;
|
|
|
|
|
|
|
|
} value_x_radiobtn;
|
|
|
|
|
|
|
|
void UpdateCheatSearchResultsList();
|
|
|
|
void StartNewSearch(wxCommandEvent& event);
|
|
|
|
void FilterCheatSearchResults(wxCommandEvent& event);
|
|
|
|
void CreateARCode(wxCommandEvent&);
|
2010-07-22 05:28:24 +00:00
|
|
|
void ApplyFocus(wxCommandEvent&);
|
2010-07-18 04:13:16 +00:00
|
|
|
};
|
|
|
|
|
2011-06-03 12:26:32 +00:00
|
|
|
class wxCheatsWindow : public wxDialog
|
2010-07-18 04:13:16 +00:00
|
|
|
{
|
|
|
|
friend class CreateCodeDialog;
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxCheatsWindow(wxWindow* const parent);
|
2011-02-27 02:27:43 +00:00
|
|
|
~wxCheatsWindow();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
struct ARCodeIndex {
|
|
|
|
u32 uiIndex;
|
|
|
|
size_t index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- GUI Controls ---
|
|
|
|
wxNotebook *m_Notebook_Main;
|
|
|
|
|
|
|
|
wxPanel *m_Tab_Cheats;
|
|
|
|
wxPanel *m_Tab_Log;
|
|
|
|
|
2008-12-12 06:44:02 +00:00
|
|
|
wxCheckBox *m_CheckBox_LogAR;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
wxStaticText *m_Label_Codename;
|
|
|
|
wxStaticText *m_Label_NumCodes;
|
|
|
|
|
|
|
|
wxCheckListBox *m_CheckListBox_CheatsList;
|
|
|
|
|
2008-12-12 06:44:02 +00:00
|
|
|
wxTextCtrl *m_TextCtrl_Log;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
wxListBox *m_ListBox_CodesList;
|
|
|
|
|
|
|
|
wxStaticBox *m_GroupBox_Info;
|
|
|
|
|
|
|
|
wxArrayString m_CheatStringList;
|
|
|
|
|
|
|
|
std::vector<ARCodeIndex> indexList;
|
|
|
|
|
2010-07-22 01:48:48 +00:00
|
|
|
Gecko::CodeConfigPanel *m_geckocode_panel;
|
|
|
|
IniFile m_gameini;
|
|
|
|
std::string m_gameini_path;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
void Init_ChildControls();
|
|
|
|
|
|
|
|
void Load_ARCodes();
|
|
|
|
|
|
|
|
// --- Wx Events Handlers ---
|
|
|
|
|
|
|
|
// $ Close Button
|
|
|
|
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
|
|
|
|
|
|
|
|
// $ Cheats List
|
|
|
|
void OnEvent_CheatsList_ItemSelected(wxCommandEvent& event);
|
|
|
|
void OnEvent_CheatsList_ItemToggled(wxCommandEvent& event);
|
|
|
|
|
2010-07-22 01:48:48 +00:00
|
|
|
// $ Apply Changes Button
|
|
|
|
void OnEvent_ApplyChanges_Press(wxCommandEvent& event);
|
2008-12-12 06:44:02 +00:00
|
|
|
|
|
|
|
// $ Update Log Button
|
|
|
|
void OnEvent_ButtonUpdateLog_Press(wxCommandEvent& event);
|
|
|
|
|
|
|
|
// $ Enable Logging Checkbox
|
|
|
|
void OnEvent_CheckBoxEnableLogging_StateChange(wxCommandEvent& event);
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2009-02-24 05:20:52 +00:00
|
|
|
#endif
|
|
|
|
|