mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
feat: add requireBy and requires columns
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
bacce134c0
commit
22539a4ff8
5 changed files with 153 additions and 10 deletions
|
|
@ -105,6 +105,20 @@ int Mod::compare(const Resource& other, SortType type) const
|
|||
return compare_result;
|
||||
break;
|
||||
}
|
||||
case SortType::REQUIRED_BY: {
|
||||
if (requiredByCount() > cast_other->requiredByCount())
|
||||
return 1;
|
||||
if (requiredByCount() < cast_other->requiredByCount())
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
case SortType::REQUIRES: {
|
||||
if (requiresCount() > cast_other->requiresCount())
|
||||
return 1;
|
||||
if (requiresCount() < cast_other->requiresCount())
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -288,3 +302,20 @@ QStringList Mod::dependencies() const
|
|||
{
|
||||
return details().dependencies;
|
||||
}
|
||||
|
||||
int Mod::requiredByCount() const
|
||||
{
|
||||
return m_requiredByCount;
|
||||
}
|
||||
int Mod::requiresCount() const
|
||||
{
|
||||
return m_requiresCount;
|
||||
}
|
||||
void Mod::setRequiredByCount(int value)
|
||||
{
|
||||
m_requiredByCount = value;
|
||||
}
|
||||
void Mod::setRequiresCount(int value)
|
||||
{
|
||||
m_requiresCount = value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue