mirror of
https://github.com/ModOrganizer2/modorganizer-game_oblivion.git
synced 2026-07-27 14:00:16 -07:00
Merge pull request #24 from ModOrganizer2/dev/format-and-gh-actions
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 @@
|
||||
788cc5afada952667f927f181715b7dd4af793e7
|
||||
@@ -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,16 @@
|
||||
name: Build Oblivion Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Build Oblivion Plugin
|
||||
uses: ModOrganizer2/build-with-mob-action@master
|
||||
with:
|
||||
mo2-dependencies: cmake_common uibase game_gamebryo
|
||||
@@ -0,0 +1,16 @@
|
||||
name: Lint Oblivion Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format
|
||||
uses: ModOrganizer2/check-formatting-action@master
|
||||
with:
|
||||
check-path: "."
|
||||
@@ -1,40 +0,0 @@
|
||||
version: 1.0.{build}
|
||||
skip_branch_with_pr: true
|
||||
image: Visual Studio 2019
|
||||
environment:
|
||||
WEBHOOK_URL:
|
||||
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw=
|
||||
build_script:
|
||||
- pwsh: >-
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
git clone --depth=1 --no-single-branch https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella
|
||||
|
||||
New-Item -ItemType Directory -Path c:\projects\modorganizer-build
|
||||
|
||||
cd c:\projects\modorganizer-umbrella
|
||||
|
||||
($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -eq $null) ? ($branch = $env:APPVEYOR_REPO_BRANCH) : ($branch = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH)
|
||||
|
||||
git checkout $(git show-ref --verify --quiet refs/remotes/origin/${branch} || echo '-b') ${branch}
|
||||
|
||||
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True ${env:APPVEYOR_PROJECT_NAME}
|
||||
|
||||
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
|
||||
artifacts:
|
||||
- path: vsbuild\src\RelWithDebInfo\game_oblivion.dll
|
||||
name: game_oblivion_dll
|
||||
- path: vsbuild\src\RelWithDebInfo\game_oblivion.pdb
|
||||
name: game_oblivion_pdb
|
||||
- path: vsbuild\src\RelWithDebInfo\game_oblivion.lib
|
||||
name: game_oblivion_lib
|
||||
on_success:
|
||||
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
|
||||
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
|
||||
- ps: ./send.ps1 success $env:WEBHOOK_URL
|
||||
on_failure:
|
||||
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
|
||||
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stdout.log
|
||||
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stderr.log
|
||||
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
|
||||
- ps: ./send.ps1 failure $env:WEBHOOK_URL
|
||||
+193
-189
@@ -1,189 +1,193 @@
|
||||
#include "gameoblivion.h"
|
||||
|
||||
#include "oblivionbsainvalidation.h"
|
||||
#include "obliviondataarchives.h"
|
||||
#include "oblivionscriptextender.h"
|
||||
#include "oblivionmoddatachecker.h"
|
||||
#include "oblivionmoddatacontent.h"
|
||||
#include "oblivionsavegame.h"
|
||||
|
||||
#include "pluginsetting.h"
|
||||
#include "executableinfo.h"
|
||||
#include <gamebryolocalsavegames.h>
|
||||
#include <gamebryogameplugins.h>
|
||||
#include <gamebryounmanagedmods.h>
|
||||
#include <gamebryosavegameinfo.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
GameOblivion::GameOblivion()
|
||||
{
|
||||
}
|
||||
|
||||
bool GameOblivion::init(IOrganizer *moInfo)
|
||||
{
|
||||
if (!GameGamebryo::init(moInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto dataArchives = std::make_shared<OblivionDataArchives>(myGamesPath());
|
||||
registerFeature(std::make_shared<OblivionScriptExtender>(this));
|
||||
registerFeature(dataArchives);
|
||||
registerFeature(std::make_shared<OblivionBSAInvalidation>(dataArchives.get(), this));
|
||||
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
|
||||
registerFeature(std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "oblivion.ini"));
|
||||
registerFeature(std::make_shared<OblivionModDataChecker>(this));
|
||||
registerFeature(std::make_shared<OblivionModDataContent>(m_Organizer->gameFeatures()));
|
||||
registerFeature(std::make_shared<GamebryoGamePlugins>(moInfo));
|
||||
registerFeature(std::make_shared<GamebryoUnmangedMods>(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
QString GameOblivion::gameName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
QList<ExecutableInfo> GameOblivion::executables() const
|
||||
{
|
||||
return QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("Oblivion", findInGameFolder(binaryName()))
|
||||
<< ExecutableInfo("Oblivion Launcher", findInGameFolder(getLauncherName()))
|
||||
<< ExecutableInfo("Oblivion Mod Manager", findInGameFolder("OblivionModManager.exe"))
|
||||
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath())).withArgument("--game=\"Oblivion\"")
|
||||
<< ExecutableInfo("Construction Set", findInGameFolder("TESConstructionSet.exe"))
|
||||
;
|
||||
}
|
||||
|
||||
QList<ExecutableForcedLoadSetting> GameOblivion::executableForcedLoads() const
|
||||
{
|
||||
return QList<ExecutableForcedLoadSetting>()
|
||||
<< ExecutableForcedLoadSetting("Oblivion.exe", "obse_1_2_416.dll").withForced().withEnabled()
|
||||
<< ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll").withForced().withEnabled()
|
||||
;
|
||||
}
|
||||
|
||||
QString GameOblivion::name() const
|
||||
{
|
||||
return "Oblivion Support Plugin";
|
||||
}
|
||||
|
||||
QString GameOblivion::localizedName() const
|
||||
{
|
||||
return tr("Oblivion Support Plugin");
|
||||
}
|
||||
|
||||
QString GameOblivion::author() const
|
||||
{
|
||||
return "Tannin & MO2 Team";
|
||||
}
|
||||
|
||||
QString GameOblivion::description() const
|
||||
{
|
||||
return tr("Adds support for the game Oblivion");
|
||||
}
|
||||
|
||||
MOBase::VersionInfo GameOblivion::version() const
|
||||
{
|
||||
return VersionInfo(1, 6, 1, VersionInfo::RELEASE_FINAL);
|
||||
}
|
||||
|
||||
QList<PluginSetting> GameOblivion::settings() const
|
||||
{
|
||||
return {
|
||||
PluginSetting("nehrim_downloads", "allow Nehrim downloads", QVariant(false))
|
||||
};
|
||||
}
|
||||
|
||||
void GameOblivion::initializeProfile(const QDir &path, ProfileSettings settings) const
|
||||
{
|
||||
if (settings.testFlag(IPluginGame::MODS)) {
|
||||
copyToProfile(localAppFolder() + "/Oblivion", 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");
|
||||
}
|
||||
|
||||
copyToProfile(myGamesPath(), path, "oblivionprefs.ini");
|
||||
}
|
||||
}
|
||||
|
||||
QString GameOblivion::savegameExtension() const
|
||||
{
|
||||
return "ess";
|
||||
}
|
||||
|
||||
QString GameOblivion::savegameSEExtension() const
|
||||
{
|
||||
return "obse";
|
||||
}
|
||||
|
||||
std::shared_ptr<const GamebryoSaveGame> GameOblivion::makeSaveGame(QString filePath) const
|
||||
{
|
||||
return std::make_shared<const OblivionSaveGame>(filePath, this);
|
||||
}
|
||||
|
||||
QString GameOblivion::steamAPPId() const
|
||||
{
|
||||
return "22330";
|
||||
}
|
||||
|
||||
QStringList GameOblivion::primaryPlugins() const
|
||||
{
|
||||
return { "oblivion.esm", "update.esm" };
|
||||
}
|
||||
|
||||
QString GameOblivion::gameShortName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
QStringList GameOblivion::validShortNames() const
|
||||
{
|
||||
QStringList shortNames;
|
||||
if (m_Organizer->pluginSetting(name(), "nehrim_downloads").toBool()) {
|
||||
shortNames.append( "Nehrim" );
|
||||
}
|
||||
return shortNames;
|
||||
}
|
||||
|
||||
QString GameOblivion::gameNexusName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
|
||||
QStringList GameOblivion::iniFiles() const
|
||||
{
|
||||
return { "oblivion.ini", "oblivionprefs.ini" };
|
||||
}
|
||||
|
||||
QStringList GameOblivion::DLCPlugins() const
|
||||
{
|
||||
return { "DLCBattlehornCastle.esp", "DLCShiveringIsles.esp", "Knights.esp", "DLCFrostcrag.esp",
|
||||
"DLCSpellTomes.esp", "DLCMehrunesRazor.esp", "DLCOrrery.esp",
|
||||
"DLCThievesDen.esp", "DLCVileLair.esp", "DLCHorseArmor.esp" };
|
||||
}
|
||||
|
||||
|
||||
int GameOblivion::nexusModOrganizerID() const
|
||||
{
|
||||
return 38277;
|
||||
}
|
||||
|
||||
int GameOblivion::nexusGameID() const
|
||||
{
|
||||
return 101;
|
||||
}
|
||||
#include "gameoblivion.h"
|
||||
|
||||
#include "oblivionbsainvalidation.h"
|
||||
#include "obliviondataarchives.h"
|
||||
#include "oblivionmoddatachecker.h"
|
||||
#include "oblivionmoddatacontent.h"
|
||||
#include "oblivionsavegame.h"
|
||||
#include "oblivionscriptextender.h"
|
||||
|
||||
#include "executableinfo.h"
|
||||
#include "pluginsetting.h"
|
||||
#include <gamebryogameplugins.h>
|
||||
#include <gamebryolocalsavegames.h>
|
||||
#include <gamebryosavegameinfo.h>
|
||||
#include <gamebryounmanagedmods.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
GameOblivion::GameOblivion() {}
|
||||
|
||||
bool GameOblivion::init(IOrganizer* moInfo)
|
||||
{
|
||||
if (!GameGamebryo::init(moInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto dataArchives = std::make_shared<OblivionDataArchives>(myGamesPath());
|
||||
registerFeature(std::make_shared<OblivionScriptExtender>(this));
|
||||
registerFeature(dataArchives);
|
||||
registerFeature(std::make_shared<OblivionBSAInvalidation>(dataArchives.get(), this));
|
||||
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
|
||||
registerFeature(
|
||||
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "oblivion.ini"));
|
||||
registerFeature(std::make_shared<OblivionModDataChecker>(this));
|
||||
registerFeature(
|
||||
std::make_shared<OblivionModDataContent>(m_Organizer->gameFeatures()));
|
||||
registerFeature(std::make_shared<GamebryoGamePlugins>(moInfo));
|
||||
registerFeature(std::make_shared<GamebryoUnmangedMods>(this));
|
||||
return true;
|
||||
}
|
||||
|
||||
QString GameOblivion::gameName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
QList<ExecutableInfo> GameOblivion::executables() const
|
||||
{
|
||||
return QList<ExecutableInfo>()
|
||||
<< ExecutableInfo("Oblivion", findInGameFolder(binaryName()))
|
||||
<< ExecutableInfo("Oblivion Launcher", findInGameFolder(getLauncherName()))
|
||||
<< ExecutableInfo("Oblivion Mod Manager",
|
||||
findInGameFolder("OblivionModManager.exe"))
|
||||
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
|
||||
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
|
||||
.withArgument("--game=\"Oblivion\"")
|
||||
<< ExecutableInfo("Construction Set",
|
||||
findInGameFolder("TESConstructionSet.exe"));
|
||||
}
|
||||
|
||||
QList<ExecutableForcedLoadSetting> GameOblivion::executableForcedLoads() const
|
||||
{
|
||||
return QList<ExecutableForcedLoadSetting>()
|
||||
<< ExecutableForcedLoadSetting("Oblivion.exe", "obse_1_2_416.dll")
|
||||
.withForced()
|
||||
.withEnabled()
|
||||
<< ExecutableForcedLoadSetting("TESConstructionSet.exe", "obse_editor_1_2.dll")
|
||||
.withForced()
|
||||
.withEnabled();
|
||||
}
|
||||
|
||||
QString GameOblivion::name() const
|
||||
{
|
||||
return "Oblivion Support Plugin";
|
||||
}
|
||||
|
||||
QString GameOblivion::localizedName() const
|
||||
{
|
||||
return tr("Oblivion Support Plugin");
|
||||
}
|
||||
|
||||
QString GameOblivion::author() const
|
||||
{
|
||||
return "Tannin & MO2 Team";
|
||||
}
|
||||
|
||||
QString GameOblivion::description() const
|
||||
{
|
||||
return tr("Adds support for the game Oblivion");
|
||||
}
|
||||
|
||||
MOBase::VersionInfo GameOblivion::version() const
|
||||
{
|
||||
return VersionInfo(1, 6, 1, VersionInfo::RELEASE_FINAL);
|
||||
}
|
||||
|
||||
QList<PluginSetting> GameOblivion::settings() const
|
||||
{
|
||||
return {PluginSetting("nehrim_downloads", "allow Nehrim downloads", QVariant(false))};
|
||||
}
|
||||
|
||||
void GameOblivion::initializeProfile(const QDir& path, ProfileSettings settings) const
|
||||
{
|
||||
if (settings.testFlag(IPluginGame::MODS)) {
|
||||
copyToProfile(localAppFolder() + "/Oblivion", 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");
|
||||
}
|
||||
|
||||
copyToProfile(myGamesPath(), path, "oblivionprefs.ini");
|
||||
}
|
||||
}
|
||||
|
||||
QString GameOblivion::savegameExtension() const
|
||||
{
|
||||
return "ess";
|
||||
}
|
||||
|
||||
QString GameOblivion::savegameSEExtension() const
|
||||
{
|
||||
return "obse";
|
||||
}
|
||||
|
||||
std::shared_ptr<const GamebryoSaveGame>
|
||||
GameOblivion::makeSaveGame(QString filePath) const
|
||||
{
|
||||
return std::make_shared<const OblivionSaveGame>(filePath, this);
|
||||
}
|
||||
|
||||
QString GameOblivion::steamAPPId() const
|
||||
{
|
||||
return "22330";
|
||||
}
|
||||
|
||||
QStringList GameOblivion::primaryPlugins() const
|
||||
{
|
||||
return {"oblivion.esm", "update.esm"};
|
||||
}
|
||||
|
||||
QString GameOblivion::gameShortName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
QStringList GameOblivion::validShortNames() const
|
||||
{
|
||||
QStringList shortNames;
|
||||
if (m_Organizer->pluginSetting(name(), "nehrim_downloads").toBool()) {
|
||||
shortNames.append("Nehrim");
|
||||
}
|
||||
return shortNames;
|
||||
}
|
||||
|
||||
QString GameOblivion::gameNexusName() const
|
||||
{
|
||||
return "Oblivion";
|
||||
}
|
||||
|
||||
QStringList GameOblivion::iniFiles() const
|
||||
{
|
||||
return {"oblivion.ini", "oblivionprefs.ini"};
|
||||
}
|
||||
|
||||
QStringList GameOblivion::DLCPlugins() const
|
||||
{
|
||||
return {"DLCBattlehornCastle.esp", "DLCShiveringIsles.esp", "Knights.esp",
|
||||
"DLCFrostcrag.esp", "DLCSpellTomes.esp", "DLCMehrunesRazor.esp",
|
||||
"DLCOrrery.esp", "DLCThievesDen.esp", "DLCVileLair.esp",
|
||||
"DLCHorseArmor.esp"};
|
||||
}
|
||||
|
||||
int GameOblivion::nexusModOrganizerID() const
|
||||
{
|
||||
return 38277;
|
||||
}
|
||||
|
||||
int GameOblivion::nexusGameID() const
|
||||
{
|
||||
return 101;
|
||||
}
|
||||
|
||||
+50
-53
@@ -1,53 +1,50 @@
|
||||
#ifndef GAMEOBLIVION_H
|
||||
#define GAMEOBLIVION_H
|
||||
|
||||
#include "gamegamebryo.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QtGlobal>
|
||||
|
||||
class GameOblivion : public GameGamebryo
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.tannin.GameOblivion" FILE "gameoblivion.json")
|
||||
|
||||
public:
|
||||
|
||||
GameOblivion();
|
||||
|
||||
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 QString steamAPPId() const override;
|
||||
virtual QStringList primaryPlugins() const override;
|
||||
virtual QString gameShortName() const override;
|
||||
virtual QStringList validShortNames() const override;
|
||||
virtual QString gameNexusName() const override;
|
||||
virtual QStringList iniFiles() const override;
|
||||
virtual QStringList DLCPlugins() const override;
|
||||
virtual int nexusModOrganizerID() const override;
|
||||
virtual int nexusGameID() const override;
|
||||
|
||||
public: // IPlugin interface
|
||||
|
||||
virtual QString name() const override;
|
||||
virtual QString localizedName() const override;
|
||||
virtual QString author() const override;
|
||||
virtual QString description() const override;
|
||||
virtual MOBase::VersionInfo version() const override;
|
||||
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 // GAMEOBLIVION_H
|
||||
#ifndef GAMEOBLIVION_H
|
||||
#define GAMEOBLIVION_H
|
||||
|
||||
#include "gamegamebryo.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QtGlobal>
|
||||
|
||||
class GameOblivion : public GameGamebryo
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.tannin.GameOblivion" FILE "gameoblivion.json")
|
||||
|
||||
public:
|
||||
GameOblivion();
|
||||
|
||||
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 QString steamAPPId() const override;
|
||||
virtual QStringList primaryPlugins() const override;
|
||||
virtual QString gameShortName() const override;
|
||||
virtual QStringList validShortNames() const override;
|
||||
virtual QString gameNexusName() const override;
|
||||
virtual QStringList iniFiles() const override;
|
||||
virtual QStringList DLCPlugins() const override;
|
||||
virtual int nexusModOrganizerID() const override;
|
||||
virtual int nexusGameID() const override;
|
||||
|
||||
public: // IPlugin interface
|
||||
virtual QString name() const override;
|
||||
virtual QString localizedName() const override;
|
||||
virtual QString author() const override;
|
||||
virtual QString description() const override;
|
||||
virtual MOBase::VersionInfo version() const override;
|
||||
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 // GAMEOBLIVION_H
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#include "oblivionbsainvalidation.h"
|
||||
|
||||
|
||||
OblivionBSAInvalidation::OblivionBSAInvalidation(MOBase::DataArchives *dataArchives, MOBase::IPluginGame const *game)
|
||||
: GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game)
|
||||
{
|
||||
}
|
||||
|
||||
QString OblivionBSAInvalidation::invalidationBSAName() const
|
||||
{
|
||||
return "Oblivion - Invalidation.bsa";
|
||||
}
|
||||
|
||||
unsigned long OblivionBSAInvalidation::bsaVersion() const
|
||||
{
|
||||
return 0x67;
|
||||
}
|
||||
#include "oblivionbsainvalidation.h"
|
||||
|
||||
OblivionBSAInvalidation::OblivionBSAInvalidation(MOBase::DataArchives* dataArchives,
|
||||
MOBase::IPluginGame const* game)
|
||||
: GamebryoBSAInvalidation(dataArchives, "oblivion.ini", game)
|
||||
{}
|
||||
|
||||
QString OblivionBSAInvalidation::invalidationBSAName() const
|
||||
{
|
||||
return "Oblivion - Invalidation.bsa";
|
||||
}
|
||||
|
||||
unsigned long OblivionBSAInvalidation::bsaVersion() const
|
||||
{
|
||||
return 0x67;
|
||||
}
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
#ifndef OBLIVIONBSAINVALIDATION_H
|
||||
#define OBLIVIONBSAINVALIDATION_H
|
||||
|
||||
|
||||
#include "gamebryobsainvalidation.h"
|
||||
#include "obliviondataarchives.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class OblivionBSAInvalidation : public GamebryoBSAInvalidation
|
||||
{
|
||||
public:
|
||||
|
||||
OblivionBSAInvalidation(MOBase::DataArchives *dataArchives, MOBase::IPluginGame const *game);
|
||||
|
||||
private:
|
||||
|
||||
virtual QString invalidationBSAName() const override;
|
||||
virtual unsigned long bsaVersion() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // OBLIVIONBSAINVALIDATION_H
|
||||
#ifndef OBLIVIONBSAINVALIDATION_H
|
||||
#define OBLIVIONBSAINVALIDATION_H
|
||||
|
||||
#include "gamebryobsainvalidation.h"
|
||||
#include "obliviondataarchives.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class OblivionBSAInvalidation : public GamebryoBSAInvalidation
|
||||
{
|
||||
public:
|
||||
OblivionBSAInvalidation(MOBase::DataArchives* dataArchives,
|
||||
MOBase::IPluginGame const* game);
|
||||
|
||||
private:
|
||||
virtual QString invalidationBSAName() const override;
|
||||
virtual unsigned long bsaVersion() const override;
|
||||
};
|
||||
|
||||
#endif // OBLIVIONBSAINVALIDATION_H
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
#include "obliviondataarchives.h"
|
||||
#include <utility.h>
|
||||
|
||||
OblivionDataArchives::OblivionDataArchives(const QDir &myGamesDir) :
|
||||
GamebryoDataArchives(myGamesDir)
|
||||
{
|
||||
}
|
||||
|
||||
QStringList OblivionDataArchives::vanillaArchives() const
|
||||
{
|
||||
return { "Oblivion - Misc.bsa"
|
||||
, "Oblivion - Textures - Compressed.bsa"
|
||||
, "Oblivion - Meshes.bsa"
|
||||
, "Oblivion - Sounds.bsa"
|
||||
, "Oblivion - Voices1.bsa"
|
||||
, "Oblivion - Voices2.bsa"
|
||||
};
|
||||
}
|
||||
|
||||
QStringList OblivionDataArchives::archives(const MOBase::IProfile *profile) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini") : m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void OblivionDataArchives::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");
|
||||
setArchivesToKey(iniFile, "SArchiveList", list);
|
||||
}
|
||||
#include "obliviondataarchives.h"
|
||||
#include <utility.h>
|
||||
|
||||
OblivionDataArchives::OblivionDataArchives(const QDir& myGamesDir)
|
||||
: GamebryoDataArchives(myGamesDir)
|
||||
{}
|
||||
|
||||
QStringList OblivionDataArchives::vanillaArchives() const
|
||||
{
|
||||
return {"Oblivion - Misc.bsa", "Oblivion - Textures - Compressed.bsa",
|
||||
"Oblivion - Meshes.bsa", "Oblivion - Sounds.bsa",
|
||||
"Oblivion - Voices1.bsa", "Oblivion - Voices2.bsa"};
|
||||
}
|
||||
|
||||
QStringList OblivionDataArchives::archives(const MOBase::IProfile* profile) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QString iniFile = profile->localSettingsEnabled()
|
||||
? QDir(profile->absolutePath()).absoluteFilePath("oblivion.ini")
|
||||
: m_LocalGameDir.absoluteFilePath("oblivion.ini");
|
||||
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void OblivionDataArchives::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");
|
||||
setArchivesToKey(iniFile, "SArchiveList", list);
|
||||
}
|
||||
|
||||
+25
-28
@@ -1,28 +1,25 @@
|
||||
#ifndef OBLIVIONDATAARCHIVES_H
|
||||
#define OBLIVIONDATAARCHIVES_H
|
||||
|
||||
|
||||
#include <gamebryodataarchives.h>
|
||||
#include <iprofile.h>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDir>
|
||||
|
||||
class OblivionDataArchives : public GamebryoDataArchives
|
||||
{
|
||||
|
||||
public:
|
||||
OblivionDataArchives(const QDir &myGamesDir);
|
||||
|
||||
public:
|
||||
|
||||
virtual QStringList vanillaArchives() const override;
|
||||
virtual QStringList archives(const MOBase::IProfile *profile) const override;
|
||||
|
||||
private:
|
||||
|
||||
virtual void writeArchiveList(MOBase::IProfile *profile, const QStringList &before) override;
|
||||
|
||||
};
|
||||
|
||||
#endif // OBLIVIONDATAARCHIVES_H
|
||||
#ifndef OBLIVIONDATAARCHIVES_H
|
||||
#define OBLIVIONDATAARCHIVES_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <gamebryodataarchives.h>
|
||||
#include <iprofile.h>
|
||||
|
||||
class OblivionDataArchives : public GamebryoDataArchives
|
||||
{
|
||||
|
||||
public:
|
||||
OblivionDataArchives(const QDir& myGamesDir);
|
||||
|
||||
public:
|
||||
virtual QStringList vanillaArchives() const override;
|
||||
virtual QStringList archives(const MOBase::IProfile* profile) const override;
|
||||
|
||||
private:
|
||||
virtual void writeArchiveList(MOBase::IProfile* profile,
|
||||
const QStringList& before) override;
|
||||
};
|
||||
|
||||
#endif // OBLIVIONDATAARCHIVES_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "oblivionmoddatachecker.h"
|
||||
|
||||
MOBase::ModDataChecker::CheckReturn OblivionModDataChecker::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,12 +19,12 @@ MOBase::ModDataChecker::CheckReturn OblivionModDataChecker::dataLooksValid(
|
||||
return CheckReturn::FIXABLE;
|
||||
}
|
||||
|
||||
std::shared_ptr<MOBase::IFileTree> OblivionModDataChecker::fix(
|
||||
std::shared_ptr<MOBase::IFileTree> fileTree) const
|
||||
std::shared_ptr<MOBase::IFileTree>
|
||||
OblivionModDataChecker::fix(std::shared_ptr<MOBase::IFileTree> fileTree) const
|
||||
{
|
||||
// If we arrive here, it means all files starts with OBSE.
|
||||
auto data = fileTree->createOrphanTree();
|
||||
auto obse = data->addDirectory("OBSE/Plugins");
|
||||
obse->merge(fileTree);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,25 +8,28 @@ class OblivionModDataChecker : 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 // OBLIVION_MODATACHECKER_H
|
||||
#endif // OBLIVION_MODATACHECKER_H
|
||||
|
||||
@@ -4,18 +4,19 @@
|
||||
#include <gamebryomoddatacontent.h>
|
||||
#include <ifiletree.h>
|
||||
|
||||
class OblivionModDataContent : public GamebryoModDataContent {
|
||||
class OblivionModDataContent : public GamebryoModDataContent
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
OblivionModDataContent(const MOBase::IGameFeatures* gameFeatures) : GamebryoModDataContent(gameFeatures) {
|
||||
OblivionModDataContent(const MOBase::IGameFeatures* gameFeatures)
|
||||
: GamebryoModDataContent(gameFeatures)
|
||||
{
|
||||
// Just need to disable some contents:
|
||||
m_Enabled[CONTENT_MCM] = false;
|
||||
m_Enabled[CONTENT_MCM] = false;
|
||||
m_Enabled[CONTENT_SKYPROC] = false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // OBLIVION_MODDATACONTENT_H
|
||||
#endif // OBLIVION_MODDATACONTENT_H
|
||||
|
||||
+24
-23
@@ -2,31 +2,32 @@
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
OblivionSaveGame::OblivionSaveGame(QString const &fileName, GameOblivion const *game) :
|
||||
GamebryoSaveGame(fileName, game)
|
||||
OblivionSaveGame::OblivionSaveGame(QString const& fileName, GameOblivion 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 OblivionSaveGame::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 OblivionSaveGame::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> OblivionSaveGame::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 OblivionSaveGame : public GamebryoSaveGame
|
||||
{
|
||||
public:
|
||||
OblivionSaveGame(QString const &fileName, GameOblivion const *game);
|
||||
OblivionSaveGame(QString const& fileName, GameOblivion 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 // OBLIVIONSAVEGAME_H
|
||||
#endif // OBLIVIONSAVEGAME_H
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
#include "oblivionscriptextender.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
OblivionScriptExtender::OblivionScriptExtender(GameGamebryo const *game) :
|
||||
GamebryoScriptExtender(game)
|
||||
{
|
||||
}
|
||||
|
||||
OblivionScriptExtender::~OblivionScriptExtender()
|
||||
{
|
||||
}
|
||||
|
||||
QString OblivionScriptExtender::BinaryName() const
|
||||
{
|
||||
return "obse_loader.exe";
|
||||
}
|
||||
|
||||
QString OblivionScriptExtender::PluginPath() const
|
||||
{
|
||||
return "obse/plugins";
|
||||
}
|
||||
#include "oblivionscriptextender.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
OblivionScriptExtender::OblivionScriptExtender(GameGamebryo const* game)
|
||||
: GamebryoScriptExtender(game)
|
||||
{}
|
||||
|
||||
OblivionScriptExtender::~OblivionScriptExtender() {}
|
||||
|
||||
QString OblivionScriptExtender::BinaryName() const
|
||||
{
|
||||
return "obse_loader.exe";
|
||||
}
|
||||
|
||||
QString OblivionScriptExtender::PluginPath() const
|
||||
{
|
||||
return "obse/plugins";
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
#ifndef OBLIVIONSCRIPTEXTENDER_H
|
||||
#define OBLIVIONSCRIPTEXTENDER_H
|
||||
|
||||
#include "gamebryoscriptextender.h"
|
||||
|
||||
class GameGamebryo;
|
||||
|
||||
class OblivionScriptExtender : public GamebryoScriptExtender
|
||||
{
|
||||
public:
|
||||
OblivionScriptExtender(const GameGamebryo *game);
|
||||
~OblivionScriptExtender();
|
||||
|
||||
virtual QString BinaryName() const override;
|
||||
virtual QString PluginPath() const override;
|
||||
|
||||
};
|
||||
|
||||
#endif // OBLIVIONSCRIPTEXTENDER_H
|
||||
#ifndef OBLIVIONSCRIPTEXTENDER_H
|
||||
#define OBLIVIONSCRIPTEXTENDER_H
|
||||
|
||||
#include "gamebryoscriptextender.h"
|
||||
|
||||
class GameGamebryo;
|
||||
|
||||
class OblivionScriptExtender : public GamebryoScriptExtender
|
||||
{
|
||||
public:
|
||||
OblivionScriptExtender(const GameGamebryo* game);
|
||||
~OblivionScriptExtender();
|
||||
|
||||
virtual QString BinaryName() const override;
|
||||
virtual QString PluginPath() const override;
|
||||
};
|
||||
|
||||
#endif // OBLIVIONSCRIPTEXTENDER_H
|
||||
|
||||
Reference in New Issue
Block a user