Skip to content

Commit 705bfd7

Browse files
committed
asdf
1 parent 73d17b8 commit 705bfd7

File tree

6 files changed

+73
-20
lines changed

6 files changed

+73
-20
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Improved Labels Menu
77
- Added ability to move labels to different corners
88
- Added TPS Bypass
9+
- Added Mac Support
910

1011
# 1.3.5
1112

src/Client/ClientSetup.h

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class ClientUtils
3333
setupDevtools();
3434

3535
Client::instance->onPostSetup();
36+
37+
registerIncompatibilitys();
3638
}
3739

3840
#pragma region Setup Windows
@@ -63,9 +65,7 @@ class ClientUtils
6365
level->windowPos = ImVec2(50 + (50 + (Client::instance->tileSize.x)) * 1, 50);
6466

6567
level->modules.push_back(new Module("Noclip", "noclip", "Prevents the player from dying"));
66-
#ifndef GEODE_IS_MACOS
6768
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>", false, "<cr>Warning!</c>\nUsing this cheat on a <co>rated level</c> <cr>WILL GET YOU LEADERBOARD BANNED</c>", true));
68-
#endif
6969

7070
level->modules.push_back(new Module("Confirm Practice", "conf-prac", "confirm practice mode help"));
7171
level->modules.push_back(new Module("Confirm Restart", "conf-res", "confirm restart help"));
@@ -215,7 +215,7 @@ class ClientUtils
215215
cosmetic->modules.push_back(new Module("No Wave Pulse", "no-wave-pulse", "Disables wave pulse"));
216216

217217
cosmetic->modules.push_back(new Module("Pulse Menu", "menu-pulse", "Pulses the <cg>Geometry Dash</c> logo on the main menu to the music"));
218-
#ifndef GEODE_IS_ANDROID
218+
#ifdef GEODE_IS_WINDOWS
219219
cosmetic->modules.push_back(new Module("Pulse Scene", "all-pulse", "Pulses the CCScene to the music, <cl>why would you want this?</c>"));
220220
#endif
221221

@@ -385,5 +385,37 @@ class ClientUtils
385385
Client::instance->windows.push_back(devtools);
386386
}
387387

388+
static void registerIncompatibilitys()
389+
{
390+
#ifdef GEODE_IS_MACOS
391+
392+
std::vector<std::string> macInc = {
393+
"instant",
394+
"show-hitboxes",
395+
"show-hitboxes-on-death",
396+
"no-static",
397+
"all-plat",
398+
"show-trajectory",
399+
"show-layout",
400+
"menu-pulse",
401+
"no-trans",
402+
"verify-hack",
403+
"coin-tracers",
404+
"no-wave",
405+
"solid-wave",
406+
"no-shake"
407+
};
408+
409+
for (auto hack : macInc)
410+
{
411+
auto mod = Client::GetModule(hack);
412+
413+
mod->setIncompatible("This mod has not <cg>yet</c> been ported to <cl>Mac OS</c>");
414+
mod->enabled = false;
415+
}
416+
417+
#endif
418+
}
419+
388420
#pragma endregion
389421
};

