This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
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
5 changed files
with
89 additions
and
0 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 |
---|---|---|
|
@@ -289,6 +289,10 @@ | |
{ | ||
"type": "embedded", | ||
"hack": "hitboxes" | ||
}, | ||
{ | ||
"type": "embedded", | ||
"hack": "respawn_delay" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "respawn-delay.hpp" | ||
#include "../../menu/menu.hpp" | ||
|
||
namespace openhack::hacks { | ||
|
||
float RespawnDelay::delay = 0.5f; | ||
static ToggleComponent* s_respawnDelay = nullptr; | ||
|
||
inline void togglePatch() { | ||
if (!s_respawnDelay) return; | ||
bool enabled = config::get<bool>("hack.respawn_delay.enabled"); | ||
s_respawnDelay->applyPatch(enabled); | ||
} | ||
|
||
void RespawnDelay::onInit() { | ||
// Set default values | ||
config::setIfEmpty("hack.respawn_delay.enabled", false); | ||
config::setIfEmpty("hack.respawn_delay.delay", 0.5f); | ||
delay = config::get<float>("hack.respawn_delay.delay"); | ||
|
||
// Initialize toggle | ||
std::vector<gd::sigscan::Opcode> opcodes = gd::sigscan::match( | ||
"F30F1005^????68????C6", | ||
utils::bytesToHex(utils::getBytes((uintptr_t)&delay))); | ||
auto customBypass = gd::sigscan::match("84C0^7410F30F10", "EB"); | ||
|
||
if (opcodes.empty() || customBypass.empty()) { | ||
L_WARN("Failed to find signature for RespawnDelay"); | ||
return; | ||
} | ||
|
||
opcodes.push_back(customBypass[0]); | ||
s_respawnDelay = new ToggleComponent("", "", opcodes); | ||
togglePatch(); | ||
} | ||
|
||
void RespawnDelay::onDraw() { | ||
gui::callback([](){ | ||
gui::tooltip("Allows you to change the default respawn time"); | ||
}); | ||
if (gui::toggleSetting("Respawn Delay", "hack.respawn_delay.enabled", []() { | ||
gui::width(100); | ||
if (gui::inputFloat("Delay", "hack.respawn_delay.delay", 0.0f, FLT_MAX, "%.3f sec.")) { | ||
delay = config::get<float>("hack.respawn_delay.delay"); | ||
} | ||
gui::tooltip("The delay before respawning"); | ||
gui::width(); | ||
}, ImVec2(0, 0))) { | ||
togglePatch(); | ||
} | ||
} | ||
|
||
} |
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,21 @@ | ||
#pragma once | ||
|
||
#include "../hacks.hpp" | ||
|
||
namespace openhack::hacks { | ||
|
||
/// @brief Allows to change default respawn time | ||
class RespawnDelay : public EmbeddedHack { | ||
public: | ||
RespawnDelay() : EmbeddedHack("Respawn Delay", "respawn_delay") {} | ||
|
||
void onInit() override; | ||
void onDraw() override; | ||
void update() override {} | ||
bool isCheating() override { return false; } | ||
|
||
public: | ||
static float delay; | ||
}; | ||
|
||
} |
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
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please Gimme the .geode file I don't want to build myself cuz windows is so slow
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Prevter
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Prevter/GDOpenHack/actions/runs/8350835798
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Prevter I'd recommend that under any commit which adds a feature or fixes a bug in the comments you give a download if possible, not forcing, just an idea
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone can just open "Actions" tab and download builds for any commit if they want to.
902c834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thank you I didn't know that