mirror of
https://github.com/ModOrganizer2/modorganizer-game_starfield.git
synced 2026-07-27 14:08:51 -07:00
Apply clang-format
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,12 +4,12 @@
|
||||
<context>
|
||||
<name>GameStarfield</name>
|
||||
<message>
|
||||
<location filename="gamestarfield.cpp" line="130"/>
|
||||
<location filename="gamestarfield.cpp" line="134"/>
|
||||
<source>Starfield Support Plugin</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="gamestarfield.cpp" line="141"/>
|
||||
<location filename="gamestarfield.cpp" line="144"/>
|
||||
<source>Adds support for the game Starfield.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
+40
-31
@@ -1,19 +1,19 @@
|
||||
#include "gamestarfield.h"
|
||||
|
||||
#include "starfieldbsainvalidation.h"
|
||||
#include "starfielddataarchives.h"
|
||||
#include "starfieldscriptextender.h"
|
||||
#include "starfieldunmanagedmods.h"
|
||||
#include "starfieldgameplugins.h"
|
||||
#include "starfieldmoddatachecker.h"
|
||||
#include "starfieldmoddatacontent.h"
|
||||
#include "starfieldgameplugins.h"
|
||||
#include "starfieldsavegame.h"
|
||||
#include "starfieldbsainvalidation.h"
|
||||
#include "starfieldscriptextender.h"
|
||||
#include "starfieldunmanagedmods.h"
|
||||
|
||||
#include <pluginsetting.h>
|
||||
#include "versioninfo.h"
|
||||
#include <executableinfo.h>
|
||||
#include <gamebryolocalsavegames.h>
|
||||
#include <gamebryosavegameinfo.h>
|
||||
#include "versioninfo.h"
|
||||
#include <pluginsetting.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
@@ -30,11 +30,9 @@
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
GameStarfield::GameStarfield()
|
||||
{
|
||||
}
|
||||
GameStarfield::GameStarfield() {}
|
||||
|
||||
bool GameStarfield::init(IOrganizer *moInfo)
|
||||
bool GameStarfield::init(IOrganizer* moInfo)
|
||||
{
|
||||
if (!GameGamebryo::init(moInfo)) {
|
||||
return false;
|
||||
@@ -42,13 +40,15 @@ bool GameStarfield::init(IOrganizer *moInfo)
|
||||
|
||||
registerFeature<ScriptExtender>(new StarfieldScriptExtender(this));
|
||||
registerFeature<DataArchives>(new StarfieldDataArchives(myGamesPath()));
|
||||
registerFeature<LocalSavegames>(new GamebryoLocalSavegames(myGamesPath(), "StarfieldCustom.ini"));
|
||||
registerFeature<LocalSavegames>(
|
||||
new GamebryoLocalSavegames(myGamesPath(), "StarfieldCustom.ini"));
|
||||
registerFeature<ModDataChecker>(new StarfieldModDataChecker(this));
|
||||
registerFeature<ModDataContent>(new StarfieldModDataContent(this));
|
||||
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
|
||||
registerFeature<GamePlugins>(new StarfieldGamePlugins(moInfo));
|
||||
registerFeature<UnmanagedMods>(new StarfieldUnmangedMods(this));
|
||||
registerFeature<BSAInvalidation>(new StarfieldBSAInvalidation(feature<DataArchives>(), this));
|
||||
registerFeature<BSAInvalidation>(
|
||||
new StarfieldBSAInvalidation(feature<DataArchives>(), this));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -67,15 +67,17 @@ void GameStarfield::detectGame()
|
||||
QString GameStarfield::identifyGamePath() const
|
||||
{
|
||||
QString path = "Software\\Valve\\Steam";
|
||||
QString steamLocation = findInRegistry(HKEY_CURRENT_USER, path.toStdWString().c_str(), L"SteamPath");
|
||||
QString steamLocation =
|
||||
findInRegistry(HKEY_CURRENT_USER, path.toStdWString().c_str(), L"SteamPath");
|
||||
if (!steamLocation.isEmpty()) {
|
||||
QString steamLibraryLocation;
|
||||
QString steamLibraries(steamLocation + "\\" + "config" + "\\" + "libraryfolders.vdf");
|
||||
QString steamLibraries(steamLocation + "\\" + "config" + "\\" +
|
||||
"libraryfolders.vdf");
|
||||
if (QFile(steamLibraries).exists()) {
|
||||
std::ifstream file(steamLibraries.toStdString());
|
||||
auto root = tyti::vdf::read(file);
|
||||
for (auto child : root.childs) {
|
||||
tyti::vdf::object *library = child.second.get();
|
||||
tyti::vdf::object* library = child.second.get();
|
||||
auto apps = library->childs["apps"];
|
||||
if (apps->attribs.contains(steamAPPId().toStdString())) {
|
||||
steamLibraryLocation = QString::fromStdString(library->attribs["path"]);
|
||||
@@ -84,8 +86,10 @@ QString GameStarfield::identifyGamePath() const
|
||||
}
|
||||
}
|
||||
if (!steamLibraryLocation.isEmpty()) {
|
||||
QString gameLocation = steamLibraryLocation + "\\" + "steamapps" + "\\" + "common" + "\\" + "Starfield";
|
||||
if (QDir(gameLocation).exists() && QFile(gameLocation + "\\" + "Starfield.exe").exists())
|
||||
QString gameLocation = steamLibraryLocation + "\\" + "steamapps" + "\\" +
|
||||
"common" + "\\" + "Starfield";
|
||||
if (QDir(gameLocation).exists() &&
|
||||
QFile(gameLocation + "\\" + "Starfield.exe").exists())
|
||||
return gameLocation;
|
||||
}
|
||||
}
|
||||
@@ -110,9 +114,9 @@ QMap<QString, QDir> GameStarfield::secondaryDataDirectories() const
|
||||
QList<ExecutableInfo> GameStarfield::executables() const
|
||||
{
|
||||
return QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("SFSE", findInGameFolder(feature<ScriptExtender>()->loaderName()))
|
||||
<< ExecutableInfo("Starfield", findInGameFolder(binaryName()))
|
||||
;
|
||||
<< ExecutableInfo("SFSE",
|
||||
findInGameFolder(feature<ScriptExtender>()->loaderName()))
|
||||
<< ExecutableInfo("Starfield", findInGameFolder(binaryName()));
|
||||
}
|
||||
|
||||
QList<ExecutableForcedLoadSetting> GameStarfield::executableForcedLoads() const
|
||||
@@ -130,7 +134,6 @@ QString GameStarfield::localizedName() const
|
||||
return tr("Starfield Support Plugin");
|
||||
}
|
||||
|
||||
|
||||
QString GameStarfield::author() const
|
||||
{
|
||||
return "Silarn";
|
||||
@@ -151,16 +154,17 @@ QList<PluginSetting> GameStarfield::settings() const
|
||||
return QList<PluginSetting>();
|
||||
}
|
||||
|
||||
void GameStarfield::initializeProfile(const QDir &path, ProfileSettings settings) const
|
||||
void GameStarfield::initializeProfile(const QDir& path, ProfileSettings settings) const
|
||||
{
|
||||
if (settings.testFlag(IPluginGame::MODS)) {
|
||||
copyToProfile(localAppFolder() + "/Starfield", path, "plugins.txt");
|
||||
}
|
||||
|
||||
if (settings.testFlag(IPluginGame::CONFIGURATION)) {
|
||||
if (settings.testFlag(IPluginGame::PREFER_DEFAULTS)
|
||||
|| !QFileInfo(myGamesPath() + "/Starfield.ini").exists()) {
|
||||
copyToProfile(gameDirectory().absolutePath(), path, "StarfieldDefault.ini", "Starfield.ini");
|
||||
if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) ||
|
||||
!QFileInfo(myGamesPath() + "/Starfield.ini").exists()) {
|
||||
copyToProfile(gameDirectory().absolutePath(), path, "StarfieldDefault.ini",
|
||||
"Starfield.ini");
|
||||
} else {
|
||||
copyToProfile(myGamesPath(), path, "Starfield.ini");
|
||||
}
|
||||
@@ -180,7 +184,8 @@ QString GameStarfield::savegameSEExtension() const
|
||||
return "sfse";
|
||||
}
|
||||
|
||||
std::shared_ptr<const GamebryoSaveGame> GameStarfield::makeSaveGame(QString filePath) const
|
||||
std::shared_ptr<const GamebryoSaveGame>
|
||||
GameStarfield::makeSaveGame(QString filePath) const
|
||||
{
|
||||
return std::make_shared<const StarfieldSaveGame>(filePath, this);
|
||||
}
|
||||
@@ -190,8 +195,10 @@ QString GameStarfield::steamAPPId() const
|
||||
return "1716740";
|
||||
}
|
||||
|
||||
QStringList GameStarfield::primaryPlugins() const {
|
||||
QStringList plugins = { "Starfield.esm", "Constellation.esm", "OldMars.esm", "BlueprintShips-Starfield.esm" };
|
||||
QStringList GameStarfield::primaryPlugins() const
|
||||
{
|
||||
QStringList plugins = {"Starfield.esm", "Constellation.esm", "OldMars.esm",
|
||||
"BlueprintShips-Starfield.esm"};
|
||||
|
||||
plugins.append(CCPlugins());
|
||||
|
||||
@@ -200,7 +207,7 @@ QStringList GameStarfield::primaryPlugins() const {
|
||||
|
||||
QStringList GameStarfield::gameVariants() const
|
||||
{
|
||||
return { "Regular" };
|
||||
return {"Regular"};
|
||||
}
|
||||
|
||||
QString GameStarfield::gameShortName() const
|
||||
@@ -215,7 +222,7 @@ QString GameStarfield::gameNexusName() const
|
||||
|
||||
QStringList GameStarfield::iniFiles() const
|
||||
{
|
||||
return { "Starfield.ini", "StarfieldPrefs.ini", "StarfieldCustom.ini" };
|
||||
return {"Starfield.ini", "StarfieldPrefs.ini", "StarfieldCustom.ini"};
|
||||
}
|
||||
|
||||
QStringList GameStarfield::DLCPlugins() const
|
||||
@@ -228,7 +235,9 @@ QStringList GameStarfield::CCPlugins() const
|
||||
QStringList plugins = {};
|
||||
QFile file(gameDirectory().absoluteFilePath("Starfield.ccc"));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
ON_BLOCK_EXIT([&file]() { file.close(); });
|
||||
ON_BLOCK_EXIT([&file]() {
|
||||
file.close();
|
||||
});
|
||||
|
||||
if (file.size() == 0) {
|
||||
return plugins;
|
||||
|
||||
+5
-9
@@ -1,7 +1,6 @@
|
||||
#ifndef GAMESTARFIELD_H
|
||||
#define GAMESTARFIELD_H
|
||||
|
||||
|
||||
#include "gamegamebryo.h"
|
||||
|
||||
#include <QObject>
|
||||
@@ -14,20 +13,20 @@ class GameStarfield : public GameGamebryo
|
||||
Q_PLUGIN_METADATA(IID "org.modorganizer.GameStarfield" FILE "gamestarfield.json")
|
||||
|
||||
public:
|
||||
|
||||
GameStarfield();
|
||||
|
||||
virtual bool init(MOBase::IOrganizer *moInfo) override;
|
||||
virtual bool init(MOBase::IOrganizer* moInfo) override;
|
||||
|
||||
public: // IPluginGame interface
|
||||
|
||||
virtual QString gameName() const override;
|
||||
virtual void detectGame() override;
|
||||
virtual QDir dataDirectory() const override;
|
||||
virtual QMap<QString, QDir> secondaryDataDirectories() const override;
|
||||
virtual QList<MOBase::ExecutableInfo> executables() const override;
|
||||
virtual QList<MOBase::ExecutableForcedLoadSetting> executableForcedLoads() const override;
|
||||
virtual void initializeProfile(const QDir &path, ProfileSettings settings) const override;
|
||||
virtual QList<MOBase::ExecutableForcedLoadSetting>
|
||||
executableForcedLoads() const override;
|
||||
virtual void initializeProfile(const QDir& path,
|
||||
ProfileSettings settings) const override;
|
||||
virtual QString steamAPPId() const override;
|
||||
virtual QStringList primaryPlugins() const override;
|
||||
virtual QStringList gameVariants() const override;
|
||||
@@ -41,7 +40,6 @@ public: // IPluginGame interface
|
||||
virtual int nexusGameID() const override;
|
||||
|
||||
public: // IPlugin interface
|
||||
|
||||
virtual QString name() const override;
|
||||
virtual QString localizedName() const override;
|
||||
virtual QString author() const override;
|
||||
@@ -50,12 +48,10 @@ public: // IPlugin interface
|
||||
virtual QList<MOBase::PluginSetting> settings() const override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual QString identifyGamePath() const override;
|
||||
std::shared_ptr<const GamebryoSaveGame> makeSaveGame(QString filePath) const override;
|
||||
QString savegameExtension() const override;
|
||||
QString savegameSEExtension() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // GAMEStarfield_H
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
#include "dummybsa.h"
|
||||
#include "iplugingame.h"
|
||||
#include "iprofile.h"
|
||||
#include "registry.h"
|
||||
#include <imoinfo.h>
|
||||
#include <utility.h>
|
||||
#include "registry.h"
|
||||
|
||||
StarfieldBSAInvalidation::StarfieldBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game)
|
||||
StarfieldBSAInvalidation::StarfieldBSAInvalidation(DataArchives* dataArchives,
|
||||
MOBase::IPluginGame const* game)
|
||||
: GamebryoBSAInvalidation(dataArchives, "StarfieldCustom.ini", game)
|
||||
{
|
||||
m_IniFileName = "StarfieldCustom.ini";
|
||||
@@ -32,8 +33,7 @@ unsigned long StarfieldBSAInvalidation::bsaVersion() const
|
||||
bool StarfieldBSAInvalidation::prepareProfile(MOBase::IProfile* profile)
|
||||
{
|
||||
bool dirty = false;
|
||||
QString basePath
|
||||
= profile->localSettingsEnabled()
|
||||
QString basePath = profile->localSettingsEnabled()
|
||||
? profile->absolutePath()
|
||||
: m_Game->documentsDirectory().absolutePath();
|
||||
QString iniFilePath = basePath + "/" + m_IniFileName;
|
||||
@@ -41,18 +41,25 @@ bool StarfieldBSAInvalidation::prepareProfile(MOBase::IProfile* profile)
|
||||
|
||||
if (profile->invalidationActive(nullptr)) {
|
||||
// write bInvalidateOlderFiles = 1, if needed
|
||||
if (!::GetPrivateProfileStringW(L"Archive", L"bInvalidateOlderFiles", L"0", setting, MAX_PATH, iniFilePath.toStdWString().c_str())
|
||||
|| wcstol(setting, nullptr, 10) != 1) {
|
||||
if (!::GetPrivateProfileStringW(L"Archive", L"bInvalidateOlderFiles", L"0", setting,
|
||||
MAX_PATH, iniFilePath.toStdWString().c_str()) ||
|
||||
wcstol(setting, nullptr, 10) != 1) {
|
||||
dirty = true;
|
||||
if (!MOBase::WriteRegistryValue(L"Archive", L"bInvalidateOlderFiles", L"1", iniFilePath.toStdWString().c_str())) {
|
||||
qWarning("failed to override data directory in \"%s\"", qUtf8Printable(m_IniFileName));
|
||||
if (!MOBase::WriteRegistryValue(L"Archive", L"bInvalidateOlderFiles", L"1",
|
||||
iniFilePath.toStdWString().c_str())) {
|
||||
qWarning("failed to override data directory in \"%s\"",
|
||||
qUtf8Printable(m_IniFileName));
|
||||
}
|
||||
}
|
||||
if (!::GetPrivateProfileStringW(L"Archive", L"sResourceDataDirsFinal", L"STRINGS\\", setting, MAX_PATH, iniFilePath.toStdWString().c_str())
|
||||
|| wcscmp(setting, L"") != 0) {
|
||||
if (!::GetPrivateProfileStringW(L"Archive", L"sResourceDataDirsFinal", L"STRINGS\\",
|
||||
setting, MAX_PATH,
|
||||
iniFilePath.toStdWString().c_str()) ||
|
||||
wcscmp(setting, L"") != 0) {
|
||||
dirty = true;
|
||||
if (!MOBase::WriteRegistryValue(L"Archive", L"sResourceDataDirsFinal", L"", iniFilePath.toStdWString().c_str())) {
|
||||
qWarning("failed to override data directory in \"%s\"", qUtf8Printable(m_IniFileName));
|
||||
if (!MOBase::WriteRegistryValue(L"Archive", L"sResourceDataDirsFinal", L"",
|
||||
iniFilePath.toStdWString().c_str())) {
|
||||
qWarning("failed to override data directory in \"%s\"",
|
||||
qUtf8Printable(m_IniFileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,32 @@
|
||||
#ifndef STARFIELDBSAINVALIDATION_H
|
||||
#define STARFIELDBSAINVALIDATION_H
|
||||
|
||||
|
||||
#include <bsainvalidation.h>
|
||||
#include <dataarchives.h>
|
||||
#include "gamebryobsainvalidation.h"
|
||||
#include "starfielddataarchives.h"
|
||||
#include <bsainvalidation.h>
|
||||
#include <dataarchives.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace MOBase {
|
||||
class IPluginGame;
|
||||
namespace MOBase
|
||||
{
|
||||
class IPluginGame;
|
||||
}
|
||||
|
||||
class StarfieldBSAInvalidation : public GamebryoBSAInvalidation
|
||||
{
|
||||
public:
|
||||
|
||||
StarfieldBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game);
|
||||
StarfieldBSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game);
|
||||
virtual bool isInvalidationBSA(const QString& bsaName) override;
|
||||
virtual bool prepareProfile(MOBase::IProfile* profile) override;
|
||||
|
||||
private:
|
||||
|
||||
virtual QString invalidationBSAName() const override;
|
||||
virtual unsigned long bsaVersion() const override;
|
||||
|
||||
private:
|
||||
|
||||
QString m_IniFileName;
|
||||
MOBase::IPluginGame const* m_Game;
|
||||
|
||||
};
|
||||
|
||||
#endif // STARFIELDBSAINVALIDATION_H
|
||||
|
||||
@@ -3,75 +3,77 @@
|
||||
#include "iprofile.h"
|
||||
#include <utility.h>
|
||||
|
||||
StarfieldDataArchives::StarfieldDataArchives(const QDir &myGamesDir) :
|
||||
GamebryoDataArchives(myGamesDir)
|
||||
StarfieldDataArchives::StarfieldDataArchives(const QDir& myGamesDir)
|
||||
: GamebryoDataArchives(myGamesDir)
|
||||
{}
|
||||
|
||||
QStringList StarfieldDataArchives::vanillaArchives() const
|
||||
{
|
||||
return { "Starfield - Animations.ba2"
|
||||
, "Starfield - DensityMaps.ba2"
|
||||
, "Starfield - FaceAnimation01.ba2"
|
||||
, "Starfield - FaceAnimation02.ba2"
|
||||
, "Starfield - FaceAnimation03.ba2"
|
||||
, "Starfield - FaceAnimation04.ba2"
|
||||
, "Starfield - FaceAnimationPatch.ba2"
|
||||
, "Starfield - FaceMeshes.ba2"
|
||||
, "Starfield - GeneratedTextures.ba2"
|
||||
, "Starfield - Interface.ba2"
|
||||
, "Starfield - Localization.ba2"
|
||||
, "Starfield - LODMeshes.ba2"
|
||||
, "Starfield - LODMeshesPatch.ba2"
|
||||
, "Starfield - LODTextures.ba2"
|
||||
, "Starfield - Materials.ba2"
|
||||
, "Starfield - Meshes01.ba2"
|
||||
, "Starfield - Meshes02.ba2"
|
||||
, "Starfield - MeshesPatch.ba2"
|
||||
, "Starfield - Misc.ba2"
|
||||
, "Starfield - Particles.ba2"
|
||||
, "Starfield - ParticlesTestData.ba2"
|
||||
, "Starfield - PlanetData.ba2"
|
||||
, "Starfield - Shaders.ba2"
|
||||
, "Starfield - ShadersBeta.ba2"
|
||||
, "Starfield - Terrain01.ba2"
|
||||
, "Starfield - Terrain02.ba2"
|
||||
, "Starfield - Terrain03.ba2"
|
||||
, "Starfield - Terrain04.ba2"
|
||||
, "Starfield - TerrainPatch.ba2"
|
||||
, "Starfield - Textures01.ba2"
|
||||
, "Starfield - Textures02.ba2"
|
||||
, "Starfield - Textures03.ba2"
|
||||
, "Starfield - Textures04.ba2"
|
||||
, "Starfield - Textures05.ba2"
|
||||
, "Starfield - Textures06.ba2"
|
||||
, "Starfield - Textures07.ba2"
|
||||
, "Starfield - Textures08.ba2"
|
||||
, "Starfield - Textures09.ba2"
|
||||
, "Starfield - Textures10.ba2"
|
||||
, "Starfield - Textures11.ba2"
|
||||
, "Starfield - TexturesPatch.ba2"
|
||||
, "Starfield - Voices01.ba2"
|
||||
, "Starfield - Voices02.ba2"
|
||||
, "Starfield - VoicesPatch.ba2"
|
||||
, "Starfield - WwiseSounds01.ba2"
|
||||
, "Starfield - WwiseSounds02.ba2"
|
||||
, "Starfield - WwiseSounds03.ba2"
|
||||
, "Starfield - WwiseSounds04.ba2"
|
||||
, "Starfield - WwiseSounds05.ba2"
|
||||
, "Starfield - WwiseSoundsPatch.ba2"
|
||||
, "Constellation - Localization.ba2"
|
||||
, "Constellation - Textures.ba2"
|
||||
, "OldMars - Localization.ba2"
|
||||
, "OldMars - Textures.ba2"
|
||||
, "BlueprintShips-Starfield - Localization.ba2" };
|
||||
return {"Starfield - Animations.ba2",
|
||||
"Starfield - DensityMaps.ba2",
|
||||
"Starfield - FaceAnimation01.ba2",
|
||||
"Starfield - FaceAnimation02.ba2",
|
||||
"Starfield - FaceAnimation03.ba2",
|
||||
"Starfield - FaceAnimation04.ba2",
|
||||
"Starfield - FaceAnimationPatch.ba2",
|
||||
"Starfield - FaceMeshes.ba2",
|
||||
"Starfield - GeneratedTextures.ba2",
|
||||
"Starfield - Interface.ba2",
|
||||
"Starfield - Localization.ba2",
|
||||
"Starfield - LODMeshes.ba2",
|
||||
"Starfield - LODMeshesPatch.ba2",
|
||||
"Starfield - LODTextures.ba2",
|
||||
"Starfield - Materials.ba2",
|
||||
"Starfield - Meshes01.ba2",
|
||||
"Starfield - Meshes02.ba2",
|
||||
"Starfield - MeshesPatch.ba2",
|
||||
"Starfield - Misc.ba2",
|
||||
"Starfield - Particles.ba2",
|
||||
"Starfield - ParticlesTestData.ba2",
|
||||
"Starfield - PlanetData.ba2",
|
||||
"Starfield - Shaders.ba2",
|
||||
"Starfield - ShadersBeta.ba2",
|
||||
"Starfield - Terrain01.ba2",
|
||||
"Starfield - Terrain02.ba2",
|
||||
"Starfield - Terrain03.ba2",
|
||||
"Starfield - Terrain04.ba2",
|
||||
"Starfield - TerrainPatch.ba2",
|
||||
"Starfield - Textures01.ba2",
|
||||
"Starfield - Textures02.ba2",
|
||||
"Starfield - Textures03.ba2",
|
||||
"Starfield - Textures04.ba2",
|
||||
"Starfield - Textures05.ba2",
|
||||
"Starfield - Textures06.ba2",
|
||||
"Starfield - Textures07.ba2",
|
||||
"Starfield - Textures08.ba2",
|
||||
"Starfield - Textures09.ba2",
|
||||
"Starfield - Textures10.ba2",
|
||||
"Starfield - Textures11.ba2",
|
||||
"Starfield - TexturesPatch.ba2",
|
||||
"Starfield - Voices01.ba2",
|
||||
"Starfield - Voices02.ba2",
|
||||
"Starfield - VoicesPatch.ba2",
|
||||
"Starfield - WwiseSounds01.ba2",
|
||||
"Starfield - WwiseSounds02.ba2",
|
||||
"Starfield - WwiseSounds03.ba2",
|
||||
"Starfield - WwiseSounds04.ba2",
|
||||
"Starfield - WwiseSounds05.ba2",
|
||||
"Starfield - WwiseSoundsPatch.ba2",
|
||||
"Constellation - Localization.ba2",
|
||||
"Constellation - Textures.ba2",
|
||||
"OldMars - Localization.ba2",
|
||||
"OldMars - Textures.ba2",
|
||||
"BlueprintShips-Starfield - Localization.ba2"};
|
||||
}
|
||||
|
||||
|
||||
QStringList StarfieldDataArchives::archives(const MOBase::IProfile *profile) const
|
||||
QStringList StarfieldDataArchives::archives(const MOBase::IProfile* profile) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("Starfield.ini") : m_LocalGameDir.absoluteFilePath("Starfield.ini");
|
||||
QString iniFile =
|
||||
profile->localSettingsEnabled()
|
||||
? QDir(profile->absolutePath()).absoluteFilePath("Starfield.ini")
|
||||
: m_LocalGameDir.absoluteFilePath("Starfield.ini");
|
||||
result.append(getArchivesFromKey(iniFile, "SResourceArchiveList"));
|
||||
result.append(getArchivesFromKey(iniFile, "sResourceIndexFileList"));
|
||||
result.append(getArchivesFromKey(iniFile, "SResourceArchiveMemoryCacheList"));
|
||||
@@ -81,11 +83,15 @@ QStringList StarfieldDataArchives::archives(const MOBase::IProfile *profile) con
|
||||
return result;
|
||||
}
|
||||
|
||||
void StarfieldDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before)
|
||||
void StarfieldDataArchives::writeArchiveList(MOBase::IProfile* profile,
|
||||
const QStringList& before)
|
||||
{
|
||||
QString list = before.join(", ");
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("Starfield.ini") : m_LocalGameDir.absoluteFilePath("Starfield.ini");
|
||||
QString iniFile =
|
||||
profile->localSettingsEnabled()
|
||||
? QDir(profile->absolutePath()).absoluteFilePath("Starfield.ini")
|
||||
: m_LocalGameDir.absoluteFilePath("Starfield.ini");
|
||||
if (list.length() > 255) {
|
||||
int splitIdx = list.lastIndexOf(",", 256);
|
||||
setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx));
|
||||
|
||||
@@ -3,27 +3,27 @@
|
||||
|
||||
#include "gamebryodataarchives.h"
|
||||
|
||||
namespace MOBase { class IProfile; }
|
||||
namespace MOBase
|
||||
{
|
||||
class IProfile;
|
||||
}
|
||||
|
||||
#include <QStringList>
|
||||
#include <QDir>
|
||||
#include <QStringList>
|
||||
|
||||
class StarfieldDataArchives : public GamebryoDataArchives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
StarfieldDataArchives(const QDir &myGamesDir);
|
||||
StarfieldDataArchives(const QDir& myGamesDir);
|
||||
|
||||
public:
|
||||
|
||||
virtual QStringList vanillaArchives() const override;
|
||||
virtual QStringList archives(const MOBase::IProfile *profile) const override;
|
||||
virtual QStringList archives(const MOBase::IProfile* profile) const override;
|
||||
|
||||
private:
|
||||
|
||||
virtual void writeArchiveList(MOBase::IProfile *profile, const QStringList &before) override;
|
||||
|
||||
virtual void writeArchiveList(MOBase::IProfile* profile,
|
||||
const QStringList& before) override;
|
||||
};
|
||||
|
||||
#endif // STARFIELDDATAARCHIVES_H
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
StarfieldGamePlugins::StarfieldGamePlugins(MOBase::IOrganizer* organizer) : CreationGamePlugins(organizer)
|
||||
{
|
||||
}
|
||||
StarfieldGamePlugins::StarfieldGamePlugins(MOBase::IOrganizer* organizer)
|
||||
: CreationGamePlugins(organizer)
|
||||
{}
|
||||
|
||||
bool StarfieldGamePlugins::overridePluginsAreSupported()
|
||||
{
|
||||
|
||||
@@ -10,13 +10,10 @@ class StarfieldGamePlugins : public CreationGamePlugins
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
StarfieldGamePlugins(MOBase::IOrganizer* organizer);
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool overridePluginsAreSupported() override;
|
||||
|
||||
};
|
||||
|
||||
#endif // _STARFIELDGAMEPLUGINS_H
|
||||
@@ -9,18 +9,19 @@ public:
|
||||
using GamebryoModDataChecker::GamebryoModDataChecker;
|
||||
|
||||
protected:
|
||||
virtual const FileNameSet& possibleFolderNames() const override {
|
||||
virtual const FileNameSet& possibleFolderNames() const override
|
||||
{
|
||||
static FileNameSet result{
|
||||
"interface", "meshes", "music", "scripts", "sound", "strings", "textures",
|
||||
"trees", "video", "materials", "sfse", "distantlod", "asi", "Tools", "MCM",
|
||||
"distantland", "mits", "dllplugins", "CalienteTools", "shadersfx", "aaf"
|
||||
};
|
||||
"interface", "meshes", "music", "scripts", "sound", "strings",
|
||||
"textures", "trees", "video", "materials", "sfse", "distantlod",
|
||||
"asi", "Tools", "MCM", "distantland", "mits", "dllplugins",
|
||||
"CalienteTools", "shadersfx", "aaf"};
|
||||
return result;
|
||||
}
|
||||
virtual const FileNameSet& possibleFileExtensions() const override {
|
||||
static FileNameSet result{
|
||||
"esp", "esm", "esl", "ba2", "modgroups", "ini", "csg", "cdx"
|
||||
};
|
||||
virtual const FileNameSet& possibleFileExtensions() const override
|
||||
{
|
||||
static FileNameSet result{"esp", "esm", "esl", "ba2",
|
||||
"modgroups", "ini", "csg", "cdx"};
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,15 +4,17 @@
|
||||
#include <gamebryomoddatacontent.h>
|
||||
#include <ifiletree.h>
|
||||
|
||||
class StarfieldModDataContent : public GamebryoModDataContent {
|
||||
class StarfieldModDataContent : public GamebryoModDataContent
|
||||
{
|
||||
protected:
|
||||
enum StarfieldContent {
|
||||
enum StarfieldContent
|
||||
{
|
||||
CONTENT_MATERIAL = CONTENT_NEXT_VALUE
|
||||
};
|
||||
|
||||
public:
|
||||
StarfieldModDataContent(GameGamebryo const* gamePlugin) :
|
||||
GamebryoModDataContent(gamePlugin)
|
||||
StarfieldModDataContent(GameGamebryo const* gamePlugin)
|
||||
: GamebryoModDataContent(gamePlugin)
|
||||
{
|
||||
m_Enabled[CONTENT_SKYPROC] = false;
|
||||
}
|
||||
@@ -20,12 +22,13 @@ public:
|
||||
std::vector<Content> getAllContents() const override
|
||||
{
|
||||
auto contents = GamebryoModDataContent::getAllContents();
|
||||
contents.push_back(Content(CONTENT_MATERIAL, "Materials", ":/MO/gui/content/material"));
|
||||
contents.push_back(
|
||||
Content(CONTENT_MATERIAL, "Materials", ":/MO/gui/content/material"));
|
||||
return contents;
|
||||
}
|
||||
|
||||
std::vector<int> getContentsFor(
|
||||
std::shared_ptr<const MOBase::IFileTree> fileTree) const override
|
||||
std::vector<int>
|
||||
getContentsFor(std::shared_ptr<const MOBase::IFileTree> fileTree) const override
|
||||
{
|
||||
auto contents = GamebryoModDataContent::getContentsFor(fileTree);
|
||||
for (auto e : *fileTree) {
|
||||
|
||||
+15
-19
@@ -4,28 +4,28 @@
|
||||
|
||||
#include "gamestarfield.h"
|
||||
|
||||
StarfieldSaveGame::StarfieldSaveGame(QString const &fileName, GameStarfield const* game) :
|
||||
GamebryoSaveGame(fileName, game, true)
|
||||
StarfieldSaveGame::StarfieldSaveGame(QString const& fileName, GameStarfield const* game)
|
||||
: GamebryoSaveGame(fileName, game, true)
|
||||
{
|
||||
FileWrapper file(getFilepath(), "BCPS");
|
||||
|
||||
getData(file);
|
||||
FILETIME creationTime;
|
||||
fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation, creationTime);
|
||||
fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation,
|
||||
creationTime);
|
||||
file.closeCompressedData();
|
||||
file.close();
|
||||
|
||||
//A file time is a 64-bit value that represents the number of 100-nanosecond
|
||||
//intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC).
|
||||
//So we need to convert that to something useful
|
||||
// A file time is a 64-bit value that represents the number of 100-nanosecond
|
||||
// intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal
|
||||
// Time (UTC). So we need to convert that to something useful
|
||||
SYSTEMTIME ctime;
|
||||
::FileTimeToSystemTime(&creationTime, &ctime);
|
||||
|
||||
setCreationTime(ctime);
|
||||
}
|
||||
|
||||
void StarfieldSaveGame::getData(
|
||||
FileWrapper& file) const
|
||||
void StarfieldSaveGame::getData(FileWrapper& file) const
|
||||
{
|
||||
file.skip<uint32_t>(); // header version
|
||||
file.skip<uint64_t>(); // zip start location
|
||||
@@ -41,18 +41,14 @@ void StarfieldSaveGame::getData(
|
||||
}
|
||||
|
||||
void StarfieldSaveGame::fetchInformationFields(
|
||||
FileWrapper& file,
|
||||
unsigned long& saveNumber,
|
||||
QString& playerName,
|
||||
unsigned short& playerLevel,
|
||||
QString& playerLocation,
|
||||
FILETIME& creationTime) const
|
||||
FileWrapper& file, unsigned long& saveNumber, QString& playerName,
|
||||
unsigned short& playerLevel, QString& playerLocation, FILETIME& creationTime) const
|
||||
{
|
||||
char fileID[12]; // SFS_SAVEGAME
|
||||
unsigned int headerSize;
|
||||
unsigned int version;
|
||||
unsigned char unknown;
|
||||
//file.read(fileID, 12);
|
||||
// file.read(fileID, 12);
|
||||
headerSize = file.readInt(12);
|
||||
version = file.readInt();
|
||||
unknown = file.readChar();
|
||||
@@ -81,7 +77,7 @@ void StarfieldSaveGame::fetchInformationFields(
|
||||
|
||||
std::unique_ptr<GamebryoSaveGame::DataFields> StarfieldSaveGame::fetchDataFields() const
|
||||
{
|
||||
FileWrapper file(getFilepath(), "BCPS"); //10bytes
|
||||
FileWrapper file(getFilepath(), "BCPS"); // 10bytes
|
||||
|
||||
getData(file);
|
||||
FILETIME creationTime;
|
||||
@@ -92,14 +88,14 @@ std::unique_ptr<GamebryoSaveGame::DataFields> StarfieldSaveGame::fetchDataFields
|
||||
unsigned long dummySaveNumber;
|
||||
FILETIME dummyTime;
|
||||
|
||||
fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel,
|
||||
dummyLocation, dummyTime);
|
||||
fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel, dummyLocation,
|
||||
dummyTime);
|
||||
}
|
||||
|
||||
QString ignore;
|
||||
std::unique_ptr<DataFields> fields = std::make_unique<DataFields>();
|
||||
|
||||
//fields->Screenshot = file.readImage(384, true);
|
||||
// fields->Screenshot = file.readImage(384, true);
|
||||
|
||||
uint8_t saveGameVersion = file.readChar(12);
|
||||
file.read(ignore); // game version
|
||||
|
||||
+5
-13
@@ -11,23 +11,15 @@ class GameStarfield;
|
||||
class StarfieldSaveGame : public GamebryoSaveGame
|
||||
{
|
||||
public:
|
||||
StarfieldSaveGame(QString const &fileName, GameStarfield const* game);
|
||||
StarfieldSaveGame(QString const& fileName, GameStarfield const* game);
|
||||
|
||||
protected:
|
||||
|
||||
// Fetch easy-to-access information.
|
||||
void getData(
|
||||
FileWrapper& file
|
||||
) const;
|
||||
void getData(FileWrapper& file) const;
|
||||
|
||||
void fetchInformationFields(
|
||||
FileWrapper& file,
|
||||
unsigned long& saveNumber,
|
||||
QString& playerName,
|
||||
unsigned short& playerLevel,
|
||||
QString& playerLocation,
|
||||
FILETIME& creationTime
|
||||
) const;
|
||||
void fetchInformationFields(FileWrapper& file, unsigned long& saveNumber,
|
||||
QString& playerName, unsigned short& playerLevel,
|
||||
QString& playerLocation, FILETIME& creationTime) const;
|
||||
|
||||
std::unique_ptr<DataFields> fetchDataFields() const override;
|
||||
};
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
StarfieldScriptExtender::StarfieldScriptExtender(GameGamebryo const *game) :
|
||||
GamebryoScriptExtender(game)
|
||||
{
|
||||
}
|
||||
StarfieldScriptExtender::StarfieldScriptExtender(GameGamebryo const* game)
|
||||
: GamebryoScriptExtender(game)
|
||||
{}
|
||||
|
||||
QString StarfieldScriptExtender::BinaryName() const
|
||||
{
|
||||
|
||||
@@ -8,11 +8,10 @@ class GameGamebryo;
|
||||
class StarfieldScriptExtender : public GamebryoScriptExtender
|
||||
{
|
||||
public:
|
||||
StarfieldScriptExtender(GameGamebryo const *game);
|
||||
StarfieldScriptExtender(GameGamebryo const* game);
|
||||
|
||||
virtual QString BinaryName() const override;
|
||||
virtual QString PluginPath() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // STARFIELDSCRIPTEXTENDER_H
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
#include "starfieldunmanagedmods.h"
|
||||
|
||||
|
||||
StarfieldUnmangedMods::StarfieldUnmangedMods(const GameGamebryo *game)
|
||||
StarfieldUnmangedMods::StarfieldUnmangedMods(const GameGamebryo* game)
|
||||
: GamebryoUnmangedMods(game)
|
||||
{}
|
||||
|
||||
StarfieldUnmangedMods::~StarfieldUnmangedMods()
|
||||
{}
|
||||
StarfieldUnmangedMods::~StarfieldUnmangedMods() {}
|
||||
|
||||
QStringList StarfieldUnmangedMods::mods(bool onlyOfficial) const {
|
||||
QStringList StarfieldUnmangedMods::mods(bool onlyOfficial) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QStringList pluginList = game()->primaryPlugins();
|
||||
@@ -18,7 +17,7 @@ QStringList StarfieldUnmangedMods::mods(bool onlyOfficial) const {
|
||||
pluginList.removeAll(plugin);
|
||||
}
|
||||
QDir dataDir(game()->dataDirectory());
|
||||
for (const QString &fileName : dataDir.entryList({ "*.esp", "*.esl", "*.esm" })) {
|
||||
for (const QString& fileName : dataDir.entryList({"*.esp", "*.esl", "*.esm"})) {
|
||||
if (!pluginList.contains(fileName, Qt::CaseInsensitive)) {
|
||||
if (!onlyOfficial || pluginList.contains(fileName, Qt::CaseInsensitive)) {
|
||||
result.append(fileName.chopped(4)); // trims the extension off
|
||||
@@ -29,17 +28,18 @@ QStringList StarfieldUnmangedMods::mods(bool onlyOfficial) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList StarfieldUnmangedMods::secondaryFiles(const QString &modName) const {
|
||||
QStringList StarfieldUnmangedMods::secondaryFiles(const QString& modName) const
|
||||
{
|
||||
// file extension in FO4 is .ba2 instead of bsa
|
||||
QStringList archives;
|
||||
QDir dataDir = game()->dataDirectory();
|
||||
for (const QString &archiveName : dataDir.entryList({modName + "*.ba2"})) {
|
||||
for (const QString& archiveName : dataDir.entryList({modName + "*.ba2"})) {
|
||||
archives.append(dataDir.absoluteFilePath(archiveName));
|
||||
}
|
||||
return archives;
|
||||
}
|
||||
|
||||
QString StarfieldUnmangedMods::displayName(const QString &modName) const
|
||||
QString StarfieldUnmangedMods::displayName(const QString& modName) const
|
||||
{
|
||||
// unlike in earlier games, in fallout 4 the file name doesn't correspond to
|
||||
// the public name
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
#ifndef STARFIELDUNMANAGEDMODS_H
|
||||
#define STARFIELDUNMANAGEDMODS_H
|
||||
|
||||
|
||||
#include "gamebryounmanagedmods.h"
|
||||
#include <gamegamebryo.h>
|
||||
|
||||
|
||||
class StarfieldUnmangedMods : public GamebryoUnmangedMods {
|
||||
class StarfieldUnmangedMods : public GamebryoUnmangedMods
|
||||
{
|
||||
public:
|
||||
StarfieldUnmangedMods(const GameGamebryo *game);
|
||||
StarfieldUnmangedMods(const GameGamebryo* game);
|
||||
~StarfieldUnmangedMods();
|
||||
|
||||
virtual QStringList mods(bool onlyOfficial) const override;
|
||||
virtual QStringList secondaryFiles(const QString &modName) const override;
|
||||
virtual QString displayName(const QString &modName) const override;
|
||||
virtual QStringList secondaryFiles(const QString& modName) const override;
|
||||
virtual QString displayName(const QString& modName) const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // STARFIELDUNMANAGEDMODS_H
|
||||
|
||||
+190
-181
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user