From d659ad7294af2bc67a3b569dc90a7920f5469b07 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Thu, 26 Oct 2017 16:28:15 -0500 Subject: Update master parsing and detect ESLs by extension --- src/organizer_en.ts | 173 +++++++++++++++++++++++++--------------------------- src/pluginlist.cpp | 26 ++++---- 2 files changed, 98 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 15785d1f..f8e6ffaa 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -2989,227 +2989,227 @@ p, li { white-space: pre-wrap; } - + &Delete - + &Rename - + &Hide - + &Unhide - + &Open - + &New Folder - - + + 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 @@ -4769,52 +4769,52 @@ Start elevated anyway? (you will be asked if you want to allow ModOrganizer.exe - + New update available (%1) - + Install - + Download failed - + Failed to find correct download, please try again later. - + Update - + Download in progress - + Download failed: %1 - + Failed to install update: %1 - + Failed to start %1: %2 - + Error @@ -5919,113 +5919,108 @@ Please open the "Nexus"-tab tutorial_primer_main - + This window shows all the mods that are installed. The column headers can be used for sorting. Only checked mods are active in the current profile. - + Each profile is a separate set of enabled mods and ini settings. - + The dropdown allows various ways of grouping the mods shown in the mod list. - + Show/hide the category pane. - + Quickly filter the mod list as you type. - + Switch between information views. - + This shows mod categories and some meta categories (in angle-brackets). Select some to filter the mod list. For example select "<Checked>" to show only active mods. - + Customizable list for choosing the program to run. - + When this button is clicked, Mod Organizer creates a virtual directory structure then runs the program selected to the left. - + Will create a shortcut for quick access. The shortcut can be placed in the toolbar at the top, in the Start Menu or on the Windows Desktop. - + Log messages produced by MO. Please note that messages with a light bulb usually don't require your attention. - + Configure Mod Organizer. - + Reports potential Problems about the current setup. - + Activates if there is an update for MO. Please note that if, for any reason, MO can't communicate with NMM, this will not work either. - + 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. - + Automatically sort plugins using the bundled LOOT application. - + Quickly filter plugin list as you type. - - All the asset archives (.bsa files) for all active mods. - - - - + The directory tree and all files that the program will see. - + Save game browser. Shows all the saves for the current profile and whether or not the current mod-load status is correct. - + Shows the mods that have been downloaded and if they’ve been installed. - + Click to quit diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index a66a2fb4..4420bf17 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -686,18 +686,18 @@ void PluginList::testMasters() // emit layoutAboutToBeChanged(); std::set enabledMasters; - for (auto iter = m_ESPs.begin(); iter != m_ESPs.end(); ++iter) { - if (iter->m_Enabled) { - enabledMasters.insert(iter->m_Name.toLower()); + for (const auto& iter: m_ESPs) { + if (iter.m_Enabled) { + enabledMasters.insert(iter.m_Name.toLower()); } } - for (auto iter = m_ESPs.begin(); iter != m_ESPs.end(); ++iter) { - iter->m_MasterUnset.clear(); - if (iter->m_Enabled) { - for (auto master = iter->m_Masters.begin(); master != iter->m_Masters.end(); ++master) { - if (enabledMasters.find(master->toLower()) == enabledMasters.end()) { - iter->m_MasterUnset.insert(*master); + for (auto& iter: m_ESPs) { + iter.m_MasterUnset.clear(); + if (iter.m_Enabled) { + for (const auto& master: iter.m_Masters) { + if (enabledMasters.find(master.toLower()) == enabledMasters.end()) { + iter.m_MasterUnset.insert(master); } } } @@ -1138,8 +1138,10 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, { try { ESP::File file(ToWString(fullPath)); - m_IsMaster = file.isMaster() && !file.isLight(); - m_IsLight = file.isLight(); + m_IsMaster = file.isMaster(); + auto extension = name.right(3).toLower(); + m_IsLight = (extension == "esl"); // The .isLight() header is apparently meaningless. + m_Author = QString::fromLatin1(file.author().c_str()); m_Description = QString::fromLatin1(file.description().c_str()); std::set masters = file.masters(); @@ -1147,7 +1149,7 @@ PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, m_Masters.insert(QString(iter->c_str())); } } catch (const std::exception &e) { - qCritical("failed to parse esp file %s: %s", qPrintable(fullPath), e.what()); + qCritical("failed to parse plugin file %s: %s", qPrintable(fullPath), e.what()); m_IsMaster = false; m_IsLight = false; } -- cgit v1.3.1