summaryrefslogtreecommitdiff
path: root/src/profile.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-05-31 13:43:48 +0200
committerTannin <devnull@localhost>2014-05-31 13:43:48 +0200
commit1eb783aae348f906056cee17cb65dfd507429901 (patch)
treed9e5b93c1d528a2182416d971b27e49cb524532b /src/profile.cpp
parent93a19799b86dd6e12a186e84eb43699b318b214d (diff)
- added a new mod type that represents files handled externally (i.e. DLCs) as mods in MO
- hashes of file names in bsa files are no longer checked all the time - author and description is now read from esp files - rewrote the code that fixes modlists after a rename, should be a bit more robust - fixes to qt 5 and msvc 2013 compatibility - started to update the tutorial (not done yet!) - bugfix: counter for the problems badge wasn't calculated correctly
Diffstat (limited to 'src/profile.cpp')
-rw-r--r--src/profile.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/profile.cpp b/src/profile.cpp
index 8d02c047..2d982790 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -162,8 +162,11 @@ void Profile::writeModlistNow(bool onlyOnTimer) const
unsigned int index = m_ModIndexByPriority[i];
if (index != UINT_MAX) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(index);
- if (modInfo->getFixedPriority() == INT_MIN) {
- if (m_ModStatus[index].m_Enabled) {
+ std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
+ if ((modInfo->getFixedPriority() == INT_MIN)) {
+ if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) != flags.end()) {
+ file->write("*");
+ } else if (m_ModStatus[index].m_Enabled) {
file->write("+");
} else {
file->write("-");
@@ -255,7 +258,8 @@ void Profile::refreshModStatus()
} else if (line.at(0) == '-') {
enabled = false;
modName = QString::fromUtf8(line.mid(1).trimmed().constData());
- } else if (line.at(0) == '+') {
+ } else if ((line.at(0) == '+')
+ || (line.at(0) == '*')) {
modName = QString::fromUtf8(line.mid(1).trimmed().constData());
} else {
modName = QString::fromUtf8(line.trimmed().constData());
@@ -269,8 +273,9 @@ void Profile::refreshModStatus()
unsigned int modindex = ModInfo::getIndex(modName);
if (modindex != UINT_MAX) {
ModInfo::Ptr info = ModInfo::getByIndex(modindex);
- if ((modindex < m_ModStatus.size()) && (info->getFixedPriority() == INT_MIN)) {
- m_ModStatus[modindex].m_Enabled = enabled;
+ if ((modindex < m_ModStatus.size())
+ && (info->getFixedPriority() == INT_MIN)) {
+ m_ModStatus[modindex].m_Enabled = enabled || info->alwaysEnabled();
if (m_ModStatus[modindex].m_Priority == -1) {
if (static_cast<size_t>(index) >= m_ModStatus.size()) {
throw MyException(tr("invalid index %1").arg(index));
@@ -295,9 +300,10 @@ void Profile::refreshModStatus()
// give priorities to mods not referenced in the profile
for (size_t i = 0; i < m_ModStatus.size(); ++i) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(i);
- if (!modInfo->canBeEnabled()) {
+ if (modInfo->getFixedPriority() == INT_MAX) {
continue;
}
+
if (m_ModStatus[i].m_Priority != -1) {
m_ModStatus[i].m_Priority = numKnownMods - m_ModStatus[i].m_Priority - 1;
} else {