Skip to content

Commit

Permalink
seperated keybinds and worldinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
skarockoi committed Feb 28, 2023
1 parent 069ea0f commit e99dce1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
51 changes: 27 additions & 24 deletions pHake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,38 +110,41 @@ bool Start()
menu->Add(boostplayer);
menu->Add(suicide);

std::unique_ptr<pThread> thread = std::make_unique<pThread>([&]() // extra thread needed to update world info and key toggles
std::unique_ptr<pThread> world_thread = std::make_unique<pThread>([&]() // extra thread needed to update world info and key toggles
{
world->UpdateAll(process->read<uintptr_t>(settings->pointers.world));
settings->kmh = 3.6f * process->read<float>(settings->pointers.kmh);
}, 1);

GetKeyExecuteWaitForRelease(settings->keys.menu, [=]()
{
menu->ui->Toggle();
});
GetKeyExecuteWaitForRelease(settings->keys.teleport, [=]()
{
teleport->Execute();
});

GetKeyExecuteWaitForRelease(settings->keys.boost_player, [=]()
{
boostplayer->Execute();
});

GetKeyExecuteWaitForRelease(settings->keys.boost_vehicle, [=]()
{
boostvehicle->Execute();
});

if (settings->noclip)
std::unique_ptr<pThread> toggles_thread = std::make_unique<pThread>([&]() // extra thread needed for keyboard toggles
{
GetKeyExecuteWaitForRelease(VK_SPACE, [=]()
GetKeyExecuteWaitForRelease(settings->keys.menu, [=]()
{
menu->ui->Toggle();
});
GetKeyExecuteWaitForRelease(settings->keys.teleport, [=]()
{
teleport->Execute();
});

GetKeyExecuteWaitForRelease(settings->keys.boost_player, [=]()
{
boostplayer->Execute();
});
}
}, 1);

GetKeyExecuteWaitForRelease(settings->keys.boost_vehicle, [=]()
{
boostvehicle->Execute();
});

if (settings->noclip)
{
GetKeyExecuteWaitForRelease(VK_SPACE, [=]()
{
boostplayer->Execute();
});
}
}, 10);

menu->Start();

Expand Down
4 changes: 2 additions & 2 deletions pHake/pLib/Ui/pOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ void pOverlay::Create(LPCSTR Name)
notification.Create(&window_);

mouse_.Create(&window_);
mouse_.Toggle();

list.Create(&window_);
list.position(sf::Vector2f(window_.getSize().x / 2, window_.getSize().y / 4));
list.Toggle();

this->Toggle();
}

void pOverlay::Toggle()
Expand Down

0 comments on commit e99dce1

Please sign in to comment.