diff --git a/src/lootthread.cpp b/src/lootthread.cpp index 884e48a..fd9b694 100644 --- a/src/lootthread.cpp +++ b/src/lootthread.cpp @@ -85,9 +85,9 @@ void LOOTWorker::setGamePath(const std::string& gamePath) m_GamePath = gamePath; } -void LOOTWorker::setOutput(const std::string& outputPath) +void LOOTWorker::setReportOutputPath(const std::string& reportOutputPath) { - m_OutputPath = outputPath; + m_ReportOutputPath = reportOutputPath; } void LOOTWorker::setUpdateMasterlist(bool update) @@ -100,6 +100,12 @@ void LOOTWorker::setPluginListPath(const std::string& pluginListPath) m_PluginListPath = pluginListPath; } +void LOOTWorker::setSortedPluginListOutputPath( + const std::string& sortedPluginListOutputPath) +{ + m_SortedPluginListOutputPath = sortedPluginListOutputPath; +} + void LOOTWorker::setLanguageCode(const std::string& languageCode) { m_Language = languageCode; @@ -818,10 +824,10 @@ int LOOTWorker::run() progress(Progress::WritingLoadorder); - std::ofstream outf(m_PluginListPath); + std::ofstream outf(m_SortedPluginListOutputPath); if (!outf) { log(loot::LogLevel::error, - "failed to open " + m_PluginListPath + " to rewrite it"); + "failed to open " + m_SortedPluginListOutputPath + " to rewrite it"); return 1; } outf << "# This file was automatically generated by Mod Organizer." << std::endl; @@ -831,7 +837,7 @@ int LOOTWorker::run() outf.close(); progress(Progress::ParsingLootMessages); - std::ofstream(m_OutputPath) << createJsonReport(*gameHandle, sortedPlugins); + std::ofstream(m_ReportOutputPath) << createJsonReport(*gameHandle, sortedPlugins); } catch (std::system_error& e) { log(loot::LogLevel::error, e.what()); return 1; diff --git a/src/lootthread.h b/src/lootthread.h index 647f4a9..530180a 100644 --- a/src/lootthread.h +++ b/src/lootthread.h @@ -23,8 +23,9 @@ class LOOTWorker void setGame(const std::string& gameName); void setGamePath(const std::string& gamePath); - void setOutput(const std::string& outputPath); + void setReportOutputPath(const std::string& reportOutputPath); void setPluginListPath(const std::string& pluginListPath); + void setSortedPluginListOutputPath(const std::string& sortedPluginListOutputPath); void setLanguageCode(const std::string& language_code); // Will add this when I figure out // how languages work on MO @@ -73,8 +74,9 @@ class LOOTWorker std::string m_Language; std::string m_GameName; std::string m_GamePath; - std::string m_OutputPath; + std::string m_ReportOutputPath; std::string m_PluginListPath; + std::string m_SortedPluginListOutputPath; loot::LogLevel m_LogLevel; bool m_UpdateMasterlist; mutable std::recursive_mutex mutex_; diff --git a/src/main.cpp b/src/main.cpp index 0ded3e2..783edd6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -74,8 +74,12 @@ int wWinMain(HINSTANCE, HINSTANCE, LPTSTR, int) worker.setUpdateMasterlist(!getParameter(arguments, "skipUpdateMasterlist")); worker.setGame(getParameter(arguments, "game")); worker.setGamePath(getParameter(arguments, "gamePath")); - worker.setPluginListPath(getParameter(arguments, "pluginListPath")); - worker.setOutput(getParameter(arguments, "out")); + + const auto pluginListPath = getParameter(arguments, "pluginListPath"); + worker.setPluginListPath(pluginListPath); + worker.setReportOutputPath(getParameter(arguments, "out")); + worker.setSortedPluginListOutputPath(getOptionalParameter( + arguments, "pluginListOutputPath", pluginListPath)); worker.setLogLevel(getLogLevel(arguments)); const auto lang = getOptionalParameter(arguments, "language", "");