2014-10-18 21:32:50 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2014-10-18 21:32:50 +00:00
|
|
|
// 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 wxCloseEvent;
|
|
|
|
class wxListBox;
|
|
|
|
class wxNotebook;
|
|
|
|
class wxStaticBox;
|
|
|
|
class wxStaticText;
|
|
|
|
class wxTextCtrl;
|
|
|
|
|
|
|
|
namespace Gecko
|
|
|
|
{
|
|
|
|
class CodeConfigPanel;
|
|
|
|
}
|
|
|
|
|
|
|
|
class wxCheatsWindow final : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxCheatsWindow(wxWindow* const parent);
|
|
|
|
~wxCheatsWindow();
|
|
|
|
void UpdateGUI();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct ARCodeIndex
|
|
|
|
{
|
|
|
|
u32 uiIndex;
|
|
|
|
size_t index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// --- GUI Controls ---
|
|
|
|
wxButton* m_button_apply;
|
|
|
|
wxNotebook* m_notebook_main;
|
|
|
|
|
|
|
|
wxPanel* m_tab_cheats;
|
|
|
|
wxPanel* m_tab_log;
|
|
|
|
|
|
|
|
wxCheckBox* m_checkbox_log_ar;
|
|
|
|
|
|
|
|
wxStaticText* m_label_code_name;
|
|
|
|
wxStaticText* m_label_num_codes;
|
|
|
|
|
|
|
|
wxCheckListBox* m_checklistbox_cheats_list;
|
|
|
|
|
|
|
|
wxTextCtrl* m_textctrl_log;
|
|
|
|
|
|
|
|
wxListBox* m_listbox_codes_list;
|
|
|
|
|
|
|
|
wxStaticBox* m_groupbox_info;
|
|
|
|
|
|
|
|
wxArrayString m_cheat_string_list;
|
|
|
|
|
|
|
|
std::vector<ARCodeIndex> m_index_list;
|
|
|
|
|
|
|
|
Gecko::CodeConfigPanel* m_geckocode_panel;
|
|
|
|
IniFile m_gameini_default;
|
|
|
|
IniFile m_gameini_local;
|
|
|
|
std::string m_gameini_local_path;
|
|
|
|
|
2016-04-19 21:19:31 +00:00
|
|
|
// ActionReplay::UnregisterCodeChangeCallback handle
|
|
|
|
void* m_ar_callback_token = nullptr;
|
|
|
|
bool m_ar_ignore_callback = false;
|
|
|
|
|
2014-10-18 21:32:50 +00:00
|
|
|
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);
|
2016-04-19 21:19:31 +00:00
|
|
|
void OnEvent_CheatsList_Update(wxThreadEvent& event);
|
|
|
|
void OnActionReplayModified();
|
2014-10-18 21:32:50 +00:00
|
|
|
|
|
|
|
// 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);
|
|
|
|
};
|