@@ -9,54 +9,47 @@ bool isSettingEnabled(std::string setting) {
99}
1010
1111class $modify(MyMenuLayer, MenuLayer) {
12- struct Fields {
13- CCNode* bottomMenu;
14- CCNode* socialMediaMenu;
15- CCNode* moreGamesMenu;
16- };
17-
18- bool init () {
12+ bool init () override {
1913 if (!MenuLayer::init ()) {
2014 return false ;
2115 }
2216
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" );
17+ auto const bottomMenu = this ->getChildByID (" bottom-menu" );
18+ auto const socialMediaMenu = this ->getChildByID (" social-media-menu" );
19+ auto const moreGamesMenu = this ->getChildByID (" more-games-menu" );
2620
2721 if (isSettingEnabled (" hide-newgrounds-button" )) {
28- m_fields-> bottomMenu ->removeChildByID (" newgrounds-button" );
29- m_fields-> bottomMenu ->updateLayout ();
22+ bottomMenu->removeChildByID (" newgrounds-button" );
23+ bottomMenu->updateLayout ();
3024 }
3125
3226 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 ();
27+ socialMediaMenu->removeChildByID (" facebook-button" );
28+ socialMediaMenu->removeChildByID (" twitter-button" );
29+ socialMediaMenu->removeChildByID (" youtube-button" );
30+ socialMediaMenu->removeChildByID (" twitch-button" );
31+ socialMediaMenu->removeChildByID (" discord-button" );
32+ socialMediaMenu->updateLayout ();
3933 }
4034
4135 if (isSettingEnabled (" hide-robtop-logo" )) {
42- m_fields-> socialMediaMenu ->removeChildByID (" robtop-logo-button" );
43- m_fields-> socialMediaMenu ->updateLayout ();
36+ socialMediaMenu->removeChildByID (" robtop-logo-button" );
37+ socialMediaMenu->updateLayout ();
4438 }
4539 else if (isSettingEnabled (" hide-social-media-buttons" )) {
46- CCNode* robtopButtonNode =
47- m_fields->socialMediaMenu ->getChildByID (" robtop-logo-button" );
48- CCNode* bottomMenuButton = m_fields->bottomMenu ->getChildByID (" settings-button" );
40+ CCNode* const robtopButtonNode = socialMediaMenu->getChildByID (" robtop-logo-button" );
41+ CCNode* const bottomMenuButton = bottomMenu->getChildByID (" settings-button" );
4942 robtopButtonNode->setPositionY (bottomMenuButton->getPositionY ());
50- m_fields-> socialMediaMenu ->updateLayout ();
43+ socialMediaMenu->updateLayout ();
5144 }
5245
5346#ifdef GEODE_IS_ANDROID
5447 if (Loader::get ()->isModLoaded (" geode.devtools" ))
5548 return true ;
5649#endif
5750 if (isSettingEnabled (" hide-more-games-button" )) {
58- m_fields-> moreGamesMenu ->removeChildByID (" more-games-button" );
59- m_fields-> moreGamesMenu ->updateLayout ();
51+ moreGamesMenu->removeChildByID (" more-games-button" );
52+ moreGamesMenu->updateLayout ();
6053 }
6154
6255 return true ;
0 commit comments