Skip to content

Commit 621dce6

Browse files
committed
fix PackInfoPopup positioning
1 parent 9b72651 commit 621dce6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.0.0-beta.1",
2+
"geode": "4.0.1",
33
"version": "v1.6.6",
44
"gd": {
55
"win": "2.2074",

src/PackInfoPopup.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ std::filesystem::path PackInfoPopup::getPathInPack(const char* filename) const {
6565
bool PackInfoPopup::setup(std::shared_ptr<Pack> pack) {
6666
m_pack = pack;
6767

68-
auto winSize = CCDirector::sharedDirector()->getWinSize();
69-
7068
auto title = WackyBypassFont::create(
7169
pack->getDisplayName().c_str(),
7270
this->getPathInPack("goldFont.fnt")
7371
);
7472
title->setPosition(
75-
winSize.width / 2,
76-
winSize.height / 2 + m_size.height / 2 - 30.f
73+
m_size.width / 2,
74+
m_size.height / 2 + m_size.height / 2 - 30.f
7775
);
7876
m_mainLayer->addChild(title);
7977

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

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

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

144142
return true;

0 commit comments

Comments
 (0)