From a611c355ce732961c2a9ba1a8909f0c144afa860 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 20 Oct 2017 20:27:06 -0500 Subject: Basic ESL updates --- src/pluginlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index a4d8561c..f2c52d5b 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -135,7 +135,7 @@ void PluginList::refresh(const QString &profileName QString extension = filename.right(3).toLower(); - if ((extension == "esp") || (extension == "esm")) { + if ((extension == "esp") || (extension == "esm") || (extension == "esl")) { bool forceEnabled = Settings::instance().forceEnableCoreFiles() && std::find(primaryPlugins.begin(), primaryPlugins.end(), filename.toLower()) != primaryPlugins.end(); -- cgit v1.3.1 From b16a0ab3d94fad599347098e79e4a8131de08efa Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 20 Oct 2017 23:16:04 -0500 Subject: Add ESL flag type detection * ESL files can be sorted like ESMs * ESL files are displayed italicized but not bold --- src/pluginlist.cpp | 24 ++++++++++++++++++++---- src/pluginlist.h | 2 ++ 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index f2c52d5b..2a252d27 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -593,6 +593,16 @@ bool PluginList::isMaster(const QString &name) const } } +bool PluginList::isLight(const QString &name) const +{ + auto iter = m_ESPsByName.find(name.toLower()); + if (iter == m_ESPsByName.end()) { + return false; + } else { + return m_ESPs[iter->second].m_IsLight; + } +} + QStringList PluginList::masters(const QString &name) const { auto iter = m_ESPsByName.find(name.toLower()); @@ -736,6 +746,8 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (m_ESPs[index].m_IsMaster) { result.setItalic(true); result.setWeight(QFont::Bold); + } else if (m_ESPs[index].m_IsLight) { + result.setItalic(true); } return result; } else if (role == Qt::TextAlignmentRole) { @@ -895,16 +907,18 @@ void PluginList::setPluginPriority(int row, int &newPriority) { int newPriorityTemp = newPriority; - if (!m_ESPs[row].m_IsMaster) { + if (!m_ESPs[row].m_IsMaster && !m_ESPs[row].m_IsLight) { // don't allow esps to be moved above esms while ((newPriorityTemp < static_cast(m_ESPsByPriority.size() - 1)) && - m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsMaster) { + (m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsMaster || + m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsLight)) { ++newPriorityTemp; } } else { // don't allow esms to be moved below esps while ((newPriorityTemp > 0) && - !m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsMaster) { + !m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsMaster && + !m_ESPs.at(m_ESPsByPriority.at(newPriorityTemp)).m_IsLight) { --newPriorityTemp; } // also don't allow "regular" esms to be moved above primary plugins @@ -1110,7 +1124,8 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, { try { ESP::File file(ToWString(fullPath)); - m_IsMaster = file.isMaster(); + m_IsMaster = file.isMaster() && !file.isLight(); + m_IsLight = file.isMaster() && file.isLight(); m_Author = QString::fromLatin1(file.author().c_str()); m_Description = QString::fromLatin1(file.description().c_str()); std::set masters = file.masters(); @@ -1120,6 +1135,7 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, } catch (const std::exception &e) { qCritical("failed to parse esp file %s: %s", qPrintable(fullPath), e.what()); m_IsMaster = false; + m_IsLight = false; } } diff --git a/src/pluginlist.h b/src/pluginlist.h index 78623cae..aaa45bc1 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -213,6 +213,7 @@ public: virtual int loadOrder(const QString &name) const; virtual bool onRefreshed(const std::function &callback); virtual bool isMaster(const QString &name) const; + virtual bool isLight(const QString &name) const; virtual QStringList masters(const QString &name) const; virtual QString origin(const QString &name) const; virtual void setLoadOrder(const QStringList &pluginList) override; @@ -275,6 +276,7 @@ private: FILETIME m_Time; QString m_OriginName; bool m_IsMaster; + bool m_IsLight; QString m_Author; QString m_Description; bool m_HasIni; -- cgit v1.3.1 From eaeb48d745d74857d47da5d66d82fea005a16555 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Sat, 21 Oct 2017 22:43:45 -0500 Subject: Correctly render the modindex for ESLs --- src/pluginlist.cpp | 20 +++++++++++++++++--- src/pluginlist.h | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/pluginlist.cpp') 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 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 m_Masters; mutable std::set m_MasterUnset; + bool operator < (const ESPInfo& str) const + { + return (m_LoadOrder < str.m_LoadOrder); + } }; struct AdditionalInfo { -- cgit v1.3.1 From e4d431fe2111134ec38f69a1924a2730e89767fc Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Sat, 21 Oct 2017 23:00:32 -0500 Subject: Display the index of the ESL in the mod index space to differentiate ESLs --- src/organizer_en.ts | 159 +++++++++++++++++++++++++++------------------------- src/pluginlist.cpp | 2 +- 2 files changed, 83 insertions(+), 78 deletions(-) (limited to 'src/pluginlist.cpp') diff --git a/src/organizer_en.ts b/src/organizer_en.ts index f73717f2..535c16a5 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -3019,197 +3019,197 @@ p, li { white-space: pre-wrap; } - - + + Save changes? - - + + Save changes to "%1"? - + File Exists - + A file with that name exists, please enter a new one - + failed to move file - + failed to create directory "optional" - - + + Info requested, please wait - + Main - + Update - + Optional - + Old - + Misc - + Unknown - + Current Version: %1 - + No update available - + (description incomplete, please visit nexus) - + <a href="%1">Visit on Nexus</a> - + Failed to delete %1 - - + + Confirm - + Are sure you want to delete "%1"? - + Are sure you want to delete the selected files? - - + + New Folder - + Failed to create "%1" - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - - + + failed to rename %1 to %2 - + There already is a visible version of this file. Replace it? - + Un-Hide - + Hide - + Name - + Please enter a name - - + + Error - + Invalid name. Must be a valid file name - + A tweak by that name exists - + Create Tweak @@ -3240,7 +3240,8 @@ p, li { white-space: pre-wrap; } - %1 contains no esp/esm and no asset (textures, meshes, interface, ...) directory + %1 contains no esp/esm/esl and no asset (textures, meshes, interface, ...) directory + %1 contains no esp/esm and no asset (textures, meshes, interface, ...) directory @@ -3253,7 +3254,8 @@ p, li { white-space: pre-wrap; } ModList - Game plugins (esp/esm) + Game plugins (esp/esm/esl) + Game plugins (esp/esm) @@ -3459,7 +3461,8 @@ p, li { white-space: pre-wrap; } - Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm)</tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</tr></table> + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm/esl)</tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</tr></table> + Depicts the content of the mod:<br><table cellspacing=7><tr><td><img src=":/MO/gui/content/plugin" width=32/></td><td>Game plugins (esp/esm)</tr><tr><td><img src=":/MO/gui/content/interface" width=32/></td><td>Interface</tr><tr><td><img src=":/MO/gui/content/mesh" width=32/></td><td>Meshes</tr><tr><td><img src=":/MO/gui/content/bsa" width=32/></td><td>BSA</tr><tr><td><img src=":/MO/gui/content/texture" width=32/></td><td>Textures</tr><tr><td><img src=":/MO/gui/content/sound" width=32/></td><td>Sounds</tr><tr><td><img src=":/MO/gui/content/music" width=32/></td><td>Music</tr><tr><td><img src=":/MO/gui/content/string" width=32/></td><td>Strings</tr><tr><td><img src=":/MO/gui/content/script" width=32/></td><td>Scripts (Papyrus)</tr><tr><td><img src=":/MO/gui/content/skse" width=32/></td><td>Script Extender plugins</tr><tr><td><img src=":/MO/gui/content/skyproc" width=32/></td><td>SkyProc Patcher</tr></table> @@ -3659,81 +3662,81 @@ p, li { white-space: pre-wrap; } - - Multiple esps activated, please check that they don't conflict. + + Multiple esps/esls activated, please check that they don't conflict. - + Download? - + A download has been started but no installed page plugin recognizes it. If you download anyway no information (i.e. version) will be associated with the download. Continue? - + failed to update mod list: %1 - - + + login successful - + Login failed - + Login failed, try again? - + login failed: %1. Download will not be associated with an account - + login failed: %1 - + login failed: %1. You need to log-in with Nexus to update MO. - + Too many esps, esms, and esls enabled - - + + Description missing - + The game doesn't allow more than 255 active plugins (including the official ones) to be loaded. You have to disable some unused plugins or merge some plugins into one. You can find a guide here: <a href="http://wiki.step-project.com/Guide:Merging_Plugins">http://wiki.step-project.com/Guide:Merging_Plugins</a> - + failed to save load order: %1 - + The designated write target "%1" is not enabled. @@ -3902,37 +3905,37 @@ Continue? - + This plugin can't be disabled (enforced by the game) - + <b>Origin</b>: %1 - + Author - + Description - + Missing Masters - + Enabled Masters - + failed to restore load order for %1 @@ -5670,7 +5673,8 @@ On Windows XP: - I told you in the "First Steps" tutorial how the esp/esm plugins contain changes to the game world like modifications to the terrain or existing NPCs. Each change like this is stored in a record, hence the name "record conflict". For example when two mods try to change the same location, only one change can become active. + I told you in the "First Steps" tutorial how the esp/esm/esl plugins contain changes to the game world like modifications to the terrain or existing NPCs. Each change like this is stored in a record, hence the name "record conflict". For example when two mods try to change the same location, only one change can become active. + I told you in the "First Steps" tutorial how the esp/esm plugins contain changes to the game world like modifications to the terrain or existing NPCs. Each change like this is stored in a record, hence the name "record conflict". For example when two mods try to change the same location, only one change can become active. @@ -5977,7 +5981,8 @@ Please open the "Nexus"-tab - Plugins (esp/esm files) of the mods in the current profile. They need to be checked to be loaded. + Plugins (esp/esm/esl files) of the mods in the current profile. They need to be checked to be loaded. + Plugins (esp/esm files) of the mods in the current profile. They need to be checked to be loaded. diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index f1e28cb2..d2ffad91 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -734,7 +734,7 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const } if (m_ESPs[index].m_IsLight) { int ESLpos = 254 + (numESLs+1 / 4096); - return QString("%1").arg(ESLpos, 2, 16, QChar('0')).toUpper(); + return QString("%1:%2").arg(ESLpos, 2, 16, QChar('0')).arg((numESLs+1)%4096).toUpper(); } else { return QString("%1").arg(m_ESPs[index].m_LoadOrder - numESLs, 2, 16, QChar('0')).toUpper(); } -- cgit v1.3.1