@@ -96,6 +96,14 @@ QString PluginList::getColumnName(int column)
9696 return tr (" Mod Index" );
9797 case COL_FLAGS:
9898 return tr (" Flags" );
99+ case COL_FORMVERSION:
100+ return tr (" Form Version" );
101+ case COL_HEADERVERSION:
102+ return tr (" Header Version" );
103+ case COL_AUTHOR:
104+ return tr (" Author" );
105+ case COL_DESCRIPTION:
106+ return tr (" Description" );
99107 default :
100108 return tr (" unknown" );
101109 }
@@ -114,6 +122,14 @@ QString PluginList::getColumnToolTip(int column)
114122 " overwrites data from plugins with lower priority." );
115123 case COL_MODINDEX:
116124 return tr (" Determines the formids of objects originating from this mods." );
125+ case COL_FORMVERSION:
126+ return tr (" Form version of the plugin." );
127+ case COL_HEADERVERSION:
128+ return tr (" Header version of the plugin." );
129+ case COL_AUTHOR:
130+ return tr (" Author of the plugin." );
131+ case COL_DESCRIPTION:
132+ return tr (" Description of the plugin." );
117133 default :
118134 return tr (" unknown" );
119135 }
@@ -1100,6 +1116,26 @@ bool PluginList::hasNoRecords(const QString& name) const
11001116 }
11011117}
11021118
1119+ int PluginList::formVersion (const QString& name) const
1120+ {
1121+ auto iter = m_ESPsByName.find (name);
1122+ if (iter == m_ESPsByName.end ()) {
1123+ return -1 ;
1124+ } else {
1125+ return m_ESPs[iter->second ].formVersion ;
1126+ }
1127+ }
1128+
1129+ float PluginList::headerVersion (const QString& name) const
1130+ {
1131+ auto iter = m_ESPsByName.find (name);
1132+ if (iter == m_ESPsByName.end ()) {
1133+ return -1 ;
1134+ } else {
1135+ return m_ESPs[iter->second ].headerVersion ;
1136+ }
1137+ }
1138+
11031139QString PluginList::author (const QString& name) const
11041140{
11051141 auto iter = m_ESPsByName.find (name);
@@ -1279,17 +1315,30 @@ QVariant PluginList::data(const QModelIndex& modelIndex, int role) const
12791315
12801316QVariant PluginList::displayData (const QModelIndex& modelIndex) const
12811317{
1282- const int index = modelIndex.row ();
1318+ const int index = modelIndex.row ();
1319+ const auto & plugin = m_ESPs[index];
12831320
12841321 switch (modelIndex.column ()) {
12851322 case COL_NAME:
1286- return m_ESPs[index] .name ;
1323+ return plugin .name ;
12871324
12881325 case COL_PRIORITY:
1289- return QString::number (m_ESPs[index] .priority );
1326+ return QString::number (plugin .priority );
12901327
12911328 case COL_MODINDEX:
1292- return m_ESPs[index].index ;
1329+ return plugin.index ;
1330+
1331+ case COL_FORMVERSION:
1332+ return plugin.formVersion != 0 ? QString::number (plugin.formVersion ) : QString ();
1333+
1334+ case COL_HEADERVERSION:
1335+ return QString::number (plugin.headerVersion );
1336+
1337+ case COL_AUTHOR:
1338+ return plugin.author ;
1339+
1340+ case COL_DESCRIPTION:
1341+ return plugin.description ;
12931342
12941343 default :
12951344 return {};
@@ -1388,6 +1437,15 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const
13881437 tr (" This plugin can't be disabled (enforced by the game)." ) + " </i></b>" ;
13891438 }
13901439
1440+ if (esp.formVersion != 0 ) {
1441+ // Oblivion-style plugin headers don't have a form version
1442+ toolTip +=
1443+ " <br><b>" + tr (" Form Version" ) + " </b>: " + QString::number (esp.formVersion );
1444+ }
1445+
1446+ toolTip +=
1447+ " <br><b>" + tr (" Header Version" ) + " </b>: " + QString::number (esp.headerVersion );
1448+
13911449 if (!esp.author .isEmpty ()) {
13921450 toolTip += " <br><b>" + tr (" Author" ) + " </b>: " + TruncateString (esp.author );
13931451 }
@@ -1960,8 +2018,10 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn
19602018 file.isBlueprint ();
19612019 hasNoRecords = file.isDummy ();
19622020
1963- author = QString::fromLatin1 (file.author ().c_str ());
1964- description = QString::fromLatin1 (file.description ().c_str ());
2021+ formVersion = file.formVersion ();
2022+ headerVersion = file.headerVersion ();
2023+ author = QString::fromLatin1 (file.author ().c_str ());
2024+ description = QString::fromLatin1 (file.description ().c_str ());
19652025
19662026 for (auto && m : file.masters ()) {
19672027 masters.insert (QString::fromStdString (m));
0 commit comments