Skip to content

Commit

Permalink
fixed the mod for the newest geode beta
Browse files Browse the repository at this point in the history
  • Loading branch information
SCZSkyward authored Feb 13, 2024
1 parent 8206056 commit fd3c9aa
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 1 deletion.
96 changes: 96 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Include the Geode headers.
*/
#include <Geode/Geode.hpp>
/**
* Required to modify the MenuLayer class
*/
#include <Geode/modify/MenuLayer.hpp>

/**
* Brings cocos2d and all Geode namespaces
* to the current scope.
*/
using namespace geode::prelude;

/**
* Allows you to modify the MenuLayer
*/
class $modify(MenuLayer) {
bool init() {
if(!MenuLayer::init()) return false;

// Gets the social-media-menu child from the MenuLayer
auto socialmediamenu = this->getChildByID("social-media-menu");

// Removes the child robtop-logo-button from the socialmediamenu
socialmediamenu->removeChildByID("robtop-logo-button");

// Gets the twitch button child from the socialmediamenu
auto twitchbutton = socialmediamenu->getChildByID("twitch-button");

// Gets the discord button child from the socialmediamenu
auto discordbutton = socialmediamenu->getChildByID("discord-button");

// Gets the youtube button child from the socialmediamenu
auto youtubebutton = socialmediamenu->getChildByID("youtube-button");

// Gets the facebook button child from the socialmediamenu
auto facebookbutton = socialmediamenu->getChildByID("facebook-button");


if (Mod::get()->getSettingValue<bool>("switch-discord-twitch")) {
if (Mod::get()->getSettingValue<bool>("switch-discord-twitch"))
// Sets the discord button to X: 99, Y: 68.6
discordbutton->setPosition(99, 68.6);

// Lowers the scale of the socialmediamenu
socialmediamenu->setScale(0.9);

// Sets the position to X: 9, Y: -15
socialmediamenu->setPosition(9, -15);
return true;
// Sets the position to X: 128, Y: 39.6
discordbutton->setPosition(128, 39.6);

// Finally sets the twitch button to X: 99, Y: 39.6
twitchbutton->setPosition(99, 39.6);

// Lowers the scale of the socialmediamenu
socialmediamenu->setScale(0.9);

// Sets the position to X: 9, Y: -15
socialmediamenu->setPosition(9, -15);

// Sets the Y position of the youtube button to 39.6
youtubebutton->setPositionY(39.6);

// Sets the Y position of the facebook button to 39.6
facebookbutton->setPositionY(39.6);

return true;
} else {
twitchbutton->setPosition(128, 39.6);

discordbutton->setPosition(99, 39.6);

// Lowers the scale of the socialmediamenu
socialmediamenu->setScale(0.9);

// Sets the position to X: 9, Y: -15
socialmediamenu->setPosition(9, -15);

// Sets the Y position of the youtube button to 39.6
youtubebutton->setPositionY(39.6);

// Sets the Y position of the facebook button to 39.6
facebookbutton->setPositionY(39.6);


if (Mod::get()->getSettingValue<bool>("put-twitch-logo-ontop")) {
twitchbutton->setPosition(99, 68.6);
}
return true;
}
}
};
9 changes: 8 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"android": "2.205",
"win": "2.204"
},
"version": "v1.0.3",
"version": "v1.0.4",
"id": "skyward.no_robtop_logo",
"name": "No Robtop Logo",
"developer": "Skyward",
Expand All @@ -24,5 +24,12 @@
"type": "bool",
"default": false
}
,"put-twitch-logo-ontop": {
"name": "Put Twitch/Discord Button Ontop",
"description": "Makes the Twitch or Discord button ontop of the other logos"
,"type": "bool"
,"default": false

}
}
}

0 comments on commit fd3c9aa

Please sign in to comment.