diff --git a/changelog.md b/changelog.md index d4beb50..94e3e28 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +# 1.5.3 + +- Fixed Crash pressing Q or E in the editor with startpos switcher enabled +- Fixed the Button disappearing when switching scenes +- Changed the Button to use textures instead of labels + # 1.5.2 - Fixed Crash removing checkpoints with checkpoint limit bypass enabled (thanks @hiimjustin000) diff --git a/mod.json b/mod.json index 7325ddc..12694ba 100644 --- a/mod.json +++ b/mod.json @@ -1,6 +1,6 @@ { - "geode": "3.3.1", - "version": "v1.5.2", + "geode": "3.4.0", + "version": "v1.5.3", "gd": { "win": "2.206", "android": "2.206", diff --git a/resources/sprites/qolmodButtonBG.png b/resources/sprites/qolmodButtonBG.png new file mode 100644 index 0000000..30b1e9b Binary files /dev/null and b/resources/sprites/qolmodButtonBG.png differ diff --git a/resources/sprites/qolmodButtonOverlay.png b/resources/sprites/qolmodButtonOverlay.png new file mode 100644 index 0000000..a21051e Binary files /dev/null and b/resources/sprites/qolmodButtonOverlay.png differ diff --git a/resources/sprites/qolmodButtonOverlaycolonthree.png b/resources/sprites/qolmodButtonOverlaycolonthree.png new file mode 100644 index 0000000..6a4962f Binary files /dev/null and b/resources/sprites/qolmodButtonOverlaycolonthree.png differ diff --git a/src/Client/AndroidBall.cpp b/src/Client/AndroidBall.cpp index e3c87b8..2e4c484 100644 --- a/src/Client/AndroidBall.cpp +++ b/src/Client/AndroidBall.cpp @@ -26,10 +26,13 @@ bool AndroidBall::init() menu->setPosition(position); menu->setContentSize(ccp(0, 0)); - l = CCLabelBMFont::create(">_", "bigFont.fnt"); - l->setAnchorPoint(ccp(0.5f, 0.35f)); + //l = CCLabelBMFont::create(">_", "bigFont.fnt"); + //l->setAnchorPoint(ccp(0.5f, 0.35f)); - btn = CircleButtonSprite::create(l, CircleBaseColor::Gray); + btnOverlay = CCSprite::create("qolmodButtonOverlay.png"_spr); + + btn = CCSprite::create("qolmodButtonBG.png"_spr); + btn->addChildAtPosition(btnOverlay, Anchor::Center); menu->addChild(btn); this->addChild(menu); @@ -153,7 +156,7 @@ void AndroidBall::UpdateVisible(bool i) ColourUtility::pastel++; - l->setColor(ColourUtility::getPastelColour(ColourUtility::pastel)); + btnOverlay->setColor(ColourUtility::getPastelColour(ColourUtility::pastel)); instance = this; if (btn->getActionByTag(69)) @@ -164,7 +167,7 @@ void AndroidBall::UpdateVisible(bool i) if (PlayLayer::get()) { btn->setOpacity(50); - l->setOpacity(50); + btnOverlay->setOpacity(50); i = false; } @@ -200,7 +203,7 @@ void AndroidBall::UpdateVisible(bool i) if (i) { btn->setOpacity(op); - l->setOpacity(op); + btnOverlay->setOpacity(op); } else { @@ -211,7 +214,7 @@ void AndroidBall::UpdateVisible(bool i) action2->setTag(69); btn->runAction(action); - l->runAction(action2); + btnOverlay->runAction(action2); } } } @@ -263,8 +266,8 @@ class $modify (AppDelegate) if (getChildOfType(newScene, 0)) return; // fixes texture ldr - if (AndroidBall::get()) - AndroidBall::get()->removeFromParent(); + if (auto ball = getChildOfType(newScene, 0)) + ball->removeFromParent(); newScene->addChild(AndroidBall::create()); diff --git a/src/Client/AndroidBall.h b/src/Client/AndroidBall.h index 7d0eafd..209fe01 100644 --- a/src/Client/AndroidBall.h +++ b/src/Client/AndroidBall.h @@ -17,7 +17,8 @@ class AndroidBall : public CCLayer bool doingThing = false; static inline bool dragging = false; - CircleButtonSprite* btn; + CCSprite* btnOverlay; + CCSprite* btn; CCLabelBMFont* l; CCMenu* menu; diff --git a/src/Hacks/StartposSwitcher.cpp b/src/Hacks/StartposSwitcher.cpp index 11e744f..9948867 100644 --- a/src/Hacks/StartposSwitcher.cpp +++ b/src/Hacks/StartposSwitcher.cpp @@ -149,21 +149,24 @@ class $modify (UILayer) { UILayer::keyDown(key); - if (auto pl = PlayLayer::get(); Client::GetModuleEnabled("startpos-switcher")) + if (Client::GetModuleEnabled("startpos-switcher")) { - if (key == enumKeyCodes::KEY_Q) - as(pl)->setStartpos(as(pl)->m_fields->selectedIndex - 1); + if (auto pl = PlayLayer::get()) + { + if (key == enumKeyCodes::KEY_Q) + as(pl)->setStartpos(as(pl)->m_fields->selectedIndex - 1); - if (key == enumKeyCodes::KEY_E) - as(pl)->setStartpos(as(pl)->m_fields->selectedIndex + 1); + if (key == enumKeyCodes::KEY_E) + as(pl)->setStartpos(as(pl)->m_fields->selectedIndex + 1); + } } } #else void handleKeypress(cocos2d::enumKeyCodes key, bool down) { - if (down) + if (down && Client::GetModuleEnabled("startpos-switcher")) { - if (auto pl = PlayLayer::get(); Client::GetModuleEnabled("startpos-switcher")) + if (auto pl = PlayLayer::get()) { if (key == enumKeyCodes::KEY_Q) as(pl)->setStartpos(as(pl)->m_fields->selectedIndex - 1);