Skip to content

Commit c04c2dd

Browse files
committed
okay fix it for real this time
1 parent 442b9a6 commit c04c2dd

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.5.0",
2+
"geode": "4.6.1",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",

src/Keybinds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool Bind::isEqual(Bind* other) const {
7979
}
8080

8181
CCNode* Bind::createLabel() const {
82-
return CCLabelBMFont::create(this->toString().c_str(), "goldFont.fnt");
82+
return CCLabelBMFont::create(this->toString().c_str(), "bigFont.fnt");
8383
}
8484

8585
CCNodeRGBA* Bind::createBindSprite() const {

src/UILayer.cpp

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,34 @@
1515
using namespace geode::prelude;
1616
using namespace keybinds;
1717

18-
static void addBindSprites(CCNode* target, const char* action) {
18+
static void addBindSprites(CCNodeRGBA* target, const char* action) {
19+
if (target == nullptr) return;
1920
target->removeAllChildren();
2021

2122
auto bindContainer = CCNode::create();
22-
bindContainer->setScale(.65f);
2323
bool first = true;
2424
for (auto& bind : BindManager::get()->getBindsFor(action)) {
2525
if (!first) {
26-
bindContainer->addChild(CCLabelBMFont::create("/", "bigFont.fnt"));
26+
auto separator = CCLabelBMFont::create("/", "bigFont.fnt");
27+
separator->setScale(.8f);
28+
separator->setOpacity(target->getOpacity());
29+
bindContainer->addChild(separator);
2730
}
2831
first = false;
29-
bindContainer->addChild(bind->createLabel());
32+
auto label = bind->createLabel();
33+
label->setScale(.8f);
34+
if (auto rgba = typeinfo_cast<CCRGBAProtocol*>(label)) {
35+
rgba->setOpacity(target->getOpacity());
36+
}
37+
bindContainer->addChild(label);
3038
}
3139
bindContainer->setID("binds"_spr);
3240
bindContainer->setContentSize({
33-
target->getContentSize().width / bindContainer->getScale(), 40.f
41+
target->getScaledContentWidth(), 40.f
3442
});
35-
bindContainer->setLayout(RowLayout::create());
43+
bindContainer->setLayout(SimpleRowLayout::create()->setMainAxisScaling(AxisScaling::ScaleDown));
3644
bindContainer->setAnchorPoint({ .5f, .5f });
37-
bindContainer->setPosition(target->getContentSize().width / 2, -1.f);
45+
bindContainer->setPosition(target->getContentWidth() / 2, -1.f);
3846
target->addChild(bindContainer);
3947
}
4048

@@ -256,15 +264,15 @@ struct $modify(UILayer) {
256264
});
257265
// display practice mode button keybinds
258266
if (auto menu = this->getChildByID("checkpoint-menu")) {
259-
if (auto add = menu->getChildByID("add-checkpoint-button")) {
267+
if (auto add = typeinfo_cast<CCMenuItemSpriteExtra*>(menu->getChildByID("add-checkpoint-button"))) {
260268
addBindSprites(
261-
static_cast<CCMenuItemSpriteExtra*>(add)->getNormalImage(),
269+
typeinfo_cast<CCNodeRGBA*>(add->getNormalImage()),
262270
"robtop.geometry-dash/place-checkpoint"
263271
);
264272
}
265-
if (auto rem = menu->getChildByID("remove-checkpoint-button")) {
273+
if (auto rem = typeinfo_cast<CCMenuItemSpriteExtra*>(menu->getChildByID("remove-checkpoint-button"))) {
266274
addBindSprites(
267-
static_cast<CCMenuItemSpriteExtra*>(rem)->getNormalImage(),
275+
typeinfo_cast<CCNodeRGBA*>(rem->getNormalImage()),
268276
"robtop.geometry-dash/delete-checkpoint"
269277
);
270278
}

0 commit comments

Comments
 (0)