Skip to content

Commit

Permalink
pause menu fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Mar 2, 2024
1 parent 359cbb9 commit cef5094
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/Client/AndroidUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class AndroidUI : public cocos2d::CCLayerColor {

void close(CCObject* sender)
{
if (auto pause = getChildOfType<PauseLayer>(CCScene::get(), 0))
{
handleTouchPriority(pause);
}

CCTouchDispatcher::get()->removeDelegate(this);
this->removeFromParent();
}
Expand Down
14 changes: 10 additions & 4 deletions src/Client/Replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using namespace geode::prelude;
/*
int actionsIndex = 0;
float dta;
*/
/*class $modify(PlayLayer) {
Expand Down Expand Up @@ -58,32 +57,37 @@ class $modify (PlayLayer)
TodoReturn startGameDelayed()
{
PlayLayer::startGameDelayed();

m_fields->started = true;

log::info("started");
}

void postUpdate(float dt) { //until GJBaseGameLayer::update

PlayLayer::postUpdate(dt);

#ifdef GEODE_IS_WINDOWS

if (!m_started)
#else
if (!m_fields->started)
#endif

return;

if (!m_player1->m_isDead)
GJReplayManager::dt += dt / CCScheduler::get()->getTimeScale();

if (GJReplayManager::playing && GJReplayManager::frame + 1 < GJReplayManager::replay.inputs.size())
{

//log::info("cur: {}, inp: {}", GJReplayManager::dt, GJReplayManager::replay.inputs[GJReplayManager::frame].dt);

while (GJReplayManager::replay.inputs[GJReplayManager::frame].dt <= GJReplayManager::dt) // SHOULD fix this replay issues :3
//if (GJReplayManager::replay.inputs[GJReplayManager::frame].dt <= GJReplayManager::dt)
{

PlayerObject* plr = m_player1;

if (GJReplayManager::replay.inputs[GJReplayManager::frame].player2)
Expand All @@ -103,6 +107,7 @@ class $modify (PlayLayer)
void resetLevel() {
GJReplayManager::dt = 0;
GJReplayManager::frame = 0;

PlayLayer::resetLevel();

log::info("resetLevel");
Expand All @@ -112,9 +117,9 @@ class $modify (PlayLayer)
TodoReturn loadFromCheckpoint(CheckpointObject* p0)
{
PlayLayer::loadFromCheckpoint(p0);
GJReplayManager::dt = as<CheckpointObjectExt*>(p0)->m_fields->dt;
GJReplayManager::frame = as<CheckpointObjectExt*>(p0)->m_fields->frame;
Expand All @@ -140,6 +145,7 @@ class $modify (PlayLayer)
class $modify(GJBaseGameLayer) {

void handleButton(bool push, int button, bool player1) {

GJBaseGameLayer::handleButton(push, button, player1);

PlayerObject* plr = m_player1;
Expand Down
2 changes: 1 addition & 1 deletion src/Hacks/FreeMove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class $modify (CCKeyboardDispatcher)
{
if (PlayLayer::get())
{
if (key == enumKeyCodes::KEY_Insert && down)
if (key == enumKeyCodes::KEY_Home && down)
{
a = !a;

Expand Down
File renamed without changes.

0 comments on commit cef5094

Please sign in to comment.