Skip to content

Commit 29b84b8

Browse files
committed
hide social media buttons and optionally robtop logo
1 parent b3d53b3 commit 29b84b8

File tree

3 files changed

+94
-42
lines changed

3 files changed

+94
-42
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog for NoStupidButtons
2+
3+
## v1.1.0
4+
- Hide Social Media buttons and optionally the RobTop logo as well
5+
- Fix typo in mod description
6+
7+
## v1.0.0
8+
- Initial Release

mod.json

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
{
2-
"geode": "3.1.1",
3-
"gd": {
4-
"win": "2.206",
5-
"android": "2.206",
6-
"mac": "2.206",
7-
"ios": "2.206"
8-
},
9-
"id": "timestepyt.nostupidbuttons",
10-
"name": "NoStupidButtons",
11-
"version": "v1.0.0",
12-
"developer": "TimeStepYT",
13-
"description": "This mod hides the Newgrounds button and the More Games button",
2+
"geode": "3.1.1",
3+
"gd": {
4+
"win": "2.206",
5+
"android": "2.206",
6+
"mac": "2.206",
7+
"ios": "2.206"
8+
},
9+
"id": "timestepyt.nostupidbuttons",
10+
"name": "NoStupidButtons",
11+
"version": "v1.1.0",
12+
"developer": "TimeStepYT",
13+
"description": "This mod hides the Newgrounds button and the More Games button",
1414

15-
"settings": {
16-
"hide-newgrounds-button": {
17-
"name": "Hide Newgrounds Button",
18-
"description": "Toggles if the Newgrounds Button should be hidden in the Main Menu",
19-
"type": "bool",
20-
"default": true
21-
},
22-
"hide-more-games-button": {
23-
"name": "Hide More Games Button",
24-
"description": "Toggles if the More Games button should be hidden in the Main Menu. Will not work if DevTools is insalled on Android",
25-
"type": "bool",
26-
"default": true
27-
}
28-
}
15+
"settings": {
16+
"hide-newgrounds-button": {
17+
"name": "Hide Newgrounds Button",
18+
"description": "Toggles if the Newgrounds Button should be hidden in the Main Menu",
19+
"type": "bool",
20+
"default": true
21+
},
22+
"hide-more-games-button": {
23+
"name": "Hide More Games Button",
24+
"description": "Toggles if the More Games button should be hidden in the Main Menu. Will not work if DevTools is insalled on Android",
25+
"type": "bool",
26+
"default": true
27+
},
28+
"hide-social-media-buttons": {
29+
"name": "Hide Social Media Buttons",
30+
"description": "Toggles if the Social Media buttons should be hidden in the Main Menu",
31+
"type": "bool",
32+
"default": true
33+
},
34+
"hide-robtop-logo": {
35+
"name": "Hide RobTop Logo",
36+
"description": "Toggles if the RobTop logo should be hidden in the Main Menu. Default is off because it's kinda immoral to remove a watermark",
37+
"type": "bool",
38+
"default": false
39+
}
40+
}
2941
}

src/main.cpp

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
711
class $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

Comments
 (0)