src/Client/Module.cpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ void Module::onToggleAndroid(CCObject* sender)
2525
{
2626
auto dat = static_cast<Module*>(static_cast<CCNode*>(sender)->getUserData());
2727

28+
if (dat->isInComp)
29+
{
30+
as<CCMenuItemToggler*>(sender)->toggle(!as<CCMenuItemToggler*>(sender)->isToggled());
31+
return FLAlertLayer::create(dat->name.c_str(), dat->inCompAlert.c_str(), "OK")->show();
32+
}
33+
2834
if (dat->useAlert && !dat->vAlert)
2935
{
3036
FLAlertLayer::create(dat->name.c_str(), dat->alert.c_str(), "OK")->show();
@@ -58,6 +64,9 @@ void Module::onToggleAndroid(CCObject* sender)
5864

5965
void Module::makeAndroid(CCNode* menu, CCPoint pos)
6066
{
67+
if (inCompAlert.empty())
68+
this->isInComp = false;
69+
6170
auto btn = CCMenuItemToggler::createWithStandardSprites(menu, menu_selector(Module::onToggleAndroid), 0.75f);
6271
btn->setUserData(this);
6372
btn->setID(id);
@@ -68,9 +77,9 @@ void Module::makeAndroid(CCNode* menu, CCPoint pos)
6877
label->setAnchorPoint(ccp(0, 0.5f));
6978
label->setScale(0.575f);
7079
label->setPosition(pos + ccp(15, 0));
71-
label->limitLabelWidth(110 - ((options.size() != 0) ? 3 : 0), 0.575f, 0.1f);
80+
label->limitLabelWidth(110 - ((options.size() != 0) ? 3 : 0) + (isInComp ? 17.5f : 0), 0.575f, 0.1f);
7281

73-
if (description.size() != 0 && options.size() == 0)
82+
if (description.size() != 0 && options.size() == 0 && !isInComp)
7483
{
7584
auto info = CCMenuItemSpriteExtra::create(CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png"), menu, menu_selector(Module::onInfoAndroid));
7685
info->setScale(0.55f);
@@ -83,7 +92,7 @@ void Module::makeAndroid(CCNode* menu, CCPoint pos)
8392
menu->addChild(info);
8493
}
8594

86-
if (options.size() != 0)
95+
if (options.size() != 0 && !isInComp)
8796
{
8897
auto options = CCMenuItemSpriteExtra::create(CCSprite::createWithSpriteFrameName("GJ_plus3Btn_001.png"), menu, menu_selector(Module::onOptionsAndroid));
8998
options->setUserData(this);
@@ -92,10 +101,23 @@ void Module::makeAndroid(CCNode* menu, CCPoint pos)
92101
menu->addChild(options);
93102
}
94103

104+
if (isInComp)
105+
{
106+
label->setOpacity(150);
107+
btn->m_onButton->setOpacity(150);
108+
btn->m_offButton->setOpacity(150);
109+
}
110+
95111
menu->addChild(btn);
96112
menu->addChild(label);
97113
}
98114

115+
void Module::setIncompatible(std::string str)
116+
{
117+
this->isInComp = true;
118+
this->inCompAlert = str;
119+
}
120+
99121
void ColourDelegate::updateColor(cocos2d::ccColor4B const& color)
100122
{
101123
log::info("colour: {}", color);

src/Client/Module.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ class Module
4646
std::string id;
4747
std::string description;
4848
std::string alert;
49+
std::string inCompAlert;
4950
bool enabled;
5051
bool useAlert;
5152
bool onceAlert;
53+
bool isInComp;
5254

5355
bool vAlert;
5456

@@ -162,6 +164,8 @@ class Module
162164
void onInfoAndroid(CCObject* sender);
163165
void onOptionsAndroid(CCObject* sender);
164166
void onToggleAndroid(CCObject* sender);
167+
168+
void setIncompatible(std::string str);
165169

166170
virtual void makeAndroid(CCNode* menu, CCPoint pos);
167171
};

src/Client/Window.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,15 @@ class Universal : public Window
826826

827827
auto pos = ccp(menu->getContentSize().width, 0) + ccp(-58, 22);
828828

829+
CCMenuItemSpriteExtra* btn = nullptr;
830+
831+
#ifndef GEODE_IS_MACOS
832+
829833
auto btnS = ButtonSprite::create("Transition\nCustomizer", 90, false, "bigFont.fnt", "GJ_button_05.png", 35, 0.75f);
830834
as<CCNode*>(btnS->getChildren()->objectAtIndex(0))->setScale(0.375f);
831835
as<CCLabelBMFont*>(btnS->getChildren()->objectAtIndex(0))->setAlignment(CCTextAlignment::kCCTextAlignmentCenter);
832836
as<CCLabelBMFont*>(btnS->getChildren()->objectAtIndex(0))->updateLabel();
833-
auto btn = CCMenuItemSpriteExtra::create(btnS, menu, menu_selector(Universal::onTransCustomizer));
837+
btn = CCMenuItemSpriteExtra::create(btnS, menu, menu_selector(Universal::onTransCustomizer));
834838
btn->setSizeMult(1.15f);
835839
btn->setPosition(pos);
836840
menu->addChild(btn);
@@ -839,6 +843,8 @@ class Universal : public Window
839843
pos = ccp(menu->getContentSize().width, 0) + ccp(-28 - 18 - 2.5f, 22);
840844
pos += ccp(-110, 0);
841845

846+
#endif
847+
842848
auto btnUnc = ButtonSprite::create("Uncomplete\nLevel", 70, false, "bigFont.fnt", "GJ_button_05.png", 35, 0.75f);
843849

844850
as<CCNode*>(btnUnc->getChildren()->objectAtIndex(0))->setScale(0.375f);

src/Hacks/SafeMode.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class HackModuleDelegate : public ModuleChangeDelegate
4949
}
5050
};
5151

52-
#ifndef GEODE_IS_MACOS
53-
5452
std::vector<std::string> hacks = {
5553
"speedhack-enabled",
5654
"force-plat",
@@ -67,25 +65,18 @@ std::vector<std::string> hacks = {
6765
"tps-bypass"
6866
};
6967

70-
#endif
71-
7268
void Client::onPostSetup()
7369
{
74-
#ifndef GEODE_IS_MACOS
75-
7670
log::info("post setup");
7771

7872
for (auto mod : hacks)
7973
{
8074
Client::GetModule(mod)->delegate = new HackModuleDelegate();
8175
}
82-
83-
#endif
8476
}
8577

8678
void updateSafemode()
8779
{
88-
#ifndef GEODE_IS_MACOS
8980
if (Client::GetModuleEnabled("auto-safe-mode"))
9081
{
9182
for (auto mod : hacks)
@@ -94,7 +85,6 @@ void updateSafemode()
9485
hasHackedAttempt = true;
9586
}
9687
}
97-
#endif
9888

9989
hasHackedAttempt = (Client::GetModule("safe-mode")->enabled) ? true : hasHackedAttempt;
10090

@@ -157,8 +147,8 @@ class $modify (PlayLayerExt, PlayLayer)
157147

158148
PlayLayer::resetLevel();
159149

160-
updateSafemode();
161150
hasHackedAttempt = Client::GetModule("safe-mode")->enabled;
151+
updateSafemode();
162152
}
163153
};
164154

@@ -209,13 +199,11 @@ class $modify(EndLevelLayerExt, EndLevelLayer)
209199

210200
std::vector<std::string> hs = {};
211201

212-
#ifndef GEODE_IS_MACOS
213202
for (auto mod : hacks)
214203
{
215204
if (Client::GetModule(mod)->enabled)
216205
hs.push_back(Client::GetModule(mod)->name);
217206
}
218-
#endif
219207

220208
if (hs.size() != 0)
221209
{

0 commit comments

Comments
 (0)