55#include < Geode/modify/CCScene.hpp>
66#include < Geode/modify/CCMenuItem.hpp>
77#include < Geode/modify/GJGameLevel.hpp>
8+ #include < Geode/modify/LevelEditorLayer.hpp>
89
910#include < Geode/binding/FMODAudioEngine.hpp>
1011
@@ -13,12 +14,16 @@ using namespace horrible;
1314
1415bool isFlipped = false ;
1516
16- class $modify(HorribleCCScene, CCScene) {
17- bool init () {
18- if (!CCScene::init ()) return false ;
17+ class $modify(HorribleCCScene, CCScene)
18+ {
19+ bool init ()
20+ {
21+ if (!CCScene::init ())
22+ return false ;
1923
2024#if !defined(GEODE_IS_MACOS) && !defined(GEODE_IS_IOS)
21- if (typeinfo_cast<CCTransitionFade*>(this )) {
25+ if (typeinfo_cast<CCTransitionFade *>(this ))
26+ {
2227 log::debug (" scene is a CCTransitionFade" );
2328 return true ;
2429 };
@@ -31,16 +36,21 @@ class $modify(HorribleCCScene, CCScene) {
3136};
3237
3338// modify CCMenuItem so it plays the sound whenever a button is clicked regardless of the layer
34- class $modify(HorribleCCMenuItem, CCMenuItem) {
35- void activate () {
39+ class $modify(HorribleCCMenuItem, CCMenuItem)
40+ {
41+ void activate ()
42+ {
3643 auto rnd = Rand::fast ();
3744 log::debug (" button menu chance {}" , rnd);
3845
39- if (horribleMod && horribleMod->getSavedValue <bool >(" achieve" , true )) {
40- if (auto fmod = FMODAudioEngine::sharedEngine ()) {
46+ if (horribleMod && horribleMod->getSavedValue <bool >(" achieve" , true ))
47+ {
48+ if (auto fmod = FMODAudioEngine::sharedEngine ())
49+ {
4150
4251 // @geode-ignore(unknown-resource)
43- if (rnd <= static_cast <int >(horribleMod->getSettingValue <int64_t >(" achieve-chance" ))) fmod->playEffect (" achievement_01.ogg" );
52+ if (rnd <= static_cast <int >(horribleMod->getSettingValue <int64_t >(" achieve-chance" )))
53+ fmod->playEffect (" achievement_01.ogg" );
4454 };
4555 };
4656
@@ -49,12 +59,31 @@ class $modify(HorribleCCMenuItem, CCMenuItem) {
4959};
5060
5161// safe mode
52- class $modify(HorribleGJGameLevel, GJGameLevel) {
53- void savePercentage (int percent, bool isPracticeMode, int clicks, int attempts, bool isChkValid) {
54- if (horribleMod->getSettingValue <bool >(" safe-mode" )) {
62+ class $modify(HorribleGJGameLevel, GJGameLevel)
63+ {
64+ void savePercentage (int percent, bool isPracticeMode, int clicks, int attempts, bool isChkValid)
65+ {
66+ if (horribleMod->getSettingValue <bool >(" safe-mode" ))
67+ {
5568 log::warn (" Safe mode is enabled, progress will not be saved" );
56- } else {
69+ }
70+ else
71+ {
5772 GJGameLevel::savePercentage (percent, isPracticeMode, clicks, attempts, isChkValid);
5873 };
5974 };
75+ };
76+
77+ // WOMP WOMP BROKEN PLAYTEST
78+ class $modify(HorribleLevelEditorLayer, LevelEditorLayer)
79+ {
80+ void onPlaytest ()
81+ {
82+ FLAlertLayer::create (
83+ " Playtest Disabled" ,
84+ " <cy>Horrible Ideas Mod</c> has <cr>completely broken</c> the Playtest function which prevents the player from testing the level.\n <cg>I recommend disabling the mod while editing levels.</c>" ,
85+ " OK" )
86+ ->show ();
87+ LevelEditorLayer::onPlaytest ();
88+ };
6089};
0 commit comments