diff options
author | flow <flowlnlnln@gmail.com> | 2022-07-18 12:40:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 12:40:25 -0300 |
commit | dec81c4f274dd8388d442062cf9fa18600aa850d (patch) | |
tree | 11bf89a63035e4bf52b4d875a63cf5872da69bdc /launcher/minecraft/MinecraftInstance.cpp | |
parent | 56085310cb066c7b3899684c3e3f39fe9fd311c4 (diff) | |
parent | 54b335711acac5e57e94bc9cb81c751c9b2872c5 (diff) | |
download | PrismLauncher-dec81c4f274dd8388d442062cf9fa18600aa850d.tar.gz PrismLauncher-dec81c4f274dd8388d442062cf9fa18600aa850d.tar.bz2 PrismLauncher-dec81c4f274dd8388d442062cf9fa18600aa850d.zip |
Merge pull request #588 from flowln/mod_update
Implement mod updater (:sunglasses:)
Diffstat (limited to 'launcher/minecraft/MinecraftInstance.cpp')
-rw-r--r-- | launcher/minecraft/MinecraftInstance.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index abc022b6..360e754d 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -700,24 +700,24 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session, Minecr { out << QString("%1:").arg(label); auto modList = model.allMods(); - std::sort(modList.begin(), modList.end(), [](Mod &a, Mod &b) { - auto aName = a.fileinfo().completeBaseName(); - auto bName = b.fileinfo().completeBaseName(); + std::sort(modList.begin(), modList.end(), [](Mod::Ptr a, Mod::Ptr b) { + auto aName = a->fileinfo().completeBaseName(); + auto bName = b->fileinfo().completeBaseName(); return aName.localeAwareCompare(bName) < 0; }); - for(auto & mod: modList) + for(auto mod: modList) { - if(mod.type() == Mod::MOD_FOLDER) + if(mod->type() == Mod::MOD_FOLDER) { - out << u8" [📁] " + mod.fileinfo().completeBaseName() + " (folder)"; + out << u8" [📁] " + mod->fileinfo().completeBaseName() + " (folder)"; continue; } - if(mod.enabled()) { - out << u8" [✔️] " + mod.fileinfo().completeBaseName(); + if(mod->enabled()) { + out << u8" [✔️]" + mod->fileinfo().completeBaseName(); } else { - out << u8" [❌] " + mod.fileinfo().completeBaseName() + " (disabled)"; + out << u8" [❌] " + mod->fileinfo().completeBaseName() + " (disabled)"; } } @@ -1136,16 +1136,16 @@ std::shared_ptr<GameOptions> MinecraftInstance::gameOptionsModel() const return m_game_options; } -QList< Mod > MinecraftInstance::getJarMods() const +QList<Mod*> MinecraftInstance::getJarMods() const { auto profile = m_components->getProfile(); - QList<Mod> mods; + QList<Mod*> mods; for (auto jarmod : profile->getJarMods()) { QStringList jar, temp1, temp2, temp3; jarmod->getApplicableFiles(currentSystem, jar, temp1, temp2, temp3, jarmodsPath().absolutePath()); // QString filePath = jarmodsPath().absoluteFilePath(jarmod->filename(currentSystem)); - mods.push_back(Mod(QFileInfo(jar[0]))); + mods.push_back(new Mod(QFileInfo(jar[0]))); } return mods; } |