diff --git a/application/application.cpp b/application/application.cpp index 56a83c29c..33f5c8a0e 100644 --- a/application/application.cpp +++ b/application/application.cpp @@ -272,7 +272,7 @@ void eu07_application::DiscordRPCService() if (currentMode != mode::driver) { // the editor and the other modes: nothing to tell, without spinning a core on it - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + std::this_thread::sleep_for(std::chrono::milliseconds(250)); continue; } diff --git a/application/scenarioloadermode.cpp b/application/scenarioloadermode.cpp index 7afe0a442..eaa034f7e 100644 --- a/application/scenarioloadermode.cpp +++ b/application/scenarioloadermode.cpp @@ -67,8 +67,13 @@ bool scenarioloader_mode::update() { return true; } catch (invalid_scenery_exception &e) { + // back to the launcher as when the scenario can't be opened, not on to the driver mode with the scenery half loaded ErrorLog( "Bad init: scenario loading failed" ); + state.reset(); + Global.SceneryFile.clear(); Application.pop_mode(); + Application.push_mode(eu07_application::mode::launcher); + return true; } // the loading state holds the scenario file open, which on some systems keeps the file from being replaced // when the scenery is saved in the editor. it'd also get in the way of another load diff --git a/application/uilayer.cpp b/application/uilayer.cpp index d8417e4fe..a188d4f0b 100644 --- a/application/uilayer.cpp +++ b/application/uilayer.cpp @@ -598,7 +598,7 @@ void ui_layer::render_hierarchy(){ if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(STR_C("UUID: %s\nNode type: %s"),uuid.c_str(), typeid(*node).name()); + ImGui::SetTooltip(STR_C("UUID: %s\nNode type: %s"), uuid.c_str(), typeid(*node).name()); } } } diff --git a/utilities/utilities.cpp b/utilities/utilities.cpp index 0c18e0027..b25c6b31d 100644 --- a/utilities/utilities.cpp +++ b/utilities/utilities.cpp @@ -476,6 +476,12 @@ std::string FileCased(std::string const &Filename) std::error_code error; if (std::filesystem::exists(Filename, error)) return Filename; +#ifdef _WIN32 + // the names there are found in any case already: no folder to go through for every file missing, nor names outside of the + // code page to throw on + return {}; +#else + // only the name of the file itself, a folder named in another case isn't found std::filesystem::path const path{Filename}; auto const directory{path.has_parent_path() ? path.parent_path() : std::filesystem::path{"."}}; auto const wanted{ToLower(path.filename().string())}; @@ -483,6 +489,7 @@ std::string FileCased(std::string const &Filename) if (ToLower(entry->path().filename().string()) == wanted) return path.has_parent_path() ? (directory / entry->path().filename()).string() : entry->path().filename().string(); return {}; +#endif } std::pair FileExists(std::vector const &Names, std::vector const &Extensions) diff --git a/utilities/utilities.h b/utilities/utilities.h index d98b7bc9a..f16431dde 100644 --- a/utilities/utilities.h +++ b/utilities/utilities.h @@ -218,7 +218,7 @@ template <> bool extract_value(bool &Variable, std::string const &Key, std::stri bool FileExists(std::string const &Filename); // the file as it's named on the disk when only the case of its name differs, as in the sceneries made on Windows; empty when -// there's none +// there's none. the folders have to be named in their case; on Windows, finding the names in any case itself, the file given or none std::string FileCased(std::string const &Filename); std::pair FileExists(std::vector const &Names, std::vector const &Extensions);