Skip to content

Commit

Permalink
Plugins updates
Browse files Browse the repository at this point in the history
- Temporarily remove some overlay info
- Add isDummy and dummy info
- Display refinements for plugin info
  • Loading branch information
Silarn committed Oct 19, 2023
1 parent d57d8bd commit 2f5cca5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
39 changes: 29 additions & 10 deletions src/pluginlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,16 @@ bool PluginList::isOverlayFlagged(const QString& name) const
}
}

bool PluginList::isDummy(const QString& name) const
{
auto iter = m_ESPsByName.find(name);
if (iter == m_ESPsByName.end()) {
return false;
} else {
return m_ESPs[iter->second].isDummy;
}
}

boost::signals2::connection PluginList::onPluginStateChanged(
const std::function<void(const std::map<QString, PluginStates>&)>& func)
{
Expand Down Expand Up @@ -1093,9 +1103,9 @@ void PluginList::generatePluginIndexes()
.arg((numESLs) % 4096, 3, 16, QChar('0'))
.toUpper();
++numESLs;
} else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) {
m_ESPs[i].index = QString("XX");
++numSkipped;
//} else if (overridePluginsSupported && m_ESPs[i].isOverlayFlagged) {
// m_ESPs[i].index = QString("XX");
// ++numSkipped;
} else {
m_ESPs[i].index =
QString("%1").arg(l - numESLs - numSkipped, 2, 16, QChar('0')).toUpper();
Expand Down Expand Up @@ -1233,10 +1243,11 @@ 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);
}

if (m_ESPs[index].isDummy)
result.setStrikeOut(true);

return result;
}

Expand Down Expand Up @@ -1329,11 +1340,17 @@ 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.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.isDummy) {
toolTip += "<br><br>" + tr("This is a dummy plugin. It contains no records and is "
"typically used to load a paired archive file.");
}

if (esp.forceDisabled) {
Expand Down Expand Up @@ -1787,6 +1804,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
isOverlayFlagged = overlaySupported && file.isOverlay();
isLightFlagged =
lightSupported && !isOverlayFlagged && file.isLight(overlaySupported);
isDummy = file.isDummy();

author = QString::fromLatin1(file.author().c_str());
description = QString::fromLatin1(file.description().c_str());
Expand All @@ -1801,6 +1819,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
isMasterFlagged = false;
isOverlayFlagged = false;
isLightFlagged = false;
isDummy = false;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/pluginlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class PluginList : public QAbstractItemModel
bool isMasterFlagged(const QString& name) const;
bool isLightFlagged(const QString& name) const;
bool isOverlayFlagged(const QString& name) const;
bool isDummy(const QString& name) const;

boost::signals2::connection onRefreshed(const std::function<void()>& callback);
boost::signals2::connection
Expand Down Expand Up @@ -334,6 +335,7 @@ public slots:
bool isMasterFlagged;
bool isLightFlagged;
bool isOverlayFlagged;
bool isDummy;
bool modSelected;
QString author;
QString description;
Expand Down
5 changes: 5 additions & 0 deletions src/pluginlistproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,8 @@ bool PluginListProxy::isOverlayFlagged(const QString& name) const
{
return m_Proxied->isOverlayFlagged(name);
}

bool PluginListProxy::isDummy(const QString& name) const
{
return m_Proxied->isDummy(name);
}
1 change: 1 addition & 0 deletions src/pluginlistproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PluginListProxy : public MOBase::IPluginList
bool isMasterFlagged(const QString& name) const override;
bool isLightFlagged(const QString& name) const override;
bool isOverlayFlagged(const QString& name) const override;
bool isDummy(const QString& name) const override;

private:
friend class OrganizerProxy;
Expand Down

0 comments on commit 2f5cca5

Please sign in to comment.