2013-04-17 21:43:35 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
#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-17 22:13:16 -06:00
|
|
|
#include <wx/textctrl.h>
|
2008-12-07 21:46:09 -07:00
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/mimetype.h>
|
|
|
|
#include <wx/colour.h>
|
|
|
|
#include <wx/listbox.h>
|
2010-07-17 22:13:16 -06:00
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
#include <string>
|
2010-07-17 22:13:16 -06:00
|
|
|
#include <vector>
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
#include "ActionReplay.h"
|
|
|
|
|
2010-07-21 19:48:48 -06:00
|
|
|
#include "GeckoCodeDiag.h"
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
#include "Filesystem.h"
|
|
|
|
#include "IniFile.h"
|
|
|
|
|
2010-07-17 22:13:16 -06:00
|
|
|
class CreateCodeDialog : public wxDialog
|
2008-12-07 21:46:09 -07:00
|
|
|
{
|
2010-07-17 22:13:16 -06: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&);
|
2011-06-17 03:19:13 -06:00
|
|
|
void OnEvent_Close(wxCloseEvent& ev);
|
2010-07-17 22:13:16 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
class CheatSearchTab : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CheatSearchTab(wxWindow* const parent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
class CheatSearchResult
|
|
|
|
{
|
2008-12-07 21:46:09 -07:00
|
|
|
public:
|
2010-07-17 22:13:16 -06:00
|
|
|
CheatSearchResult() : address(0), old_value(0) {}
|
|
|
|
|
|
|
|
u32 address;
|
|
|
|
u32 old_value;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<CheatSearchResult> search_results;
|
|
|
|
unsigned int search_type_size;
|
|
|
|
|
2010-07-21 23:28:24 -06:00
|
|
|
wxChoice* search_type;
|
2010-07-17 22:13:16 -06:00
|
|
|
wxListBox* lbox_search_results;
|
|
|
|
wxStaticText* label_results_count;
|
2010-07-21 23:28:24 -06:00
|
|
|
wxTextCtrl* textctrl_value_x;
|
|
|
|
wxButton *btnInitScan, *btnNextScan;
|
2010-07-17 22:13:16 -06:00
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
wxRadioButton *rad_8, *rad_16, *rad_32;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2010-07-17 22:13:16 -06:00
|
|
|
} size_radiobtn;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2010-07-17 22:13:16 -06:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
wxRadioButton *rad_oldvalue, *rad_uservalue;
|
|
|
|
|
|
|
|
} value_x_radiobtn;
|
|
|
|
|
|
|
|
void UpdateCheatSearchResultsList();
|
|
|
|
void StartNewSearch(wxCommandEvent& event);
|
|
|
|
void FilterCheatSearchResults(wxCommandEvent& event);
|
|
|
|
void CreateARCode(wxCommandEvent&);
|
2013-01-13 01:28:12 -07:00
|
|
|
void ApplyFocus(wxEvent&);
|
2010-07-17 22:13:16 -06:00
|
|
|
};
|
|
|
|
|
2011-06-03 06:26:32 -06:00
|
|
|
class wxCheatsWindow : public wxDialog
|
2010-07-17 22:13:16 -06:00
|
|
|
{
|
|
|
|
friend class CreateCodeDialog;
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxCheatsWindow(wxWindow* const parent);
|
2011-02-26 19:27:43 -07:00
|
|
|
~wxCheatsWindow();
|
2013-05-04 11:27:39 -06:00
|
|
|
void UpdateGUI();
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
struct ARCodeIndex {
|
|
|
|
u32 uiIndex;
|
|
|
|
size_t index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- GUI Controls ---
|
2013-05-04 11:27:39 -06:00
|
|
|
wxButton* button_apply;
|
2008-12-07 21:46:09 -07:00
|
|
|
wxNotebook *m_Notebook_Main;
|
|
|
|
|
|
|
|
wxPanel *m_Tab_Cheats;
|
|
|
|
wxPanel *m_Tab_Log;
|
|
|
|
|
2008-12-11 23:44:02 -07:00
|
|
|
wxCheckBox *m_CheckBox_LogAR;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
wxStaticText *m_Label_Codename;
|
|
|
|
wxStaticText *m_Label_NumCodes;
|
|
|
|
|
|
|
|
wxCheckListBox *m_CheckListBox_CheatsList;
|
|
|
|
|
2008-12-11 23:44:02 -07:00
|
|
|
wxTextCtrl *m_TextCtrl_Log;
|
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
wxListBox *m_ListBox_CodesList;
|
|
|
|
|
|
|
|
wxStaticBox *m_GroupBox_Info;
|
|
|
|
|
|
|
|
wxArrayString m_CheatStringList;
|
|
|
|
|
|
|
|
std::vector<ARCodeIndex> indexList;
|
|
|
|
|
2010-07-21 19:48:48 -06:00
|
|
|
Gecko::CodeConfigPanel *m_geckocode_panel;
|
2013-09-07 15:02:49 -06:00
|
|
|
IniFile m_gameini_default;
|
|
|
|
IniFile m_gameini_local;
|
|
|
|
std::string m_gameini_default_path;
|
|
|
|
std::string m_gameini_local_path;
|
2010-07-21 19:48:48 -06:00
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
void Init_ChildControls();
|
|
|
|
|
|
|
|
void Load_ARCodes();
|
2013-05-04 11:27:39 -06:00
|
|
|
void Load_GeckoCodes();
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
// --- Wx Events Handlers ---
|
|
|
|
|
|
|
|
// $ Close Button
|
|
|
|
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
|
2011-06-17 03:19:13 -06:00
|
|
|
void OnEvent_Close(wxCloseEvent& ev);
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
// $ Cheats List
|
|
|
|
void OnEvent_CheatsList_ItemSelected(wxCommandEvent& event);
|
|
|
|
void OnEvent_CheatsList_ItemToggled(wxCommandEvent& event);
|
|
|
|
|
2010-07-21 19:48:48 -06:00
|
|
|
// $ Apply Changes Button
|
|
|
|
void OnEvent_ApplyChanges_Press(wxCommandEvent& event);
|
2008-12-11 23:44:02 -07:00
|
|
|
|
|
|
|
// $ Update Log Button
|
|
|
|
void OnEvent_ButtonUpdateLog_Press(wxCommandEvent& event);
|
|
|
|
|
|
|
|
// $ Enable Logging Checkbox
|
|
|
|
void OnEvent_CheckBoxEnableLogging_StateChange(wxCommandEvent& event);
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|
|
|
|
|
2009-02-23 22:20:52 -07:00
|
|
|
#endif
|
|
|
|
|