Skip to content

Commit 7148cea

Browse files
authored
Big Button Toggle and Fixes (#24)
* Big Button Toggle and Fixes * Fix oversight
1 parent 9547786 commit 7148cea

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

mod.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "3.0.0-beta.1",
2+
"geode": "3.0.0-beta.4",
33
"gd": {
44
"win": "2.206",
55
"android": "2.206",
@@ -55,6 +55,12 @@
5555
"description": "Enable or disable auto pausing after getting the goal percentage during a round of roulette.",
5656
"type": "bool",
5757
"default": true
58+
},
59+
"use-big-button": {
60+
"name": "Use big button",
61+
"description": "Use a big button rather than the small circle button. Only works with Pages API installed.",
62+
"type": "bool",
63+
"default": false
5864
}
5965
}
6066
}

resources/RL_blankBtn_001.png

-14.7 KB
Binary file not shown.

resources/RL_btn_big.png

207 KB
Loading

src/layers/CreatorLayer.cpp

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,34 @@ class $modify(RouletteButton, CreatorLayer)
2020

2121
auto winSize = CCDirector::sharedDirector()->getWinSize();
2222

23-
auto menu = CCMenu::create();
24-
menu->setPosition({ 24.f, winSize.height / 2 });
25-
menu->setID("center-left-menu"_spr);
26-
this->addChild(menu);
27-
28-
// this still sucks :(
29-
auto rouletteButton = CCMenuItemSpriteExtra::create(
30-
CCSprite::create("RL_blankBtn_001.png"_spr),
31-
this,
32-
menu_selector(RouletteButton::onRouletteButton)
33-
);
34-
rouletteButton->setID("roulette-button"_spr);
35-
auto rouletteSprite = CCSprite::create("RL_btn_001.png"_spr);
36-
rouletteSprite->setScale(.725f);
37-
rouletteSprite->setPosition({ 22.5f, 23.75f });
38-
rouletteButton->addChild(rouletteSprite);
39-
40-
menu->addChild(rouletteButton);
23+
if(Mod::get()->getSettingValue<bool>("use-big-button") && Loader::get()->isModLoaded("alphalaneous.pages_api")) {
24+
if(auto menu = getChildByID("creator-buttons-menu")) {
25+
auto spr = CCSprite::create("RL_btn_big.png"_spr);
26+
spr->setScale(0.842);
27+
auto rouletteButton = CCMenuItemSpriteExtra::create(
28+
spr,
29+
this,
30+
menu_selector(RouletteButton::onRouletteButton)
31+
);
32+
rouletteButton->setID("roulette-button"_spr);
33+
menu->addChild(rouletteButton);
34+
}
35+
}
36+
else {
37+
if(auto menu = getChildByID("exit-menu")) {
38+
auto spr = CircleButtonSprite::createWithSprite("RL_btn_001.png"_spr, 1.0f, CircleBaseColor::Green, CircleBaseSize::Small);
39+
40+
auto rouletteButton = CCMenuItemSpriteExtra::create(
41+
spr,
42+
this,
43+
menu_selector(RouletteButton::onRouletteButton)
44+
);
45+
rouletteButton->setID("roulette-button"_spr);
46+
menu->addChild(rouletteButton);
47+
typeinfo_cast<AxisLayout*>(menu->getLayout())->setAxisReverse(true);
48+
menu->updateLayout();
49+
}
50+
}
4151

4252
return true;
4353
}

0 commit comments

Comments
 (0)