Skip to content

Commit

Permalink
Merge pull request #23 from Alphalaneous/fix-issues
Browse files Browse the repository at this point in the history
Fix missing nullptr checks
  • Loading branch information
Minemaker0430 authored Jun 20, 2024
2 parents 2cbb169 + bdf3952 commit 977198e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/CreatorLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -117,21 +120,21 @@ class $modify(CreatorLayer) {

if (Loader::get()->isModLoaded("cvolton.betterinfo") && !Mod::get()->getSettingValue<bool>("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<bool>("dont-move-side-btns")) {
log::info("GD Roulette Detected. Moved Button.");
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;
}

};

0 comments on commit 977198e

Please sign in to comment.