2014-10-18 15:32:50 -06:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2014-10-18 15:32:50 -06: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
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
class CodeConfigPanel;
|
2014-10-18 15:32:50 -06:00
|
|
|
}
|
|
|
|
|
2016-04-22 04:42:16 -06:00
|
|
|
wxDECLARE_EVENT(DOLPHIN_EVT_ADD_NEW_ACTION_REPLAY_CODE, wxCommandEvent);
|
|
|
|
|
2014-10-18 15:32:50 -06:00
|
|
|
class wxCheatsWindow final : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 02:43:46 -06:00
|
|
|
wxCheatsWindow(wxWindow* const parent);
|
|
|
|
~wxCheatsWindow();
|
|
|
|
void UpdateGUI();
|
2014-10-18 15:32:50 -06:00
|
|
|
|
|
|
|
private:
|
2016-06-24 02:43:46 -06:00
|
|
|
struct CodeData;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// --- GUI Controls ---
|
|
|
|
wxButton* m_button_apply;
|
|
|
|
wxNotebook* m_notebook_main;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxPanel* m_tab_cheats;
|
|
|
|
wxPanel* m_tab_log;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxCheckBox* m_checkbox_log_ar;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxStaticText* m_label_code_name;
|
|
|
|
wxStaticText* m_label_num_codes;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxCheckListBox* m_checklistbox_cheats_list;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxTextCtrl* m_textctrl_log;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxListBox* m_listbox_codes_list;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
wxStaticBox* m_groupbox_info;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
Gecko::CodeConfigPanel* m_geckocode_panel;
|
|
|
|
IniFile m_gameini_default;
|
|
|
|
IniFile m_gameini_local;
|
|
|
|
std::string m_gameini_local_path;
|
|
|
|
std::string m_game_id;
|
|
|
|
u32 m_game_revision;
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
bool m_ignore_ini_callback = false;
|
2016-04-19 15:19:31 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
void Init_ChildControls();
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
void Load_ARCodes();
|
|
|
|
void Load_GeckoCodes();
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// --- Wx Events Handlers ---
|
|
|
|
// Cheat Search
|
|
|
|
void OnNewARCodeCreated(wxCommandEvent& ev);
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Close Button
|
|
|
|
void OnEvent_ButtonClose_Press(wxCommandEvent& event);
|
|
|
|
void OnEvent_Close(wxCloseEvent& ev);
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Cheats List
|
|
|
|
void OnEvent_CheatsList_ItemSelected(wxCommandEvent& event);
|
|
|
|
void OnEvent_CheatsList_Update(wxCommandEvent& event);
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Apply Changes Button
|
|
|
|
void OnEvent_ApplyChanges_Press(wxCommandEvent& event);
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Update Log Button
|
|
|
|
void OnEvent_ButtonUpdateLog_Press(wxCommandEvent& event);
|
|
|
|
void OnClearActionReplayLog(wxCommandEvent& event);
|
2014-10-18 15:32:50 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Enable Logging Checkbox
|
|
|
|
void OnEvent_CheckBoxEnableLogging_StateChange(wxCommandEvent& event);
|
2014-10-18 15:32:50 -06:00
|
|
|
};
|