Skip to content

Commit 18ce495

Browse files
committed
vibecoded warning
1 parent 374d86e commit 18ce495

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,4 @@
351351
"reason": "breaking"
352352
}
353353
}
354-
}
354+
}

src/MenuLayer.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
#include "ui/SongControlMenu.hpp"
2+
#include "ui/SongListLayer.hpp"
23
#include "SongControl.hpp"
34
#include "SongManager.hpp"
45
#include "Utils.hpp"
56
#include <Geode/modify/MenuLayer.hpp>
67

7-
#include "ui/SongListLayer.hpp"
8-
98
#define REST_OF_THE_OWL static_cast<cocos2d::CCMenu*>(this->getChildByID("right-side-menu")), this
109

1110
using namespace geode::prelude;
1211

12+
bool shownVibecodedWarning = false;
13+
1314
class $modify(MenuLayerMLHook, MenuLayer) {
15+
static cocos2d::CCScene* scene(bool p0) {
16+
CCScene* scene = MenuLayer::scene(p0);
17+
if (SongManager::get().getVibecodedVentilla() && !shownVibecodedWarning) {
18+
FLAlertLayer* alert = FLAlertLayer::create("Uh oh!", "<c_>Another mod overriding the menu loop is active!</c>\n<cy>The specific menu music mod you have active does not respect menu loops created from other mods, and overrides all mods that change the behavior of the in-game menu loop.</c> <co>Additionally, this specific menu music mod relies on an Internet connection, and does not work with Cloudflare WARP.</c> <cy>If you want to use Menu Loop Randomizer, please check your loaded mods.</c>\n\n<cg>You will only see this warning once.</c>", "I Understand");
19+
scene->addChild(alert);
20+
shownVibecodedWarning = true;
21+
}
22+
return scene;
23+
}
1424
bool init() {
1525
if (!MenuLayer::init()) return false;
1626

src/SongManager.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,4 +294,12 @@ void SongManager::setColonMenuLoopStartTime(geode::Mod* value) {
294294

295295
geode::Mod* SongManager::getColonMenuLoopStartTime() const {
296296
return m_colonMenuLoopStartTime;
297+
}
298+
299+
void SongManager::setVibecodedVentilla(const bool value) {
300+
m_vibecodedVentilla = value;
301+
}
302+
303+
bool SongManager::getVibecodedVentilla() const {
304+
return m_vibecodedVentilla;
297305
}

src/SongManager.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ class SongManager {
7171
bool getUndefined0Alk1m123TouchPrio() const;
7272
void setColonMenuLoopStartTime(geode::Mod* value);
7373
geode::Mod* getColonMenuLoopStartTime() const;
74+
void setVibecodedVentilla(const bool value);
75+
bool getVibecodedVentilla() const;
7476

7577
private:
7678
SongManager();
@@ -93,6 +95,7 @@ class SongManager {
9395
bool m_sawbladeCustomSongsFolder = false;
9496
bool m_advancedLogs = false;
9597
bool m_shouldRestoreMenuLoopPoint = false;
98+
bool m_vibecodedVentilla = false;
9699
int m_lastPosition = 0;
97100
std::vector<std::string> m_blacklist;
98101
std::vector<std::string> m_favorites;

src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ SongManager &songManager = SongManager::get();
1010
std::filesystem::path configDir = Mod::get()->getConfigDir();
1111
bool originalOverrideWasEmpty = false;
1212

13+
#define VIBECODED_RADIO Loader::get()->getInstalledMod("joseii.ventilla")
14+
1315
$on_mod(Loaded) {
1416
(void) Mod::get()->registerCustomSettingType("configdir", &MyButtonSettingV3::parse);
1517
songManager.setConstantShuffleMode();
1618
songManager.setLastMenuLoopPosition(0);
1719
songManager.setShouldRestoreMenuLoopPoint(true);
1820
songManager.setAdvancedLogs(Mod::get()->getSettingValue<bool>("advancedLogs"));
21+
songManager.setVibecodedVentilla(VIBECODED_RADIO && (VIBECODED_RADIO->isEnabled() || VIBECODED_RADIO->shouldLoad()));
1922
if (!std::filesystem::exists(configDir / "playlistOne.txt")) Utils::writeToFile("# This file was generated automatically as it hadn't existed previously.", configDir / "playlistOne.txt");
2023
if (!std::filesystem::exists(configDir / "playlistTwo.txt")) Utils::writeToFile("# This file was generated automatically as it hadn't existed previously.", configDir / "playlistTwo.txt");
2124
if (!std::filesystem::exists(configDir / "playlistThree.txt")) Utils::writeToFile("# This file was generated automatically as it hadn't existed previously.", configDir / "playlistThree.txt");

0 commit comments

Comments
 (0)