@@ -4,28 +4,60 @@ using namespace geode::prelude;
44
55#include < Geode/modify/MenuLayer.hpp>
66
7+ bool isSettingEnabled (std::string setting) {
8+ return Mod::get ()->getSettingValue <bool >(setting);
9+ }
10+
711class $modify(MyMenuLayer, MenuLayer) {
12+ struct Fields {
13+ CCNode *bottomMenu;
14+ CCNode *socialMediaMenu;
15+ CCNode *moreGamesMenu;
16+ };
17+
818 bool init () {
919 if (!MenuLayer::init ()) {
1020 return false ;
11- }
21+ }
22+
23+ m_fields->bottomMenu = this ->getChildByID (" bottom-menu" );
24+ m_fields->socialMediaMenu = this ->getChildByID (" social-media-menu" );
25+ m_fields->moreGamesMenu = this ->getChildByID (" more-games-menu" );
1226
13- if (Mod::get ()->getSettingValue <bool >(" hide-newgrounds-button" )) {
14- auto bottomMenu = this ->getChildByID (" bottom-menu" );
15- bottomMenu->removeChildByID (" newgrounds-button" );
16- bottomMenu->updateLayout ();
17- }
27+ if (isSettingEnabled (" hide-newgrounds-button" )) {
28+ m_fields->bottomMenu ->removeChildByID (" newgrounds-button" );
29+ m_fields->bottomMenu ->updateLayout ();
30+ }
31+
32+ if (isSettingEnabled (" hide-social-media-buttons" )) {
33+ m_fields->socialMediaMenu ->removeChildByID (" facebook-button" );
34+ m_fields->socialMediaMenu ->removeChildByID (" twitter-button" );
35+ m_fields->socialMediaMenu ->removeChildByID (" youtube-button" );
36+ m_fields->socialMediaMenu ->removeChildByID (" twitch-button" );
37+ m_fields->socialMediaMenu ->removeChildByID (" discord-button" );
38+ m_fields->socialMediaMenu ->updateLayout ();
39+ }
40+
41+ if (isSettingEnabled (" hide-robtop-logo" )) {
42+ m_fields->socialMediaMenu ->removeChildByID (" robtop-logo-button" );
43+ m_fields->socialMediaMenu ->updateLayout ();
44+ } else if (isSettingEnabled (" hide-social-media-buttons" )) {
45+ CCNode *robtopButtonNode =
46+ m_fields->socialMediaMenu ->getChildByID (" robtop-logo-button" );
47+ CCNode *bottomMenuButton = m_fields->bottomMenu ->getChildByID (" settings-button" );
48+ robtopButtonNode->setPositionY (bottomMenuButton->getPositionY ());
49+ m_fields->socialMediaMenu ->updateLayout ();
50+ }
1851
1952#ifdef GEODE_IS_ANDROID
20- if (Loader::get ()->isModLoaded (" geode.devtools" ))
21- return true ;
53+ if (Loader::get ()->isModLoaded (" geode.devtools" ))
54+ return true ;
2255#endif
23- if (Mod::get ()->getSettingValue <bool >(" hide-more-games-button" )) {
24- auto moreGamesMenu = this ->getChildByID (" more-games-menu" );
25- moreGamesMenu->removeChildByID (" more-games-button" );
26- moreGamesMenu->updateLayout ();
27- }
28-
29- return true ;
30- }
56+ if (isSettingEnabled (" hide-more-games-button" )) {
57+ m_fields->moreGamesMenu ->removeChildByID (" more-games-button" );
58+ m_fields->moreGamesMenu ->updateLayout ();
59+ }
60+
61+ return true ;
62+ }
3163};
0 commit comments