Skip to content

Commit

Permalink
uncomment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 7, 2024
1 parent 4fa06c2 commit 831f740
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 14 deletions.
9 changes: 4 additions & 5 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cg>Geometry Dash</c> anti-cheat.\nUsing this cheat on a <co>rated level</c> <cr>WILL GET YOU LEADERBOARD BANNED</c>"));
#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 <cl>Windows</c> 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"));

Expand Down Expand Up @@ -84,9 +86,6 @@ class ClientUtils
bypass->modules.push_back(new Module("Character Limit", "char-limit", "Removes the <cl>character limit</c> on input fields"));
bypass->modules.push_back(new Module("Character Filter", "char-filter", "Allows you to input <cg>any</c> 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
Expand Down
59 changes: 56 additions & 3 deletions src/Client/Dropdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Dropdown : public CCMenu {
std::vector<std::string> strs;
std::vector<CCMenuItemSprite*> btns;

cocos2d::SEL_MenuHandler event;

public:
void onToggleVisible(CCObject*)
{
Expand All @@ -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<CCNode*>(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<std::string> strs, cocos2d::SEL_MenuHandler callback, int sel = 0)
Expand All @@ -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");
Expand All @@ -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);
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Client/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
};

Expand Down
6 changes: 1 addition & 5 deletions src/Hacks/ForcePlatformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using namespace geode::prelude;

#ifdef GEODE_IS_WINDOWS

class $modify (PlayerObject)
{
virtual void update(float dt)
Expand All @@ -15,6 +13,4 @@ class $modify (PlayerObject)

PlayerObject::update(dt);
}
};

#endif
};

0 comments on commit 831f740

Please sign in to comment.