Skip to content

Commit e9cc123

Browse files
committed
1.2.2
1 parent c01a566 commit e9cc123

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else()
99
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
1010
endif()
1111

12-
project(NoStupidButtons VERSION 1.2.1)
12+
project(NoStupidButtons VERSION 1.2.2)
1313

1414
add_library(${PROJECT_NAME} SHARED
1515
src/main.cpp

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog for NoStupidButtons
22

3+
## v1.2.2
4+
- Added option to reposition the profile button if the social media buttons and the robtop logo are hidden
5+
36
## v1.2.1
47
- Hiding now works by <cg>only setting the buttons invisible and telling the layout to ignore invisible children</c>, instead of <cr>brutally murdering them</c> (and possibly causing problems with other mods)!
58
- iOS now doesn't remove the more games button if DevTools is enabled too!

mod.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.4.0",
2+
"geode": "4.5.0",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",
@@ -11,7 +11,7 @@
1111
},
1212
"id": "timestepyt.nostupidbuttons",
1313
"name": "NoStupidButtons",
14-
"version": "v1.2.1",
14+
"version": "v1.2.2",
1515
"developer": "TimeStepYT",
1616
"description": "This mod hides the buttons nobody uses!",
1717

@@ -40,11 +40,17 @@
4040
"default": true
4141
},
4242
"reposition-robtop-logo": {
43-
"name": "Reposition RobTop logo",
43+
"name": "Reposition RobTop Logo",
4444
"description": "Repositions the RobTop logo in a way that I (the mod developer) find nicer to look at when hiding the social media buttons.",
4545
"type": "bool",
4646
"default": true
4747
},
48+
"reposition-profile-btn": {
49+
"name": "Reposition profile Button",
50+
"description": "Repositions the profile button to be next to the bottom menu",
51+
"type": "bool",
52+
"default": true
53+
},
4854
"hide-robtop-logo": {
4955
"name": "Hide RobTop Logo",
5056
"description": "Toggles if the RobTop logo should be hidden in the Main Menu",

src/main.cpp

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
using namespace geode::prelude;
44

5-
#include <Geode/modify/MenuLayer.hpp>
65
#include <Geode/modify/CreatorLayer.hpp>
6+
#include <Geode/modify/MenuLayer.hpp>
77

88
bool isSettingEnabled(std::string setting) {
99
return Mod::get()->getSettingValue<bool>(setting);
@@ -15,7 +15,7 @@ void kys(CCNode* victim) {
1515

1616
void ignoreInvisible(CCNode* menu) {
1717
if (!menu) return;
18-
18+
1919
auto layout = menu->getLayout();
2020
if (!layout) return;
2121

@@ -56,25 +56,42 @@ class $modify(MyMenuLayer, MenuLayer) {
5656
kys(ytBtn);
5757
kys(twitchBtn);
5858
kys(discordBtn);
59-
59+
6060
socialMediaMenu->updateLayout();
6161
}
62-
62+
6363
if (isSettingEnabled("hide-robtop-logo")) {
6464
auto robtopBtn = socialMediaMenu->getChildByID("robtop-logo-button");
65-
65+
6666
ignoreInvisible(socialMediaMenu);
6767

6868
kys(robtopBtn);
69-
69+
7070
socialMediaMenu->updateLayout();
7171
}
72+
7273
else if (isSettingEnabled("hide-social-media-buttons") && isSettingEnabled("reposition-robtop-logo")) {
7374
CCNode* const robtopButtonNode = socialMediaMenu->getChildByID("robtop-logo-button");
7475
CCNode* const bottomMenuButton = bottomMenu->getChildByID("settings-button");
7576
robtopButtonNode->setPositionY(bottomMenuButton->getPositionY());
7677
}
7778

79+
if (isSettingEnabled("hide-social-media-buttons") && isSettingEnabled("hide-robtop-logo")) {
80+
socialMediaMenu->setVisible(false);
81+
82+
if (isSettingEnabled("reposition-profile-btn")) {
83+
auto profileMenu = this->getChildByID("profile-menu");
84+
auto usernameLabel = this->getChildByID("player-username");
85+
86+
float prevY = profileMenu->getPositionY();
87+
float newY = bottomMenu->getPositionY();
88+
float yOffset = newY - prevY;
89+
90+
profileMenu->setPositionY(newY);
91+
usernameLabel->setPositionY(usernameLabel->getPositionY() + yOffset);
92+
}
93+
}
94+
7895
#ifdef GEODE_IS_MOBILE
7996
if (Loader::get()->isModLoaded("geode.devtools"))
8097
return true;
@@ -84,7 +101,7 @@ class $modify(MyMenuLayer, MenuLayer) {
84101
auto moreGamesButton = moreGamesMenu->getChildByID("more-games-button");
85102

86103
ignoreInvisible(moreGamesMenu);
87-
104+
88105
kys(moreGamesButton);
89106

90107
moreGamesMenu->updateLayout();
@@ -94,7 +111,6 @@ class $modify(MyMenuLayer, MenuLayer) {
94111
}
95112
};
96113

97-
98114
class $modify(MyCreatorLayer, CreatorLayer) {
99115
bool init() {
100116
if (!CreatorLayer::init()) return false;

0 commit comments

Comments
 (0)