2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-19 01:56:29 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <wx/colour.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <wx/filepicker.h>
|
|
|
|
#include <wx/gbsizer.h>
|
2014-02-19 01:56:29 +00:00
|
|
|
#include <wx/imaglist.h>
|
2008-12-08 04:46:09 +00:00
|
|
|
#include <wx/listbox.h>
|
2014-02-19 01:56:29 +00:00
|
|
|
#include <wx/mimetype.h>
|
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/statbmp.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/treectrl.h>
|
|
|
|
#include <wx/wx.h>
|
2010-07-18 04:13:16 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/IniFile.h"
|
2014-02-19 01:56:29 +00:00
|
|
|
#include "Core/ActionReplay.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DiscIO/Filesystem.h"
|
|
|
|
#include "DolphinWX/GeckoCodeDiag.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
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&);
|
2011-06-17 09:19:13 +00:00
|
|
|
void OnEvent_Close(wxCloseEvent& ev);
|
2010-07-18 04:13:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2014-02-17 04:51:41 +00:00
|
|
|
std::vector<CheatSearchResult> search_results;
|
2010-07-18 04:13:16 +00:00
|
|
|
unsigned int search_type_size;
|
|
|
|
|
2010-07-22 05:28:24 +00:00
|
|
|
wxChoice* search_type;
|
2014-02-17 04:51:41 +00:00
|
|
|
wxListBox* lbox_search_results;
|
2010-07-18 04:13:16 +00:00
|
|
|
wxStaticText* label_results_count;
|
2014-02-17 04:51:41 +00:00
|
|
|
wxTextCtrl* textctrl_value_x;
|
2010-07-22 05:28:24 +00:00
|
|
|
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&);
|
2013-01-13 08:28:12 +00:00
|
|
|
void ApplyFocus(wxEvent&);
|
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();
|
2013-05-04 17:27:39 +00:00
|
|
|
void UpdateGUI();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
struct ARCodeIndex {
|
|
|
|
u32 uiIndex;
|
|
|
|
size_t index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- GUI Controls ---
|
2013-05-04 17:27:39 +00:00
|
|
|
wxButton* button_apply;
|
2008-12-08 04:46:09 +00:00
|
|
|
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;
|
2013-09-07 21:02:49 +00:00
|
|
|
IniFile m_gameini_default;
|
|
|
|
IniFile m_gameini_local;
|
|
|
|
std::string m_gameini_local_path;
|
2010-07-22 01:48:48 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
void Init_ChildControls();
|
|
|
|
|
|
|
|
void Load_ARCodes();
|
2013-05-04 17:27:39 +00:00
|
|
|
void Load_GeckoCodes();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// --- Wx Events Handlers ---
|
|
|
|
|
|
|
|
// $ Close Button
|
|
|
|
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
|
2011-06-17 09:19:13 +00:00
|
|
|
void OnEvent_Close(wxCloseEvent& ev);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// $ 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
|
|
|
};
|