Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Asiern committed Jul 30, 2022
1 parent 5273245 commit 3a2f953
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 23 deletions.
3 changes: 3 additions & 0 deletions include/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ class Main : public wxFrame, public wxThreadHelper

// UI Thread Timer
wxTimer* m_Timer = nullptr;
int version = -1;

// HOOK STATUS
wxStaticText* m_hooked = nullptr;
wxStaticText* m_status = nullptr;
wxStaticText* m_version = nullptr;
wxStaticText* m_gameVer = nullptr;
wxComboBox* m_version_selector = nullptr;

// Tabs
wxNotebook* notebook = nullptr;
Expand All @@ -40,5 +42,6 @@ class Main : public wxFrame, public wxThreadHelper
void StartHook(void);
void disableUI(void);
void enableUI(void);
void onChangeVersion(wxCommandEvent& evt);
wxDECLARE_EVENT_TABLE();
};
70 changes: 48 additions & 22 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@ wxBEGIN_EVENT_TABLE(Main, wxFrame) EVT_CLOSE(Main::OnClose) wxEND_EVENT_TABLE()
m_status = new wxStaticText(this, wxID_ANY, "Process: None", wxPoint(margin, margin * 3), wxDefaultSize, 0,
wxStaticTextNameStr);
m_status->SetFont(font);
m_version = new wxStaticText(this, wxID_ANY, "Version: 2.1.0", wxPoint(width - margin * 6, margin), wxDefaultSize,
m_version = new wxStaticText(this, wxID_ANY, "Version: 2.1.1", wxPoint(width - margin * 6, margin), wxDefaultSize,
0, wxStaticTextNameStr);
m_version->SetFont(font);
m_gameVer = new wxStaticText(this, wxID_ANY, "Game Version: None", wxPoint(width - margin * 9, margin * 3),
wxDefaultSize, 0, wxStaticTextNameStr);
m_gameVer->SetFont(font);
/* m_gameVer = new wxStaticText(this, wxID_ANY, "Game Version: None", wxPoint(width - margin * 9, margin * 3),
wxDefaultSize, 0, wxStaticTextNameStr);
m_gameVer->SetFont(font);*/

wxArrayString* versions = new wxArrayString();
versions->Insert("Auto", 0);
versions->Insert("0.1", 1);
versions->Insert("0.2", 2);
wxComboBox* m_version_selector =
new wxComboBox(this, wxID_ANY, "Auto", wxPoint(width - margin * 5, margin * 3), wxDefaultSize, *versions,
wxCB_READONLY | wxCB_SIMPLE, wxDefaultValidator, wxComboBoxNameStr);
m_version_selector->Bind(wxEVT_COMBOBOX, &Main::onChangeVersion, this);

Weapons->Enable(false);
Player->Enable(false);
Expand All @@ -75,28 +84,25 @@ void Main::updateComponents(void)
m_hooked->SetForegroundColour(greenColor);
m_hooked->SetLabelText("Hooked: Yes");
m_status->SetLabel("Process: " + wxString::Format(wxT("%i"), hook->getProcessID()));
switch (hook->getVersion())
{
case 0:
m_gameVer->SetLabel("Game Version: ");
break;
case 1:
m_gameVer->SetLabel("Game Version: 1.0.1");
break;
case 2:
m_gameVer->SetLabel("Game Version: 1.0.2");
break;
}
if (hook->isSavefileLoaded())
enableUI();
else
disableUI();
/* switch (hook->getVersion())
{
case 0:
m_gameVer->SetLabel("Game Version: ");
break;
case 1:
m_gameVer->SetLabel("Game Version: 1.0.1");
break;
case 2:
m_gameVer->SetLabel("Game Version: 1.0.2");
break;
}*/
enableUI();
}
else
{
m_hooked->SetForegroundColour(redColor);
m_hooked->SetLabelText("Hooked: No");
m_gameVer->SetLabel("Game Version: None");
// m_gameVer->SetLabel("Game Version: None");
m_status->SetLabel("Process: None");
disableUI();
}
Expand Down Expand Up @@ -169,14 +175,34 @@ void Main::enableUI(void)
// Settings->Enable(true);
}

void Main::onChangeVersion(wxCommandEvent& evt)
{
switch (evt.GetSelection())
{
case 0:
this->version = -1;
break;
case 1:
this->version = 001;
break;
case 2:
this->version = 002;
break;
default:
this->version = -1;
break;
}
this->hook->stop();
}

wxThread::ExitCode Main::Entry()
{
while (!GetThread()->TestDestroy())
{
hook->hookStatus(); // Update status
if (!hook->isHooked())
{
hook->start(); // Start hook
hook->start(this->version); // Start hook
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/PlayerPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void PlayerPanel::OnTimer(wxTimerEvent&)
case VER_0_0_2:
m_WarpButton->Enable(false);
m_WarpComboBox->Enable(false);
m_RestorePosition->Enable(false);
// m_RestorePosition->Enable(false);
m_NoClip->Enable(false);
m_IgnoreUpgradeMaterials->Enable(false);
m_SpeedHack->Enable(false);
Expand Down

0 comments on commit 3a2f953

Please sign in to comment.