Skip to content

Commit

Permalink
keep m_buttonMenu unlayouted for ChallengesPage
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Feb 23, 2024
1 parent 3fe4be1 commit 7608d7a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/ChallengesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ using namespace geode::node_ids;
"info-button"
);

topMenu->setID("main-menu");
// leave m_buttonMenu unlayouted, even if it'll have to be empty
// otherwise we could break assumptions from other mods

auto infoMenu = detachAndCreateMenu(
m_mainLayer,
"top-right-menu",
Expand All @@ -50,19 +54,20 @@ using namespace geode::node_ids;
);
infoMenu->updateLayout();

topMenu->setID("top-left-menu");
topMenu->setLayout(
auto closeMenu = detachAndCreateMenu(
m_mainLayer,
"top-left-menu",
ColumnLayout::create()
->setAxisReverse(true)
->setAxisAlignment(AxisAlignment::End)
->setAxisAlignment(AxisAlignment::End),
topMenu->getChildByID("close-button")
);
topMenu->setContentSize({ 60.f, 120.f });
topMenu->setPositionY(
topMenu->getPositionY() - 120.f / 2 +
topMenu->getChildByID("close-button")->getScaledContentSize().height / 2
closeMenu->setContentSize({ 60.f, 120.f });
closeMenu->setPositionY(
closeMenu->getPositionY() - 120.f / 2 +
closeMenu->getChildByID("close-button")->getScaledContentSize().height / 2
);
topMenu->updateLayout();
//topMenu->setPositionX(285);
closeMenu->updateLayout();
}
getChildOfType<ChallengeNode>(m_mainLayer, 0)->setID("top-quest");
getChildOfType<ChallengeNode>(m_mainLayer, 1)->setID("middle-quest");
Expand Down

0 comments on commit 7608d7a

Please sign in to comment.