diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2017-10-21 22:43:45 -0500 |
|---|---|---|
| committer | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2017-10-21 22:43:45 -0500 |
| commit | eaeb48d745d74857d47da5d66d82fea005a16555 (patch) | |
| tree | 16c9c9452d36860596006fb3eeda8dcc7eb163f1 /src | |
| parent | b16a0ab3d94fad599347098e79e4a8131de08efa (diff) | |
Correctly render the modindex for ESLs
Diffstat (limited to 'src')
| -rw-r--r-- | src/pluginlist.cpp | 20 | ||||
| -rw-r--r-- | src/pluginlist.h | 4 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 2a252d27..f1e28cb2 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -102,7 +102,7 @@ QString PluginList::getColumnToolTip(int column) case COL_NAME: return tr("Name of your mods");
case COL_PRIORITY: return tr("Load priority of your mod. The higher, the more \"important\" it is and thus "
"overwrites data from plugins with lower priority.");
- case COL_MODINDEX: return tr("The modindex determins the formids of objects originating from this mods.");
+ case COL_MODINDEX: return tr("The modindex determines the formids of objects originating from this mods.");
default: return tr("unknown");
}
}
@@ -713,7 +713,7 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if ((role == Qt::DisplayRole)
|| (role == Qt::EditRole)) {
switch (modelIndex.column()) {
- case COL_NAME: {
+ case COL_NAME: {
return m_ESPs[index].m_Name;
} break;
case COL_PRIORITY: {
@@ -723,7 +723,21 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (m_ESPs[index].m_LoadOrder == -1) {
return QString();
} else {
- return QString("%1").arg(m_ESPs[index].m_LoadOrder, 2, 16, QChar('0')).toUpper();
+ int numESLs = 0;
+ std::vector<ESPInfo> sortESPs(m_ESPs);
+ std::sort(sortESPs.begin(), sortESPs.end());
+ for (auto sortedESP: sortESPs) {
+ if (sortedESP.m_LoadOrder == m_ESPs[index].m_LoadOrder)
+ break;
+ if (sortedESP.m_IsLight && sortedESP.m_LoadOrder != -1)
+ ++numESLs;
+ }
+ if (m_ESPs[index].m_IsLight) {
+ int ESLpos = 254 + (numESLs+1 / 4096);
+ return QString("%1").arg(ESLpos, 2, 16, QChar('0')).toUpper();
+ } else {
+ return QString("%1").arg(m_ESPs[index].m_LoadOrder - numESLs, 2, 16, QChar('0')).toUpper();
+ }
}
} break;
default: {
diff --git a/src/pluginlist.h b/src/pluginlist.h index aaa45bc1..e98f5c41 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -282,6 +282,10 @@ private: bool m_HasIni;
std::set<QString> m_Masters;
mutable std::set<QString> m_MasterUnset;
+ bool operator < (const ESPInfo& str) const
+ {
+ return (m_LoadOrder < str.m_LoadOrder);
+ }
};
struct AdditionalInfo {
|
