Skip to content

Commit 0beb5b5

Browse files
committed
fix
1 parent f0bf5c4 commit 0beb5b5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@
247247
"default": true
248248
},
249249
"gd/UIOptionsLayer": {
250-
"name": "ui",
250+
"name": "Platformer Controls Settings",
251251
"description": "UIOptionsLayer",
252252
"type": "bool",
253253
"default": true
254254
},
255255
"gd/UIPOptionsLayer": {
256-
"name": "uip",
256+
"name": "Practice Controls Settings",
257257
"description": "UIPOptionsLayer",
258258
"type": "bool",
259259
"default": true

src/Tags.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Tags {
163163
return it->second;
164164
}
165165
log::error("Unknown tag: {}", tag);
166-
return "unknown";
166+
return "Unknown";
167167
}
168168

169169
private:

src/layers/GYScreenshotPopup.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,18 @@ void GYScreenshotPopup::imageCreationFinished(CCImage* image) {
7070

7171
void GYScreenshotPopup::onDownloadFail() {
7272
CCSprite* fallbackSprite = CCSprite::create("noPreview.png"_spr);
73-
m_mainLayer->addChildAtPosition(fallbackSprite, Anchor::Center);
73+
if (fallbackSprite) {
74+
auto maxWidth = m_mainLayer->getContentSize().width * 0.75f;
75+
auto maxHeight = m_mainLayer->getContentSize().height * 0.75f;
76+
77+
auto spriteWidth = fallbackSprite->getContentSize().width;
78+
auto spriteHeight = fallbackSprite->getContentSize().height;
79+
80+
float scale = std::min(maxWidth / spriteWidth, maxHeight / spriteHeight);
81+
fallbackSprite->setScale(scale);
82+
83+
m_mainLayer->addChildAtPosition(fallbackSprite, Anchor::Center);
84+
}
7485
}
7586

7687
std::string GYScreenshotPopup::extractLastSegment(const std::string& input) {

0 commit comments

Comments
 (0)