diff --git a/tf2_bot_detector/Filesystem.cpp b/tf2_bot_detector/Filesystem.cpp index 05b3433d..4143334b 100644 --- a/tf2_bot_detector/Filesystem.cpp +++ b/tf2_bot_detector/Filesystem.cpp @@ -115,10 +115,7 @@ std::filesystem::path Filesystem::ResolvePath(const std::filesystem::path& path, } else if (usage == PathUsage::Write) { - if (!m_IsPortable) - return m_AppDataDir / path; - - return m_WorkingDir / path; + return GetRealMutableDataDir() / path; } else { diff --git a/tf2_bot_detector/Filesystem.h b/tf2_bot_detector/Filesystem.h index 473c47f1..e658f07b 100644 --- a/tf2_bot_detector/Filesystem.h +++ b/tf2_bot_detector/Filesystem.h @@ -45,18 +45,15 @@ namespace tf2_bot_detector { return baseDataDir / "logs"; } - std::filesystem::path GetLogsDir() const - { - return GetLogsDir(GetMutableDataDir()); - } + std::filesystem::path GetLogsDir() const { return GetLogsDir(GetMutableDataDir()); } + std::filesystem::path GetRealLogsDir() const { return GetLogsDir(GetRealMutableDataDir()); } + static std::filesystem::path GetConfigDir(const std::filesystem::path& baseDataDir) { return baseDataDir / "cfg"; } - std::filesystem::path GetConfigDir() const - { - return GetConfigDir(GetMutableDataDir()); - } + std::filesystem::path GetConfigDir() const { return GetConfigDir(GetMutableDataDir()); } + std::filesystem::path GetRealConfigDir() const { return GetConfigDir(GetRealMutableDataDir()); } bool Exists(const std::filesystem::path& path) const { diff --git a/tf2_bot_detector/UI/MainWindow.cpp b/tf2_bot_detector/UI/MainWindow.cpp index d1317171..9915ba12 100644 --- a/tf2_bot_detector/UI/MainWindow.cpp +++ b/tf2_bot_detector/UI/MainWindow.cpp @@ -617,9 +617,9 @@ void MainWindow::OnDrawMenuBar() if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Open Config Folder")) - Shell::ExploreTo(IFilesystem::GetConfigDir(IFilesystem::Get().GetRealMutableDataDir())); + Shell::ExploreTo(IFilesystem::Get().GetRealConfigDir()); if (ImGui::MenuItem("Open Logs Folder")) - Shell::ExploreTo(IFilesystem::GetLogsDir(IFilesystem::Get().GetRealMutableDataDir())); + Shell::ExploreTo(IFilesystem::Get().GetRealLogsDir()); ImGui::Separator();