diff --git a/src/Client/ClientSetup.h b/src/Client/ClientSetup.h index 59165bc..34fce9e 100644 --- a/src/Client/ClientSetup.h +++ b/src/Client/ClientSetup.h @@ -52,9 +52,11 @@ class ClientUtils level->modules.push_back(new Module("Noclip", "noclip", "Prevents the player from dying")); level->modules.push_back(new Module("Instant Complete", "instant", "Instantly completes a level.\nMay not work because of the Geometry Dash anti-cheat.\nUsing this cheat on a rated level WILL GET YOU LEADERBOARD BANNED")); - #ifndef GEODE_IS_ANDROID + + level->modules.push_back(new Module("Confirm Practice", "conf-prac", "confirm practice mode help")); + level->modules.push_back(new Module("Confirm Restart", "conf-res", "confirm restart help")); + level->modules.push_back(new Module("Force Platformer", "force-plat", "Force Platformer mode on all levels.\nOnly supported on Windows for the time being")); - #endif //level->modules.push_back(new Module("Startpos Switcher", "startpos-switcher", "Switch between start-positions in the level")); //level->modules.push_back(new Module("Show Hitboxes", "hitbox")); @@ -84,9 +86,6 @@ class ClientUtils bypass->modules.push_back(new Module("Character Limit", "char-limit", "Removes the character limit on input fields")); bypass->modules.push_back(new Module("Character Filter", "char-filter", "Allows you to input any character in input fields")); - bypass->modules.push_back(new Module("Confirm Practice", "conf-prac", "confirm practice mode help")); - bypass->modules.push_back(new Module("Confirm Restart", "conf-res", "confirm restart help")); - bypass->modules.push_back(new Module("Level Edit", "level-edit", "Allows you to edit any level")); #ifdef GEODE_IS_ANDROID diff --git a/src/Client/Dropdown.h b/src/Client/Dropdown.h index 069839c..90f9e70 100644 --- a/src/Client/Dropdown.h +++ b/src/Client/Dropdown.h @@ -17,6 +17,8 @@ class Dropdown : public CCMenu { std::vector strs; std::vector btns; + cocos2d::SEL_MenuHandler event; + public: void onToggleVisible(CCObject*) { @@ -41,8 +43,43 @@ class Dropdown : public CCMenu { void setVis(bool n) { CCPoint s = ccp(size.width, size.height * (1 + (open ? strs.size() : 0))); - + bg->stopAllActions(); bg->runAction(CCEaseInOut::create( CCContentSizeTo::create(0.35f, s), 2.0f)); + + if (n) + { + for (size_t i = 0; i < btns.size(); i++) + { + btns[i]->stopAllActions(); + + btns[i]->runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.1f * i), CCEaseInOut::create(CCScaleTo::create(0.5f, 1), 2))); + } + } + else + { + std::reverse(btns.begin(), btns.end()); + + for (size_t i = 0; i < btns.size(); i++) + { + btns[i]->stopAllActions(); + + btns[i]->runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.1f * i), CCEaseInOut::create(CCScaleTo::create(0.35f, 0), 2))); + } + + std::reverse(btns.begin(), btns.end()); + } + } + + void onPress(CCObject* sender) + { + open = false; + setSelected(as(sender)->getTag()); + + btn->runAction(CCEaseBackOut::create(CCScaleTo::create(0.35f, 1, 1))); + setVis(false); + + if (event) + (this->*event)(sender); } bool init(CCSize size, std::vector strs, cocos2d::SEL_MenuHandler callback, int sel = 0) @@ -52,6 +89,7 @@ class Dropdown : public CCMenu { this->size = size; this->strs = strs; + this->event = callback; this->setContentSize(size); bg = CCScale9Sprite::create("square02b_small.png"); @@ -63,9 +101,9 @@ class Dropdown : public CCMenu { bg->setScaleY(-1); this->addChild(bg); - sprBtn = CCSprite::createWithSpriteFrameName("edit_upBtn_001.png"); + sprBtn = CCSprite::createWithSpriteFrameName("edit_downBtn_001.png"); sprBtn->setColor({200, 200, 200}); - sprBtn2 = CCSprite::createWithSpriteFrameName("edit_upBtn_001.png"); + sprBtn2 = CCSprite::createWithSpriteFrameName("edit_downBtn_001.png"); btn = CCMenuItemSprite::create(sprBtn, sprBtn2, this, menu_selector(Dropdown::onToggleVisible)); btn->setPosition(size + ccp(-7.5f - sprBtn->getContentSize().width / 2, -1 * (size.height / 2))); this->addChild(btn); @@ -75,6 +113,21 @@ class Dropdown : public CCMenu { tex->limitLabelWidth(size.width - 10 - (7.5f + sprBtn->getContentSize().width), 0.7f, 0.05f); this->addChild(tex); + for (size_t s = 0; s < strs.size(); s++) + { + auto lbl = CCLabelBMFont::create(strs[s].c_str(), "bigFont.fnt"); + lbl->limitLabelWidth(size.width, 0.7f, 0.01f); + + auto btn = CCMenuItemSpriteExtra::create(lbl, this, menu_selector(Dropdown::onPress)); + btn->setPosition(ccp(size.width / 2, (size.height * (s + 1) * -1) + size.height / 2 )); + btn->setScale(0); + btn->setTag(s); + this->addChild(btn); + + btns.push_back(btn); + } + + this->registerWithTouchDispatcher(); cocos::handleTouchPriority(this); diff --git a/src/Client/Window.h b/src/Client/Window.h index 1bfa74e..5182135 100644 --- a/src/Client/Window.h +++ b/src/Client/Window.h @@ -694,7 +694,7 @@ class Config : public Window yt->setID("https://www.youtube.com/@TheSillyDoggo"); menu->addChild(yt); - menu->addChild(Dropdown::create({130, 30}, {"Boobs", "b", "c"}, nullptr)); + menu->addChild(Dropdown::create({130, 30}, {"hi", "b", "c"}, nullptr)); } }; diff --git a/src/Hacks/ForcePlatformer.cpp b/src/Hacks/ForcePlatformer.cpp index ec2050d..3c383a6 100644 --- a/src/Hacks/ForcePlatformer.cpp +++ b/src/Hacks/ForcePlatformer.cpp @@ -4,8 +4,6 @@ using namespace geode::prelude; -#ifdef GEODE_IS_WINDOWS - class $modify (PlayerObject) { virtual void update(float dt) @@ -15,6 +13,4 @@ class $modify (PlayerObject) PlayerObject::update(dt); } -}; - -#endif \ No newline at end of file +}; \ No newline at end of file