diff --git a/src/pluginlistview.cpp b/src/pluginlistview.cpp index 49eb87dc..5a4e7efa 100644 --- a/src/pluginlistview.cpp +++ b/src/pluginlistview.cpp @@ -7,6 +7,7 @@ #include #include "copyeventfilter.h" +#include "gameplugins.h" #include "genericicondelegate.h" #include "mainwindow.h" #include "modelutils.h" @@ -59,10 +60,12 @@ void PluginListView::updatePluginCount() int activeMasterCount = 0; int activeMediumMasterCount = 0; int activeLightMasterCount = 0; + int activeBlueprintCount = 0; int activeRegularCount = 0; int masterCount = 0; int mediumMasterCount = 0; int lightMasterCount = 0; + int blueprintCount = 0; int regularCount = 0; int activeVisibleCount = 0; @@ -89,37 +92,68 @@ void PluginListView::updatePluginCount() activeRegularCount += active; activeVisibleCount += visible && active; } + + if (list->isBlueprintFlagged(plugin)) { + // separate if-statement because blueprint masters are also counted as + // (medium/light) masters + blueprintCount++; + activeBlueprintCount += active; + } } int activeCount = activeMasterCount + activeMediumMasterCount + activeLightMasterCount + activeRegularCount; int totalCount = masterCount + mediumMasterCount + lightMasterCount + regularCount; - ui.counter->display(activeVisibleCount); - ui.counter->setToolTip( + auto toolTip = tr("" "" "" "" - "" - "" - "" - "" - "
TypeActive Total
All plugins:%1 %2
ESMs:%3 %4
ESPs:%7 %8
ESMs+ESPs:%9 %10
ESHs:%11 %12
ESLs:%5 %6
") + "ESPs:%5 %6" + "ESMs+ESPs:%7 %8") .arg(activeCount) .arg(totalCount) .arg(activeMasterCount) .arg(masterCount) - .arg(activeLightMasterCount) - .arg(lightMasterCount) .arg(activeRegularCount) .arg(regularCount) .arg(activeMasterCount + activeRegularCount) - .arg(masterCount + regularCount) - .arg(activeMediumMasterCount) - .arg(mediumMasterCount)); + .arg(masterCount + regularCount); + + auto gamePlugins = m_core->gameFeatures().gameFeature(); + const bool lightPluginsAreSupported = + gamePlugins ? gamePlugins->lightPluginsAreSupported() : false; + const bool mediumPluginsAreSupported = + gamePlugins ? gamePlugins->mediumPluginsAreSupported() : false; + const bool blueprintPluginsAreSupported = + gamePlugins ? gamePlugins->blueprintPluginsAreSupported() : false; + + if (mediumPluginsAreSupported) { + toolTip += + tr("ESHs:%1 %2") + .arg(activeMediumMasterCount) + .arg(mediumMasterCount); + } + if (lightPluginsAreSupported) { + toolTip += + tr("ESLs:%1 %2") + .arg(activeLightMasterCount) + .arg(lightMasterCount); + } + if (blueprintPluginsAreSupported) { + toolTip += tr("Blueprint masters:%1 %2") + .arg(activeBlueprintCount) + .arg(blueprintCount); + } + + toolTip += ""; + + ui.counter->display(activeVisibleCount); + ui.counter->setToolTip(toolTip); } void PluginListView::onFilterChanged(const QString& filter)