@@ -12,6 +12,7 @@ class TextureLoaderBetterMenu : public CCLayer {
1212};
1313static void setupshortcuts (CCNode* layer) {
1414 // setup vars
15+ int menupos = Mod::get ()->getSettingValue <SettingPosStruct>(" MenuPos-pos" ).m_pos ;
1516 cocos2d::CCSize winSize = CCDirector::get ()->getWinSize ();
1617 // create the menu
1718 CCMenu* SearchMenu = Build<CCMenu>::create ()
@@ -45,6 +46,24 @@ static void setupshortcuts(CCNode* layer) {
4546 .parent (SearchMenu)
4647 .id (" search-menu" _spr);
4748 }
49+
50+ if (Mod::get ()->getSettingValue <bool >(" Leaderboard-Shortcut" ) && !Loader::get ()->isModLoaded (" ninxout.redash" ) && layer->getChildByIDRecursive (" right-side-menu" )) {
51+ CCSprite* LeaderboardShortcut = CCSprite::createWithSpriteFrameName (
52+ " GJ_highscoreBtn_001.png"
53+ );
54+ LeaderboardShortcut->setScale (0.5 );
55+ auto Button = Build (LeaderboardShortcut)
56+ .intoMenuItem ([](auto target) {
57+ CreatorLayer::create ()->onLeaderboards (target);
58+ // reinterpret_cast<CreatorLayer*>(target)->onLeaderboards(target);
59+ })
60+ .pos (0 , 0 )
61+ .parent (layer->getChildByIDRecursive (" right-side-menu" ))
62+ .id (" Leaderboard-menu" _spr);
63+ layer->getChildByIDRecursive (" right-side-menu" )->updateLayout ();
64+ }
65+
66+
4867 if (Mod::get ()->getSettingValue <bool >(" TextureLDR-Shortcut" ) && (typeinfo_cast<CCMenuItemSpriteExtra*>(layer->getChildByIDRecursive (" geode.texture-loader/texture-loader-button" ))) && !Loader::get ()->isModLoaded (" ninxout.redash" ) ) {
4968 if (layer->getChildByID (" more-games-menu" )) {
5069 layer->getChildByID (" more-games-menu" )->setVisible (false );
@@ -57,7 +76,11 @@ static void setupshortcuts(CCNode* layer) {
5776 TextureLDRe->setID (" texture-loader-button" _spr);
5877 TextureLDRe->m_pfnSelector = geode_texture_loader_texture_loader_button->m_pfnSelector ;
5978 geode_texture_loader_texture_loader_button->setVisible (false ); // no crash by hiding it
79+ geode_texture_loader_texture_loader_button->removeFromParent ();
6080 SearchMenu->addChild (TextureLDRe);
81+ if (CCNode* Node = layer->getChildByID (" right-side-menu" )) {
82+ Node->updateLayout ();
83+ }
6184 }
6285 CCMenu* shortcutMenu = Build<CCMenu>::create ()
6386 .pos (7 , 6 )
@@ -166,8 +189,40 @@ static void setupshortcuts(CCNode* layer) {
166189 .parent (Menu2_2);
167190 }
168191 Menu2_2->updateLayout ();
169- SearchMenu->updateLayout ();
170192 shortcutMenu->updateLayout ();
193+ SearchMenu->updateLayout ();
194+ // log::debug("SETTING IS ON! {}", menupos);
195+ if (menupos == 1 ) {
196+ if (CCNode* rightSideMenu = layer->getChildByID (" right-side-menu" )){
197+ if (!Mod::get ()->getSettingValue <bool >(" RightSide" )) {
198+ rightSideMenu->setPositionY (rightSideMenu->getPositionY () + 40 );
199+ rightSideMenu->updateLayout ();
200+ };
201+ };
202+ if (SearchMenu->getChildrenCount () > 1 ) {
203+ SearchMenu->setPositionX (winSize.width - 110 );
204+ SearchMenu->setScale (0.425 );
205+ };
206+ } else {
207+ if (menupos == 2 ) {
208+ if (CCNode* rightSideMenu = layer->getChildByID (" right-side-menu" )){
209+ if (!Mod::get ()->getSettingValue <bool >(" RightSide" )) {
210+ rightSideMenu->setPositionY (rightSideMenu->getPositionY () + 40 );
211+ rightSideMenu->updateLayout ();
212+ };
213+ };
214+ };
215+ }
216+
217+ if (menupos > 2 ) {
218+ if (CCNode* rightSideMenu = layer->getChildByID (" right-side-menu" )) {
219+ if (rightSideMenu->getChildrenCount () > 3 ) {
220+ SearchMenu->setPositionX (winSize.width - 110 );
221+ SearchMenu->setScale (0.425 );
222+ rightSideMenu->updateLayout ();
223+ };
224+ };
225+ };
171226 // fixes with compact
172227 if (Mod::get ()->getSettingValue <bool >(" compact-main-menu" )) {
173228 if (CCNode* node = layer->getChildByIDRecursive (" shortcuts-menu-Fix" _spr)) node->setVisible (Loader::get ()->isModLoaded (" ninxout.redash" ));
0 commit comments