diff options
| author | Jeremy Rimpo <jeremy.rimpo@servermonkey.com> | 2024-06-22 01:31:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 08:31:26 +0200 |
| commit | a4f6298111b9b4518d00e6df3a53dd176858dd34 (patch) | |
| tree | 11d35c88a96c6998eac9b7debb8736ebe907d014 /src/pluginlist.cpp | |
| parent | d3b647ab2b19626b2f86b5c2af3946c1fcf22068 (diff) | |
Parse unmanaged file location when creating ModInfoForeign (#2053)
* Parse unmanaged file location when creating ModInfoForeign
- Fixes issues with secondaryDataDirectories
* Revert SF memory address changes
- CCC implementation prevents the need to determine core plugin LO by dependency chains
* The light flag wins over the medium flag
- I had expected the opposite, but apparently the light flag still wins if both are set. This shouldn't really happen but it's possible, even with the CK
* Update display to account for multi-flagged plugins
- Show both icons, warn if both set
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 75 |
1 files changed, 26 insertions, 49 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 9f99ff60..94aee98d 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1102,14 +1102,7 @@ void PluginList::generatePluginIndexes() continue; } if (mediumPluginsSupported && m_ESPs[i].isMediumFlagged) { - if (mediumPluginsSupported && m_ESPs[i].forceLoaded) { - // Starfield core medium plugins are loaded in memory addresses after custom - // medium plugins - coreMediumPlugins.push_back(i); - ++numSkipped; - continue; - } - int ESHpos = 253 + ((numESHs + 1) / 256); + int ESHpos = 253 + (numESHs / 256); m_ESPs[i].index = QString("%1:%2") .arg(ESHpos, 2, 16, QChar('0')) .arg(numESHs % 256, 2, 16, QChar('0')) @@ -1118,15 +1111,7 @@ void PluginList::generatePluginIndexes() } else if (lightPluginsSupported && (m_ESPs[i].hasLightExtension || m_ESPs[i].isLightFlagged)) { - // Starfield core light plugins are loaded in memory addresses after custom light - // plugins - if (mediumPluginsSupported && m_ESPs[i].forceLoaded) { - coreLightPlugins.push_back(i); - ++numSkipped; - continue; - } - - int ESLpos = 254 + ((numESLs + 1) / 4096); + int ESLpos = 254 + (numESLs / 4096); m_ESPs[i].index = QString("%1:%2") .arg(ESLpos, 2, 16, QChar('0')) .arg(numESLs % 4096, 3, 16, QChar('0')) @@ -1138,22 +1123,6 @@ void PluginList::generatePluginIndexes() .toUpper(); } } - for (auto pluginIndex : coreMediumPlugins) { - int ESHpos = 253 + ((numESHs + 1) / 4096); - m_ESPs[pluginIndex].index = QString("%1:%2") - .arg(ESHpos, 2, 16, QChar('0')) - .arg(numESHs % 256, 2, 16, QChar('0')) - .toUpper(); - ++numESHs; - } - for (auto pluginIndex : coreLightPlugins) { - int ESLpos = 254 + ((numESLs + 1) / 4096); - m_ESPs[pluginIndex].index = QString("%1:%2") - .arg(ESLpos, 2, 16, QChar('0')) - .arg(numESLs % 4096, 3, 16, QChar('0')) - .toUpper(); - ++numESLs; - } emit esplist_changed(); } @@ -1283,10 +1252,10 @@ QVariant PluginList::fontData(const QModelIndex& modelIndex) const if (m_ESPs[index].hasMasterExtension || m_ESPs[index].isMasterFlagged || m_ESPs[index].hasLightExtension) result.setWeight(QFont::Bold); - if (m_ESPs[index].isMediumFlagged) - result.setUnderline(true); if (m_ESPs[index].isLightFlagged || m_ESPs[index].hasLightExtension) result.setItalic(true); + else if (m_ESPs[index].isMediumFlagged) + result.setUnderline(true); return result; } @@ -1372,13 +1341,6 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const "be added to your game settings, overwriting in case of conflicts."); } - if (esp.isMediumFlagged && esp.hasMasterExtension) { - toolTip += "<br><br>" + - tr("This ESM is flagged as a medium plugin (ESH). It adheres to the ESM " - "load order but loads records in ESH space (FD). You can have 256 " - "medium plugins in addition to other plugin types."); - } - if (esp.isLightFlagged && !esp.hasLightExtension) { QString type = esp.hasMasterExtension ? "ESM" : "ESP"; toolTip += @@ -1387,6 +1349,19 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const "order but the records will be loaded in ESL space (FE/FF). You can have up " "to 4096 light plugins in addition to other plugin types.") .arg(type); + } else if (esp.isMediumFlagged && esp.hasMasterExtension) { + toolTip += "<br><br>" + + tr("This ESM is flagged as a medium plugin (ESH). It adheres to the ESM " + "load order but loads records in ESH space (FD). You can have 256 " + "medium plugins in addition to other plugin types."); + } + + if (esp.isLightFlagged && esp.isMediumFlagged) { + toolTip += + "<br><br>" + + tr("WARNING: This plugin is both light and medium flagged. " + "This could indicate that the file was saved improperly " + "and may have mismatched record references. Use it at your own risk."); } if (esp.hasNoRecords) { @@ -1515,14 +1490,17 @@ QVariant PluginList::iconData(const QModelIndex& modelIndex) const result.append(":/MO/gui/archive_conflict_neutral"); } - if (esp.isMediumFlagged) { - result.append(":/MO/gui/run"); - } - if (esp.isLightFlagged && !esp.hasLightExtension) { result.append(":/MO/gui/awaiting"); } + if (esp.isMediumFlagged) { + result.append(":/MO/gui/run"); + if (esp.isLightFlagged) { + result.append(":/MO/gui/warning"); + } + } + if (esp.hasNoRecords) { result.append(":/MO/gui/unchecked-checkbox"); } @@ -1851,10 +1829,9 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn hasMasterExtension = (extension == "esm"); hasLightExtension = (extension == "esl"); isMasterFlagged = file.isMaster(); + isLightFlagged = lightSupported && file.isLight(mediumSupported); isMediumFlagged = mediumSupported && file.isMedium(); - isLightFlagged = - lightSupported && !isMediumFlagged && file.isLight(mediumSupported); - hasNoRecords = file.isDummy(); + hasNoRecords = file.isDummy(); author = QString::fromLatin1(file.author().c_str()); description = QString::fromLatin1(file.description().c_str()); |
