diff --git a/mod.json b/mod.json index b133f4a..f6a46f6 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.0.0-beta.1", + "geode": "3.0.0-beta.4", "gd": { "win": "2.206", "android": "2.206" diff --git a/src/CreatorLayer.cpp b/src/CreatorLayer.cpp index a6ad335..91975c6 100644 --- a/src/CreatorLayer.cpp +++ b/src/CreatorLayer.cpp @@ -33,8 +33,11 @@ class $modify(CreatorLayer) { if (Loader::get()->isModLoaded("cvolton.betterinfo")) { log::info("BetterInfo Detected. Added Button."); - this->getChildByID("cvolton.betterinfo/center-right-menu")->addChild(dpBtn); - this->getChildByID("cvolton.betterinfo/center-right-menu")->setLayout(AxisLayout::create(Axis::Column), true, true); + + if(auto menu = this->getChildByID("cvolton.betterinfo/center-right-menu")){ + menu->addChild(dpBtn); + menu->setLayout(AxisLayout::create(Axis::Column), true, true); + } } else { auto size = CCDirector::sharedDirector()->getWinSize(); @@ -107,7 +110,9 @@ class $modify(CreatorLayer) { if (Loader::get()->isModLoaded("cvolton.betterinfo") && !Mod::get()->getSettingValue("dont-move-side-btns")) { log::info("BetterInfo Detected. Moved Button."); - this->getChildByID("cvolton.betterinfo/center-right-menu")->setPositionY(260); + if(auto menu = this->getChildByID("cvolton.betterinfo/center-right-menu")){ + menu->setPositionY(260); + } } if (Loader::get()->isModLoaded("spaghettdev.gd-roulette") && !Mod::get()->getSettingValue("dont-move-side-btns")) { @@ -115,13 +120,11 @@ class $modify(CreatorLayer) { if (auto menu = this->getChildByID("spaghettdev.gd-roulette/creator-layer-menu")) { menu->setPositionY(92); } - else { - this->getChildByID("spaghettdev.gd-roulette/center-left-menu")->setPositionY(255); + else if (auto menu = this->getChildByID("spaghettdev.gd-roulette/center-left-menu")){ + menu->setPositionY(255); } } } - return true; } - }; \ No newline at end of file