From 06dd866bcfdaf34205d4b1c7c18866087ef1802b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asier=20Nu=C3=B1ez?= <45818936+Asiern@users.noreply.github.com> Date: Mon, 24 May 2021 19:41:49 +0200 Subject: [PATCH] add: Cheats + Player + Graphics --- Source/ReplicantGadget/CheatsPanel.cpp | 36 ++++++ Source/ReplicantGadget/CheatsPanel.hpp | 20 +++ Source/ReplicantGadget/GraphicsPanel.cpp | 88 ++++++++++++++ Source/ReplicantGadget/GraphicsPanel.hpp | 33 +++++ Source/ReplicantGadget/Main.cpp | 14 +++ Source/ReplicantGadget/Main.hpp | 6 +- Source/ReplicantGadget/PlayerPanel.cpp | 114 ++++++++++-------- Source/ReplicantGadget/PlayerPanel.hpp | 20 +-- .../ReplicantGadget/ReplicantGadget.vcxproj | 4 + .../ReplicantGadget.vcxproj.filters | 12 ++ 10 files changed, 286 insertions(+), 61 deletions(-) create mode 100644 Source/ReplicantGadget/CheatsPanel.cpp create mode 100644 Source/ReplicantGadget/CheatsPanel.hpp create mode 100644 Source/ReplicantGadget/GraphicsPanel.cpp create mode 100644 Source/ReplicantGadget/GraphicsPanel.hpp diff --git a/Source/ReplicantGadget/CheatsPanel.cpp b/Source/ReplicantGadget/CheatsPanel.cpp new file mode 100644 index 0000000..62d0f45 --- /dev/null +++ b/Source/ReplicantGadget/CheatsPanel.cpp @@ -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()); +} \ No newline at end of file diff --git a/Source/ReplicantGadget/CheatsPanel.hpp b/Source/ReplicantGadget/CheatsPanel.hpp new file mode 100644 index 0000000..2bc2e19 --- /dev/null +++ b/Source/ReplicantGadget/CheatsPanel.hpp @@ -0,0 +1,20 @@ +#pragma once +#include +#include +#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(); +}; + diff --git a/Source/ReplicantGadget/GraphicsPanel.cpp b/Source/ReplicantGadget/GraphicsPanel.cpp new file mode 100644 index 0000000..9094a18 --- /dev/null +++ b/Source/ReplicantGadget/GraphicsPanel.cpp @@ -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("Kaine"), wxString("kaineE"))); + models.insert(std::pair(wxString("Nier young"), wxString("nierB"))); + models.insert(std::pair(wxString("Nier old"), wxString("nierY"))); + models.insert(std::pair(wxString("Nier Father"), wxString("nierF"))); + models.insert(std::pair(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::iterator it = models.begin(); + std::map::iterator end = models.end(); + wxArrayString choices; + + for (;it != end;it++) { + choices.Add(it->first); + } + return choices; +} + +wxString GraphicsPanel::getItemID(wxString name) +{ + std::map::iterator it = models.begin(); + std::map::iterator end = models.end(); + + for (;it != end;it++) { + if (it->first == name) { + return it->second; + } + } + return ""; +} \ No newline at end of file diff --git a/Source/ReplicantGadget/GraphicsPanel.hpp b/Source/ReplicantGadget/GraphicsPanel.hpp new file mode 100644 index 0000000..a2923a6 --- /dev/null +++ b/Source/ReplicantGadget/GraphicsPanel.hpp @@ -0,0 +1,33 @@ +#pragma once +#include +#include +#include "ReplicantHook/Source/ReplicantHook/ReplicantHook.hpp" +#include +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 models; + wxListBox* m_models = nullptr; + wxStaticText* modelsLabel = nullptr; + wxButton* m_setModel = nullptr; + wxArrayString getItems(); + wxString getItemID(wxString name); + +}; + + diff --git a/Source/ReplicantGadget/Main.cpp b/Source/ReplicantGadget/Main.cpp index 38cd776..93b713d 100644 --- a/Source/ReplicantGadget/Main.cpp +++ b/Source/ReplicantGadget/Main.cpp @@ -1,5 +1,7 @@ #include "Main.hpp" #include "PlayerPanel.hpp" +#include "GraphicsPanel.hpp" +#include "CheatsPanel.hpp" wxBEGIN_EVENT_TABLE(Main, wxFrame) EVT_CLOSE(Main::OnClose) @@ -27,9 +29,16 @@ Main::Main() : wxFrame(nullptr, wxID_ANY, "NieR Replicant Gadget", wxPoint(30, 3 //Create Notebook notebook = new wxNotebook(this, wxID_ANY, wxPoint(margin, margin * 6), wxSize(width, 485), 0, wxNotebookNameStr); Player = new PlayerPanel(notebook, hook); + Graphics = new GraphicsPanel(notebook, hook); + Cheats = new CheatsPanel(notebook, hook); + notebook->AddPage(Player, wxT("Player"), false, 0); + notebook->AddPage(Graphics, wxT("Graphics"), false, 1); + notebook->AddPage(Cheats, wxT("Cheats"), false, 2); Player->Enable(false); + Graphics->Enable(false); + Cheats->Enable(false); //Timer m_Timer = new wxTimer(); @@ -59,12 +68,17 @@ void Main::updateComponents(void) m_hooked->SetLabelText("Hooked: Yes"); m_status->SetLabel("Process: " + wxString::Format(wxT("%i"), hook->getProcessID())); Player->Enable(true); + Graphics->Enable(true); + Cheats->Enable(true); + } else { m_hooked->SetForegroundColour(wxColor(244, 67, 54)); m_hooked->SetLabelText("Hooked: No"); m_status->SetLabel("Process: None"); Player->Enable(false); + Graphics->Enable(false); + Cheats->Enable(false); } } diff --git a/Source/ReplicantGadget/Main.hpp b/Source/ReplicantGadget/Main.hpp index 59c27d5..1b82f6a 100644 --- a/Source/ReplicantGadget/Main.hpp +++ b/Source/ReplicantGadget/Main.hpp @@ -20,9 +20,9 @@ class Main : public wxFrame, public wxThreadHelper //Tabs wxNotebook* notebook = nullptr; wxPanel* Player = nullptr; - wxPanel* Inventory = nullptr; - wxPanel* Weapons = nullptr; - wxPanel* Misc = nullptr; + wxPanel* Graphics = nullptr; + wxPanel* Cheats = nullptr; + public: Main(); diff --git a/Source/ReplicantGadget/PlayerPanel.cpp b/Source/ReplicantGadget/PlayerPanel.cpp index 12276a6..a3f51bd 100644 --- a/Source/ReplicantGadget/PlayerPanel.cpp +++ b/Source/ReplicantGadget/PlayerPanel.cpp @@ -15,44 +15,51 @@ PlayerPanel::PlayerPanel(wxNotebook* parent, ReplicantHook* hook) : wxPanel(pare m_Timer->Bind(wxEVT_TIMER, &PlayerPanel::OnTimer, this); //Status - m_StatsBox = new wxStaticBox(this, wxID_ANY, "Status", wxPoint(margin, margin), wxSize(width - 30, 90), 1, wxStaticBoxNameStr); + m_StatsBox = new wxStaticBox(this, wxID_ANY, "Status", wxPoint(margin, margin), wxSize(width - 30, 150), 1, wxStaticBoxNameStr); + m_Health = new wxStaticText(this, wxID_ANY, "Health: 0/0", wxPoint(margin * 3, margin + 30), wxDefaultSize, 0, wxStaticTextNameStr); m_Level = new wxStaticText(this, wxID_ANY, "Level: 0", wxPoint(margin + (width - 2 * margin) / 2, margin + 30), wxDefaultSize, 0, wxStaticTextNameStr); - m_Funds = new wxStaticText(this, wxID_ANY, "Funds(G): 0", wxPoint(margin + (width - 2 * margin) / 2, margin + 60), wxDefaultSize, 0, wxStaticTextNameStr); - m_Zone = new wxStaticText(this, wxID_ANY, "Zone: ", wxPoint(margin * 3, margin + 60), wxDefaultSize, 0, wxStaticTextNameStr); - - //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(3 * margin, 140), wxDefaultSize, 0, wxDefaultValidator, wxCheckBoxNameStr); - m_InfiniteHealth->Bind(wxEVT_CHECKBOX, &PlayerPanel::InfiniteHealth, this); - m_InfiniteMagic = new wxCheckBox(this, wxID_ANY, "Infinite Magic", wxPoint(3 * margin, 170), wxDefaultSize, 0, wxDefaultValidator, wxCheckBoxNameStr); - m_InfiniteMagic->Bind(wxEVT_CHECKBOX, &PlayerPanel::InfiniteMagic, this); - - //Position - wxSize TextCtrlSize = wxSize(80, 20); - m_PositionBox = new wxStaticBox(this, wxID_ANY, "Position", wxPoint(margin, 250), wxSize(width - 30, 200), 1, wxStaticBoxNameStr); - m_XText = new wxStaticText(this, wxID_ANY, "X", wxPoint(20, 303), wxDefaultSize, 0, wxStaticTextNameStr); - m_YText = new wxStaticText(this, wxID_ANY, "Y", wxPoint(20, 338), wxDefaultSize, 0, wxStaticTextNameStr); - m_ZText = new wxStaticText(this, wxID_ANY, "Z", wxPoint(20, 373), wxDefaultSize, 0, wxStaticTextNameStr); - m_XposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 300), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_YposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 335), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_ZposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 370), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_XposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 300), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_YposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 335), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_ZposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 370), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); - m_CurrentPosText = new wxStaticText(this, wxID_ANY, "Current", wxPoint(4 * margin, 280), wxDefaultSize, 0, wxStaticTextNameStr); - m_StoredPosText = new wxStaticText(this, wxID_ANY, "Stored", wxPoint(width / 2 - 4 * margin, 280), wxDefaultSize, 0, wxStaticTextNameStr); - m_StorePosition = new wxButton(this, wxID_ANY, "Store", wxPoint(240, 300), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); - m_StorePosition->Bind(wxEVT_BUTTON, &PlayerPanel::StorePosition, this); - m_RestorePosition = new wxButton(this, wxID_ANY, "Restore", wxPoint(240, 335), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); - m_RestorePosition->Bind(wxEVT_BUTTON, &PlayerPanel::RestorePosition, this); - m_WarpButton = new wxButton(this, wxID_ANY, "Warp", wxPoint(240, 410), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); - m_WarpButton->Bind(wxEVT_BUTTON, &PlayerPanel::onWarpCLicked, this); - wxArrayString* Locations = new wxArrayString(); - Locations->Add("Amusement (Beauvoir)", 1); - m_WarpComboBox = new wxComboBox(this, wxID_ANY, "", wxPoint(2 * margin, 410), wxSize((width - (6 * margin)) * 2 / 3, 20), *Locations, 0, wxDefaultValidator, wxComboBoxNameStr); - - delete Locations; + + m_Funds = new wxStaticText(this, wxID_ANY, "Gold(G): 0", wxPoint(margin * 3, margin + 60), wxDefaultSize, 0, wxStaticTextNameStr); + m_Magic = new wxStaticText(this, wxID_ANY, "Magic: ", wxPoint(margin + (width - 2 * margin) / 2, margin + 60), wxDefaultSize, 0, wxStaticTextNameStr); + + m_Name = new wxStaticText(this, wxID_ANY, "Name: ", wxPoint(margin * 3, margin + 90), wxDefaultSize, 0, wxStaticTextNameStr); + m_Playtime = new wxStaticText(this, wxID_ANY, "Playtime: ", wxPoint(margin + (width - 2 * margin) / 2, margin + 90), wxDefaultSize, 0, wxStaticTextNameStr); + + m_Zone = new wxStaticText(this, wxID_ANY, "Zone: ", wxPoint(margin * 3, margin + 120), wxDefaultSize, 0, wxStaticTextNameStr); + + ////Position + //wxSize TextCtrlSize = wxSize(80, 20); + //m_PositionBox = new wxStaticBox(this, wxID_ANY, "Position", wxPoint(margin, 250), wxSize(width - 30, 200), 1, wxStaticBoxNameStr); + //m_XText = new wxStaticText(this, wxID_ANY, "X", wxPoint(20, 303), wxDefaultSize, 0, wxStaticTextNameStr); + //m_YText = new wxStaticText(this, wxID_ANY, "Y", wxPoint(20, 338), wxDefaultSize, 0, wxStaticTextNameStr); + //m_ZText = new wxStaticText(this, wxID_ANY, "Z", wxPoint(20, 373), wxDefaultSize, 0, wxStaticTextNameStr); + //m_XposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 300), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_YposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 335), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_ZposTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(4 * margin, 370), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_XposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 300), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_YposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 335), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_ZposStoredTextCtrl = new wxTextCtrl(this, wxID_ANY, "0.000000", wxPoint(width / 2 - 4 * margin, 370), TextCtrlSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + //m_CurrentPosText = new wxStaticText(this, wxID_ANY, "Current", wxPoint(4 * margin, 280), wxDefaultSize, 0, wxStaticTextNameStr); + //m_StoredPosText = new wxStaticText(this, wxID_ANY, "Stored", wxPoint(width / 2 - 4 * margin, 280), wxDefaultSize, 0, wxStaticTextNameStr); + //m_StorePosition = new wxButton(this, wxID_ANY, "Store", wxPoint(240, 300), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); + //m_StorePosition->Bind(wxEVT_BUTTON, &PlayerPanel::StorePosition, this); + //m_RestorePosition = new wxButton(this, wxID_ANY, "Restore", wxPoint(240, 335), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); + //m_RestorePosition->Bind(wxEVT_BUTTON, &PlayerPanel::RestorePosition, this); + //m_WarpButton = new wxButton(this, wxID_ANY, "Warp", wxPoint(240, 410), wxSize(90, 25), 1, wxDefaultValidator, wxStaticBoxNameStr); + //m_WarpButton->Bind(wxEVT_BUTTON, &PlayerPanel::onWarpCLicked, this); + //wxArrayString* Locations = new wxArrayString(); + //Locations->Add("Amusement (Beauvoir)", 1); + //m_WarpComboBox = new wxComboBox(this, wxID_ANY, "", wxPoint(2 * margin, 410), wxSize((width - (6 * margin)) * 2 / 3, 20), *Locations, 0, wxDefaultValidator, wxComboBoxNameStr); + + //delete Locations; + + //Attributes + m_AttributesBox = new wxStaticBox(this, wxID_ANY, "Attributes", wxPoint(margin, 180), wxSize(width - 30, 260), 1, wxStaticBoxNameStr); + m_SetLevel = new wxStaticText(this, wxID_ANY, "Level", wxPoint(margin * 3, 210), wxDefaultSize, 0, wxStaticTextNameStr); + m_LevelTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxPoint(margin * 2 + 100, 210), wxDefaultSize, 0, wxDefaultValidator, wxTextCtrlNameStr); + m_setLevelBtn = new wxButton(this, wxID_ANY, "Set Level", wxPoint(240, 210), wxDefaultSize, 0, wxDefaultValidator, wxButtonNameStr); + m_setLevelBtn->Bind(wxEVT_BUTTON, &PlayerPanel::setLevel, this); this->SetBackgroundColour(wxColor(255, 255, 255)); m_Timer->Start(1000, wxTIMER_CONTINUOUS); @@ -68,28 +75,23 @@ void PlayerPanel::OnTimer(wxTimerEvent&) { if (hook->isHooked()) { //Player - m_Level->SetLabel("Level: " + wxString::Format(wxT("%i"), hook->getLevel())); + m_Level->SetLabel("Level: " + wxString::Format(wxT("%i"), hook->getLevel() + 1)); m_Health->SetLabel("Health: " + wxString::Format(wxT("%i"), hook->getHealth())); - m_Funds->SetLabel("Funds(G): " + wxString::Format(wxT("%i"), hook->getGold())); - m_Zone->SetLabel("Zone: " + wxString::Format(wxT("%i"), hook->getLevel())); - //Position - m_XposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getX())); - m_YposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getY())); - m_ZposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getZ())); + m_Funds->SetLabel("Gold(G): " + wxString::Format(wxT("%i"), hook->getGold())); + m_Magic->SetLabel("Magic: " + wxString::Format(wxT("%f"), (float)hook->getMagic())); + m_Name->SetLabel("Name: " + hook->getName()); + m_Playtime->SetLabel("Playtime: " + wxString::Format(wxT("%f"), hook->getPlaytime())); + m_Zone->SetLabel("Zone: " + hook->getZone()); + ////Position + //m_XposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getX())); + //m_YposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getY())); + //m_ZposTextCtrl->SetLabel(wxString::Format(wxT("%f"), hook->getZ())); } else { } } -void PlayerPanel::InfiniteMagic(wxCommandEvent& evt) -{ - hook->InfiniteMagic(m_InfiniteMagic->IsChecked()); -} -void PlayerPanel::InfiniteHealth(wxCommandEvent& evt) -{ - hook->InfiniteHealth(m_InfiniteHealth->IsChecked()); -} void PlayerPanel::StorePosition(wxCommandEvent& evt) @@ -112,6 +114,16 @@ void PlayerPanel::RestorePosition(wxCommandEvent& evt) hook->setPosition(this->StoredX, this->StoredY, this->StoredZ); } +void PlayerPanel::setLevel(wxCommandEvent& evt) +{ + long level; + if (!m_LevelTextCtrl->GetValue().ToLong(&level)) { + wxMessageBox("Could not set the level"); + return; + } + hook->setLevel(level - 1); +} + constexpr unsigned int str2int(const char* str, int h = 0) { return !str[h] ? 5381 : (str2int(str, h + 1) * 33) ^ str[h]; diff --git a/Source/ReplicantGadget/PlayerPanel.hpp b/Source/ReplicantGadget/PlayerPanel.hpp index 77efb0c..bdb8c60 100644 --- a/Source/ReplicantGadget/PlayerPanel.hpp +++ b/Source/ReplicantGadget/PlayerPanel.hpp @@ -14,11 +14,11 @@ class PlayerPanel :public wxPanel wxStaticText* m_Level = nullptr; wxStaticText* m_Funds = nullptr; wxStaticText* m_Zone = nullptr; + wxStaticText* m_Name = nullptr; + wxStaticText* m_Playtime = nullptr; + wxStaticText* m_Magic = nullptr; + - //CHEATS - wxStaticBox* m_CheatsBox = nullptr; - wxCheckBox* m_InfiniteHealth = nullptr; - wxCheckBox* m_InfiniteMagic = nullptr; //POSITION wxStaticBox* m_PositionBox = nullptr; @@ -38,18 +38,24 @@ class PlayerPanel :public wxPanel wxButton* m_StorePosition = nullptr; wxButton* m_RestorePosition = nullptr; + //Attributes + wxStaticBox* m_AttributesBox = nullptr; + wxStaticText* m_SetLevel = nullptr; + wxTextCtrl* m_LevelTextCtrl = nullptr; + wxButton* m_setLevelBtn = nullptr; + + PlayerPanel(wxNotebook* parent, ReplicantHook* hook); ~PlayerPanel(); protected: //TIMER void OnTimer(wxTimerEvent&); - //CHEAT EVT - void InfiniteHealth(wxCommandEvent& evt); - void InfiniteMagic(wxCommandEvent& evt); + //POSITION EVT void onWarpCLicked(wxCommandEvent& evt); void StorePosition(wxCommandEvent& evt); void RestorePosition(wxCommandEvent& evt); + void setLevel(wxCommandEvent& evt); wxDECLARE_EVENT_TABLE(); private: diff --git a/Source/ReplicantGadget/ReplicantGadget.vcxproj b/Source/ReplicantGadget/ReplicantGadget.vcxproj index ee92ba6..d5c3ded 100644 --- a/Source/ReplicantGadget/ReplicantGadget.vcxproj +++ b/Source/ReplicantGadget/ReplicantGadget.vcxproj @@ -20,13 +20,17 @@ + + + + diff --git a/Source/ReplicantGadget/ReplicantGadget.vcxproj.filters b/Source/ReplicantGadget/ReplicantGadget.vcxproj.filters index 98c894a..a83bdc7 100644 --- a/Source/ReplicantGadget/ReplicantGadget.vcxproj.filters +++ b/Source/ReplicantGadget/ReplicantGadget.vcxproj.filters @@ -27,6 +27,12 @@ Header Files + + Header Files + + + Header Files + @@ -41,5 +47,11 @@ Source Files + + Source Files + + + Source Files + \ No newline at end of file