Browse Source

Fix startup crash when osu! folder couldn't be found

kiwec 2 months ago
parent
commit
3bb0d43dfa

+ 10 - 5
src/App/Osu/Changelog.cpp

@@ -29,13 +29,18 @@ Changelog::Changelog() : ScreenBackable() {
     CHANGELOG latest;
     latest.title =
         UString::format("%.2f (%s, %s)", convar->getConVarByName("osu_version")->getFloat(), __DATE__, __TIME__);
-    latest.changes.push_back("- Added ability to import .osk and .osz files (drop them onto the neosu window)");
-    latest.changes.push_back("- Added persistent map database (downloaded or imported maps stay after restarting the game)");
-    latest.changes.push_back("- Added skin folder");
-    latest.changes.push_back("- Now publishing 32-bit releases (for PCs running Windows 7)");
-    latest.changes.push_back("- Fixed songs failing to restart");
+    latest.changes.push_back("- Fixed crash when osu! folder couldn't be found");
     changelogs.push_back(latest);
 
+    CHANGELOG v35_08;
+    v35_08.title = "35.08 (2024-06-28)";
+    v35_08.changes.push_back("- Added ability to import .osk and .osz files (drop them onto the neosu window)");
+    v35_08.changes.push_back("- Added persistent map database (downloaded or imported maps stay after restarting the game)");
+    v35_08.changes.push_back("- Added skin folder");
+    v35_08.changes.push_back("- Now publishing 32-bit releases (for PCs running Windows 7)");
+    v35_08.changes.push_back("- Fixed songs failing to restart");
+    changelogs.push_back(v35_08);
+
     CHANGELOG v35_07;
     v35_07.title = "35.07 (2024-06-27)";
     v35_07.changes.push_back("- Added sort_skins_by_name convar");

+ 0 - 22
src/App/Osu/OptionsMenu.cpp

@@ -530,18 +530,6 @@ OptionsMenu::OptionsMenu() : ScreenBackable() {
 
     CBaseUIElement *sectionGeneral = addSection("General");
 
-    addSubSection("");
-    UIButton *downloadOsuButton = addButton("Download osu! and get some beatmaps!");
-    downloadOsuButton->setClickCallback(fastdelegate::MakeDelegate(this, &OptionsMenu::onDownloadOsuClicked));
-    downloadOsuButton->setColor(0xff00ff00);
-    downloadOsuButton->setTextColor(0xffffffff);
-
-    addLabel("... or ...")->setCenterText(true);
-    UIButton *manuallyManageBeatmapsButton = addButton("Manually manage beatmap files?");
-    manuallyManageBeatmapsButton->setClickCallback(
-        fastdelegate::MakeDelegate(this, &OptionsMenu::onManuallyManageBeatmapsClicked));
-    manuallyManageBeatmapsButton->setColor(0xff10667b);
-
     addSubSection("osu!folder");
     addLabel("1) If you have an existing osu! installation:")->setTextColor(0xff666666);
     addLabel("2) osu! > Options > \"Open osu! folder\"")->setTextColor(0xff666666);
@@ -2641,16 +2629,6 @@ void OptionsMenu::onLogInClicked() {
     }
 }
 
-void OptionsMenu::onDownloadOsuClicked() {
-    osu->getNotificationOverlay()->addNotification("Opening browser, please wait ...", 0xffffffff, false, 0.75f);
-    env->openURLInDefaultBrowser("https://osu.ppy.sh/");
-}
-
-void OptionsMenu::onManuallyManageBeatmapsClicked() {
-    osu->getNotificationOverlay()->addNotification("Opening browser, please wait ...", 0xffffffff, false, 0.75f);
-    env->openURLInDefaultBrowser("https://steamcommunity.com/sharedfiles/filedetails/?id=880768265");
-}
-
 void OptionsMenu::onCM360CalculatorLinkClicked() {
     osu->getNotificationOverlay()->addNotification("Opening browser, please wait ...", 0xffffffff, false, 0.75f);
     env->openURLInDefaultBrowser("https://www.mouse-sensitivity.com/");

+ 0 - 2
src/App/Osu/OptionsMenu.h

@@ -124,8 +124,6 @@ class OptionsMenu : public ScreenBackable, public NotificationOverlayKeyListener
     void onOutputDeviceResetUpdate();
     void onOutputDeviceRestart();
     void onLogInClicked();
-    void onDownloadOsuClicked();
-    void onManuallyManageBeatmapsClicked();
     void onCM360CalculatorLinkClicked();
     void onNotelockSelect();
     void onNotelockSelect2(UString notelockType, int id = -1);

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

@@ -59,7 +59,7 @@ Osu *osu = NULL;
 
 // release configuration
 ConVar auto_update("auto_update", true, FCVAR_DEFAULT);
-ConVar osu_version("osu_version", 35.08f, FCVAR_DEFAULT | FCVAR_HIDDEN);
+ConVar osu_version("osu_version", 35.09f, FCVAR_DEFAULT | FCVAR_HIDDEN);
 
 #ifdef _DEBUG
 ConVar osu_debug("osu_debug", true, FCVAR_DEFAULT);

+ 1 - 1
src/Engine/Platform/WinEnvironment.cpp

@@ -315,7 +315,7 @@ std::vector<std::string> WinEnvironment::getFoldersInFolder(std::string folder)
 
         buffer = filename;
 
-        if(filename.length() > 0) {
+        if(filename.length() > 0 && filename.compare(L".") != 0 && filename.compare(L"..") != 0) {
             if((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
                 int size = WideCharToMultiByte(CP_UTF8, 0, filename.c_str(), filename.length(), NULL, 0, NULL, NULL);
                 std::string utf8filename(size, 0);