-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
286 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "CheatsPanel.hpp" | ||
|
||
|
||
wxBEGIN_EVENT_TABLE(CheatsPanel, wxPanel) | ||
wxEND_EVENT_TABLE() | ||
|
||
CheatsPanel::CheatsPanel(wxNotebook* parent, ReplicantHook* hook) : wxPanel(parent, wxID_ANY) | ||
{ | ||
this->hook = hook; | ||
//Const sizes | ||
const int margin = 10; | ||
const int width = 365; | ||
|
||
//Cheats | ||
//m_CheatsBox = new wxStaticBox(this, wxID_ANY, "Cheats", wxPoint(margin, 110), wxSize(width - 30, 130), 1, wxStaticBoxNameStr); | ||
m_InfiniteHealth = new wxCheckBox(this, wxID_ANY, "Infinite Health", wxPoint(margin, margin), wxDefaultSize, 0, wxDefaultValidator, wxCheckBoxNameStr); | ||
m_InfiniteHealth->Bind(wxEVT_CHECKBOX, &CheatsPanel::InfiniteHealth, this); | ||
m_InfiniteMagic = new wxCheckBox(this, wxID_ANY, "Infinite Magic", wxPoint(margin, 40), wxDefaultSize, 0, wxDefaultValidator, wxCheckBoxNameStr); | ||
m_InfiniteMagic->Bind(wxEVT_CHECKBOX, &CheatsPanel::InfiniteMagic, this); | ||
|
||
this->SetBackgroundColour(wxColor(255, 255, 255)); | ||
} | ||
|
||
CheatsPanel::~CheatsPanel() | ||
{ | ||
} | ||
|
||
void CheatsPanel::InfiniteMagic(wxCommandEvent& evt) | ||
{ | ||
hook->InfiniteMagic(m_InfiniteMagic->IsChecked()); | ||
} | ||
|
||
void CheatsPanel::InfiniteHealth(wxCommandEvent& evt) | ||
{ | ||
hook->InfiniteHealth(m_InfiniteHealth->IsChecked()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
#include <wx/wx.h> | ||
#include <wx/notebook.h> | ||
#include "ReplicantHook/Source/ReplicantHook/ReplicantHook.hpp" | ||
class CheatsPanel :public wxPanel | ||
{ | ||
public: | ||
//wxStaticBox* m_CheatsBox = nullptr; | ||
wxCheckBox* m_InfiniteHealth = nullptr; | ||
wxCheckBox* m_InfiniteMagic = nullptr; | ||
|
||
CheatsPanel(wxNotebook* parent, ReplicantHook* hook); | ||
~CheatsPanel(); | ||
private: | ||
ReplicantHook* hook = nullptr; | ||
void InfiniteHealth(wxCommandEvent& evt); | ||
void InfiniteMagic(wxCommandEvent& evt); | ||
wxDECLARE_EVENT_TABLE(); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#include "GraphicsPanel.hpp" | ||
|
||
wxBEGIN_EVENT_TABLE(GraphicsPanel, wxPanel) | ||
wxEND_EVENT_TABLE() | ||
|
||
GraphicsPanel::GraphicsPanel(wxNotebook* parent, ReplicantHook* hook) : wxPanel(parent, wxID_ANY) | ||
{ | ||
this->hook = hook; | ||
//Const sizes | ||
const int margin = 10; | ||
const int width = 365; | ||
|
||
//Load Models | ||
models.insert(std::pair<wxString, wxString>(wxString("Kaine"), wxString("kaineE"))); | ||
models.insert(std::pair<wxString, wxString>(wxString("Nier young"), wxString("nierB"))); | ||
models.insert(std::pair<wxString, wxString>(wxString("Nier old"), wxString("nierY"))); | ||
models.insert(std::pair<wxString, wxString>(wxString("Nier Father"), wxString("nierF"))); | ||
models.insert(std::pair<wxString, wxString>(wxString("Nier shadowlord"), wxString("nierT"))); | ||
|
||
modelsLabel = new wxStaticText(this, wxID_ANY, "Models", wxPoint(20, 30), wxDefaultSize, 0, wxStaticTextNameStr); | ||
|
||
wxArrayString choices = getItems(); | ||
m_models = new wxListBox(this, wxID_ANY, wxPoint(20, 60), wxSize(315, 100), choices, 0, wxDefaultValidator, wxListBoxNameStr); | ||
|
||
m_setModel = new wxButton(this, wxID_ANY, "Set Model", wxPoint(20, 180), wxDefaultSize, 0, wxDefaultValidator, wxButtonNameStr); | ||
m_setModel->Bind(wxEVT_BUTTON, &GraphicsPanel::loadModel, this); | ||
|
||
//Timer | ||
m_Timer = new wxTimer(); | ||
m_Timer->Bind(wxEVT_TIMER, &GraphicsPanel::OnTimer, this); | ||
|
||
this->SetBackgroundColour(wxColor(255, 255, 255)); | ||
m_Timer->Start(1000, wxTIMER_CONTINUOUS); | ||
} | ||
|
||
GraphicsPanel::~GraphicsPanel() | ||
{ | ||
m_Timer->Stop(); | ||
delete m_Timer; | ||
} | ||
|
||
void GraphicsPanel::OnTimer(wxTimerEvent&) | ||
{ | ||
if (hook->isHooked()) { | ||
|
||
} | ||
else { | ||
} | ||
} | ||
|
||
void GraphicsPanel::loadModel(wxCommandEvent& evt) | ||
{ | ||
if (wxNOT_FOUND == m_models->GetSelection()) { | ||
wxMessageBox("Please select a model"); | ||
return; | ||
} | ||
wxString ID = getItemID(m_models->GetString(m_models->GetSelection())); | ||
if (ID == "") { | ||
wxMessageBox("Could not change the model"); | ||
return; | ||
} | ||
hook->setActorModel(std::string(ID)); | ||
} | ||
|
||
wxArrayString GraphicsPanel::getItems() | ||
{ | ||
std::map<wxString, wxString>::iterator it = models.begin(); | ||
std::map<wxString, wxString>::iterator end = models.end(); | ||
wxArrayString choices; | ||
|
||
for (;it != end;it++) { | ||
choices.Add(it->first); | ||
} | ||
return choices; | ||
} | ||
|
||
wxString GraphicsPanel::getItemID(wxString name) | ||
{ | ||
std::map<wxString, wxString>::iterator it = models.begin(); | ||
std::map<wxString, wxString>::iterator end = models.end(); | ||
|
||
for (;it != end;it++) { | ||
if (it->first == name) { | ||
return it->second; | ||
} | ||
} | ||
return ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
#include <wx/wx.h> | ||
#include <wx/notebook.h> | ||
#include "ReplicantHook/Source/ReplicantHook/ReplicantHook.hpp" | ||
#include <map> | ||
class GraphicsPanel :public wxPanel | ||
{ | ||
public: | ||
//Timer | ||
wxTimer* m_Timer = nullptr; | ||
|
||
GraphicsPanel(wxNotebook* parent, ReplicantHook* hook); | ||
~GraphicsPanel(); | ||
|
||
protected: | ||
//TIMER | ||
void OnTimer(wxTimerEvent&); | ||
//POSITION EVT | ||
void loadModel(wxCommandEvent& evt); | ||
wxDECLARE_EVENT_TABLE(); | ||
|
||
private: | ||
ReplicantHook* hook = nullptr; | ||
std::map<wxString, wxString> models; | ||
wxListBox* m_models = nullptr; | ||
wxStaticText* modelsLabel = nullptr; | ||
wxButton* m_setModel = nullptr; | ||
wxArrayString getItems(); | ||
wxString getItemID(wxString name); | ||
|
||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.