From a4c6b4020eadf47b95fa39ff433a1567ea8b2d16 Mon Sep 17 00:00:00 2001 From: FireMario211 <17692105+FireMario211@users.noreply.github.com> Date: Thu, 2 May 2024 20:27:12 -0400 Subject: [PATCH] why did i not see this, how did i not see this!\? --- changelog.md | 5 +++++ src/Hacks/Quartz.cpp | 38 +++++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/changelog.md b/changelog.md index f21d02f..b7a4493 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# v1.6.4 + - Added indicators for the hold/release button + - Added Practice Music Hack back (a silly mistake I made with the if condition) + - Fix last frame not recalculated after you finish recording. + - (hopefully) Fix the issues with Macro Editor frame buttons not working # v1.6.3 - Fixed issue where macros with no input would crash. - Fixed issue with Uncomplete Level not working in ImGui style. diff --git a/src/Hacks/Quartz.cpp b/src/Hacks/Quartz.cpp index c654643..2476c06 100644 --- a/src/Hacks/Quartz.cpp +++ b/src/Hacks/Quartz.cpp @@ -568,23 +568,37 @@ class $modify(QuartzPlayLayer, PlayLayer) { m_fields->prevBtn->setPosition({-40, 25}); m_fields->nextBtn->setPosition({40, 25}); + + auto relSpr = CCSprite::create("GJ_button_01.png"); + auto relTxt = CCLabelBMFont::create("Rel", "bigFont.fnt"); + relTxt->setScale(.55F); + relTxt->setAnchorPoint({0, 0}); + relTxt->setPosition({4, 12}); + relSpr->addChild(relTxt); + auto holdSpr = CCSprite::create("GJ_button_06.png"); + auto holdTxt = CCLabelBMFont::create("Hold", "bigFont.fnt"); + holdTxt->setScale(.4F); + holdTxt->setAnchorPoint({0, 0}); + holdTxt->setPosition({4, 14}); + holdSpr->addChild(holdTxt); + m_fields->inputStateBtn1_p1 = CCMenuItemSpriteExtra::create( - CCSprite::create("GJ_button_01.png"), + relSpr, this, menu_selector(QuartzPlayLayer::markInputP1) ); m_fields->inputStateBtn2_p1 = CCMenuItemSpriteExtra::create( - CCSprite::create("GJ_button_06.png"), + holdSpr, this, menu_selector(QuartzPlayLayer::markInputP1) ); m_fields->inputStateBtn1_p2 = CCMenuItemSpriteExtra::create( - CCSprite::create("GJ_button_01.png"), + relSpr, this, menu_selector(QuartzPlayLayer::markInputP2) ); m_fields->inputStateBtn2_p2 = CCMenuItemSpriteExtra::create( - CCSprite::create("GJ_button_06.png"), + holdSpr, this, menu_selector(QuartzPlayLayer::markInputP2) ); @@ -608,9 +622,9 @@ class $modify(QuartzPlayLayer, PlayLayer) { m_fields->buttons->addChild(m_fields->inputStateBtn2_p2); m_uiLayer->addChild(m_fields->buttons); m_fields->buttons->setPositionY(0); - //GJ_playEditorBtn_001.png - //GJ_stopEditorBtn_001.png - //m_fields->playPauseBtn + + + // TODO: add advance and prev frame for +5 and -5, oh and also allow clearing from right or clearing a section } void markInputP1(CCObject*) { @@ -749,10 +763,7 @@ class $modify(QuartzPlayLayer, PlayLayer) { } } STOPTIME = false; - std::string fpsToStr = CCDirector::sharedDirector()->m_pszFPS; - int frameRate = std::stoi(fpsToStr.substr(fpsToStr.find(":") + 2)); GJBaseGameLayer::update(1.F / current_macro.framerate); - //GJBaseGameLayer::update(1.F / frameRate); STOPTIME = true; log::debug("[-] Frame {}", m_fields->bot_frame); } @@ -816,8 +827,6 @@ class $modify(QuartzPlayLayer, PlayLayer) { } } STOPTIME = false; - std::string fpsToStr = CCDirector::sharedDirector()->m_pszFPS; - int frameRate = std::stoi(fpsToStr.substr(fpsToStr.find(":") + 2)); GJBaseGameLayer::update(1.F / current_macro.framerate); STOPTIME = true; log::debug("[+] Frame {}", m_fields->bot_frame); @@ -857,10 +866,7 @@ class $modify(QuartzPlayLayer, PlayLayer) { UpdatePlayer(m_player1, *input_player); } STOPTIME = false; - std::string fpsToStr = CCDirector::sharedDirector()->m_pszFPS; - int frameRate = std::stoi(fpsToStr.substr(fpsToStr.find(":") + 2)); GJBaseGameLayer::update(1.F / current_macro.framerate); - //GJBaseGameLayer::update(1.F / frameRate); STOPTIME = true; } @@ -1011,6 +1017,8 @@ class $modify(GJBaseGameLayer) { } if (playLayer->m_fields->lastInputFrame != 0 && playLayer->m_fields->bot_frame > playLayer->m_fields->lastInputFrame) { playLayer->m_fields->lastInputFrame++; + } else if (playLayer->m_fields->lastInputFrame == 0 && Hacks::isHackEnabled("Record")) { + playLayer->m_fields->lastInputFrame = playLayer->m_fields->bot_frame + 1; // does + 2 even matter? it gets reset anyways! } bool checkIfMoved = false; if (m_level->isPlatformer()) {