1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

revert launcher changes

This commit is contained in:
nordsoft 2022-09-22 17:15:49 +04:00
parent 89d0de53da
commit 2c2c044191
3 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,10 @@ public:
bool isInstalled() const;
// vcmi essential files
bool isEssential() const;
// checks if verison is compatible with vcmi
bool isCompatible() const;
// returns if has any data
bool isValid() const;
// see ModStatus enum
int getModStatus() const;

View File

@ -245,6 +245,7 @@ bool CModFilterModel::filterMatchesThis(const QModelIndex & source) const
{
CModEntry mod = base->getMod(source.data(ModRoles::ModNameRole).toString());
return (mod.getModStatus() & filterMask) == filteredType &&
mod.isValid() &&
QSortFilterProxyModel::filterAcceptsRow(source.row(), source.parent());
}

View File

@ -169,6 +169,10 @@ bool CModManager::canEnableMod(QString modname)
if(!mod.isInstalled())
return addError(modname, "Mod must be installed first");
//check for compatibility
if(!mod.isCompatible())
return addError(modname, "Mod is not compatible, please update VCMI and checkout latest mod revisions");
for(auto modEntry : mod.getValue("depends").toStringList())
{
if(!modList->hasMod(modEntry)) // required mod is not available