diff --git a/src/Editor/Editor.cpp b/src/Editor/Editor.cpp index 7a399b35..e46e21a6 100644 --- a/src/Editor/Editor.cpp +++ b/src/Editor/Editor.cpp @@ -523,13 +523,14 @@ struct EditorImpl : public Editor, public InputHandler { if (gSimfile->isClosed()) return false; // Make a list of all simfiles in the current pack. - fs::path packDir = fs::path(gSimfile->getDir()); + fs::path this_dir = fs::path(gSimfile->getDir()); + fs::path packDir = this_dir.parent_path(); auto songDirs = File::findDirs(packDir, false); // Find the current simfile. int index = -1; for (int i = 0; i < songDirs.size(); ++i) { - if (songDirs[i].u8string() == packDir.u8string()) { + if (fs::equivalent(songDirs[i], this_dir)) { index = i; } } @@ -540,28 +541,33 @@ struct EditorImpl : public Editor, public InputHandler { // Find the previous/next simfile with a different directory. fs::path path; + int start_index = index; if (iterateForward) { - while (++index < songDirs.size()) { + while (++index != start_index) { + if (index == songDirs.size()) { + HudInfo("Looping to the first simfile."); + index = -1; + continue; + } path = findSimfile(songDirs[index], true); - if (path.empty()) break; - } - if (index == songDirs.size()) { - HudInfo("This is the last simfile."); - return false; + if (!path.empty()) break; } } else { - while (--index >= 0) { + while (--index != start_index) { + if (index < 0) { + HudInfo("Looping to the last simfile."); + index = songDirs.size(); + continue; + } path = findSimfile(songDirs[index], true); - if (path.empty()) break; - } - if (index < 0) { - HudInfo("This is the first simfile."); - return false; + if (!path.empty()) break; } } - - // Open the simfile. - return openSimfile(path); + if (index == start_index) { + HudInfo("No valid simfiles found."); + return false; + } else + return openSimfile(path); } bool saveSimfile(bool showSaveAsDialog) override { diff --git a/src/Editor/Notefield.cpp b/src/Editor/Notefield.cpp index 704f3437..c0b6361a 100644 --- a/src/Editor/Notefield.cpp +++ b/src/Editor/Notefield.cpp @@ -49,7 +49,9 @@ static int RoundUp(int value, int multiple) { struct TweakInfoBox : public InfoBox { void draw(recti r) override; - int height() override { return 100; } + int height() override { + return static_cast(100 * gSystem->getScaleFactor()); + } }; struct DrawPosHelper { @@ -846,8 +848,11 @@ void TweakInfoBox::draw(recti r) { Str::fmt str("Tweak %1 :: %2"); str.arg(name[mode]).arg(gTempo->getTweakValue(), 3, 3); + const int init_off_h = static_cast(16 * gSystem->getScaleFactor()); + const int text_row_h = static_cast(14 * gSystem->getScaleFactor()); + Text::arrange(Text::MC, str); - Text::draw(vec2i{r.x, r.y + 16}); + Text::draw(vec2i{r.x, r.y + init_off_h}); const char* keys[] = { "scrollwheel + shift", @@ -866,11 +871,11 @@ void TweakInfoBox::draw(recti r) { for (int i = 0; i < 4; ++i) { textStyle.textColor = RGBAtoColor32(255, 255, 255, 128); Text::arrange(Text::TR, textStyle, keys[i]); - Text::draw(vec2i{r.x - 8, r.y + 32 + i * 14}); + Text::draw(vec2i{r.x - 8, r.y + init_off_h * 2 + i * text_row_h}); textStyle.textColor = Colors::white; Text::arrange(Text::TL, textStyle, desc[i]); - Text::draw(vec2i{r.x + 8, r.y + 32 + i * 14}); + Text::draw(vec2i{r.x + 8, r.y + init_off_h * 2 + i * text_row_h}); } } diff --git a/src/Editor/TextOverlay.cpp b/src/Editor/TextOverlay.cpp index 33f21cf9..739e9a42 100644 --- a/src/Editor/TextOverlay.cpp +++ b/src/Editor/TextOverlay.cpp @@ -409,7 +409,8 @@ struct TextOverlayImpl : public TextOverlay { vec2i view = gSystem->getWindowSize(); int x = view.x / 2, y = 8; for (auto& box : infoBoxes_) { - vec2i size = {280, box->height()}; + vec2i size = {static_cast(280 * gSystem->getScaleFactor()), + box->height()}; recti r = {x - size.x / 2, y, size.x, size.y}; recti r2 = {r.x - 4, r.y - 4, r.w + 8, r.h + 8}; @@ -418,7 +419,7 @@ struct TextOverlayImpl : public TextOverlay { box->draw(r); - y += size.y + 12; + y += size.y + static_cast(280 * gSystem->getScaleFactor()); } x = 4, y = 4; diff --git a/src/Managers/TempoMan.cpp b/src/Managers/TempoMan.cpp index edc36353..12a3882a 100644 --- a/src/Managers/TempoMan.cpp +++ b/src/Managers/TempoMan.cpp @@ -550,7 +550,7 @@ struct TempoManImpl : public TempoMan { void startTweakingOffset() override { if (myTweakMode == TWEAK_OFFSET || !myTempo) return; - stopTweaking(false); + stopTweaking(true); myTweakTempo = new Tempo; myTweakTempo->copy(myTempo); myTweakMode = TWEAK_OFFSET; @@ -563,7 +563,7 @@ struct TempoManImpl : public TempoMan { if ((myTweakMode == TWEAK_BPM && myTweakRow == row) || !myTempo) return; - stopTweaking(false); + stopTweaking(true); myTweakTempo = new Tempo; myTweakTempo->copy(myTempo); myTweakMode = TWEAK_BPM; @@ -575,7 +575,7 @@ struct TempoManImpl : public TempoMan { if ((myTweakMode == TWEAK_STOP && myTweakRow == row) || !myTempo) return; - stopTweaking(false); + stopTweaking(true); myTweakTempo = new Tempo; myTweakTempo->copy(myTempo); myTweakMode = TWEAK_STOP;