Browse Source

Fix restoreMods() always using Nightcore when speed modifying

kiwec 4 months ago
parent
commit
6eb1edd28e
2 changed files with 10 additions and 12 deletions
  1. 1 0
      src/App/Osu/Changelog.cpp
  2. 9 12
      src/App/Osu/ModSelector.cpp

+ 1 - 0
src/App/Osu/Changelog.cpp

@@ -30,6 +30,7 @@ Changelog::Changelog() : ScreenBackable() {
     latest.title =
         UString::format("%.2f (%s, %s)", convar->getConVarByName("osu_version")->getFloat(), __DATE__, __TIME__);
     latest.changes.push_back("- Added slider instafade setting");
+    latest.changes.push_back("- Fixed Nightcore getting auto-selected instead of Double Time in some cases");
     changelogs.push_back(latest);
 
     CHANGELOG v35_09;

+ 9 - 12
src/App/Osu/ModSelector.cpp

@@ -537,10 +537,9 @@ void ModSelector::draw(Graphics *g) {
             g->pushTransform();
             {
                 g->rotate(90);
-                g->translate(
-                    (int)(experimentalTextHeight / 3.0f +
-                          max(0.0f, experimentalModsAnimationTranslation + m_experimentalContainer->getSize().x)),
-                    (int)(osu->getScreenHeight() / 2 - experimentalTextWidth / 2));
+                g->translate((int)(experimentalTextHeight / 3.0f + max(0.0f, experimentalModsAnimationTranslation +
+                                                                                 m_experimentalContainer->getSize().x)),
+                             (int)(osu->getScreenHeight() / 2 - experimentalTextWidth / 2));
                 g->setColor(0xff777777);
                 g->setAlpha(1.0f - m_fExperimentalAnimation * m_fExperimentalAnimation);
                 g->drawString(experimentalFont, experimentalText);
@@ -551,7 +550,7 @@ void ModSelector::draw(Graphics *g) {
             {
                 g->rotate(90);
                 g->translate((int)(rectHeight + max(0.0f, experimentalModsAnimationTranslation +
-                                                                   m_experimentalContainer->getSize().x)),
+                                                              m_experimentalContainer->getSize().x)),
                              (int)(osu->getScreenHeight() / 2 - rectWidth / 2));
                 g->drawRect(0, 0, rectWidth, rectHeight);
             }
@@ -1214,9 +1213,7 @@ void ModSelector::resetMods() {
     }
 }
 
-u32 ModSelector::getModFlags() {
-    return osu->getScore()->getModsLegacy();
-}
+u32 ModSelector::getModFlags() { return osu->getScore()->getModsLegacy(); }
 
 ModSelection ModSelector::getModSelection() {
     ModSelection selection;
@@ -1240,6 +1237,9 @@ void ModSelector::restoreMods(ModSelection selection) {
     // Reset buttons and sliders to clean state
     resetMods();
 
+    // Legacy mods
+    enableModsFromFlags(selection.flags);
+
     // Override sliders
     for(int i = 0; i < m_overrideSliders.size(); i++) {
         if(m_overrideSliders[i].lock != NULL) {
@@ -1265,10 +1265,7 @@ void ModSelector::restoreMods(ModSelection selection) {
         }
     }
 
-    // Legacy mods
-    enableModsFromFlags(selection.flags);
-
-    // osu->updateMods() is already called by enableModsFromFlags()
+    osu->updateMods();
 }
 
 void ModSelector::enableModsFromFlags(u32 flags) {