mirror of
https://github.com/ModOrganizer2/modorganizer-game_bethesda.git
synced 2026-07-27 14:08:44 -07:00
Starfield: Final updates (#27)
* Add diagnoses for blueprints * Bump version * [pre-commit.ci] Auto fixes from pre-commit.com hooks. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
pre-commit-ci[bot]
parent
c0318ee389
commit
28289067ca
@@ -128,7 +128,7 @@ QString GameStarfield::description() const
|
||||
|
||||
MOBase::VersionInfo GameStarfield::version() const
|
||||
{
|
||||
return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL);
|
||||
return VersionInfo(1, 2, 0, VersionInfo::RELEASE_FINAL);
|
||||
}
|
||||
|
||||
QList<PluginSetting> GameStarfield::settings() const
|
||||
@@ -369,6 +369,10 @@ std::vector<unsigned int> GameStarfield::activeProblems() const
|
||||
if (testFilePresent())
|
||||
result.push_back(PROBLEM_TEST_FILE);
|
||||
}
|
||||
if (hasInvalidBlueprint())
|
||||
result.push_back(PROBLEM_INVALID_BLUEPRINT);
|
||||
if (hasUnpairedBlueprint())
|
||||
result.push_back(PROBLEM_UNPAIRED_BLUEPRINT);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -401,6 +405,38 @@ bool GameStarfield::testFilePresent() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameStarfield::hasInvalidBlueprint() const
|
||||
{
|
||||
auto plugins = m_Organizer->pluginList()->pluginNames();
|
||||
for (auto plugin : plugins) {
|
||||
if (m_Organizer->pluginList()->isBlueprintFlagged(plugin)) {
|
||||
if (!plugin.startsWith(blueprintPrefix(), Qt::CaseInsensitive) ||
|
||||
!m_Organizer->pluginList()->hasMasterExtension(plugin))
|
||||
return true;
|
||||
} else if (plugin.startsWith(blueprintPrefix(), Qt::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameStarfield::hasUnpairedBlueprint() const
|
||||
{
|
||||
auto plugins = m_Organizer->pluginList()->pluginNames();
|
||||
for (auto plugin : plugins) {
|
||||
if (plugin.startsWith(blueprintPrefix(), Qt::CaseInsensitive) &&
|
||||
m_Organizer->pluginList()->hasMasterExtension(plugin)) {
|
||||
QString parent = plugin.mid(blueprintPrefix().size(),
|
||||
plugin.size() - blueprintPrefix().size() - 4);
|
||||
auto mainPlugin = plugins.filter(QRegularExpression(
|
||||
"^" + parent + "\.es(m|p|l)$", QRegularExpression::CaseInsensitiveOption));
|
||||
if (mainPlugin.isEmpty())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString GameStarfield::shortDescription(unsigned int key) const
|
||||
{
|
||||
switch (key) {
|
||||
@@ -408,6 +444,10 @@ QString GameStarfield::shortDescription(unsigned int key) const
|
||||
return tr("You have active ESP plugins in Starfield");
|
||||
case PROBLEM_TEST_FILE:
|
||||
return tr("sTestFile entries are present");
|
||||
case PROBLEM_INVALID_BLUEPRINT:
|
||||
return tr("Invalid blueprint plugins found");
|
||||
case PROBLEM_UNPAIRED_BLUEPRINT:
|
||||
return tr("Unpaired blueprint plugins found");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -435,6 +475,17 @@ QString GameStarfield::fullDescription(unsigned int key) const
|
||||
"settings in your StarfieldCustom.ini. These must be removed or the game "
|
||||
"will not read the plugins.txt file. Management is still disabled.</p>");
|
||||
}
|
||||
case PROBLEM_INVALID_BLUEPRINT:
|
||||
return tr(
|
||||
"<p>You have a blueprint file that is invalid. Blueprints require the "
|
||||
"blueprint flag and prefix and must have the ESM extension to be valid.</p>");
|
||||
case PROBLEM_UNPAIRED_BLUEPRINT:
|
||||
return tr(
|
||||
"<p>You have a valid blueprint file that has no paired main plugin. The only "
|
||||
"way to load blueprint files is by enabling a main plugin with the same base "
|
||||
"name. This is the part after the prefix and before the extension.</p><p>eg. "
|
||||
"<strong>BlueprintShips-example.esm</strong> should have a paired main plugin "
|
||||
"<strong>example.esm</strong></p>");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -73,10 +73,14 @@ private:
|
||||
QStringList CCCPlugins() const;
|
||||
bool activeESP() const;
|
||||
bool testFilePresent() const;
|
||||
bool hasInvalidBlueprint() const;
|
||||
bool hasUnpairedBlueprint() const;
|
||||
|
||||
private:
|
||||
static const unsigned int PROBLEM_ESP = 1;
|
||||
static const unsigned int PROBLEM_TEST_FILE = 2;
|
||||
static const unsigned int PROBLEM_ESP = 1;
|
||||
static const unsigned int PROBLEM_TEST_FILE = 2;
|
||||
static const unsigned int PROBLEM_INVALID_BLUEPRINT = 3;
|
||||
static const unsigned int PROBLEM_UNPAIRED_BLUEPRINT = 4;
|
||||
|
||||
mutable std::set<QString> m_Active_ESPs;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user