Skip to content

Commit

Permalink
gg ez 1 attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Mar 7, 2024
1 parent d90d48c commit ccf2299
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ClientUtils

level->modules.push_back(new Module("Show Hitboxes", "show-hitboxes", "Shows object hitboxes"));
level->modules.push_back(new Module("Show Hitboxes On Death", "show-hitboxes-on-death", "Shows object hitboxes on death"));
level->modules.push_back(new Module("Hitbox Trail", "hitbox-trail", "Creates a trail for your players hitbox"));
//level->modules.push_back(new Module("Hitbox Trail", "hitbox-trail", "Creates a trail for your players hitbox"));

level->modules.push_back(new Module("No Static Camera", "no-static", "Disables static camera"));

Expand Down
53 changes: 19 additions & 34 deletions src/Hacks/HitboxTrail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,27 @@ class $modify (GJBaseGameLayer)
CCDrawNode* dn = nullptr;
void updateVisibility(float p0) {
PlayLayer::updateVisibility(p0);
std::vector<CCPoint> points = {};
if (!m_fields->dn)
m_fields->dn = as<CCDrawNode*>(getChildByTagRecursively(PlayLayer::get(), -9999));
if (!m_fields->dn)
m_fields->dn = as<CCDrawNode*>(getChildByTagRecursively(PlayLayer::get(), 1));
if (!m_fields->dn && PlayLayer::get()->getChildByID("hitbox-node"))
m_fields->dn = as<CCDrawNode*>(getChildOfType<CCDrawNode>(getChildOfType<CCLayer>(PlayLayer::get()->getChildByID("hitbox-node"), 0), 0));
if (!m_fields->dn)
return;
#ifdef GEODE_IS_WINDOWS
bool shouldVis = m_isDebugDrawEnabled && m_isPracticeMode;
#else
//bool shouldVis = m_isPracticeMode;
bool shouldVis = false;
#endif
virtual TodoReturn updateDebugDraw()
{
GJBaseGameLayer::updateDebugDraw();
if (!m_fields->mod)
m_fields->mod = Client::GetModule("show-hitboxes");
if (!m_fields->mod2)
m_fields->mod2 = Client::GetModule("show-hitboxes-on-death");
if (m_fields->mod->enabled)
shouldVis = true;
if (m_fields->mod2->enabled && m_player1->m_isDead)
shouldVis = true;
PlayLayer::updateDebugDraw();
m_fields->dn->setVisible(shouldVis);
m_fields->mod = Client::GetModule("hitbox-trail");
if (m_fields->mod->enabled && m_player1)
{
if (m_fields->points.size() == 0 || (m_fields->points[m_fields->points.size() - 1].equals(m_player1->getPosition())))
{
m_fields->points.push_back(m_player1->getPosition());
}
for (size_t i = 0; i < m_fields->points.size(); i++)
{
m_debugDrawNode->drawRect(m_fields->points[i], m_fields->points[i] + ccp(100, 100), ccc4FFromccc4B(ccc4(0, 0, 0, 0)), 1, ccc4FFromccc4B(ccc4(255, 0, 0, 255)));
}
}
}
};*/
4 changes: 3 additions & 1 deletion src/Layers/ReplayOptionsLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ReplayOptionsLayer : public FLAlertLayer
{
public:
CCMenu* l = nullptr;
std::vector<CCMenuItemToggler*> toggles = {};
static inline std::vector<CCMenuItemToggler*> toggles = {};

void onClose(CCObject*)
{
Expand Down Expand Up @@ -48,6 +48,8 @@ class ReplayOptionsLayer : public FLAlertLayer

bool init()
{
toggles.clear();

if (!FLAlertLayer::init(0))
return false;

Expand Down

0 comments on commit ccf2299

Please sign in to comment.