mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-06 21:36:58 +03:00
Higlight installed mods
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
7fb4c8358b
commit
f96b135ef7
21 changed files with 67 additions and 51 deletions
|
|
@ -6,8 +6,10 @@
|
|||
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
#include "minecraft/PackProfile.h"
|
||||
#include "minecraft/mod/ModFolderModel.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <algorithm>
|
||||
|
||||
namespace ResourceDownload {
|
||||
|
||||
|
|
@ -67,4 +69,14 @@ void ModModel::searchWithTerm(const QString& term, unsigned int sort, bool filte
|
|||
refresh();
|
||||
}
|
||||
|
||||
bool ModModel::isPackInstalled(ModPlatform::IndexedPack::Ptr pack) const
|
||||
{
|
||||
auto allMods = static_cast<MinecraftInstance const&>(m_base_instance).loaderModList()->allMods();
|
||||
return std::any_of(allMods.cbegin(), allMods.cend(), [pack](Mod* mod) {
|
||||
if (auto meta = mod->metadata(); meta)
|
||||
return meta->provider == pack->provider && meta->project_id == pack->addonId;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace ResourceDownload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue