Skip to content

Commit

Permalink
v1.0.2 2
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyMC9730 committed Apr 29, 2024
1 parent dba666f commit b451214
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,27 @@ class $modify(LHLevelSearchLayer, LevelSearchLayer) {

auto menu = (CCMenu *)this->getChildByID("other-filter-menu");

// extrasearch->setID("provider-button"_spr);
auto app = CCApplication::sharedApplication();
auto platform = app->getTargetPlatform();

// auto children = menu->getChildren();
if (platform != TargetPlatform::kTargetAndroid) {
menu->addChild(extrasearch);
menu->updateLayout();
} else {
extrasearch->setID("provider-button"_spr);

// auto last_child = (CCNode *)children->lastObject();
// auto pos = last_child->getPosition();
// auto csz = last_child->getContentSize();
auto children = menu->getChildren();

// pos.y -= csz.width + 10.f;
auto last_child = (CCNode *)children->lastObject();
auto pos = last_child->getPosition();
auto csz = last_child->getContentSize();

// extrasearch->setPosition(pos);
pos.y -= csz.width + 10.f;

menu->addChild(extrasearch);
extrasearch->setPosition(pos);

menu->updateLayout();
menu->addChild(extrasearch);
}

return true;
}
Expand Down

0 comments on commit b451214

Please sign in to comment.