summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-10-08 13:05:11 -0500
committerGitHub <noreply@github.com>2023-10-08 13:05:11 -0500
commit16977b5159d2cabeb9b7be088c0a8a9d998710a1 (patch)
tree576f522936c2efe121cc181729842ecd7931c174 /src
parent48e8fdff0df30fa807e61d4df7b6116a9d190f2f (diff)
parent028c8eafa982a5b126544f733880dd7711e0786a (diff)
Merge pull request #1899 from ModOrganizer2/overlay_support
Additional overlay plugin support
Diffstat (limited to 'src')
-rw-r--r--src/pluginlist.cpp27
-rw-r--r--src/pluginlist.h4
-rw-r--r--src/pluginlistproxy.cpp5
-rw-r--r--src/pluginlistproxy.h1
-rw-r--r--src/pluginlistview.cpp16
5 files changed, 41 insertions, 12 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp
index 7b732af8..489e312b 100644
--- a/src/pluginlist.cpp
+++ b/src/pluginlist.cpp
@@ -1006,13 +1006,13 @@ bool PluginList::isLightFlagged(const QString& name) const
}
}
-bool PluginList::isOverrideFlagged(const QString& name) const
+bool PluginList::isOverlayFlagged(const QString& name) const
{
auto iter = m_ESPsByName.find(name);
if (iter == m_ESPsByName.end()) {
return false;
} else {
- return m_ESPs[iter->second].isOverrideFlagged;
+ return m_ESPs[iter->second].isOverlayFlagged;
}
}
@@ -1093,7 +1093,7 @@ void PluginList::generatePluginIndexes()
.arg((numESLs) % 4096, 3, 16, QChar('0'))
.toUpper();
++numESLs;
- } else if (overridePluginsSupported && m_ESPs[i].isOverrideFlagged) {
+ } else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) {
m_ESPs[i].index = QString("");
++numSkipped;
} else {
@@ -1233,6 +1233,8 @@ QVariant PluginList::fontData(const QModelIndex& modelIndex) const
result.setWeight(QFont::Bold);
} else if (m_ESPs[index].isLightFlagged) {
result.setItalic(true);
+ } else if (m_ESPs[index].isOverlayFlagged) {
+ result.setUnderline(true);
}
return result;
@@ -1327,6 +1329,13 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const
.arg(type);
}
+ if (esp.isOverlayFlagged) {
+ toolTip +=
+ "<br><br>" + tr("This plugin is flagged as an overlay plugin. It contains only "
+ "modified records and will overlay those changes onto the "
+ "existing records in memory. It takes no memory space.");
+ }
+
if (esp.forceDisabled) {
toolTip += "<br><br>" + tr("This game does not currently permit custom plugin "
"loading. There may be manual workarounds.");
@@ -1447,6 +1456,10 @@ QVariant PluginList::iconData(const QModelIndex& modelIndex) const
result.append(":/MO/gui/awaiting");
}
+ if (esp.isOverlayFlagged) {
+ result.append(":/MO/gui/instance_switch");
+ }
+
if (info && !info->loot.dirty.empty()) {
result.append(":/MO/gui/edit_clear");
}
@@ -1759,7 +1772,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
bool forceDisabled, const QString& originName,
const QString& fullPath, bool hasIni,
std::set<QString> archives, bool lightSupported,
- bool overrideSupported)
+ bool overlaySupported)
: name(name), fullPath(fullPath), enabled(forceLoaded), forceLoaded(forceLoaded),
forceEnabled(forceEnabled), forceDisabled(forceDisabled), priority(0),
loadOrder(-1), originName(originName), hasIni(hasIni),
@@ -1771,9 +1784,9 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
hasMasterExtension = (extension == "esm");
hasLightExtension = lightSupported && (extension == "esl");
isMasterFlagged = file.isMaster();
- isOverrideFlagged = overrideSupported && file.isOverride();
+ isOverlayFlagged = overlaySupported && file.isOverlay();
isLightFlagged =
- lightSupported && !isOverrideFlagged && file.isLight(overrideSupported);
+ lightSupported && !isOverlayFlagged && file.isLight(overlaySupported);
author = QString::fromLatin1(file.author().c_str());
description = QString::fromLatin1(file.description().c_str());
@@ -1786,7 +1799,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
hasMasterExtension = false;
hasLightExtension = false;
isMasterFlagged = false;
- isOverrideFlagged = false;
+ isOverlayFlagged = false;
isLightFlagged = false;
}
}
diff --git a/src/pluginlist.h b/src/pluginlist.h
index db32d911..10bb3997 100644
--- a/src/pluginlist.h
+++ b/src/pluginlist.h
@@ -241,7 +241,7 @@ public:
bool hasLightExtension(const QString& name) const;
bool isMasterFlagged(const QString& name) const;
bool isLightFlagged(const QString& name) const;
- bool isOverrideFlagged(const QString& name) const;
+ bool isOverlayFlagged(const QString& name) const;
boost::signals2::connection onRefreshed(const std::function<void()>& callback);
boost::signals2::connection
@@ -333,7 +333,7 @@ private:
bool hasLightExtension;
bool isMasterFlagged;
bool isLightFlagged;
- bool isOverrideFlagged;
+ bool isOverlayFlagged;
bool modSelected;
QString author;
QString description;
diff --git a/src/pluginlistproxy.cpp b/src/pluginlistproxy.cpp
index e5fa5e01..a056a38d 100644
--- a/src/pluginlistproxy.cpp
+++ b/src/pluginlistproxy.cpp
@@ -118,3 +118,8 @@ bool PluginListProxy::isLightFlagged(const QString& name) const
{
return m_Proxied->isLightFlagged(name);
}
+
+bool PluginListProxy::isOverlayFlagged(const QString& name) const
+{
+ return m_Proxied->isOverlayFlagged(name);
+}
diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h
index 63602043..98e62475 100644
--- a/src/pluginlistproxy.h
+++ b/src/pluginlistproxy.h
@@ -33,6 +33,7 @@ public:
bool hasLightExtension(const QString& name) const override;
bool isMasterFlagged(const QString& name) const override;
bool isLightFlagged(const QString& name) const override;
+ bool isOverlayFlagged(const QString& name) const override;
private:
friend class OrganizerProxy;
diff --git a/src/pluginlistview.cpp b/src/pluginlistview.cpp
index 3c2bf000..28f77821 100644
--- a/src/pluginlistview.cpp
+++ b/src/pluginlistview.cpp
@@ -58,9 +58,11 @@ void PluginListView::updatePluginCount()
{
int activeMasterCount = 0;
int activeLightMasterCount = 0;
+ int activeOverlayCount = 0;
int activeRegularCount = 0;
int masterCount = 0;
int lightMasterCount = 0;
+ int overlayCount = 0;
int regularCount = 0;
int activeVisibleCount = 0;
@@ -78,6 +80,10 @@ void PluginListView::updatePluginCount()
masterCount++;
activeMasterCount += active;
activeVisibleCount += visible && active;
+ } else if (list->isOverlayFlagged(plugin)) {
+ overlayCount++;
+ activeOverlayCount += active;
+ activeVisibleCount += visible && active;
} else {
regularCount++;
activeRegularCount += active;
@@ -85,8 +91,9 @@ void PluginListView::updatePluginCount()
}
}
- int activeCount = activeMasterCount + activeLightMasterCount + activeRegularCount;
- int totalCount = masterCount + lightMasterCount + regularCount;
+ int activeCount = activeMasterCount + activeLightMasterCount + activeOverlayCount +
+ activeRegularCount;
+ int totalCount = masterCount + lightMasterCount + overlayCount + regularCount;
ui.counter->display(activeVisibleCount);
ui.counter->setToolTip(
@@ -99,6 +106,7 @@ void PluginListView::updatePluginCount()
"<tr><td>ESMs+ESPs:</td><td align=right>%9 </td><td "
"align=right>%10</td></tr>"
"<tr><td>ESLs:</td><td align=right>%5 </td><td align=right>%6</td></tr>"
+ "<tr><td>Overlay:</td><td align=right>%11 </td><td align=right>%12</td></tr>"
"</table>")
.arg(activeCount)
.arg(totalCount)
@@ -109,7 +117,9 @@ void PluginListView::updatePluginCount()
.arg(activeRegularCount)
.arg(regularCount)
.arg(activeMasterCount + activeRegularCount)
- .arg(masterCount + regularCount));
+ .arg(masterCount + regularCount)
+ .arg(activeOverlayCount)
+ .arg(overlayCount));
}
void PluginListView::onFilterChanged(const QString& filter)