Skip to content

Commit 445a455

Browse files
committed
UI Changes
1 parent a2f91b5 commit 445a455

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/ui/SongListLayer.cpp

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ void SongListLayer::customSetup() {
2424
);
2525
infoMenu->setContentSize({24.f, 23.f});
2626
InfoAlertButton* infoBtn = InfoAlertButton::create(
27-
"Menu Loop Randomizer",
27+
"Menu Loop Randomizer - FAQ",
2828
"<cy>Q: I can't blacklist/favorite songs from here?!</c>\n"
2929
"A: You should at least <c_>***listen***</c> to a song before making these decisions. "
3030
"Also, there wasn't enough room\nto fit those buttons into each row.\n\n"
3131
"<cy>Q: Why did the MLR control panel just close?!</c>\n"
3232
"A: Touch priority and Z ordering issues.\n<cy>(In other words, bugs not worth fixing.)</c>\n\n"
33-
"<cy>Q: Add a search bar!</c> A: <c_>No. Never. Learn how to scroll through a list.</c>",
33+
"<cy>Q: Add a search bar!</c>\n"
34+
"A: <c_>No. Never. Learn how to scroll through a list.</c>",
3435
1.f
3536
);
3637
infoMenu->addChildAtPosition(infoBtn, geode::Anchor::Center);
@@ -101,6 +102,39 @@ void SongListLayer::showLayer(const bool instant) {
101102

102103
this->setID("SongListLayer"_spr);
103104
m_listLayer->setID("list-of-songs-layer"_spr);
105+
106+
CCNode* titleLabel = m_listLayer->getChildByID("title");
107+
if (!titleLabel) return;
108+
109+
const SongManager& songManager = SongManager::get();
110+
111+
const std::string& playlistFileName = songManager.getPlaylistIsEmpty() ? "None" : geode::utils::string::replace(Utils::toNormalizedString(geode::Mod::get()->getSettingValue<std::filesystem::path>("playlistFile").filename()), ".txt", "");
112+
cocos2d::CCLabelBMFont* currentPlaylistLabel = cocos2d::CCLabelBMFont::create(fmt::format("Selected Playlist: {}", playlistFileName).c_str(), "bigFont.fnt");
113+
currentPlaylistLabel->setPosition({83.5f, 0.f});
114+
currentPlaylistLabel->limitLabelWidth(279.f * .45f, 1.f, .0001f);
115+
currentPlaylistLabel->setZOrder(titleLabel->getZOrder());
116+
117+
const std::string& loadPlaylistFileInstead = Utils::getBool("loadPlaylistFile") ? "ON" : "OFF";
118+
cocos2d::CCLabelBMFont* loadPlaylistFileLabel = cocos2d::CCLabelBMFont::create(fmt::format("Load Playlist File: {}", loadPlaylistFileInstead).c_str(), "bigFont.fnt");
119+
loadPlaylistFileLabel->setPosition({83.5f, -11.f});
120+
loadPlaylistFileLabel->limitLabelWidth(279.f * .45f, 1.f, .0001f);
121+
loadPlaylistFileLabel->setZOrder(titleLabel->getZOrder());
122+
123+
const std::string& isConstantShuffleMode = songManager.getConstantShuffleMode() ? "ON" : "OFF";
124+
cocos2d::CCLabelBMFont* constantShuffleModeLabel = cocos2d::CCLabelBMFont::create(fmt::format("Constant Shuffle Mode: {}", isConstantShuffleMode).c_str(), "bigFont.fnt");
125+
constantShuffleModeLabel->setPosition({272.5f, 0.f});
126+
constantShuffleModeLabel->limitLabelWidth(279.f * .45f, 1.f, .0001f);
127+
constantShuffleModeLabel->setZOrder(titleLabel->getZOrder());
128+
129+
cocos2d::CCLabelBMFont* platformLabel = cocos2d::CCLabelBMFont::create(fmt::format("Platform: {}", Utils::getPlatform()).c_str(), "bigFont.fnt");
130+
platformLabel->setPosition({272.5f, -11.f});
131+
platformLabel->limitLabelWidth(279.f * .45f, 1.f, .0001f);
132+
platformLabel->setZOrder(titleLabel->getZOrder());
133+
134+
m_listLayer->addChild(currentPlaylistLabel);
135+
m_listLayer->addChild(loadPlaylistFileLabel);
136+
m_listLayer->addChild(constantShuffleModeLabel);
137+
m_listLayer->addChild(platformLabel);
104138
}
105139

106140
void SongListLayer::onSettingsButton(CCObject*) {

0 commit comments

Comments
 (0)