Skip to content

Commit eecf1da

Browse files
committed
blur moved
1 parent 22c5414 commit eecf1da

6 files changed

Lines changed: 10 additions & 106 deletions

File tree

include/Horrible.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include "Geode/loader/Loader.hpp"
43
#ifdef GEODE_IS_WINDOWS
54
#ifdef AWCW_HORRIBLE_API_EXPORTING
65
#define AWCW_HORRIBLE_API_DLL __declspec(dllexport)
@@ -173,14 +172,6 @@ namespace horrible {
173172
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
174173
}
175174

176-
// Statically register an option on game load, if another mod is loaded
177-
#define HORRIBLE_REGISTER_OPTION_DEPENDENCY(opt, modId) \
178-
$on_game(Loaded) { \
179-
if (Loader::get()->isModLoaded(modId)) { \
180-
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
181-
}; \
182-
}
183-
184175
// Delegate hooks to OptionManager for dynamic toggling
185176
#define HORRIBLE_DELEGATE_HOOKS(optID) \
186177
static void onModify(auto& self) { \

include/OptionalAPI.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace horrible {
1818
using Event::Event;
1919
};
2020

21-
// Bridge to option manager for Horrible Ideas
21+
// Optional bridge to option manager for Horrible Ideas
2222
class OptionManagerV2 final {
2323
public:
2424
/**

src/Utils.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <Horrible.hpp>
44

5-
#include <util/Blur.hpp>
65
#include <util/Jumpscares.hpp>
76
#include <util/Menu.hpp>
87
#include <util/Options.hpp>
@@ -29,7 +28,7 @@ namespace horrible {
2928
*
3029
* @param chance The chance setting number
3130
*/
32-
inline float chanceToDelayPct(int chance) noexcept {
31+
inline constexpr float chanceToDelayPct(int chance = 50) noexcept {
3332
if (chance <= 0) chance = 1;
3433
if (chance > 100) chance = 100;
3534

src/hooks/PlayLayer/BlurGame.cpp

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/main.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <Utils.hpp>
22

3+
#include <ranges>
4+
35
#include <menu/OptionMenuButton.hpp>
46
#include <menu/SettingV3.hpp>
57

6-
#include <ranges>
7-
88
#include <Geode/modify/PlayLayer.hpp>
99
#include <Geode/modify/PauseLayer.hpp>
1010
#include <Geode/modify/GJGameLevel.hpp>
@@ -14,7 +14,7 @@
1414
using namespace horrible::prelude;
1515

1616
inline static std::vector<Hook*> safeModeHooks;
17-
inline static std::vector<Hook*> floatingBtnHooks;
17+
inline static std::vector<std::weak_ptr<Hook>> floatingBtnHooks;
1818

1919
#define HORRIBLE_HOOK_SAFEMODE(hookName) \
2020
static void onModify(auto& self) { \
@@ -39,7 +39,7 @@ inline static std::vector<Hook*> floatingBtnHooks;
3939
hook->setAutoEnable(enable); \
4040
(void)hook->toggle(enable); \
4141
\
42-
floatingBtnHooks.push_back(hook.get()); \
42+
floatingBtnHooks.push_back(hook); \
4343
}; \
4444
}
4545

@@ -68,8 +68,10 @@ inline static std::vector<Hook*> floatingBtnHooks;
6868
if (auto fb = OptionMenuButton::get()) fb->setVisible(value);
6969

7070
for (auto& hook : floatingBtnHooks) {
71-
log::trace("Toggling floating button hook '{}' {}...", hook->getDisplayName(), value ? "ON" : "OFF");
72-
(void)hook->toggle(value);
71+
if (auto h = hook.lock()) {
72+
log::trace("Toggling floating button hook '{}' {}...", h->getDisplayName(), value ? "ON" : "OFF");
73+
(void)h->toggle(value);
74+
};
7375
};
7476
});
7577

src/util/Blur.hpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)