Skip to content

Commit dbd0b92

Browse files
committed
congrats wont show when u beat in this ver dont fix i got it
1 parent 19ea804 commit dbd0b92

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

src/ExpertMapLayer.hpp

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ class ExpertMapLayer : public CCLayer, LevelDownloadDelegate {
5151
void openSettings(CCObject*);
5252
void openDevs(CCObject*);
5353
void openDiscord(CCObject*);
54+
void showAllLevels(CCObject*);
5455
void downloadLevels();
5556
void addMap();
5657
void ondownloadfinished(std::string const&);
5758
void expertReset();
58-
void showCongrats();
59+
void showCongrats(CCObject*);
5960
void showGameOver();
6061

6162
int dl_count;
@@ -128,6 +129,7 @@ bool ExpertMapLayer::init() { //beware, this code is dog shit holy fuck
128129
CCLabelBMFont* super_expert_lbl = CCLabelBMFont::create("Super Expert Run", "goldFont.fnt");
129130
skips_left = CCLabelBMFont::create(fmt::format("Skips Left: {}/{}", skips, Mod::get()->getSettingValue<int64_t>("skips")).c_str(), "chatFont.fnt");
130131
dl_txt = CCLabelBMFont::create("Fetching Level ID...", "bigFont.fnt");
132+
131133
CCLabelBMFont* lvls_completed = CCLabelBMFont::create(fmt::format("Levels Complete: {}/15", current_level_display).c_str(), "chatFont.fnt");
132134
if (current_level_display > 15) current_level_display = 15;
133135
dl_count = 0;
@@ -161,7 +163,7 @@ bool ExpertMapLayer::init() { //beware, this code is dog shit holy fuck
161163
auto settingsBtn = CCMenuItemSpriteExtra::create(settingsGear, this, menu_selector(ExpertMapLayer::openSettings));
162164
auto discordBtn = CCMenuItemSpriteExtra::create(discordSprite, this, menu_selector(ExpertMapLayer::openDiscord));
163165
startBtn = CCMenuItemSpriteExtra::create(CCSprite::createWithSpriteFrameName("GJ_longBtn03_001.png"), this, menu_selector(ExpertMapLayer::start_expert_run));
164-
devBtn = CCMenuItemSpriteExtra::create(devsSprite, this, menu_selector(ExpertMapLayer::openDevs));
166+
devBtn = CCMenuItemSpriteExtra::create(devsSprite, this, menu_selector(ExpertMapLayer::showCongrats));
165167

166168
addChild(devs_menu);
167169
devs_menu->addChild(devBtn);
@@ -261,8 +263,8 @@ bool ExpertMapLayer::init() { //beware, this code is dog shit holy fuck
261263
else {
262264
(downloading) ? downloadLevels() : addMap();
263265
if (current_level == 15) {
264-
auto showCongrats = CCCallFunc::create(this, callfunc_selector(ExpertMapLayer::showCongrats));
265-
runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.2f), showCongrats));
266+
//auto showCongrats = CCCallFunc::create(this, callfunc_selector(ExpertMapLayer::showCongrats));
267+
//runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.3f), showCongrats));
266268
current_level++;
267269
}
268270
}
@@ -272,8 +274,29 @@ bool ExpertMapLayer::init() { //beware, this code is dog shit holy fuck
272274
return true;
273275
}
274276

275-
void ExpertMapLayer::showCongrats() {
276-
FLAlertLayer::create("Congratulations!", "You successfully completed\n<cp>Super Expert</c>!", "OK")->show();
277+
void ExpertMapLayer::showCongrats(CCObject*) {
278+
FLAlertLayer* congrats = FLAlertLayer::create("Congratulations", "You have successfully completed\n<cp>Super Expert</c>!", "OK");
279+
congrats->show();
280+
281+
auto main_layer = static_cast<CCNode*>(congrats->getChildren()->objectAtIndex(0)); // thanks for NOTHING getChildbyID! asshole
282+
283+
CCSprite* showLevels = CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
284+
CCMenu* showLevelMenu = CCMenu::create();
285+
CCMenuItemSpriteExtra* showLevelBtn = CCMenuItemSpriteExtra::create(showLevels, this, menu_selector(ExpertMapLayer::showAllLevels));
286+
287+
showLevels->setPosition({155, 75.5});
288+
showLevels->setScale(1.025);
289+
290+
main_layer->addChild(showLevelMenu, 1);
291+
292+
showLevelMenu->setID("levels");
293+
showLevelMenu->addChild(showLevelBtn);
294+
handleTouchPriority(this, true);
295+
296+
}
297+
298+
void ExpertMapLayer::showAllLevels(CCObject*) {
299+
FLAlertLayer::create("Level List", sharelevels, "OK")->show();
277300
}
278301

279302
void ExpertMapLayer::showGameOver() {
@@ -410,6 +433,7 @@ void ExpertMapLayer::ondownloadfinished(std::string const& string) {
410433
}
411434
try {
412435
ids = std::stoi(leveldata[1]);
436+
sharelevels += fmt::format("{}\n", leveldata[1]);
413437
}
414438
catch (std::invalid_argument const& ex) // FIX THIS SHIT FOR ANDROID IMA KMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
415439
{

0 commit comments

Comments
 (0)