diff options
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index e05935ef..fc09097a 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -708,6 +708,15 @@ QString ModList::displayName(const QString &internalName) const }
}
+QStringList ModList::allMods() const
+{
+ QStringList result;
+ for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) {
+ result.append(ModInfo::getByIndex(i)->internalName());
+ }
+ return result;
+}
+
IModList::ModStates ModList::state(const QString &name) const
{
unsigned int modIndex = ModInfo::getIndex(name);
@@ -715,6 +724,20 @@ IModList::ModStates ModList::state(const QString &name) const return state(modIndex);
}
+bool ModList::setActive(const QString &name, bool active)
+{
+ unsigned int modIndex = ModInfo::getIndex(name);
+ if (modIndex == UINT_MAX) {
+ return false;
+ } else {
+ m_Profile->setModEnabled(modIndex, active);
+
+ IModList::ModStates newState = state(modIndex);
+ m_ModStateChanged(name, newState);
+ return true;
+ }
+}
+
int ModList::priority(const QString &name) const
{
unsigned int modIndex = ModInfo::getIndex(name);
|
