From 92c1c6b5cc3be9b9fafefb75efdb3223515e5c84 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Wed, 10 Jan 2024 00:25:45 +0100 Subject: [PATCH] hide random btn when theres only 1 page of results --- src/hooks/LevelBrowserLayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/LevelBrowserLayer.cpp b/src/hooks/LevelBrowserLayer.cpp index f880ae2..d214ff6 100644 --- a/src/hooks/LevelBrowserLayer.cpp +++ b/src/hooks/LevelBrowserLayer.cpp @@ -70,6 +70,9 @@ class $modify(BILevelBrowserLayer, LevelBrowserLayer) { if(auto lastButton = pageMenu->getChildByID("last-button"_spr)) { lastButton->setVisible(this->m_itemCount > BetterInfo::levelsPerPage(this->m_searchObject)); } + if(auto randomButton = pageMenu->getChildByID("random-button"_spr)) { + randomButton->setVisible(this->m_itemCount > BetterInfo::levelsPerPage(this->m_searchObject)); + } } }