mirror of
https://github.com/ModOrganizer2/modorganizer-game_nehrim.git
synced 2026-07-27 14:08:13 -07:00
Add formatting and CI
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']
|
||||
@@ -0,0 +1,7 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.cpp text eol=crlf
|
||||
*.h text eol=crlf
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Build Nehrim Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Build Nehrim Plugin
|
||||
uses: ModOrganizer2/build-with-mob-action@master
|
||||
with:
|
||||
mo2-third-parties: fmt gtest spdlog boost lz4
|
||||
mo2-dependencies: cmake_common uibase game_gamebryo
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Lint Nehrim Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run clang-format
|
||||
uses: jidicula/clang-format-action@v4.11.0
|
||||
with:
|
||||
clang-format-version: "15"
|
||||
check-path: "."
|
||||
+75
-69
@@ -2,17 +2,17 @@
|
||||
|
||||
#include "nehrimbsainvalidation.h"
|
||||
#include "nehrimdataarchives.h"
|
||||
#include "nehrimscriptextender.h"
|
||||
#include "nehrimmoddatachecker.h"
|
||||
#include "nehrimmoddatacontent.h"
|
||||
#include "nehrimsavegame.h"
|
||||
#include "nehrimscriptextender.h"
|
||||
|
||||
#include "pluginsetting.h"
|
||||
#include "executableinfo.h"
|
||||
#include <gamebryolocalsavegames.h>
|
||||
#include "pluginsetting.h"
|
||||
#include <gamebryogameplugins.h>
|
||||
#include <gamebryounmanagedmods.h>
|
||||
#include <gamebryolocalsavegames.h>
|
||||
#include <gamebryosavegameinfo.h>
|
||||
#include <gamebryounmanagedmods.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
@@ -22,174 +22,180 @@
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
GameNehrim::GameNehrim()
|
||||
{
|
||||
}
|
||||
GameNehrim::GameNehrim() {}
|
||||
|
||||
bool GameNehrim::init(IOrganizer* moInfo)
|
||||
{
|
||||
if (!GameGamebryo::init(moInfo)) {
|
||||
return false;
|
||||
}
|
||||
registerFeature<ScriptExtender>(new NehrimScriptExtender(this));
|
||||
registerFeature<DataArchives>(new NehrimDataArchives(myGamesPath()));
|
||||
registerFeature<BSAInvalidation>(new NehrimBSAInvalidation(feature<DataArchives>(), this));
|
||||
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
|
||||
registerFeature<LocalSavegames>(new GamebryoLocalSavegames(myGamesPath(), "oblivion.ini"));
|
||||
registerFeature<ModDataChecker>(new NehrimModDataChecker(this));
|
||||
registerFeature<ModDataContent>(new NehrimModDataContent(this));
|
||||
registerFeature<GamePlugins>(new GamebryoGamePlugins(moInfo));
|
||||
registerFeature<UnmanagedMods>(new GamebryoUnmangedMods(this));
|
||||
return true;
|
||||
if (!GameGamebryo::init(moInfo)) {
|
||||
return false;
|
||||
}
|
||||
registerFeature<ScriptExtender>(new NehrimScriptExtender(this));
|
||||
registerFeature<DataArchives>(new NehrimDataArchives(myGamesPath()));
|
||||
registerFeature<BSAInvalidation>(
|
||||
new NehrimBSAInvalidation(feature<DataArchives>(), this));
|
||||
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
|
||||
registerFeature<LocalSavegames>(
|
||||
new GamebryoLocalSavegames(myGamesPath(), "oblivion.ini"));
|
||||
registerFeature<ModDataChecker>(new NehrimModDataChecker(this));
|
||||
registerFeature<ModDataContent>(new NehrimModDataContent(this));
|
||||
registerFeature<GamePlugins>(new GamebryoGamePlugins(moInfo));
|
||||
registerFeature<UnmanagedMods>(new GamebryoUnmangedMods(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
QString GameNehrim::gameName() const
|
||||
{
|
||||
return "Nehrim";
|
||||
return "Nehrim";
|
||||
}
|
||||
|
||||
QList<ExecutableInfo> GameNehrim::executables() const
|
||||
{
|
||||
return QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("Nehrim", findInGameFolder("Oblivion.exe"))
|
||||
<< ExecutableInfo("Nehrim Launcher", findInGameFolder("NehrimLauncher.exe"))
|
||||
<< ExecutableInfo("Oblivion Mod Manager", findInGameFolder("OblivionModManager.exe"))
|
||||
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath())).withArgument("--game=\"Nehrim\"")
|
||||
<< ExecutableInfo("Construction Set", findInGameFolder("TESConstructionSet.exe"))
|
||||
;
|
||||
return QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("Nehrim", findInGameFolder("Oblivion.exe"))
|
||||
<< ExecutableInfo("Nehrim Launcher", findInGameFolder("NehrimLauncher.exe"))
|
||||
<< ExecutableInfo("Oblivion Mod Manager",
|
||||
findInGameFolder("OblivionModManager.exe"))
|
||||
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
|
||||
.withArgument("--game=\"Nehrim\"")
|
||||
<< ExecutableInfo("Construction Set",
|
||||
findInGameFolder("TESConstructionSet.exe"));
|
||||
}
|
||||
|
||||
QList<ExecutableForcedLoadSetting> GameNehrim::executableForcedLoads() const
|
||||
{
|
||||
//TODO Search game directory for OBSE DLLs
|
||||
return QList<ExecutableForcedLoadSetting>()
|
||||
<< ExecutableForcedLoadSetting("Oblvion.exe", "obse_1_2_416.dll").withForced().withEnabled()
|
||||
<< ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll").withForced().withEnabled()
|
||||
;
|
||||
// TODO Search game directory for OBSE DLLs
|
||||
return QList<ExecutableForcedLoadSetting>()
|
||||
<< ExecutableForcedLoadSetting("Oblvion.exe", "obse_1_2_416.dll")
|
||||
.withForced()
|
||||
.withEnabled()
|
||||
<< ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll")
|
||||
.withForced()
|
||||
.withEnabled();
|
||||
}
|
||||
|
||||
QString GameNehrim::name() const
|
||||
{
|
||||
return "Nehrim Support Plugin";
|
||||
return "Nehrim Support Plugin";
|
||||
}
|
||||
|
||||
QString GameNehrim::localizedName() const
|
||||
{
|
||||
return tr("Nehrim Support Plugin");
|
||||
return tr("Nehrim Support Plugin");
|
||||
}
|
||||
|
||||
QString GameNehrim::author() const
|
||||
{
|
||||
return "Tannin";
|
||||
return "Tannin";
|
||||
}
|
||||
|
||||
QString GameNehrim::description() const
|
||||
{
|
||||
return tr("Adds support for the game Nehrim");
|
||||
return tr("Adds support for the game Nehrim");
|
||||
}
|
||||
|
||||
MOBase::VersionInfo GameNehrim::version() const
|
||||
{
|
||||
return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL);
|
||||
return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL);
|
||||
}
|
||||
|
||||
QList<PluginSetting> GameNehrim::settings() const
|
||||
{
|
||||
return QList<PluginSetting>();
|
||||
return QList<PluginSetting>();
|
||||
}
|
||||
|
||||
void GameNehrim::initializeProfile(const QDir& path, ProfileSettings settings) const
|
||||
{
|
||||
if (settings.testFlag(IPluginGame::MODS)) {
|
||||
copyToProfile(localAppFolder() + "/Oblvion", path, "plugins.txt");
|
||||
}
|
||||
if (settings.testFlag(IPluginGame::MODS)) {
|
||||
copyToProfile(localAppFolder() + "/Oblvion", path, "plugins.txt");
|
||||
}
|
||||
|
||||
if (settings.testFlag(IPluginGame::CONFIGURATION)) {
|
||||
if (settings.testFlag(IPluginGame::PREFER_DEFAULTS)
|
||||
|| !QFileInfo(myGamesPath() + "/oblivion.ini").exists()) {
|
||||
copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini", "oblivion.ini");
|
||||
}
|
||||
else {
|
||||
copyToProfile(myGamesPath(), path, "oblivion.ini");
|
||||
}
|
||||
if (settings.testFlag(IPluginGame::CONFIGURATION)) {
|
||||
if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) ||
|
||||
!QFileInfo(myGamesPath() + "/oblivion.ini").exists()) {
|
||||
copyToProfile(gameDirectory().absolutePath(), path, "oblivion_default.ini",
|
||||
"oblivion.ini");
|
||||
} else {
|
||||
copyToProfile(myGamesPath(), path, "oblivion.ini");
|
||||
}
|
||||
|
||||
copyToProfile(myGamesPath(), path, "oblivionprefs.ini");
|
||||
}
|
||||
copyToProfile(myGamesPath(), path, "oblivionprefs.ini");
|
||||
}
|
||||
}
|
||||
|
||||
QString GameNehrim::savegameExtension() const
|
||||
{
|
||||
return "ess";
|
||||
return "ess";
|
||||
}
|
||||
|
||||
QString GameNehrim::savegameSEExtension() const
|
||||
{
|
||||
return "obse";
|
||||
return "obse";
|
||||
}
|
||||
|
||||
std::shared_ptr<const GamebryoSaveGame> GameNehrim::makeSaveGame(QString filePath) const
|
||||
{
|
||||
return std::make_shared<const NehrimSaveGame>(filePath, this);
|
||||
return std::make_shared<const NehrimSaveGame>(filePath, this);
|
||||
}
|
||||
|
||||
QString GameNehrim::steamAPPId() const
|
||||
{
|
||||
return "22330";
|
||||
return "22330";
|
||||
}
|
||||
|
||||
QStringList GameNehrim::primaryPlugins() const
|
||||
{
|
||||
return { "Nehrim.esm", "Translation.esp" };
|
||||
return {"Nehrim.esm", "Translation.esp"};
|
||||
}
|
||||
|
||||
QString GameNehrim::gameShortName() const
|
||||
{
|
||||
return "Nehrim";
|
||||
return "Nehrim";
|
||||
}
|
||||
|
||||
QString GameNehrim::gameNexusName() const
|
||||
{
|
||||
return "Nehrim";
|
||||
return "Nehrim";
|
||||
}
|
||||
|
||||
QStringList GameNehrim::iniFiles() const
|
||||
{
|
||||
return { "oblivion.ini", "oblivionprefs.ini" };
|
||||
return {"oblivion.ini", "oblivionprefs.ini"};
|
||||
}
|
||||
|
||||
QStringList GameNehrim::DLCPlugins() const
|
||||
{
|
||||
return {};
|
||||
return {};
|
||||
}
|
||||
|
||||
int GameNehrim::nexusModOrganizerID() const
|
||||
{
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GameNehrim::nexusGameID() const
|
||||
{
|
||||
return 3312;
|
||||
return 3312;
|
||||
}
|
||||
|
||||
QStringList GameNehrim::primarySources() const
|
||||
{
|
||||
return { "Oblivion" };
|
||||
return {"Oblivion"};
|
||||
}
|
||||
|
||||
QStringList GameNehrim::validShortNames() const
|
||||
{
|
||||
return { "Oblivion" };
|
||||
return {"Oblivion"};
|
||||
}
|
||||
|
||||
QString GameNehrim::identifyGamePath() const
|
||||
{
|
||||
QString path = "Software\\Bethesda Softworks\\Oblivion";
|
||||
return findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(), L"Installed Path");
|
||||
QString path = "Software\\Bethesda Softworks\\Oblivion";
|
||||
return findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(),
|
||||
L"Installed Path");
|
||||
}
|
||||
|
||||
QString GameNehrim::binaryName() const
|
||||
{
|
||||
return "NehrimLauncher.exe";
|
||||
return "NehrimLauncher.exe";
|
||||
}
|
||||
|
||||
+9
-12
@@ -12,17 +12,17 @@ class GameNehrim : public GameGamebryo
|
||||
Q_PLUGIN_METADATA(IID "org.tannin.GameNehrim" FILE "gamenehrim.json")
|
||||
|
||||
public:
|
||||
|
||||
GameNehrim();
|
||||
|
||||
virtual bool init(MOBase::IOrganizer *moInfo) override;
|
||||
|
||||
public: // IPluginGame interface
|
||||
virtual bool init(MOBase::IOrganizer* moInfo) override;
|
||||
|
||||
public: // IPluginGame interface
|
||||
virtual QString gameName() 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 QString gameShortName() const override;
|
||||
@@ -34,13 +34,12 @@ public: // IPluginGame interface
|
||||
virtual QStringList primarySources() const override;
|
||||
virtual QStringList validShortNames() const override;
|
||||
|
||||
// Weird stuff happens in these functions due to Nehrim
|
||||
// Weird stuff happens in these functions due to Nehrim
|
||||
// technically being in the Oblivion folder
|
||||
virtual QString identifyGamePath() const override;
|
||||
virtual QString binaryName() const override;
|
||||
|
||||
public: // IPlugin interface
|
||||
|
||||
public: // IPlugin interface
|
||||
virtual QString name() const override;
|
||||
virtual QString localizedName() const override;
|
||||
virtual QString author() const override;
|
||||
@@ -49,11 +48,9 @@ public: // IPlugin interface
|
||||
virtual QList<MOBase::PluginSetting> settings() const override;
|
||||
|
||||
protected:
|
||||
|
||||
std::shared_ptr<const GamebryoSaveGame> makeSaveGame(QString filePath) const override;
|
||||
QString savegameExtension() const override;
|
||||
QString savegameSEExtension() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // GAMENEHRIM_H
|
||||
#endif // GAMENEHRIM_H
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#include "nehrimbsainvalidation.h"
|
||||
|
||||
|
||||
NehrimBSAInvalidation::NehrimBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game)
|
||||
: GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game)
|
||||
{
|
||||
}
|
||||
NehrimBSAInvalidation::NehrimBSAInvalidation(DataArchives* dataArchives,
|
||||
MOBase::IPluginGame const* game)
|
||||
: GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game)
|
||||
{}
|
||||
|
||||
QString NehrimBSAInvalidation::invalidationBSAName() const
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef NEHRIMBSAINVALIDATION_H
|
||||
#define NEHRIMBSAINVALIDATION_H
|
||||
|
||||
|
||||
#include "gamebryobsainvalidation.h"
|
||||
#include "nehrimdataarchives.h"
|
||||
|
||||
@@ -10,14 +9,11 @@
|
||||
class NehrimBSAInvalidation : public GamebryoBSAInvalidation
|
||||
{
|
||||
public:
|
||||
|
||||
NehrimBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game);
|
||||
NehrimBSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game);
|
||||
|
||||
private:
|
||||
|
||||
virtual QString invalidationBSAName() const override;
|
||||
virtual unsigned long bsaVersion() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // NEHRIMBSAINVALIDATION_H
|
||||
#endif // NEHRIMBSAINVALIDATION_H
|
||||
|
||||
+14
-16
@@ -1,37 +1,35 @@
|
||||
#include "nehrimdataarchives.h"
|
||||
#include <utility.h>
|
||||
|
||||
NehrimDataArchives::NehrimDataArchives(const QDir &myGamesDir) :
|
||||
GamebryoDataArchives(myGamesDir)
|
||||
{
|
||||
}
|
||||
NehrimDataArchives::NehrimDataArchives(const QDir& myGamesDir)
|
||||
: GamebryoDataArchives(myGamesDir)
|
||||
{}
|
||||
|
||||
QStringList NehrimDataArchives::vanillaArchives() const
|
||||
{
|
||||
return { "N - Meshes.bsa"
|
||||
, "N - Textures1.bsa"
|
||||
, "N - Textures2.bsa"
|
||||
, "N - Misc.bsa"
|
||||
, "N - Sounds.bsa"
|
||||
, "L - Voices.bsa"
|
||||
, "L - Misc.bsa"
|
||||
};
|
||||
return {"N - Meshes.bsa", "N - Textures1.bsa", "N - Textures2.bsa", "N - Misc.bsa",
|
||||
"N - Sounds.bsa", "L - Voices.bsa", "L - Misc.bsa"};
|
||||
}
|
||||
|
||||
QStringList NehrimDataArchives::archives(const MOBase::IProfile *profile) const
|
||||
QStringList NehrimDataArchives::archives(const MOBase::IProfile* profile) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") : m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
QString iniFile = profile->localSettingsEnabled()
|
||||
? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini")
|
||||
: m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void NehrimDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before)
|
||||
void NehrimDataArchives::writeArchiveList(MOBase::IProfile* profile,
|
||||
const QStringList& before)
|
||||
{
|
||||
QString list = before.join(", ");
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") : m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
QString iniFile = profile->localSettingsEnabled()
|
||||
? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini")
|
||||
: m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
setArchivesToKey(iniFile, "SArchiveList", list);
|
||||
}
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
#ifndef NEHRIMDATAARCHIVES_H
|
||||
#define NEHRIMDATAARCHIVES_H
|
||||
|
||||
|
||||
#include <gamebryodataarchives.h>
|
||||
#include <iprofile.h>
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDir>
|
||||
#include <gamebryodataarchives.h>
|
||||
#include <iprofile.h>
|
||||
|
||||
class NehrimDataArchives : public GamebryoDataArchives
|
||||
{
|
||||
|
||||
public:
|
||||
NehrimDataArchives(const QDir &myGamesDir);
|
||||
NehrimDataArchives(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 // NEHRIMDATAARCHIVES_H
|
||||
#endif // NEHRIMDATAARCHIVES_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "nehrimmoddatachecker.h"
|
||||
|
||||
ModDataChecker::CheckReturn NehrimModDataChecker::dataLooksValid(
|
||||
std::shared_ptr<const MOBase::IFileTree> fileTree) const
|
||||
std::shared_ptr<const MOBase::IFileTree> fileTree) const
|
||||
{
|
||||
// Check with Gamebryo stuff:
|
||||
auto check = GamebryoModDataChecker::dataLooksValid(fileTree);
|
||||
@@ -19,8 +19,8 @@ ModDataChecker::CheckReturn NehrimModDataChecker::dataLooksValid(
|
||||
return CheckReturn::FIXABLE;
|
||||
}
|
||||
|
||||
std::shared_ptr<MOBase::IFileTree> NehrimModDataChecker::fix(
|
||||
std::shared_ptr<MOBase::IFileTree> fileTree) const
|
||||
std::shared_ptr<MOBase::IFileTree>
|
||||
NehrimModDataChecker::fix(std::shared_ptr<MOBase::IFileTree> fileTree) const
|
||||
{
|
||||
// If we arrive here, it means all files starts with OBSE.
|
||||
auto data = fileTree->createOrphanTree();
|
||||
|
||||
+17
-14
@@ -8,25 +8,28 @@ class NehrimModDataChecker : public GamebryoModDataChecker
|
||||
public:
|
||||
using GamebryoModDataChecker::GamebryoModDataChecker;
|
||||
|
||||
CheckReturn dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const override;
|
||||
std::shared_ptr<MOBase::IFileTree> fix(std::shared_ptr<MOBase::IFileTree> fileTree) const override;
|
||||
CheckReturn
|
||||
dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const override;
|
||||
std::shared_ptr<MOBase::IFileTree>
|
||||
fix(std::shared_ptr<MOBase::IFileTree> fileTree) const override;
|
||||
|
||||
protected:
|
||||
virtual const FileNameSet& possibleFolderNames() const override {
|
||||
static FileNameSet result{
|
||||
"fonts", "interface", "menus", "meshes", "music", "scripts", "shaders",
|
||||
"sound", "strings", "textures", "trees", "video", "facegen",
|
||||
"obse", "distantlod", "asi", "distantland", "mits", "dllplugins", "CalienteTools",
|
||||
"NetScriptFramework"
|
||||
};
|
||||
virtual const FileNameSet& possibleFolderNames() const override
|
||||
{
|
||||
static FileNameSet result{"fonts", "interface", "menus",
|
||||
"meshes", "music", "scripts",
|
||||
"shaders", "sound", "strings",
|
||||
"textures", "trees", "video",
|
||||
"facegen", "obse", "distantlod",
|
||||
"asi", "distantland", "mits",
|
||||
"dllplugins", "CalienteTools", "NetScriptFramework"};
|
||||
return result;
|
||||
}
|
||||
virtual const FileNameSet& possibleFileExtensions() const override {
|
||||
static FileNameSet result{
|
||||
"esp", "esm", "bsa", "modgroups", "ini"
|
||||
};
|
||||
virtual const FileNameSet& possibleFileExtensions() const override
|
||||
{
|
||||
static FileNameSet result{"esp", "esm", "bsa", "modgroups", "ini"};
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // NEHRIM_MODATACHECKER_H
|
||||
#endif // NEHRIM_MODATACHECKER_H
|
||||
|
||||
@@ -4,18 +4,19 @@
|
||||
#include <gamebryomoddatacontent.h>
|
||||
#include <ifiletree.h>
|
||||
|
||||
class NehrimModDataContent : public GamebryoModDataContent {
|
||||
class NehrimModDataContent : public GamebryoModDataContent
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
NehrimModDataContent(GameGamebryo const* gamePlugin) : GamebryoModDataContent(gamePlugin) {
|
||||
NehrimModDataContent(GameGamebryo const* gamePlugin)
|
||||
: GamebryoModDataContent(gamePlugin)
|
||||
{
|
||||
// Just need to disable some contents:
|
||||
m_Enabled[CONTENT_MCM] = false;
|
||||
m_Enabled[CONTENT_MCM] = false;
|
||||
m_Enabled[CONTENT_SKYPROC] = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // NEHRIM_MODDATACONTENT_H
|
||||
#endif // NEHRIM_MODDATACONTENT_H
|
||||
|
||||
+24
-23
@@ -2,31 +2,32 @@
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
NehrimSaveGame::NehrimSaveGame(QString const &fileName, GameNehrim const *game) :
|
||||
GamebryoSaveGame(fileName, game)
|
||||
NehrimSaveGame::NehrimSaveGame(QString const& fileName, GameNehrim const* game)
|
||||
: GamebryoSaveGame(fileName, game)
|
||||
{
|
||||
FileWrapper file(getFilepath(), "TES4SAVEGAME");
|
||||
file.setPluginString(GamebryoSaveGame::StringType::TYPE_BSTRING);
|
||||
|
||||
SYSTEMTIME creationTime;
|
||||
fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation, creationTime);
|
||||
fetchInformationFields(file, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation,
|
||||
creationTime);
|
||||
setCreationTime(creationTime);
|
||||
}
|
||||
|
||||
void NehrimSaveGame::fetchInformationFields(FileWrapper& file,
|
||||
unsigned long& saveNumber,
|
||||
QString& playerName,
|
||||
unsigned short& playerLevel,
|
||||
QString& playerLocation,
|
||||
SYSTEMTIME& creationTime) const
|
||||
unsigned long& saveNumber,
|
||||
QString& playerName,
|
||||
unsigned short& playerLevel,
|
||||
QString& playerLocation,
|
||||
SYSTEMTIME& creationTime) const
|
||||
{
|
||||
file.skip<unsigned char>(); //Major version
|
||||
file.skip<unsigned char>(); //Minor version
|
||||
file.skip<unsigned char>(); // Major version
|
||||
file.skip<unsigned char>(); // Minor version
|
||||
|
||||
file.skip<SYSTEMTIME>(); // exe last modified (!)
|
||||
|
||||
file.skip<unsigned long>(); //Header version
|
||||
file.skip<unsigned long>(); //Header size
|
||||
file.skip<unsigned long>(); // Header version
|
||||
file.skip<unsigned long>(); // Header size
|
||||
|
||||
file.read(saveNumber);
|
||||
|
||||
@@ -34,13 +35,13 @@ void NehrimSaveGame::fetchInformationFields(FileWrapper& file,
|
||||
file.read(playerLevel);
|
||||
file.read(playerLocation);
|
||||
|
||||
file.skip<float>(); //game days
|
||||
file.skip<unsigned long>(); //game ticks
|
||||
file.skip<float>(); // game days
|
||||
file.skip<unsigned long>(); // game ticks
|
||||
|
||||
//there is a save time stored here. So use it rather than the file time, which
|
||||
//could have been copied.
|
||||
//Note: This says it uses getlocaltime api to obtain it which is u/s - if so
|
||||
//we should ignore this.
|
||||
// there is a save time stored here. So use it rather than the file time, which
|
||||
// could have been copied.
|
||||
// Note: This says it uses getlocaltime api to obtain it which is u/s - if so
|
||||
// we should ignore this.
|
||||
file.read(creationTime);
|
||||
}
|
||||
|
||||
@@ -57,13 +58,13 @@ std::unique_ptr<GamebryoSaveGame::DataFields> NehrimSaveGame::fetchDataFields()
|
||||
unsigned long dummySaveNumber;
|
||||
SYSTEMTIME dummyTime;
|
||||
|
||||
fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel,
|
||||
dummyLocation, dummyTime);
|
||||
fetchInformationFields(file, dummySaveNumber, dummyName, dummyLevel, dummyLocation,
|
||||
dummyTime);
|
||||
}
|
||||
|
||||
//Note that screenshot size, width, height and data are apparently the same
|
||||
//structure
|
||||
file.skip<unsigned long>(); //Screenshot size.
|
||||
// Note that screenshot size, width, height and data are apparently the same
|
||||
// structure
|
||||
file.skip<unsigned long>(); // Screenshot size.
|
||||
|
||||
fields->Screenshot = file.readImage();
|
||||
|
||||
|
||||
@@ -7,19 +7,15 @@
|
||||
class NehrimSaveGame : public GamebryoSaveGame
|
||||
{
|
||||
public:
|
||||
NehrimSaveGame(QString const &fileName, GameNehrim const *game);
|
||||
NehrimSaveGame(QString const& fileName, GameNehrim const* game);
|
||||
|
||||
protected:
|
||||
|
||||
// Fetch easy-to-access information.
|
||||
void fetchInformationFields(FileWrapper& wrapper,
|
||||
unsigned long& saveNumber,
|
||||
QString& playerName,
|
||||
unsigned short& playerLevel,
|
||||
QString& playerLocation,
|
||||
SYSTEMTIME& creationTime) const;
|
||||
void fetchInformationFields(FileWrapper& wrapper, unsigned long& saveNumber,
|
||||
QString& playerName, unsigned short& playerLevel,
|
||||
QString& playerLocation, SYSTEMTIME& creationTime) const;
|
||||
|
||||
std::unique_ptr<DataFields> fetchDataFields() const override;
|
||||
};
|
||||
|
||||
#endif // NEHRIMSAVEGAME_H
|
||||
#endif // NEHRIMSAVEGAME_H
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
NehrimScriptExtender::NehrimScriptExtender(GameGamebryo const *game) :
|
||||
GamebryoScriptExtender(game)
|
||||
{
|
||||
}
|
||||
NehrimScriptExtender::NehrimScriptExtender(GameGamebryo const* game)
|
||||
: GamebryoScriptExtender(game)
|
||||
{}
|
||||
|
||||
NehrimScriptExtender::~NehrimScriptExtender()
|
||||
{
|
||||
}
|
||||
NehrimScriptExtender::~NehrimScriptExtender() {}
|
||||
|
||||
QString NehrimScriptExtender::BinaryName() const
|
||||
{
|
||||
|
||||
@@ -8,12 +8,11 @@ class GameGamebryo;
|
||||
class NehrimScriptExtender : public GamebryoScriptExtender
|
||||
{
|
||||
public:
|
||||
NehrimScriptExtender(const GameGamebryo *game);
|
||||
NehrimScriptExtender(const GameGamebryo* game);
|
||||
~NehrimScriptExtender();
|
||||
|
||||
virtual QString BinaryName() const override;
|
||||
virtual QString PluginPath() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // NEHRIMSCRIPTEXTENDER_H
|
||||
#endif // NEHRIMSCRIPTEXTENDER_H
|
||||
|
||||
Reference in New Issue
Block a user