Skip to content

Commit

Permalink
fix PackInfoPopup positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Dec 5, 2024
1 parent 9b72651 commit 621dce6
Show file tree
Hide file tree
Showing 2 changed files with 6 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": "4.0.0-beta.1",
"geode": "4.0.1",
"version": "v1.6.6",
"gd": {
"win": "2.2074",
Expand Down
12 changes: 5 additions & 7 deletions src/PackInfoPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ std::filesystem::path PackInfoPopup::getPathInPack(const char* filename) const {
bool PackInfoPopup::setup(std::shared_ptr<Pack> pack) {
m_pack = pack;

auto winSize = CCDirector::sharedDirector()->getWinSize();

auto title = WackyBypassFont::create(
pack->getDisplayName().c_str(),
this->getPathInPack("goldFont.fnt")
);
title->setPosition(
winSize.width / 2,
winSize.height / 2 + m_size.height / 2 - 30.f
m_size.width / 2,
m_size.height / 2 + m_size.height / 2 - 30.f
);
m_mainLayer->addChild(title);

Expand All @@ -84,7 +82,7 @@ bool PackInfoPopup::setup(std::shared_ptr<Pack> pack) {
this->getPathInPack("bigFont.fnt")
);
bigFontLabel->limitLabelWidth(m_size.width, .5f, .1f);
bigFontLabel->setPosition(winSize / 2 + CCPoint { 0.f, 10.f });
bigFontLabel->setPosition(m_size / 2 + CCPoint { 0.f, 10.f });
m_mainLayer->addChild(bigFontLabel);

// GJ_button_01.png
Expand All @@ -111,7 +109,7 @@ bool PackInfoPopup::setup(std::shared_ptr<Pack> pack) {
auto defaultBtn = CCMenuItemSpriteExtra::create(
defaultBtnSpr, this, nullptr
);
defaultBtn->setPosition(-60.f, -50.f);
defaultBtn->setPosition(m_size / 2 + CCPoint{-60.f, -50.f});
m_buttonMenu->addChild(defaultBtn);

// GJ_button_02.png
Expand All @@ -138,7 +136,7 @@ bool PackInfoPopup::setup(std::shared_ptr<Pack> pack) {
auto altBtn = CCMenuItemSpriteExtra::create(
altBtnSpr, this, nullptr
);
altBtn->setPosition(60.f, -50.f);
altBtn->setPosition(m_size / 2 + CCPoint{60.f, -50.f});
m_buttonMenu->addChild(altBtn);

return true;
Expand Down

0 comments on commit 621dce6

Please sign in to comment.