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