mirror of
https://github.com/ModOrganizer2/modorganizer-game_ttw.git
synced 2026-07-27 14:05:12 -07:00
Add plugin setting to enable/disable LOOT & add loot & display name (#36)
* Add plugin setting to enable/disable LOOT, update names.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
---
|
||||
# We'll use defaults from the LLVM style, but with 4 columns indentation.
|
||||
BasedOnStyle: LLVM
|
||||
IndentWidth: 2
|
||||
---
|
||||
Language: Cpp
|
||||
DeriveLineEnding: false
|
||||
UseCRLF: true
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
AlignConsecutiveAssignments: true
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
AccessModifierOffset: -2
|
||||
AlignTrailingComments: true
|
||||
SpacesBeforeTrailingComments: 2
|
||||
NamespaceIndentation: Inner
|
||||
MaxEmptyLinesToKeep: 1
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: true
|
||||
ColumnLimit: 88
|
||||
ForEachMacros: ['Q_FOREACH', 'foreach']
|
||||
+4
-2
@@ -4,12 +4,12 @@
|
||||
<context>
|
||||
<name>GameFalloutTTW</name>
|
||||
<message>
|
||||
<location filename="gamefalloutttw.cpp" line="88"/>
|
||||
<location filename="gamefalloutttw.cpp" line="186"/>
|
||||
<source>Fallout TTW Support Plugin</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="gamefalloutttw.cpp" line="98"/>
|
||||
<location filename="gamefalloutttw.cpp" line="196"/>
|
||||
<source>Adds support for the game Fallout TTW</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -172,6 +172,8 @@
|
||||
<message>
|
||||
<location filename="../../game_gamebryo/src/gamebryo/gamegamebryo.cpp" line="330"/>
|
||||
<source>failed to query registry path (read): %1</source>
|
||||
<location filename="gamefalloutttw.cpp" line="208"/>
|
||||
<source>While not recommended by the TTW modding community, enables LOOT sorting</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
+29
-13
@@ -74,7 +74,8 @@ QDir GameFalloutTTW::documentsDirectory() const
|
||||
QString GameFalloutTTW::identifyGamePath() const
|
||||
{
|
||||
QString path = "Software\\Bethesda Softworks\\FalloutNV";
|
||||
auto result = findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(), L"Installed Path");
|
||||
auto result = findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(),
|
||||
L"Installed Path");
|
||||
// EPIC Game Store
|
||||
if (result.isEmpty()) {
|
||||
/**
|
||||
@@ -130,6 +131,11 @@ QString GameFalloutTTW::gameName() const
|
||||
return "TTW";
|
||||
}
|
||||
|
||||
QString GameFalloutTTW::displayGameName() const
|
||||
{
|
||||
return "Tale of Two Wastelands";
|
||||
}
|
||||
|
||||
QString GameFalloutTTW::gameDirectoryName() const
|
||||
{
|
||||
if (selectedVariant() == "Epic Games")
|
||||
@@ -150,10 +156,9 @@ QList<ExecutableInfo> GameFalloutTTW::executables() const
|
||||
ExecutableInfo game("Tale of Two Wastelands", findInGameFolder(binaryName()));
|
||||
ExecutableInfo launcher("Fallout Launcher", findInGameFolder(getLauncherName()));
|
||||
QList<ExecutableInfo> extraExecutables =
|
||||
QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("GECK", findInGameFolder("geck.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
|
||||
.withArgument("--game=\"FalloutNV\"");
|
||||
QList<ExecutableInfo>() << ExecutableInfo("GECK", findInGameFolder("geck.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
|
||||
.withArgument("--game=\"FalloutNV\"");
|
||||
if (selectedVariant() != "Epic Games") {
|
||||
extraExecutables.prepend(ExecutableInfo(
|
||||
"NVSE", findInGameFolder(feature<ScriptExtender>()->loaderName())));
|
||||
@@ -198,7 +203,11 @@ MOBase::VersionInfo GameFalloutTTW::version() const
|
||||
|
||||
QList<PluginSetting> GameFalloutTTW::settings() const
|
||||
{
|
||||
return QList<PluginSetting>();
|
||||
return QList<PluginSetting>()
|
||||
<< PluginSetting("enable_loot_sorting",
|
||||
tr("While not recommended by the TTW modding community, "
|
||||
"enables LOOT sorting"),
|
||||
false);
|
||||
}
|
||||
|
||||
void GameFalloutTTW::initializeProfile(const QDir& path, ProfileSettings settings) const
|
||||
@@ -246,12 +255,12 @@ QString GameFalloutTTW::steamAPPId() const
|
||||
|
||||
QStringList GameFalloutTTW::primaryPlugins() const
|
||||
{
|
||||
return {"falloutnv.esm", "deadmoney.esm", "honesthearts.esm",
|
||||
"oldworldblues.esm", "lonesomeroad.esm", "gunrunnersarsenal.esm",
|
||||
"fallout3.esm", "anchorage.esm", "thepitt.esm",
|
||||
"brokensteel.esm", "pointlookout.esm", "zeta.esm",
|
||||
"caravanpack.esm", "classicpack.esm", "mercenarypack.esm",
|
||||
"tribalpack.esm", "taleoftwowastelands.esm","YUPTTW.esm"};
|
||||
return {"falloutnv.esm", "deadmoney.esm", "honesthearts.esm",
|
||||
"oldworldblues.esm", "lonesomeroad.esm", "gunrunnersarsenal.esm",
|
||||
"fallout3.esm", "anchorage.esm", "thepitt.esm",
|
||||
"brokensteel.esm", "pointlookout.esm", "zeta.esm",
|
||||
"caravanpack.esm", "classicpack.esm", "mercenarypack.esm",
|
||||
"tribalpack.esm", "taleoftwowastelands.esm", "YUPTTW.esm"};
|
||||
}
|
||||
|
||||
QStringList GameFalloutTTW::gameVariants() const
|
||||
@@ -297,7 +306,14 @@ QStringList GameFalloutTTW::DLCPlugins() const
|
||||
|
||||
MOBase::IPluginGame::SortMechanism GameFalloutTTW::sortMechanism() const
|
||||
{
|
||||
return SortMechanism::NONE;
|
||||
if (m_Organizer->pluginSetting(name(), "enable_loot_sorting").toBool())
|
||||
return IPluginGame::SortMechanism::LOOT;
|
||||
return IPluginGame::SortMechanism::NONE;
|
||||
}
|
||||
|
||||
QString GameFalloutTTW::lootGameName() const
|
||||
{
|
||||
return "FalloutNV";
|
||||
}
|
||||
|
||||
int GameFalloutTTW::nexusModOrganizerID() const
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
|
||||
public: // IPluginGame interface
|
||||
virtual QString gameName() const override;
|
||||
virtual QString displayGameName() const override;
|
||||
virtual void detectGame() override;
|
||||
virtual QList<MOBase::ExecutableInfo> executables() const override;
|
||||
virtual QList<MOBase::ExecutableForcedLoadSetting>
|
||||
@@ -39,6 +40,7 @@ public: // IPluginGame interface
|
||||
virtual int nexusGameID() const override;
|
||||
virtual QStringList primarySources() const override;
|
||||
virtual SortMechanism sortMechanism() const override;
|
||||
virtual QString lootGameName() const override;
|
||||
virtual QString getLauncherName() const override;
|
||||
|
||||
virtual bool isInstalled() const override;
|
||||
|
||||
Reference in New Issue
Block a user