diff --git a/src/main.cpp b/src/main.cpp index 93e5ca1..a831097 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,7 @@ float leftOver = 0.f; // For CCScheduler double prevSpeed = 1.0f; int fixedFps = 240; +int androidFps = 60; #ifdef GEODE_IS_ANDROID int offset = 0x320; @@ -205,6 +206,16 @@ class RecordLayer : public geode::Popup { menu_selector(RecordLayer::openSettingsMenu) ); btn->setPosition(winSize/2.f-ccp(m_size.width/2.f,m_size.height/2.f) + ccp(325, 20)); + menu->addChild(btn); + + auto spr = CCSprite::createWithSpriteFrameName("gj_discordIcon_001.png"); + spr->setScale(0.8f); + auto btn = CCMenuItemSpriteExtra::create( + spr, + this, + menu_selector(RecordLayer::discordPopup) + ); + btn->setPosition(winSize/2.f-ccp(-m_size.width/2.f,m_size.height/2.f) + ccp(-325, 20)); menu->addChild(btn); if (!isAndroid) { @@ -289,6 +300,18 @@ class RecordLayer : public geode::Popup { geode::openSettingsPopup(Mod::get()); } + void discordPopup(CCObject*) { + geode::createQuickPopup( + "Join Discord", + "Join the Discord server?", + "No", "Yes", + [this](auto, bool btn2) { + if (btn2) { + geode::utils::web::openLinkInBrowser("https://discord.gg/dwk5whfeu2"); + } + }); + } + void keyInfo(CCObject*) { FLAlertLayer::create( "Shortcuts", @@ -973,7 +996,8 @@ class $modify(GJBaseGameLayer) { if (Mod::get()->getSettingValue("frame_stepper") && stepFrame == false) return; else if (stepFrame) { - GJBaseGameLayer::update(1.f/fixedFps); + int fps = (isAndroid) ? androidFps : fixedFps; + GJBaseGameLayer::update(1.f/fps); stepFrame = false; recorder.syncMusic(); } else GJBaseGameLayer::update(dt); @@ -1223,7 +1247,7 @@ class $modify(CCScheduler) { } else wasAndroid = true; - int fps = (isAndroid && wasAndroid) ? 60 : fixedFps; + int fps = (isAndroid && wasAndroid) ? androidFps : fixedFps; float dt2 = (1.f / fps); dt = (recorder.state == state::recording) ? dt * speedhackValue : dt; auto startTime = std::chrono::high_resolution_clock::now();