Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 3, 2024
1 parent 08bb35f commit 364054b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 19 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Binary file added resources/sprites/qolmodButtonBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/sprites/qolmodButtonOverlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions src/Client/AndroidBall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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))
Expand All @@ -164,7 +167,7 @@ void AndroidBall::UpdateVisible(bool i)
if (PlayLayer::get())
{
btn->setOpacity(50);
l->setOpacity(50);
btnOverlay->setOpacity(50);

i = false;
}
Expand Down Expand Up @@ -200,7 +203,7 @@ void AndroidBall::UpdateVisible(bool i)
if (i)
{
btn->setOpacity(op);
l->setOpacity(op);
btnOverlay->setOpacity(op);
}
else
{
Expand All @@ -211,7 +214,7 @@ void AndroidBall::UpdateVisible(bool i)
action2->setTag(69);

btn->runAction(action);
l->runAction(action2);
btnOverlay->runAction(action2);
}
}
}
Expand Down Expand Up @@ -263,8 +266,8 @@ class $modify (AppDelegate)
if (getChildOfType<LoadingLayer>(newScene, 0))
return; // fixes texture ldr

if (AndroidBall::get())
AndroidBall::get()->removeFromParent();
if (auto ball = getChildOfType<AndroidBall>(newScene, 0))
ball->removeFromParent();

newScene->addChild(AndroidBall::create());

Expand Down
3 changes: 2 additions & 1 deletion src/Client/AndroidBall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 10 additions & 7 deletions src/Hacks/StartposSwitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<StartposPlayLayer*>(pl)->setStartpos(as<StartposPlayLayer*>(pl)->m_fields->selectedIndex - 1);
if (auto pl = PlayLayer::get())
{
if (key == enumKeyCodes::KEY_Q)
as<StartposPlayLayer*>(pl)->setStartpos(as<StartposPlayLayer*>(pl)->m_fields->selectedIndex - 1);

if (key == enumKeyCodes::KEY_E)
as<StartposPlayLayer*>(pl)->setStartpos(as<StartposPlayLayer*>(pl)->m_fields->selectedIndex + 1);
if (key == enumKeyCodes::KEY_E)
as<StartposPlayLayer*>(pl)->setStartpos(as<StartposPlayLayer*>(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<StartposPlayLayer*>(pl)->setStartpos(as<StartposPlayLayer*>(pl)->m_fields->selectedIndex - 1);
Expand Down

0 comments on commit 364054b

Please sign in to comment.