Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/lootthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/lootthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_;
Expand Down
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ int wWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
worker.setUpdateMasterlist(!getParameter<bool>(arguments, "skipUpdateMasterlist"));
worker.setGame(getParameter<std::string>(arguments, "game"));
worker.setGamePath(getParameter<std::string>(arguments, "gamePath"));
worker.setPluginListPath(getParameter<std::string>(arguments, "pluginListPath"));
worker.setOutput(getParameter<std::string>(arguments, "out"));

const auto pluginListPath = getParameter<std::string>(arguments, "pluginListPath");
worker.setPluginListPath(pluginListPath);
worker.setReportOutputPath(getParameter<std::string>(arguments, "out"));
worker.setSortedPluginListOutputPath(getOptionalParameter<std::string>(
arguments, "pluginListOutputPath", pluginListPath));
worker.setLogLevel(getLogLevel(arguments));

const auto lang = getOptionalParameter<std::string>(arguments, "language", "");
Expand Down
Loading