Skip to content

Commit

Permalink
Fix missing nullptr checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Jun 20, 2024
1 parent 7f44275 commit bdf3952
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.0.0-beta.1",
"geode": "3.0.0-beta.4",
"gd": {
"win": "2.206",
"android": "2.206"
Expand Down
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 @@ -107,21 +110,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 bdf3952

Please sign in to comment.