Skip to content

Commit

Permalink
Merge pull request #2 from RayDeeUx/main
Browse files Browse the repository at this point in the history
Fixes: pause button
  • Loading branch information
TheBearodactyl authored Apr 26, 2024
2 parents 0663c26 + f219d20 commit aa98fac
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <Geode/Geode.hpp>
#include <Geode/cocos/include/ccTypes.h>
#include <Geode/loader/Mod.hpp>
#include <Geode/modify/CCMotionStreak.hpp>
Expand Down Expand Up @@ -50,4 +49,4 @@ class $modify(PlayLayer) {
}
}
}
};
};
20 changes: 10 additions & 10 deletions src/pause_button.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <Geode/Geode.hpp>
// thanks to RayDeeUx for helping fix the pause button :D
#include <Geode/modify/Modify.hpp>
#include <Geode/modify/PauseLayer.hpp>
#include <Geode/ui/GeodeUI.hpp>
Expand All @@ -13,12 +13,11 @@ struct GayPauseLayer : Modify<GayPauseLayer, PauseLayer> {
void customSetup() {
PauseLayer::customSetup();

auto winSize = CCDirector::sharedDirector()->getWinSize();
auto ccmenu = this->getChildByIDRecursive("left-button-menu");

auto *settingsButtonSprite = CCSprite::create("logo.png"_spr);

settingsButtonSprite->setScale(0.25f);
auto settingsButtonSprite = CCSprite::create("logo.png"_spr);
settingsButtonSprite->setScale(.25f);
if (auto betterPause = Loader::get()->getLoadedMod("tpdea.betterpause-Better")) {
if (betterPause->getSettingValue<int64_t>("type-pause") == 1) settingsButtonSprite->setScale(.95f);
}

auto settingsBtn = CCMenuItemSpriteExtra::create(
settingsButtonSprite,
Expand All @@ -27,8 +26,9 @@ struct GayPauseLayer : Modify<GayPauseLayer, PauseLayer> {
);

settingsBtn->setID("gay-settings-button"_spr);
ccmenu->addChild(settingsBtn);

this->addChild(ccmenu);
if (auto leftMenu = getChildByIDRecursive("left-button-menu")) {
leftMenu->addChild(settingsBtn);
leftMenu->updateLayout();
}
}
};
2 changes: 1 addition & 1 deletion src/trail_customization/rainbow_trail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ cocos2d::_ccColor3B RainbowTrail::get_rainbow(float offset, float saturation) {
out.g = G * 255;
out.b = B * 255;
return out;
}
}
2 changes: 1 addition & 1 deletion src/trail_customization/rainbow_trail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class RainbowTrail {
static void hsv_to_rgb(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV);
static cocos2d::_ccColor3B get_rainbow(float offset, float saturation);
static float g;
};
};
3 changes: 1 addition & 2 deletions src/trail_customization/solid_trail.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifndef GEODE_IS_MACOS

#include <Geode/Geode.hpp>
#include <Geode/modify/CCDrawNode.hpp>

using namespace geode::prelude;
Expand Down Expand Up @@ -28,4 +27,4 @@ class $modify(CCDrawNode) {
}
};

#endif
#endif

0 comments on commit aa98fac

Please sign in to comment.