diff --git a/data/mods.list.json b/data/mods.list.json index c0170eb..ae10d98 100644 --- a/data/mods.list.json +++ b/data/mods.list.json @@ -1,5 +1,5 @@ { - "version": "v2.10.1-list1", + "version": "v2.11.0-list1", "list": [ "https://github.com/MathieuAR-GDPSFH/Gauntlets-Position-Fix/releases/latest/download/jecket.gauntlets_position_fix.geode", @@ -13,6 +13,7 @@ "https://github.com/Capeling/Hide-Main-Menu-UI/releases/latest/download/capeling.hide_main_menu_ui.geode", "https://github.com/cgytrus/SmoothParticles/releases/latest/download/cgytrus.smooth-particles.geode", + "https://api.geode-sdk.org/v1/mods/hiimjustin000.more_icons/versions/latest/download", "https://github.com/user95401/GemetryTrash/releases/latest/download/user95401.gemetry_trash.geode", "https://raw.githubusercontent.com/user95401/GemetryTrash/main/data/mods/user95401.mainlevelseditor.geode" diff --git a/data/mods/user95401.mainlevelseditor.geode b/data/mods/user95401.mainlevelseditor.geode index ef93420..7d80b22 100644 Binary files a/data/mods/user95401.mainlevelseditor.geode and b/data/mods/user95401.mainlevelseditor.geode differ diff --git a/mod.json b/mod.json index 9288dd1..f0d75c7 100644 --- a/mod.json +++ b/mod.json @@ -8,7 +8,7 @@ }, "id": "user95401.gemetry_trash", "name": "Gemetry Trash", - "version": "v2.10.1", + "version": "v2.11.0", "developer": "user95401", "description": "", "early-load": true, @@ -159,6 +159,24 @@ "description": "Update Scene Scale By Screen View.", "type": "bool", "default": true + }, + "Editor Cave Sounds": { + "name": "Editor Cave Sounds", + "description": "Editor Cave Sounds.", + "type": "bool", + "default": true + }, + "Show Random Meme After Loading": { + "name": "Show Random Meme After Loading", + "description": "Show Random Meme After Loading.", + "type": "bool", + "default": true + }, + "soggy cat?": { + "name": "soggy cat?", + "description": "soggy cat???", + "type": "bool", + "default": true } } } diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic.rand b/resources/sounds/InfinityModeMusic/InfinityModeMusic.rand new file mode 100644 index 0000000..5c45028 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic.rand differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - DA PARK.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - DA PARK.mp3 new file mode 100644 index 0000000..ab20a16 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - DA PARK.mp3 differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - LAKE HUNTERS 2.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - LAKE HUNTERS 2.mp3 new file mode 100644 index 0000000..efe8ef7 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - 9.11 playa - LAKE HUNTERS 2.mp3 differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - The Light in Me.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - The Light in Me.mp3 new file mode 100644 index 0000000..a07571c Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - The Light in Me.mp3 differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - kangi mzlff stedd burya metel i mgla.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - kangi mzlff stedd burya metel i mgla.mp3 new file mode 100644 index 0000000..31334b5 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - kangi mzlff stedd burya metel i mgla.mp3 differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - mzlff STEDD - anabioz.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - mzlff STEDD - anabioz.mp3 new file mode 100644 index 0000000..8e9e645 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - mzlff STEDD - anabioz.mp3 differ diff --git a/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - wtf happened last april.mp3 b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - wtf happened last april.mp3 new file mode 100644 index 0000000..caa9164 Binary files /dev/null and b/resources/sounds/InfinityModeMusic/InfinityModeMusic_rand - wtf happened last april.mp3 differ diff --git a/resources/sounds/SogLoop.mp3 b/resources/sounds/SogLoop.mp3 new file mode 100644 index 0000000..4d8e55f Binary files /dev/null and b/resources/sounds/SogLoop.mp3 differ diff --git a/resources/sounds/cave/cave1.ogg b/resources/sounds/cave/cave1.ogg new file mode 100644 index 0000000..89f14be Binary files /dev/null and b/resources/sounds/cave/cave1.ogg differ diff --git a/resources/sounds/cave/cave10.ogg b/resources/sounds/cave/cave10.ogg new file mode 100644 index 0000000..84fe94d Binary files /dev/null and b/resources/sounds/cave/cave10.ogg differ diff --git a/resources/sounds/cave/cave11.ogg b/resources/sounds/cave/cave11.ogg new file mode 100644 index 0000000..5906f13 Binary files /dev/null and b/resources/sounds/cave/cave11.ogg differ diff --git a/resources/sounds/cave/cave12.ogg b/resources/sounds/cave/cave12.ogg new file mode 100644 index 0000000..9272eda Binary files /dev/null and b/resources/sounds/cave/cave12.ogg differ diff --git a/resources/sounds/cave/cave13.ogg b/resources/sounds/cave/cave13.ogg new file mode 100644 index 0000000..292a51e Binary files /dev/null and b/resources/sounds/cave/cave13.ogg differ diff --git a/resources/sounds/cave/cave2.ogg b/resources/sounds/cave/cave2.ogg new file mode 100644 index 0000000..5045780 Binary files /dev/null and b/resources/sounds/cave/cave2.ogg differ diff --git a/resources/sounds/cave/cave3.ogg b/resources/sounds/cave/cave3.ogg new file mode 100644 index 0000000..c29d592 Binary files /dev/null and b/resources/sounds/cave/cave3.ogg differ diff --git a/resources/sounds/cave/cave4.ogg b/resources/sounds/cave/cave4.ogg new file mode 100644 index 0000000..c8d2e8e Binary files /dev/null and b/resources/sounds/cave/cave4.ogg differ diff --git a/resources/sounds/cave/cave5.ogg b/resources/sounds/cave/cave5.ogg new file mode 100644 index 0000000..8aac23c Binary files /dev/null and b/resources/sounds/cave/cave5.ogg differ diff --git a/resources/sounds/cave/cave6.ogg b/resources/sounds/cave/cave6.ogg new file mode 100644 index 0000000..a55be32 Binary files /dev/null and b/resources/sounds/cave/cave6.ogg differ diff --git a/resources/sounds/cave/cave7.ogg b/resources/sounds/cave/cave7.ogg new file mode 100644 index 0000000..ca5b962 Binary files /dev/null and b/resources/sounds/cave/cave7.ogg differ diff --git a/resources/sounds/cave/cave8.ogg b/resources/sounds/cave/cave8.ogg new file mode 100644 index 0000000..36a31f1 Binary files /dev/null and b/resources/sounds/cave/cave8.ogg differ diff --git a/resources/sounds/cave/cave9.ogg b/resources/sounds/cave/cave9.ogg new file mode 100644 index 0000000..b7efe56 Binary files /dev/null and b/resources/sounds/cave/cave9.ogg differ diff --git a/resources/sounds/grunt01.ogg b/resources/sounds/grunt01.ogg new file mode 100644 index 0000000..60ebfbd Binary files /dev/null and b/resources/sounds/grunt01.ogg differ diff --git a/resources/sounds/grunt02.ogg b/resources/sounds/grunt02.ogg new file mode 100644 index 0000000..48c53ce Binary files /dev/null and b/resources/sounds/grunt02.ogg differ diff --git a/resources/sounds/grunt03.ogg b/resources/sounds/grunt03.ogg new file mode 100644 index 0000000..9abf7cf Binary files /dev/null and b/resources/sounds/grunt03.ogg differ diff --git a/resources/sounds/menuLoops/menuLoop_rand KISS ME.mp3 b/resources/sounds/menuLoops/menuLoop_rand KISS ME.mp3 new file mode 100644 index 0000000..ff1fc5b Binary files /dev/null and b/resources/sounds/menuLoops/menuLoop_rand KISS ME.mp3 differ diff --git a/resources/sprites/Screenshot_64.png b/resources/sprites/Screenshot_64.png new file mode 100644 index 0000000..e07c50a Binary files /dev/null and b/resources/sprites/Screenshot_64.png differ diff --git a/resources/sprites/island_2.png~ b/resources/sprites/island_2.png~ deleted file mode 100644 index 050e3ae..0000000 Binary files a/resources/sprites/island_2.png~ and /dev/null differ diff --git a/resources/sprites/island_3.png~ b/resources/sprites/island_3.png~ deleted file mode 100644 index 050e3ae..0000000 Binary files a/resources/sprites/island_3.png~ and /dev/null differ diff --git a/resources/sprites/island_4.png~ b/resources/sprites/island_4.png~ deleted file mode 100644 index 050e3ae..0000000 Binary files a/resources/sprites/island_4.png~ and /dev/null differ diff --git a/resources/sprites/island_5.png~ b/resources/sprites/island_5.png~ deleted file mode 100644 index 050e3ae..0000000 Binary files a/resources/sprites/island_5.png~ and /dev/null differ diff --git a/src/_main.hpp b/src/_main.hpp index 3d80676..fd4cb61 100644 --- a/src/_main.hpp +++ b/src/_main.hpp @@ -118,11 +118,54 @@ namespace geode::utils { } }; +struct GJScoreKey { + inline static auto TotalJumps = "1"; + inline static auto TotalAttempts = "2"; + inline static auto CompletedLevels = "3"; + inline static auto CompletedOnlineLevels = "4"; + inline static auto Demons = "5"; + inline static auto Stars = "6"; + inline static auto CompletedMapPacksCount = "7"; + inline static auto GoldCoins = "8"; + inline static auto PlayersDestroyed = "9"; + inline static auto LikedLevelsCount = "10"; + inline static auto RatedLevelsCount = "11"; + inline static auto UserCoins = "12"; + inline static auto Diamonds = "13"; + inline static auto CurrentOrbs = "14"; + inline static auto DailyCompletionCount = "15"; + inline static auto FireShards = "16"; + inline static auto IceShards = "17"; + inline static auto PoisonShards = "18"; + inline static auto ShadowShards = "19"; + inline static auto LavaShards = "20"; + inline static auto DemonKeys = "21"; + inline static auto TotalOrbs = "22"; + inline static auto EarthShards = "23"; + inline static auto BloodShards = "24"; + inline static auto MetalShards = "25"; + inline static auto LightShards = "26"; + inline static auto SoulShards = "27"; + inline static auto Moons = "28"; + inline static auto DiamondShards = "29"; + inline static auto FirePathStarProgress = "30"; + inline static auto IcePathStarProgress = "31"; + inline static auto PoisonPathStarProgress = "32"; + inline static auto ShadowPathStarProgress = "33"; + inline static auto LavaPathStarProgress = "34"; + inline static auto EarthPathStarProgress = "35"; + inline static auto BloodPathStarProgress = "36"; + inline static auto MetalPathStarProgress = "37"; + inline static auto LightPathStarProgress = "38"; + inline static auto SoulPathStarProgress = "39"; + inline static auto CompletedGauntlets = "40"; + inline static auto ListRewardsCollected = "41"; +}; + #ifdef GEODE_IS_ANDROID #define debug error #endif // GEODE_IS_ANDROID - inline auto repo = std::string("user95401/GemetryTrash"); inline auto repobranch = std::string("user95401/GemetryTrash/main"); inline auto repo_lnk = std::string("https://github.com/" + repo); @@ -136,12 +179,15 @@ inline auto raw_content_repo_lnk = std::string("https://raw.githubusercontent.co #include "special_sprites.hpp" #include "hackpro.hpp" #include "globed.hpp" -#include "random_shit/event_level.hpp" +#include "random_shit/LocalGameModes.hpp" +#include "random_shit/PopupRandomMeme.hpp" +#include "random_shit/EditorCaveSounds.hpp" #include "random_shit/ShopkepperEyebrow.hpp" +#include "random_shit/SoggyPop.hpp" +#include "random_shit/event_level.hpp" #include "random_shit/gtasa_map.hpp" #include "random_shit/menulayer_ruinify.hpp" #include "random_shit/menuitems.hpp" #include "random_shit/loadinglayer_ruinify.hpp" #include "random_shit/second_floor.hpp" -#include "random_shit/game_ruinify.hpp" -#include "random_shit/LocalGameModes.hpp" \ No newline at end of file +#include "random_shit/game_ruinify.hpp" \ No newline at end of file diff --git a/src/random_shit/EditorCaveSounds.hpp b/src/random_shit/EditorCaveSounds.hpp new file mode 100644 index 0000000..681db8b --- /dev/null +++ b/src/random_shit/EditorCaveSounds.hpp @@ -0,0 +1,24 @@ +#pragma once +#include <_main.hpp> + +#include +class $modify(EditorCaveSounds, CCScene) { + void random(float) { + if (auto editor = GameManager::get()->m_levelEditorLayer) { + if (editor->isRunning()) { + srand(time(0)); + if ((rand() % 100 < 38)) { + auto sound_name = fmt::format("cave{}.ogg", rand() % 14); + FMODAudioEngine::get()->playEffect(sound_name); + } + } + } + }; + $override static CCScene* create(void) { + auto __this = CCScene::create(); + if (SETTING(bool, "Editor Cave Sounds")) { + __this->schedule(schedule_selector(EditorCaveSounds::random), 12.f); + }; + return __this; + } +}; \ No newline at end of file diff --git a/src/random_shit/LocalGameModes.hpp b/src/random_shit/LocalGameModes.hpp index b2f1a42..9e72cc9 100644 --- a/src/random_shit/LocalGameModes.hpp +++ b/src/random_shit/LocalGameModes.hpp @@ -63,10 +63,19 @@ class IslandsLayer : public CCLayer { }; #include -class $modify(GJBaseGameLayerInfinityMode, GJBaseGameLayer) { +class $modify(InfinityMode, GJBaseGameLayer) { + inline static int current_deaths = 0; inline static int current_amo_for_reward = 0; - inline static int next_amount_for_reward = 12; + inline static int next_amount_for_reward = 5; inline static int mltp_amount_for_reward = 1; + static void open() { + InfinityMode::current_deaths = 0; + auto level = GameLevelManager::get()->getMainLevel(1337, false); + cocos2d::CCDirector::get()->replaceScene( + cocos2d::CCTransitionFade::create(0.5f, PlayLayer::scene(level, false, false)) + ); + GameManager::get()->m_playLayer->addChild(createDataNode("INFINITY_MODE_MARK")); + } bool ENABLED() { return nullptr != this->getChildByIDRecursive("INFINITY_MODE_MARK"); } @@ -75,8 +84,17 @@ class $modify(GJBaseGameLayerInfinityMode, GJBaseGameLayer) { //log::debug("{}->{}({}, {}, {}, {}, {})", this, __func__, p0, p1, p2, p3, p4, p5); if (p0 == 21) { if (current_amo_for_reward == next_amount_for_reward) { + auto orbs = 8; + auto moons = 2; + auto diamonds = 4; + + auto stats = GameStatsManager::sharedState(); + stats->incrementStat(GJScoreKey::TotalOrbs, orbs); + stats->incrementStat(GJScoreKey::Moons, moons); + stats->incrementStat(GJScoreKey::Diamonds, diamonds); + auto rwdl = CurrencyRewardLayer::create( - 4, 0, 1, 2, + orbs, 0, moons, diamonds, CurrencySpriteType::Icon, 0, CurrencySpriteType::Icon, 0, m_player1->convertToWorldSpace(m_player1->getPosition()), @@ -84,18 +102,45 @@ class $modify(GJBaseGameLayerInfinityMode, GJBaseGameLayer) { 1.f, 1.f ); this->addChild(rwdl); + + std::vector aaa = { + "buyItem01.ogg", "buyItem03.ogg", "gold01.ogg", "gold02.ogg", "highscoreGet02.ogg" + }; + FMODAudioEngine::get()->playEffect(*select_randomly(aaa.begin(), aaa.end())); + FMODAudioEngine::get()->playEffect("achievement_01.ogg"); + current_amo_for_reward = 0; } else { ++current_amo_for_reward; } } + Notification* plr_ntfy = nullptr; + auto obj = [](int key) { + auto rtn = GameObject::createWithKey(key); + return CCSprite::createWithSpriteFrame(rtn->displayFrame()); + }; + if (p0 == 31) plr_ntfy = Notification::create("Enable Ghost", obj(32)); + if (p0 == 32) plr_ntfy = Notification::create("Disable Ghost", obj(33)); + if (p0 == 33) plr_ntfy = Notification::create("Show PLayer", obj(1613)); + if (p0 == 34) plr_ntfy = Notification::create("Hide PLayer", obj(1612)); + if (p0 == 37) plr_ntfy = Notification::create("Gravity 1.00", obj(2066)); + if (p0 == 38) plr_ntfy = Notification::create("Gravity 0.50", obj(2066)); + if (p0 == 39) plr_ntfy = Notification::create("Gravity 1.30", obj(2066)); + if (plr_ntfy) { + if (auto old_plr_ntfy = typeinfo_cast(CCScene::get()->getChildByIDRecursive("plr_ntfy"))) { + old_plr_ntfy->hide(); + } + plr_ntfy->setID("plr_ntfy"); + public_cast(plr_ntfy, m_icon)->runAction(CCRepeatForever::create(CCScaleTo::create(0.f, 0.7f))); + plr_ntfy->show(); + } return GJBaseGameLayer::spawnGroup(p0, p1, p2, p3, p4, p5); } }; #include -class $modify(PlayLayerInfinityMode, PlayLayer) { +class $modify(PlayInfinityMode, PlayLayer) { bool ENABLED() { return nullptr != this->getChildByIDRecursive("INFINITY_MODE_MARK"); } @@ -103,19 +148,32 @@ class $modify(PlayLayerInfinityMode, PlayLayer) { if (not ENABLED()) return PlayLayer::updateVisibility(p0); m_attemptLabel->setString(fmt::format( - "{} : {}", - GJBaseGameLayerInfinityMode::current_amo_for_reward, - GJBaseGameLayerInfinityMode::next_amount_for_reward + "{} : {}""\n" + "\n" + "Current Deaths: {}""\n" + "Total Deaths: {}""\n" + "\n" + "Gravity Mod: {:.2}""\n", + InfinityMode::current_amo_for_reward, InfinityMode::next_amount_for_reward, + InfinityMode::current_deaths, + getMod()->getSavedValue("InfinityModeTotalDeaths"), + m_player1->m_gravityMod ).c_str()); - m_attemptLabel->setAnchorPoint(CCPoint(0.f, 0.5f)); - m_attemptLabel->setPosition(CCPoint(8.f, 422.f)); + m_attemptLabel->setAlignment(kCCTextAlignmentLeft); + m_attemptLabel->setAnchorPoint(CCPoint(0.f, 1.f)); + m_attemptLabel->setPosition(CCPoint(8.f, this->getContentHeight() - 4.f)); + m_attemptLabel->setScale(0.4f); + if (m_attemptLabel->getParent() != this) { + m_attemptLabel->removeFromParentAndCleanup(0); + this->addChild(m_attemptLabel); + } auto fmod = FMODAudioEngine::sharedEngine(); if (not fmod->m_metering) fmod->enableMetering(); auto pulse = (fmod->m_pulse1 + fmod->m_pulse2 + fmod->m_pulse3) / 3; auto mainlayer = getChildByIDRecursive("main-node"); mainlayer->removeChildByTag(6824409); - auto colp = (pulse * 30); + auto colp = (pulse * 60); auto pulsebg = CCLayerColor::create(ccc4(colp, colp, colp, 0)); pulsebg->setBlendFunc({ GL_ONE, GL_ONE }); mainlayer->addChild(pulsebg, 0, 6824409); @@ -124,10 +182,22 @@ class $modify(PlayLayerInfinityMode, PlayLayer) { } $override void destroyPlayer(PlayerObject* p0, GameObject* p1) { if (not ENABLED()) return PlayLayer::destroyPlayer(p0, p1); + PlayLayer::destroyPlayer(p0, p1); + + if (!p0->m_isDead) return; + //log::debug("m_isDead"); + + InfinityMode::current_amo_for_reward = 0; + + InfinityMode::current_deaths += 1; + getMod()->setSavedValue( + "InfinityModeTotalDeaths", + 1 + getMod()->getSavedValue("InfinityModeTotalDeaths") + ); this->m_levelSettings->m_songOffset += this->m_timePlayed; + m_timePlayed = 0.f; - return PlayLayer::destroyPlayer(p0, p1); } }; @@ -171,12 +241,7 @@ class $modify(MenuLayerLocalGameModes, MenuLayer) { auto Infinity = CCMenuItemExt::createSpriteExtra( ButtonSprite::create("Infinity Mode", "bigFont.fnt", "geode.loader/black-square.png", 0.8f), [this](auto) { - Notification::create("in dev")->show(); - auto level = GameLevelManager::get()->getMainLevel(1337, false); - cocos2d::CCDirector::get()->replaceScene( - cocos2d::CCTransitionFade::create(0.5f, PlayLayer::scene(level, false, false)) - ); - GameManager::get()->m_playLayer->addChild(createDataNode("INFINITY_MODE_MARK")); + InfinityMode::open(); } ); menu->addChild(Infinity); diff --git a/src/random_shit/PopupRandomMeme.hpp b/src/random_shit/PopupRandomMeme.hpp new file mode 100644 index 0000000..b47092e --- /dev/null +++ b/src/random_shit/PopupRandomMeme.hpp @@ -0,0 +1,80 @@ +#pragma once +#include <_main.hpp> + +#include +class $modify(PopupRandomMeme, CCScene) { + inline static bool can_asd = false; + static void loadAndShow() { + + web::WebRequest req = web::WebRequest(); + req.header( + "x-rapidapi-key",//:> + ZipUtils::base64URLDecode("MWI0NzE0YTFiNW1zaDY0YmM3NDdmODg3YjcyOHAxNTViMjNqc25jN2UyN2I2N2ExOTM=") + ); + + auto listener = new EventListener; + listener->bind( + [listener](web::WebTask::Event* e) { + if (web::WebResponse* res = e->getValue()) { + + //log::info("headers: {}", res->headers()); + if (string::contains(res->header("content-type").value_or("asd"), "image")) { + //log::info("image"); + auto path = getMod()->getTempDir() / ".rand_meme_image"; + res->into(path); + auto sprite = CCSprite::create(path.string().c_str()); + CCTextureCache::get()->removeTextureForKey(path.string().c_str()); + fs::remove(path, fs::last_err_code); + + auto popup = createQuickPopup("", "", "", "", [](auto, auto) {}); + + popup->m_mainLayer->removeAllChildrenWithCleanup(0); + popup->m_mainLayer->addChild(popup->m_buttonMenu); + popup->m_button1->getParent()->setContentSize(CCSize(1, 1) * 7777); + popup->m_button1->setVisible(0); + popup->m_button2->setVisible(0); + + popup->m_mainLayer->addChild(sprite); + sprite->setPosition(popup->getContentSize() / 2); + limitNodeSize(sprite, popup->getContentSize() - CCSize(60, 40), 8.f, 0.1f); + + return; + } + + auto json = res->json(); + auto value = matjson::Value(json.value_or(json.error_or("unk err"))); + //log::info("{}", value); + + if (json.has_error()) return; + if (value.is_array() == false) return; + //log::info("{}", "as_array"); + //log::info("value {}", value); + auto the_memes_list = value.as_array(); + auto rand_meme = *select_randomly(the_memes_list.begin(), the_memes_list.end()); + //log::info("rand_meme {}", rand_meme); + web::WebRequest req = web::WebRequest(); + listener->setFilter(req.get(rand_meme.try_get("image").value_or("no meme?("))); + } + } + ); + listener->setFilter(req.get("https://programming-memes-images.p.rapidapi.com/v1/memes")); + }; + void asd(float) { + + if (this->getChildByIDRecursive("LoadingLayer")) { + can_asd = true; + return; + } + if (not can_asd) return; + + loadAndShow(); + can_asd = false; + }; + $override static CCScene* create(void) { + auto __this = CCScene::create(); + if (SETTING(bool, "Show Random Meme After Loading")) { + __this->scheduleOnce(schedule_selector(PopupRandomMeme::asd), 0.0f); + }; + return __this; + } +}; \ No newline at end of file diff --git a/src/random_shit/SoggyPop.hpp b/src/random_shit/SoggyPop.hpp new file mode 100644 index 0000000..6537f97 --- /dev/null +++ b/src/random_shit/SoggyPop.hpp @@ -0,0 +1,43 @@ +#pragma once +#include <_main.hpp> + +#include +class $modify(PopupSoggyCat, CCMenuItem) { + inline static bool can_asd = false; + inline static std::function onClick = []() {}; + static auto createPopup() { + auto popup = createQuickPopup("", "", "", "", [](auto, auto) { + PopupSoggyCat::onClick(); + }, false); + popup->m_mainLayer->removeAllChildrenWithCleanup(0); + popup->m_mainLayer->addChild(popup->m_buttonMenu); + popup->m_button1->getParent()->setContentSize(CCSize(1, 1) * 7777); + popup->m_button1->setVisible(0); + popup->m_button2->setVisible(0); + auto sprite = CCSprite::create("Screenshot_64.png"); + popup->m_mainLayer->addChild(sprite); + sprite->setPosition(popup->getContentSize() / 2); + sprite->setScaleX((popup->getContentSize().width) / sprite->getContentSize().width); + sprite->setScaleY((popup->getContentSize().height) / sprite->getContentSize().height); + return popup; + }; + $override void activate() { + if (SETTING(bool, "soggy cat?")) { + if (string::containsAny(this->getID(), { "play-button", "level-button" })) { + srand(time(0)); + if ((rand() % 10 < 3)) { + auto pop = createPopup(); + pop->show(); + PopupSoggyCat::onClick = [this]() + { + GameManager::get()->playMenuMusic(); + return CCMenuItem::activate(); + }; + GameManager::get()->fadeInMusic("SogLoop.mp3"); + return; + } + }; + }; + return CCMenuItem::activate(); + } +}; \ No newline at end of file diff --git a/src/random_shit/menulayer_ruinify.hpp b/src/random_shit/menulayer_ruinify.hpp index 44a6e64..3ad56d3 100644 --- a/src/random_shit/menulayer_ruinify.hpp +++ b/src/random_shit/menulayer_ruinify.hpp @@ -363,6 +363,15 @@ class $modify(MenuLayerExt, MenuLayer) { flyinAmogus_001->addChild(flyinAmogus_002); }; + auto get_rand_meme_button_menu_long_var_here_for_ever = CCMenu::createWithItem(CCMenuItemExt::createSpriteExtra( + CCLabelTTF::create("get random programming meme", "Consolas", 6.f), + [](auto) { + PopupRandomMeme::loadAndShow(); + } + )); + get_rand_meme_button_menu_long_var_here_for_ever->setPosition({ 230.f, 6.f }); + this->addChild(get_rand_meme_button_menu_long_var_here_for_ever); + return rtn; } inline static bool seenWarn = false;