Skip to content

Commit

Permalink
mreeeeow
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Sep 29, 2024
1 parent f9fd929 commit 7972fbf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fixed Noclip Accuracy being wrong a lot of the time
- Fixed Show Trajectory unnecessarily running a lot more times than necessary
- Fixed Click Sounds dying with Show Trajectory enabled
- Fixed Show Hitboxes not showing the hitbox of 2 monster objects (you know, those guys..)
- Made Update Available label clickable if an update is available, clicking it opens the mod popup to update the mod
- Added **Frame Stepper**

Expand Down
21 changes: 21 additions & 0 deletions src/Hacks/FixedMonsterHitboxes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include "../Client/Client.h"

using namespace geode::prelude;

class $modify(GJBaseGameLayer)
{
virtual void updateDebugDraw()
{
GJBaseGameLayer::updateDebugDraw();

for (auto obj : CCArrayExt<GameObject*>(m_objects))
{
if (obj->m_objectID == 918 || obj->m_objectID == 2012)
{
m_debugDrawNode->drawCircle(obj->getPosition(), obj->m_objectRadius, ccc4f(1, 0, 0, 1), 0.25f, ccc4f(1, 0, 0, 1), 120);
}
}
}
};
5 changes: 2 additions & 3 deletions src/Hacks/Frame Stepper/FrameStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ void SteppedUILayer::updateUI()

if (!typeinfo_cast<PlayLayer*>(m_gameLayer))
{
m_fields->next->setEnabled(false);
m_fields->next->setColor(ccc3(150, 150, 150));

m_fields->prev->setEnabled(false);
m_fields->prev->setColor(ccc3(150, 150, 150));
}
Expand Down Expand Up @@ -224,8 +221,10 @@ class FrameStepperUIDelegate : public ModuleChangeDelegate
Client::GetModule("frame-stepper")->onToggle = [](bool enabled)
{
if (GJBaseGameLayer::get())
{
as<SteppedUILayer*>(GJBaseGameLayer::get()->m_uiLayer)->m_fields->menu->setVisible(enabled);
as<SteppedUILayer*>(GJBaseGameLayer::get()->m_uiLayer)->updateUI();
}
};
});
}
12 changes: 12 additions & 0 deletions src/Hacks/Show Trajectory/Trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ bool TrajectoryPlayLayer::init(GJGameLevel* level, bool useReplay, bool dontCrea
return true;
}

void TrajectoryPlayLayer::resetLevel()
{
PlayLayer::resetLevel();

base_cast<TrajectoryBGL*>(this)->updateSimulation();
}

void TrajectoryPlayLayer::destroyPlayer(PlayerObject* p0, GameObject* p1)
{
auto tbgl = base_cast<TrajectoryBGL*>(this);
Expand Down Expand Up @@ -137,6 +144,11 @@ void TrajectoryBGL::update(float dt)
{
GJBaseGameLayer::update(dt);

updateSimulation();
}

void TrajectoryBGL::updateSimulation()
{
if (m_fields->trajectoryPlayer)
{
m_fields->trajectoryDraw->clear();
Expand Down
6 changes: 6 additions & 0 deletions src/Hacks/Show Trajectory/Trajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class $modify (TrajectoryBGL, GJBaseGameLayer)
void resetSimulation(PlayerObject* player);
void simulateTrajectory(bool press, PlayerObject* player);

void updateSimulation();

void collisionCheckObjects(PlayerObject* p0, gd::vector<GameObject*>* p1, int p2, float p3);
virtual void update(float dt);

Expand All @@ -43,5 +45,9 @@ class $modify (TrajectoryPlayLayer, PlayLayer)
{
bool init(GJGameLevel* level, bool useReplay, bool dontCreateObjects);

void resetLevel();

virtual void destroyPlayer(PlayerObject* p0, GameObject* p1);

QOLMOD_MOD_HOOK("show-trajectory", "PlayLayer::resetLevel")
};

0 comments on commit 7972fbf

Please sign in to comment.