diff --git a/colobot-base/src/common/font_loader.cpp b/colobot-base/src/common/font_loader.cpp index b0e485ced..d3a2be2c3 100644 --- a/colobot-base/src/common/font_loader.cpp +++ b/colobot-base/src/common/font_loader.cpp @@ -85,5 +85,5 @@ std::optional CFontLoader::GetFont(Gfx::FontType type) co if (iterator == m_fonts.end()) return std::nullopt; else - return std::filesystem::path("fonts") / iterator->second; + return "fonts" / TempToPath(iterator->second); } diff --git a/colobot-base/src/graphics/engine/oldmodelmanager.cpp b/colobot-base/src/graphics/engine/oldmodelmanager.cpp index de263073a..13e299139 100644 --- a/colobot-base/src/graphics/engine/oldmodelmanager.cpp +++ b/colobot-base/src/graphics/engine/oldmodelmanager.cpp @@ -51,13 +51,13 @@ bool COldModelManager::LoadModel(const std::string& name, bool mirrored, int tea std::unique_ptr model; try { - auto extension = std::filesystem::path(name).extension().string(); + auto extension = TempToPath(name).extension().string(); if (!extension.empty()) { GetLogger()->Debug("Loading model '%%'", name); - model = ModelInput::Read("models/" + name); + model = ModelInput::Read(TempToPath("models/" + name)); if (model->GetMeshCount() == 0) return false; @@ -67,11 +67,11 @@ bool COldModelManager::LoadModel(const std::string& name, bool mirrored, int tea auto gltf_path = "models/" + name + ".gltf"; - if (CResourceManager::Exists(gltf_path)) + if (CResourceManager::Exists(TempToPath(gltf_path))) { GetLogger()->Debug("Loading model '%%'", (name + ".gltf")); - model = ModelInput::Read(gltf_path); + model = ModelInput::Read(TempToPath(gltf_path)); if (model->GetMeshCount() > 0) goto skip; @@ -79,11 +79,11 @@ bool COldModelManager::LoadModel(const std::string& name, bool mirrored, int tea auto mod_path = "models/" + name + ".mod"; - if (CResourceManager::Exists(mod_path)) + if (CResourceManager::Exists(TempToPath(mod_path))) { GetLogger()->Debug("Loading model '%%'", (name + ".mod")); - model = ModelInput::Read(mod_path); + model = ModelInput::Read(TempToPath(mod_path)); if (model->GetMeshCount() > 0) goto skip; diff --git a/colobot-base/src/graphics/engine/particle.cpp b/colobot-base/src/graphics/engine/particle.cpp index 5dc9b713f..65e28d8c7 100644 --- a/colobot-base/src/graphics/engine/particle.cpp +++ b/colobot-base/src/graphics/engine/particle.cpp @@ -3458,7 +3458,7 @@ void CParticle::DrawParticle(int sheet) { std::string name; NameParticle(name, t); - auto texture = m_engine->LoadTexture(std::filesystem::path("textures") / name); + auto texture = m_engine->LoadTexture("textures" / TempToPath(name)); m_renderer->SetTexture(texture); loadTexture = true; } diff --git a/colobot-base/src/graphics/model/model_gltf.cpp b/colobot-base/src/graphics/model/model_gltf.cpp index 785486c6a..4a69cbc3b 100644 --- a/colobot-base/src/graphics/model/model_gltf.cpp +++ b/colobot-base/src/graphics/model/model_gltf.cpp @@ -145,7 +145,7 @@ void GLTFLoader::ReadBuffers() if (node.contains("uri")) { - auto uri = m_directory / node["uri"].get(); + auto uri = m_directory / StrUtils::ToPath(node["uri"].get()); CInputStream stream(uri); diff --git a/colobot-base/src/graphics/model/model_manager.cpp b/colobot-base/src/graphics/model/model_manager.cpp index 5fe5b5f0b..30d6a2ed0 100644 --- a/colobot-base/src/graphics/model/model_manager.cpp +++ b/colobot-base/src/graphics/model/model_manager.cpp @@ -20,6 +20,7 @@ #include "graphics/model/model_manager.h" #include "common/logger.h" +#include "common/stringutils.h" #include "common/resources/inputstream.h" @@ -35,7 +36,7 @@ CModel* CModelManager::GetModel(const std::string& modelName) if (it != m_models.end()) return it->second.get(); - std::filesystem::path modelFile = "models-new/" + modelName + ".txt"; + std::filesystem::path modelFile = TempToPath("models-new/" + modelName + ".txt"); GetLogger()->Debug("Loading new model: %%", modelFile.string()); diff --git a/colobot-base/src/level/parser/parser.cpp b/colobot-base/src/level/parser/parser.cpp index d0178c98a..4be44e300 100644 --- a/colobot-base/src/level/parser/parser.cpp +++ b/colobot-base/src/level/parser/parser.cpp @@ -89,7 +89,7 @@ std::filesystem::path CLevelParser::BuildScenePath(std::string_view category, in if (category == "custom") { - path /= CRobotMain::GetInstancePointer()->GetCustomLevelName(chapter); + path /= TempToPath(CRobotMain::GetInstancePointer()->GetCustomLevelName(chapter)); if (rank == 0) { @@ -100,7 +100,7 @@ std::filesystem::path CLevelParser::BuildScenePath(std::string_view category, in } else { - path /= StrUtils::Format("level%03d", rank); + path /= StrUtils::ToPath(StrUtils::Format("level%03d", rank)); if (sceneFile) { @@ -117,11 +117,11 @@ std::filesystem::path CLevelParser::BuildScenePath(std::string_view category, in else if (category == "win" || category == "lost") { assert(chapter == 0); - path /= StrUtils::Format("%s%03d.txt", category, rank); + path /= StrUtils::ToPath(StrUtils::Format("%s%03d.txt", category, rank)); } else { - path /= StrUtils::Format("chapter%03d", chapter); + path /= StrUtils::ToPath(StrUtils::Format("chapter%03d", chapter)); if (rank == 000) { if (sceneFile) @@ -131,7 +131,7 @@ std::filesystem::path CLevelParser::BuildScenePath(std::string_view category, in } else { - path /= StrUtils::Format("level%03d", rank); + path /= StrUtils::ToPath(StrUtils::Format("level%03d", rank)); if (sceneFile) { path /= "scene.txt"; @@ -322,7 +322,7 @@ std::filesystem::path CLevelParser::InjectLevelPaths(const std::filesystem::path if(!m_pathLvl.empty() ) newPath = StrUtils::Replace(newPath, "%lvl%", StrUtils::ToString(m_pathLvl)); if(!m_pathChap.empty()) newPath = StrUtils::Replace(newPath, "%chap%", StrUtils::ToString(m_pathChap)); if(!m_pathCat.empty() ) newPath = StrUtils::Replace(newPath, "%cat%", StrUtils::ToString(m_pathCat)); - if(newPath == path && !path.empty()) + if(newPath == StrUtils::ToString(path) && !path.empty()) { newPath = StrUtils::ToString(defaultDir) + (!defaultDir.empty() ? "/" : "") + newPath; } diff --git a/colobot-base/src/level/parser/parserline.cpp b/colobot-base/src/level/parser/parserline.cpp index 0f6627c94..da09bfa85 100644 --- a/colobot-base/src/level/parser/parserline.cpp +++ b/colobot-base/src/level/parser/parserline.cpp @@ -50,7 +50,7 @@ void CLevelParserLine::SetLevel(CLevelParser* level) // Only on the first call - this makes sure the level name doesn't change if the file is loaded using #Include if (m_levelFilename.empty()) { - m_levelFilename = StrUtils::ToString(m_level->GetFilename()); + m_levelFilename = m_level->GetFilename(); } } diff --git a/colobot-base/src/level/player_profile.cpp b/colobot-base/src/level/player_profile.cpp index 46de30f49..2562f6959 100644 --- a/colobot-base/src/level/player_profile.cpp +++ b/colobot-base/src/level/player_profile.cpp @@ -257,7 +257,7 @@ int CPlayerProfile::GetSelectedRank(LevelCategory category) void CPlayerProfile::LoadFinishedLevels(LevelCategory category) { m_levelInfo[category].clear(); - std::filesystem::path filename = GetSaveFile(GetLevelCategoryDir(category) + ".gam"); + std::filesystem::path filename = GetSaveFile(TempToPath(GetLevelCategoryDir(category) + ".gam")); if (!CResourceManager::Exists(filename)) return; @@ -299,7 +299,7 @@ void CPlayerProfile::LoadFinishedLevels(LevelCategory category) void CPlayerProfile::SaveFinishedLevels(LevelCategory category) { - std::filesystem::path filename = GetSaveFile(GetLevelCategoryDir(category) + ".gam"); + std::filesystem::path filename = GetSaveFile(TempToPath(GetLevelCategoryDir(category) + ".gam")); COutputStream file; file.open(filename); if (!file.is_open()) @@ -415,7 +415,7 @@ void CPlayerProfile::LoadAppearance() try { - CLevelParser appearanceParser(StrUtils::ToString(filename)); + CLevelParser appearanceParser(filename); appearanceParser.Load(); CLevelParserLine* line; @@ -438,7 +438,7 @@ void CPlayerProfile::SaveAppearance() { try { - CLevelParser appearanceParser(StrUtils::ToString(GetSaveFile("face.gam"))); + CLevelParser appearanceParser(GetSaveFile("face.gam")); CLevelParserLineUPtr line; line = std::make_unique("Head"); @@ -467,7 +467,7 @@ bool CPlayerProfile::HasAnySavedScene() auto saveDirs = CResourceManager::ListDirectories(GetSaveDir()); for (auto dir : saveDirs) { - if (CResourceManager::Exists(GetSaveFile(StrUtils::ToString(dir / "data.sav")))) + if (CResourceManager::Exists(GetSaveFile(dir / "data.sav"))) { return true; } @@ -485,7 +485,7 @@ std::vector CPlayerProfile::GetSavedSceneList() std::filesystem::path savegameFile = GetSaveFile(dir / "data.sav"); if (CResourceManager::Exists(savegameFile) && CResourceManager::GetFileSize(savegameFile) > 0) { - CLevelParser levelParser(StrUtils::ToString(savegameFile)); + CLevelParser levelParser(savegameFile); levelParser.Load(); CLevelParserLine* line = levelParser.GetIfDefined("Created"); int time = line != nullptr ? line->GetParam("date")->AsInt() : 0; diff --git a/colobot-base/src/level/robotmain.cpp b/colobot-base/src/level/robotmain.cpp index 0c5a15a0e..9d350b3a7 100644 --- a/colobot-base/src/level/robotmain.cpp +++ b/colobot-base/src/level/robotmain.cpp @@ -599,7 +599,7 @@ void CRobotMain::ChangePhase(Phase phase) pe->SetFontType(Gfx::FONT_COMMON); pe->SetEditCap(false); pe->SetHighlightCap(false); - pe->ReadText(std::string("help/") + m_app->GetLanguageChar() + std::string("/win.txt")); + pe->ReadText(TempToPath(std::string("help/") + m_app->GetLanguageChar() + std::string("/win.txt"))); } else { @@ -2249,7 +2249,7 @@ void CRobotMain::HelpObject() std::string filename = GetHelpFilename(obj->GetType()); if (filename.empty()) return; - StartDisplayInfo(filename, -1); + StartDisplayInfo(TempToPath(filename), -1); } @@ -2873,7 +2873,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (line->GetCommand() == "ScriptFile" && !resetObject) { - m_scriptFile = line->GetParam("name")->AsString(); + m_scriptFile = TempToPath(line->GetParam("name")->AsString()); continue; } @@ -2925,7 +2925,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) GetLogger()->Warn("This level is using deprecated way of defining %% scene. Please change the %%= parameter in EndingFile from %% to \"levels/other/%1$s%2$03d.txt\".\n", type, type, rank); std::stringstream ss; ss << std::setfill('0') << std::setw(3) << rank << ".txt"; - return std::filesystem::path("levels/other") / type / ss.str(); + return "levels/other" / StrUtils::ToPath(type) / StrUtils::ToPath(ss.str()); } else { @@ -3463,7 +3463,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) char categoryChar = GetLevelCategoryDir(m_levelCategory)[0]; programStorage->LoadAllProgramsForLevel( line.get(), - StrUtils::ToString(m_playerProfile->GetSaveFile(StrUtils::Format("%c%.3d%.3d", categoryChar, m_levelChap, m_levelRank))), + StrUtils::ToString(m_playerProfile->GetSaveFile(StrUtils::ToPath(StrUtils::Format("%c%.3d%.3d", categoryChar, m_levelChap, m_levelRank)))), soluce ); } @@ -4329,7 +4329,7 @@ void CRobotMain::SaveOneScript(CObject *obj) CProgramStorageObject* programStorage = dynamic_cast(obj); char categoryChar = GetLevelCategoryDir(m_levelCategory)[0]; - programStorage->SaveAllUserPrograms(StrUtils::ToString(m_playerProfile->GetSaveFile(StrUtils::Format("%c%.3d%.3d", categoryChar, m_levelChap, m_levelRank)))); + programStorage->SaveAllUserPrograms(StrUtils::ToString(m_playerProfile->GetSaveFile(StrUtils::ToPath(StrUtils::Format("%c%.3d%.3d", categoryChar, m_levelChap, m_levelRank))))); } //! Saves the stack of the program in execution of a robot @@ -5330,7 +5330,7 @@ void CRobotMain::SetLevel(LevelCategory cat, int chap, int rank) m_levelCategory = cat; m_levelChap = chap; m_levelRank = rank; - m_levelFile = StrUtils::ToString(CLevelParser::BuildScenePath(m_levelCategory, m_levelChap, m_levelRank)); + m_levelFile = CLevelParser::BuildScenePath(m_levelCategory, m_levelChap, m_levelRank); } LevelCategory CRobotMain::GetLevelCategory() @@ -5664,7 +5664,7 @@ void CRobotMain::Autosave() strftime(timestr, 99, "%y%m%d%H%M%S", localtime(&now)); strftime(infostr, 99, "%y.%m.%d %H:%M", localtime(&now)); std::string info = std::string("[AUTOSAVE] ") + infostr; - std::filesystem::path dir = m_playerProfile->GetSaveFile(std::string("autosave") + timestr); + std::filesystem::path dir = m_playerProfile->GetSaveFile(StrUtils::ToPath(std::string("autosave") + timestr)); m_playerProfile->SaveScene(dir, info); } @@ -5696,7 +5696,7 @@ void CRobotMain::QuickLoad() void CRobotMain::LoadSaveFromDirName(const std::string& gameDir) { - std::filesystem::path dir = m_playerProfile->GetSaveFile(gameDir); + std::filesystem::path dir = m_playerProfile->GetSaveFile(TempToPath(gameDir)); if(!CResourceManager::Exists(dir)) { GetLogger()->Error("Save slot not found"); diff --git a/colobot-base/src/object/auto/autoegg.cpp b/colobot-base/src/object/auto/autoegg.cpp index eba093934..0e6850745 100644 --- a/colobot-base/src/object/auto/autoegg.cpp +++ b/colobot-base/src/object/auto/autoegg.cpp @@ -196,7 +196,7 @@ bool CAutoEgg::EventProcess(const Event &event) CProgramStorageObject* programStorage = dynamic_cast(alien); Program* program = programStorage->AddProgram(); - programStorage->ReadProgram(program, InjectLevelPathsForCurrentLevel(m_alienProgramName, "ai")); + programStorage->ReadProgram(program, InjectLevelPathsForCurrentLevel(TempToPath(m_alienProgramName), "ai")); program->readOnly = true; program->filename = m_alienProgramName; programmable->RunProgram(program); diff --git a/colobot-base/src/object/auto/autofactory.cpp b/colobot-base/src/object/auto/autofactory.cpp index bdf50f70a..8b72636e4 100644 --- a/colobot-base/src/object/auto/autofactory.cpp +++ b/colobot-base/src/object/auto/autofactory.cpp @@ -678,7 +678,7 @@ bool CAutoFactory::CreateVehicle() for (const std::string& name : m_main->GetNewScriptNames(m_type)) { Program* prog = programStorage->AddProgram(); - programStorage->ReadProgram(prog, InjectLevelPathsForCurrentLevel(name, "ai")); + programStorage->ReadProgram(prog, InjectLevelPathsForCurrentLevel(TempToPath(name), "ai")); prog->readOnly = true; prog->filename = name; } diff --git a/colobot-base/src/script/scriptfunc.cpp b/colobot-base/src/script/scriptfunc.cpp index af315a7a2..f904f6350 100644 --- a/colobot-base/src/script/scriptfunc.cpp +++ b/colobot-base/src/script/scriptfunc.cpp @@ -1709,7 +1709,7 @@ bool CScriptFunctions::rProduce(CBotVar* var, CBotVar* result, int& exception, v if (!name.empty()) { - std::filesystem::path name2 = InjectLevelPathsForCurrentLevel(name, "ai"); + std::filesystem::path name2 = InjectLevelPathsForCurrentLevel(TempToPath(name), "ai"); if (object->Implements(ObjectInterfaceType::Programmable)) { CProgramStorageObject* programStorage = dynamic_cast(object); @@ -3466,7 +3466,7 @@ class CBotFileAccessHandlerColobot : public CBotFileAccessHandler { std::string fname = PrepareFilename(filename); GetLogger()->Info("CBot delete file '%%'", fname); - return CResourceManager::Remove(fname); + return CResourceManager::Remove(TempToPath(fname)); } private: diff --git a/colobot-base/src/ui/controls/edit.cpp b/colobot-base/src/ui/controls/edit.cpp index 1d2280e4b..9ffa745ca 100644 --- a/colobot-base/src/ui/controls/edit.cpp +++ b/colobot-base/src/ui/controls/edit.cpp @@ -818,10 +818,10 @@ void CEdit::HyperJump(std::string name, std::string marker) } std::string filename = name + std::string(".txt"); - filename = StrUtils::ToString(InjectLevelPathsForCurrentLevel(filename, "help/%lng%")); + filename = StrUtils::ToString(InjectLevelPathsForCurrentLevel(TempToPath(filename), "help/%lng%")); filename = StrUtils::Replace(filename, "\\", "/"); //TODO: Fix this in files - if ( ReadText(filename) ) + if ( ReadText(TempToPath(filename)) ) { Justif(); @@ -903,7 +903,7 @@ bool CEdit::HyperGo(EventType event) m_historyCurrent ++; } - ReadText(m_history[m_historyCurrent].filename); + ReadText(TempToPath(m_history[m_historyCurrent].filename)); Justif(); SetFirstLine(m_history[m_historyCurrent].firstLine); return true; @@ -1170,7 +1170,7 @@ static std::string PrepareImageFilename(std::string name) { std::string filename; filename = name + ".png"; - filename = StrUtils::ToString(InjectLevelPathsForCurrentLevel(filename, "icons")); + filename = StrUtils::ToString(InjectLevelPathsForCurrentLevel(TempToPath(filename), "icons")); filename = StrUtils::Replace(filename, "\\", "/"); // TODO: Fix this in files return filename; } diff --git a/colobot-base/src/ui/filedialog.cpp b/colobot-base/src/ui/filedialog.cpp index 49943495d..af1ab3d0e 100644 --- a/colobot-base/src/ui/filedialog.cpp +++ b/colobot-base/src/ui/filedialog.cpp @@ -320,7 +320,7 @@ void CFileDialog::StartFileDialog() AdjustDialog(); - SetFilenameField(pe, StrUtils::ToString(m_filename)); + SetFilenameField(pe, m_filename); SetFilename(""); UpdatePublic(m_public); @@ -815,7 +815,11 @@ bool CFileDialog::EventSelectFolder(const Event &event) if ( pl == nullptr ) return false; std::string name = pl->GetItemName(pl->GetSelect()); name = name.substr(0, name.find_first_of("\t")); - m_subDirPath += m_subDirPath.empty() ? name : "/" + name; + if (m_subDirPath.empty()) { + m_subDirPath = TempToPath(name); + } else { + m_subDirPath /= TempToPath(name); + } m_eventQueue->AddEvent(Event(EVENT_DIALOG_ACTION)); } @@ -836,7 +840,11 @@ bool CFileDialog::EventSelectFolder(const Event &event) name = name.substr(0, name.find_first_of("\t")); if ( name != ".." ) { - m_subDirPath += m_subDirPath.empty() ? name : "/" + name; + if (m_subDirPath.empty()) { + m_subDirPath = TempToPath(name); + } else { + m_subDirPath /= TempToPath(name); + } m_eventQueue->AddEvent(Event(EVENT_DIALOG_ACTION)); } } @@ -859,7 +867,7 @@ void CFileDialog::GetListChoice() std::string name = pl->GetItemName(pl->GetSelect()); name = name.substr(0, name.find_first_of("\t")); - SetFilenameField(pe, name); + SetFilenameField(pe, TempToPath(name)); pe->SetCursor(999, 0); // select all m_interface->SetFocus(pe); @@ -1055,7 +1063,7 @@ void CFileDialog::PopulateList() // list all folders std::vector folders = CResourceManager::ListDirectories(SearchDirectory(false)); - if (!m_subDirPath.empty()) folders.insert(folders.begin(), std::string("..")); + if (!m_subDirPath.empty()) folders.insert(folders.begin(), ".."); for (auto& dir : folders) { time_t now = CResourceManager::GetLastModificationTime(SearchDirectory(false) / dir); @@ -1115,7 +1123,7 @@ bool CFileDialog::DirectoryExists(const std::string &name) if ( name == ".." ) return !m_subDirPath.empty(); - return CResourceManager::DirectoryExists(SearchDirectory(false) / name); + return CResourceManager::DirectoryExists(SearchDirectory(false) / TempToPath(name)); } // Make folder @@ -1130,7 +1138,7 @@ void CFileDialog::CreateNewFolder() std::string name = pe->GetText(999); if ( name.empty() ) return; - m_subDirPath /= name; // add to current path + m_subDirPath /= TempToPath(name); // add to current path SearchDirectory(true); // make the new folder @@ -1161,7 +1169,7 @@ void CFileDialog::OpenFolder() } else if ( DirectoryExists(name) ) { - m_subDirPath /= name; + m_subDirPath /= TempToPath(name); } PopulateList(); @@ -1215,8 +1223,8 @@ bool CFileDialog::ActionOpen() } SearchDirectory(true); - SetFilename(filename); - SetFilenameField(pe, filename); + SetFilename(TempToPath(filename)); + SetFilenameField(pe, TempToPath(filename)); pe->SetCursor(999, 0); // select all pw->SetFocus(pe); @@ -1243,15 +1251,15 @@ bool CFileDialog::ActionSave(bool checkFileExist) if ( checkFileExist ) { - if (CResourceManager::Exists(SearchDirectory(false) / filename)) + if (CResourceManager::Exists(SearchDirectory(false) / TempToPath(filename))) { if ( !StartAskOverwrite(filename) ) StopAskOverwrite(); return false; } } - SetFilename(filename); - SetFilenameField(pe, filename); + SetFilename(TempToPath(filename)); + SetFilenameField(pe, TempToPath(filename)); pe->SetCursor(999, 0); // select all pw->SetFocus(pe); diff --git a/colobot-base/src/ui/screen/screen_io.cpp b/colobot-base/src/ui/screen/screen_io.cpp index 7b4aebdf1..51f5e2842 100644 --- a/colobot-base/src/ui/screen/screen_io.cpp +++ b/colobot-base/src/ui/screen/screen_io.cpp @@ -240,7 +240,7 @@ void CScreenIO::IOWriteScene() std::filesystem::path dir; if (static_cast(sel) >= m_saveList.size()) { - dir = m_main->GetPlayerProfile()->GetSaveFile("save" + clearName(info)); + dir = m_main->GetPlayerProfile()->GetSaveFile(TempToPath("save" + clearName(info))); } else { diff --git a/colobot-base/src/ui/screen/screen_mod_list.cpp b/colobot-base/src/ui/screen/screen_mod_list.cpp index 31bf706ef..caff99fe8 100644 --- a/colobot-base/src/ui/screen/screen_mod_list.cpp +++ b/colobot-base/src/ui/screen/screen_mod_list.cpp @@ -296,7 +296,7 @@ bool CScreenModList::EventProcess(const Event &event) break; case EVENT_INTERFACE_MODS_DIR: - if (!systemUtils.OpenPath(StrUtils::ToString(modDir))) + if (!systemUtils.OpenPath(modDir)) { std::string title, text; GetResource(RES_TEXT, RT_DIALOG_OPEN_PATH_FAILED_TITLE, title); diff --git a/colobot-base/src/ui/screen/screen_quit.cpp b/colobot-base/src/ui/screen/screen_quit.cpp index 40d89953f..1adfbaffa 100644 --- a/colobot-base/src/ui/screen/screen_quit.cpp +++ b/colobot-base/src/ui/screen/screen_quit.cpp @@ -22,6 +22,7 @@ #include "app/app.h" #include "common/restext.h" +#include "common/stringutils.h" #include "level/robotmain.h" @@ -63,7 +64,7 @@ void CScreenQuit::CreateInterface() pe->SetHighlightCap(false); pe->SetFontType(Gfx::FONT_STUDIO); pe->SetFontSize(Gfx::FONT_SIZE_SMALL); - pe->ReadText(std::string("help/") + m_app->GetLanguageChar() + std::string("/authors.txt")); + pe->ReadText(TempToPath(std::string("help/") + m_app->GetLanguageChar() + std::string("/authors.txt"))); pos.x = 40.0f/640.0f; pos.y = 83.0f/480.0f; diff --git a/colobot-base/src/ui/studio.cpp b/colobot-base/src/ui/studio.cpp index d6d502fa3..94ae55db3 100644 --- a/colobot-base/src/ui/studio.cpp +++ b/colobot-base/src/ui/studio.cpp @@ -143,7 +143,7 @@ bool CStudio::EventProcess(const Event &event) if ( event.type == EVENT_STUDIO_LIST ) // list clicked? { - m_main->StartDisplayInfo(m_helpFilename, -1); + m_main->StartDisplayInfo(TempToPath(m_helpFilename), -1); } if ( event.type == EVENT_STUDIO_NEW ) // new?