Skip to content

Commit fdb4852

Browse files
committed
LET'S GO
1 parent 744fd24 commit fdb4852

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/ui/SongControlMenu.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,18 @@ void SongControlMenu::checkManagerFinished(float) {
237237
}
238238

239239
void SongControlMenu::checkDaSongPositions(float) {
240-
if (!this->m_currTimeLb || !this->m_totlTimeLb) return;
240+
if (this->b) {
241+
this->b->_bottomLeft->setVisible(false);
242+
this->b->_bottomRight->setVisible(false);
243+
this->b->_bottom->setPositionX(0.f);
244+
this->b->_bottom->setScaleX(9.375f);
245+
}
246+
247+
if (!this->m_currTimeLb || !this->m_totlTimeLb || !this->m_currProgBar || !this->m_darkProgBar) return;
248+
241249
SongManager& songManager = SongManager::get();
250+
if (!songManager.getFinishedCalculatingSongLengths()) return;
251+
242252
FMODAudioEngine* fmod = FMODAudioEngine::get();
243253
const std::string& currSong = songManager.getCurrentSong();
244254
if (fmod->getActiveMusic(0) != currSong || !songManager.getSongToSongDataEntries().contains(currSong)) return;
@@ -248,6 +258,8 @@ void SongControlMenu::checkDaSongPositions(float) {
248258

249259
this->m_currTimeLb->setString(fmt::format("{}:{:02}", ((lastPosition / 1000) / 60), ((lastPosition / 1000) % 60)).c_str());
250260
this->m_totlTimeLb->setString(fmt::format("{}:{:02}", ((fullLength / 1000) / 60), ((fullLength / 1000) % 60)).c_str());
261+
262+
this->m_currProgBar->setContentWidth(((1.f * lastPosition) / (1.f * fullLength)) * this->m_darkProgBar->getContentWidth());
251263
}
252264

253265
void SongControlMenu::onShuffleButton(CCObject*) {

0 commit comments

Comments
 (0)