mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
refactor: move mod tasks to their own subfolder
Makes the launcher/minecraft/mod/ folder a little more organized.
This commit is contained in:
parent
fcfb2cfc3d
commit
5a34e8fd7c
11 changed files with 34 additions and 27 deletions
|
|
@ -1,31 +0,0 @@
|
|||
#include "LocalModUpdateTask.h"
|
||||
|
||||
#include <toml.h>
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "modplatform/packwiz/Packwiz.h"
|
||||
|
||||
LocalModUpdateTask::LocalModUpdateTask(QDir index_dir, ModPlatform::IndexedPack& mod, ModPlatform::IndexedVersion& mod_version)
|
||||
: m_index_dir(index_dir), m_mod(mod), m_mod_version(mod_version)
|
||||
{
|
||||
// Ensure a '.index' folder exists in the mods folder, and create it if it does not
|
||||
if (!FS::ensureFolderPathExists(index_dir.path())) {
|
||||
emitFailed(QString("Unable to create index for mod %1!").arg(m_mod.name));
|
||||
}
|
||||
}
|
||||
|
||||
void LocalModUpdateTask::executeTask()
|
||||
{
|
||||
setStatus(tr("Updating index for mod:\n%1").arg(m_mod.name));
|
||||
|
||||
auto pw_mod = Packwiz::createModFormat(m_index_dir, m_mod, m_mod_version);
|
||||
Packwiz::updateModIndex(m_index_dir, pw_mod);
|
||||
|
||||
emitSucceeded();
|
||||
}
|
||||
|
||||
bool LocalModUpdateTask::abort()
|
||||
{
|
||||
emitAborted();
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue