diff --git a/mod.json b/mod.json index 38458b6..617b6c7 100644 --- a/mod.json +++ b/mod.json @@ -20,6 +20,12 @@ "homepage": "https://github.com/elnexreal" }, "settings": { + "enableShuffleButton": { + "type": "bool", + "default": true, + "description": "Enables the shuffle button in the main menu", + "name": "Enable shuffle button" + }, "enableNotification": { "type": "bool", "default": true, diff --git a/src/main.cpp b/src/main.cpp index 4f736c0..59b2dda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -98,19 +98,21 @@ struct MenuLayerHook : Modify { } // 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("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; }