Skip to content

Commit

Permalink
Merge pull request #5 from elnexreal/Reinmmar/main
Browse files Browse the repository at this point in the history
thx, i love u
  • Loading branch information
pundang authored Jul 15, 2024
2 parents 2430504 + 35b04c1 commit a2c3f97
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
6 changes: 6 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"homepage": "https://github.com/elnexreal"
},
"settings": {
"enableShuffleButton": {
"type": "bool",
"default": true,
"description": "Enables the <cj>shuffle button</c> in the main menu",
"name": "Enable shuffle button"
},
"enableNotification": {
"type": "bool",
"default": true,
Expand Down
24 changes: 13 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,21 @@ struct MenuLayerHook : Modify<MenuLayerHook, MenuLayer> {
}

// add a shuffle button
auto menu = getChildByID("right-side-menu");

auto btn = CCMenuItemSpriteExtra::create(
CircleButtonSprite::create(
CCSprite::create("shuffle-btn-sprite.png"_spr)
),
this,
menu_selector(MenuLayerHook::shuffleBtn)
);
if (Mod::get()->getSettingValue<bool>("enableShuffleButton")) {
auto menu = getChildByID("right-side-menu");

auto btn = CCMenuItemSpriteExtra::create(
CircleButtonSprite::create(
CCSprite::create("shuffle-btn-sprite.png"_spr)
),
this,
menu_selector(MenuLayerHook::shuffleBtn)
);

menu->addChild(btn);
menu->addChild(btn);

menu->updateLayout();
menu->updateLayout();
}

return true;
}
Expand Down

0 comments on commit a2c3f97

Please sign in to comment.