Skip to content

Commit 5de440d

Browse files
committed
fix compile errors
1 parent 0b2fb96 commit 5de440d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void Utils::popualteSongToSongDataMap() {
473473
std::vector<std::string> tempKeys = {};
474474
std::error_code ec, ed;
475475

476-
for (const std::string_view song : songManager.getSongs()) {
476+
for (const STRING_TYPE song : songManager.getSongs()) {
477477
SongType songType = SongType::Regular;
478478
if (std::ranges::find(blacklist.begin(), blacklist.end(), song) != blacklist.end()) songType = SongType::Blacklisted;
479479
else if (std::ranges::find(favorites.begin(), favorites.end(), song) != favorites.end()) songType = SongType::Favorited;

src/Utils.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#pragma once
22

3+
#ifndef GEODE_IS_WINDOWS
4+
#define STRING_TYPE std::string_view
5+
#else
6+
#define STRING_TYPE std::string&
7+
#endif
8+
39
class Utils {
410
public:
511
static int randomIndex(int);

src/ui/MLRSongCell.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ bool MLRSongCell::init(const SongData& songData, const bool isEven, const bool i
7070
songNameLabel->setSkewX(10.f);
7171
}
7272
}
73-
songNameLabel->limitLabelWidth(356.f * (.8 / compactModeFactor), std::clamp<float>((.75f / compactModeFactor), .3, .75), .001f);
73+
songNameLabel->limitLabelWidth(356.f * (.8f / compactModeFactor), std::clamp<float>((.75f / compactModeFactor), .3, .75), .001f);
7474
this->setUserObject("song-name"_spr, cocos2d::CCString::create(songData.displayName));
7575

7676
cocos2d::CCLabelBMFont* extraInfoLabl = nullptr;
7777
if (isCompact && Utils::getBool("showExtraInfoLabel")) {
7878
extraInfoLabl = cocos2d::CCLabelBMFont::create("PLACEHOLDER SO NOTHING CRASHES", "chatFont.fnt");
79-
extraInfoLabl->setString(fmt::format("{} | {:.2f} sec | {:.2f} MB | Date: {:%F %T}", songData.fileExtension, songData.songLength / 1000.f, songData.songFileSize / 1000000.f, std::chrono::system_clock::time_point(std::chrono::duration_cast<std::chrono::system_clock::duration>(songData.songWriteTime.time_since_epoch()))).c_str());
79+
extraInfoLabl->setString(fmt::format("{} | {:.2f} sec | {:.2f} MB | Date added: {:%F %T}", songData.fileExtension, songData.songLength / 1000.f, songData.songFileSize / 1000000.f, std::chrono::system_clock::time_point(std::chrono::duration_cast<std::chrono::system_clock::duration>(songData.songWriteTime.time_since_epoch()))).c_str());
8080
extraInfoLabl->setAnchorPoint({.0f, .5f});
8181
extraInfoLabl->setPosition({songNameLabel->getPositionX() + songNameLabel->getScaledContentWidth() + 5.f, this->getContentHeight() / 2.f});
82-
extraInfoLabl->limitLabelWidth(356.f * (.5 / compactModeFactor), std::clamp<float>((.75f / compactModeFactor), .3, .75), .001f);
82+
extraInfoLabl->limitLabelWidth(356.f * (.7f / compactModeFactor), std::clamp<float>((.75f / compactModeFactor), .3, .75), .001f);
8383
}
8484

8585
CCLayerColor* divider = CCLayerColor::create({0, 0, 0, 127}, 356.f, .5f);

0 commit comments

Comments
 (0)