File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -237,8 +237,18 @@ void SongControlMenu::checkManagerFinished(float) {
237237}
238238
239239void 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
253265void SongControlMenu::onShuffleButton (CCObject*) {
You can’t perform that action at this time.
0 commit comments