Skip to content

Commit 29bbb7f

Browse files
blurry face
1 parent 62cce32 commit 29bbb7f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

include/Horrible.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,11 @@ namespace horrible {
176176
#define HORRIBLE_DELEGATE_HOOKS(optID) \
177177
static void onModify(auto& self) { \
178178
horrible::delegateHooks(optID, self.m_hooks); \
179+
}
180+
181+
#define HORRIBLE_REGISTER_OPTION_DEPENDENCY(opt, modId) \
182+
$on_game(Loaded) { \
183+
if (Loader::get()->isModLoaded(modId)) { \
184+
if (auto om = horrible::OptionManager::get()) om->registerOption(opt); \
185+
}; \
179186
}

src/hooks/PlayLayer/BlurGame.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ inline static Option const o = {
1919
SillyTier::Medium,
2020
};
2121
HORRIBLE_REGISTER_OPTION(o);
22+
HORRIBLE_REGISTER_OPTION_DEPENDENCY(o, "thesillydoggo.blur-api");
2223

2324
class $modify(BlurPlayLayer, PlayLayer) {
2425
HORRIBLE_DELEGATE_HOOKS(id);
@@ -30,7 +31,7 @@ class $modify(BlurPlayLayer, PlayLayer) {
3031
colorLayer->setID("blur-color-layer"_spr);
3132
colorLayer->setContentSize({getScaledContentWidth(), getScaledContentHeight()});
3233
colorLayer->setPosition({0, 0});
33-
this->addChild(colorLayer, 98);
34+
m_uiLayer->addChild(colorLayer, 98);
3435
BlurAPI::addBlur(colorLayer);
3536
}
3637

0 commit comments

Comments
 (0)