diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..ef64f05 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +f40a37e2704e7b9ec0376ec0f04dd6eff7f3950b diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f869712 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8b607a1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,16 @@ +name: Build TTW Plugin + +on: + push: + branches: master + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: windows-2022 + steps: + - name: Build TTW Plugin + uses: ModOrganizer2/build-with-mob-action@master + with: + mo2-dependencies: cmake_common uibase game_gamebryo diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..45de044 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,17 @@ +name: Lint TTW 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: "." + exclude-regex: "third-party" diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5b490bd..0000000 --- a/appveyor.yml +++ /dev/null @@ -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_ttw.dll - name: game_ttw_dll -- path: vsbuild\src\RelWithDebInfo\game_ttw.pdb - name: game_ttw_pdb -- path: vsbuild\src\RelWithDebInfo\game_ttw.lib - name: game_ttw_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 \ No newline at end of file diff --git a/src/SConscript b/src/SConscript deleted file mode 100644 index d6c52cc..0000000 --- a/src/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -Import('qt_env') - -env = qt_env.Clone() - -env.AppendUnique(CPPDEFINES = [ 'GAMEFALLOUTTTW_LIBRARY' ]) - -env.RequiresGamebryo() - -lib = env.SharedLibrary('gameFalloutTTW', env.Glob('*.cpp')) -env.InstallModule(lib) - -res = env['QT_USED_MODULES'] -Return('res') diff --git a/src/falloutttwbsainvalidation.cpp b/src/falloutttwbsainvalidation.cpp index 1b2b0e6..a230360 100644 --- a/src/falloutttwbsainvalidation.cpp +++ b/src/falloutttwbsainvalidation.cpp @@ -1,9 +1,9 @@ #include "falloutttwbsainvalidation.h" -FalloutTTWBSAInvalidation::FalloutTTWBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game) - : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game) -{ -} +FalloutTTWBSAInvalidation::FalloutTTWBSAInvalidation(DataArchives* dataArchives, + MOBase::IPluginGame const* game) + : GamebryoBSAInvalidation(dataArchives, "fallout.ini", game) +{} QString FalloutTTWBSAInvalidation::invalidationBSAName() const { diff --git a/src/falloutttwbsainvalidation.h b/src/falloutttwbsainvalidation.h index 57b0150..6511c85 100644 --- a/src/falloutttwbsainvalidation.h +++ b/src/falloutttwbsainvalidation.h @@ -1,23 +1,20 @@ #ifndef FALLOUTTTWBSAINVALIDATION_H #define FALLOUTTTWBSAINVALIDATION_H - -#include "gamebryobsainvalidation.h" #include "falloutttwdataarchives.h" +#include "gamebryobsainvalidation.h" #include class FalloutTTWBSAInvalidation : public GamebryoBSAInvalidation { public: - - FalloutTTWBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game); + FalloutTTWBSAInvalidation(DataArchives* dataArchives, + MOBase::IPluginGame const* game); private: - virtual QString invalidationBSAName() const override; virtual unsigned long bsaVersion() const override; - }; -#endif // FALLOUTTTWBSAINVALIDATION_H +#endif // FALLOUTTTWBSAINVALIDATION_H diff --git a/src/falloutttwdataarchives.cpp b/src/falloutttwdataarchives.cpp index 15a8a5a..1008630 100644 --- a/src/falloutttwdataarchives.cpp +++ b/src/falloutttwdataarchives.cpp @@ -1,35 +1,35 @@ #include "falloutttwdataarchives.h" #include -FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir &myGamesDir) : - GamebryoDataArchives(myGamesDir) -{ -} +FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir& myGamesDir) + : GamebryoDataArchives(myGamesDir) +{} QStringList FalloutTTWDataArchives::vanillaArchives() const { - return { "Fallout - Textures.bsa" - , "Fallout - Textures2.bsa" - , "Fallout - Meshes.bsa" - , "Fallout - Voices1.bsa" - , "Fallout - Sound.bsa" - , "Fallout - Misc.bsa" }; + return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa", + "Fallout - Voices1.bsa", "Fallout - Sound.bsa", "Fallout - Misc.bsa"}; } -QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile *profile) const +QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile* profile) const { QStringList result; - QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") : m_LocalGameDir.absoluteFilePath("fallout.ini"); + QString iniFile = profile->localSettingsEnabled() + ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") + : m_LocalGameDir.absoluteFilePath("fallout.ini"); result.append(getArchivesFromKey(iniFile, "SArchiveList")); return result; } -void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before) +void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile* profile, + const QStringList& before) { QString list = before.join(", "); - QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") : m_LocalGameDir.absoluteFilePath("fallout.ini"); + QString iniFile = profile->localSettingsEnabled() + ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") + : m_LocalGameDir.absoluteFilePath("fallout.ini"); setArchivesToKey(iniFile, "SArchiveList", list); } diff --git a/src/falloutttwdataarchives.h b/src/falloutttwdataarchives.h index 83e011f..8cb8233 100644 --- a/src/falloutttwdataarchives.h +++ b/src/falloutttwdataarchives.h @@ -1,25 +1,24 @@ #ifndef FALLOUTTTWDATAARCHIVES_H #define FALLOUTTTWDATAARCHIVES_H - -#include -#include +#include #include #include -#include +#include +#include class FalloutTTWDataArchives : public GamebryoDataArchives { public: - FalloutTTWDataArchives(const QDir &myGamesDir); + FalloutTTWDataArchives(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 // FALLOUTTTWDATAARCHIVES_H +#endif // FALLOUTTTWDATAARCHIVES_H diff --git a/src/falloutttwmoddatacontent.h b/src/falloutttwmoddatacontent.h index 4c85d89..c9ef2fb 100644 --- a/src/falloutttwmoddatacontent.h +++ b/src/falloutttwmoddatacontent.h @@ -4,18 +4,19 @@ #include #include -class FalloutTTWModDataContent : public GamebryoModDataContent { +class FalloutTTWModDataContent : public GamebryoModDataContent +{ public: - /** * */ - FalloutTTWModDataContent(GameGamebryo const* gamePlugin) : GamebryoModDataContent(gamePlugin) { + FalloutTTWModDataContent(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 // FALLOUTTTW_MODDATACONTENT_H +#endif // FALLOUTTTW_MODDATACONTENT_H diff --git a/src/falloutttwsavegame.cpp b/src/falloutttwsavegame.cpp index 910dcc8..b1cf212 100644 --- a/src/falloutttwsavegame.cpp +++ b/src/falloutttwsavegame.cpp @@ -2,34 +2,33 @@ #include "gamefalloutttw.h" -FalloutTTWSaveGame::FalloutTTWSaveGame(QString const &fileName, GameFalloutTTW const *game) : - GamebryoSaveGame(fileName, game) +FalloutTTWSaveGame::FalloutTTWSaveGame(QString const& fileName, + GameFalloutTTW const* game) + : GamebryoSaveGame(fileName, game) { FileWrapper file(getFilepath(), "FO3SAVEGAME"); unsigned long width, height; - fetchInformationFields(file, width, height, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation); - + fetchInformationFields(file, width, height, m_SaveNumber, m_PCName, m_PCLevel, + m_PCLocation); } -void FalloutTTWSaveGame::fetchInformationFields( - FileWrapper& file, - unsigned long& width, - unsigned long& height, - unsigned long& saveNumber, - QString& playerName, - unsigned short& playerLevel, - QString& playerLocation) const +void FalloutTTWSaveGame::fetchInformationFields(FileWrapper& file, unsigned long& width, + unsigned long& height, + unsigned long& saveNumber, + QString& playerName, + unsigned short& playerLevel, + QString& playerLocation) const { - file.skip(); //Save header size + file.skip(); // Save header size - file.skip(); //File version? - file.skip(); //Delimiter + file.skip(); // File version? + file.skip(); // Delimiter - //A huge wodge of text with no length but a delimiter. Given the null bytes - //in it I presume it's fixed length (64 bytes + delim) but I have no - //definite spec - for (unsigned char ignore = 0; ignore != 0x7c; ) { - file.read(ignore); // unknown + // A huge wodge of text with no length but a delimiter. Given the null bytes + // in it I presume it's fixed length (64 bytes + delim) but I have no + // definite spec + for (unsigned char ignore = 0; ignore != 0x7c;) { + file.read(ignore); // unknown } file.setHasFieldMarkers(true); @@ -49,7 +48,8 @@ void FalloutTTWSaveGame::fetchInformationFields( file.read(playerLocation); } -std::unique_ptr FalloutTTWSaveGame::fetchDataFields() const +std::unique_ptr +FalloutTTWSaveGame::fetchDataFields() const { FileWrapper file(getFilepath(), "FO3SAVEGAME"); @@ -61,8 +61,8 @@ std::unique_ptr FalloutTTWSaveGame::fetchDataField unsigned short dummyLevel; unsigned long dummySaveNumber; - fetchInformationFields(file, width, height, - dummySaveNumber, dummyName, dummyLevel, dummyLocation); + fetchInformationFields(file, width, height, dummySaveNumber, dummyName, dummyLevel, + dummyLocation); } QString playtime; @@ -70,7 +70,7 @@ std::unique_ptr FalloutTTWSaveGame::fetchDataField fields->Screenshot = file.readImage(width, height, 256); - file.skip(5); // unknown (1 byte), plugin size (4 bytes) + file.skip(5); // unknown (1 byte), plugin size (4 bytes) file.setPluginString(GamebryoSaveGame::StringType::TYPE_BSTRING); fields->Plugins = file.readPlugins(); diff --git a/src/falloutttwsavegame.h b/src/falloutttwsavegame.h index 0344eb2..8fbd180 100644 --- a/src/falloutttwsavegame.h +++ b/src/falloutttwsavegame.h @@ -8,21 +8,16 @@ class GameFalloutTTW; class FalloutTTWSaveGame : public GamebryoSaveGame { public: - FalloutTTWSaveGame(QString const &fileName, GameFalloutTTW const *game); + FalloutTTWSaveGame(QString const& fileName, GameFalloutTTW const* game); protected: - // Fetch easy-to-access information. - void fetchInformationFields( - FileWrapper& wrapper, - unsigned long& width, - unsigned long& height, - unsigned long& saveNumber, - QString& playerName, - unsigned short& playerLevel, - QString& playerLocation) const; + void fetchInformationFields(FileWrapper& wrapper, unsigned long& width, + unsigned long& height, unsigned long& saveNumber, + QString& playerName, unsigned short& playerLevel, + QString& playerLocation) const; std::unique_ptr fetchDataFields() const override; }; -#endif // FALLOUTTTWSAVEGAME_H +#endif // FALLOUTTTWSAVEGAME_H diff --git a/src/falloutttwscriptextender.cpp b/src/falloutttwscriptextender.cpp index cd542e6..ab9474e 100644 --- a/src/falloutttwscriptextender.cpp +++ b/src/falloutttwscriptextender.cpp @@ -3,10 +3,9 @@ #include #include -FalloutTTWScriptExtender::FalloutTTWScriptExtender(GameGamebryo const *game) : - GamebryoScriptExtender(game) -{ -} +FalloutTTWScriptExtender::FalloutTTWScriptExtender(GameGamebryo const* game) + : GamebryoScriptExtender(game) +{} QString FalloutTTWScriptExtender::BinaryName() const { diff --git a/src/falloutttwscriptextender.h b/src/falloutttwscriptextender.h index cd91f1d..d1e4c9a 100644 --- a/src/falloutttwscriptextender.h +++ b/src/falloutttwscriptextender.h @@ -8,11 +8,10 @@ class GameGamebryo; class FalloutTTWScriptExtender : public GamebryoScriptExtender { public: - FalloutTTWScriptExtender(const GameGamebryo *game); + FalloutTTWScriptExtender(const GameGamebryo* game); virtual QString BinaryName() const override; virtual QString PluginPath() const override; - }; -#endif // FALLOUTTTWSCRIPTEXTENDER_H +#endif // FALLOUTTTWSCRIPTEXTENDER_H diff --git a/src/gameFalloutTTW.pro b/src/gameFalloutTTW.pro deleted file mode 100644 index b134954..0000000 --- a/src/gameFalloutTTW.pro +++ /dev/null @@ -1,50 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-11-15T15:36:33 -# -#------------------------------------------------- - - -TARGET = gameFalloutTTW -TEMPLATE = lib - -CONFIG += plugins -CONFIG += dll - -DEFINES += GAMEFALLOUTTTW_LIBRARY - -SOURCES += gamefalloutTTW.cpp \ - falloutttwbsainvalidation.cpp \ - falloutttwscriptextender.cpp \ - falloutttwdataarchives.cpp \ - falloutttwsavegame.cpp \ - falloutttwsavegameinfo.cpp - -HEADERS += gamefalloutttw.h \ - falloutttwbsainvalidation.h \ - falloutttwscriptextender.h \ - falloutttwdataarchives.h \ - falloutttwsavegame.h \ - falloutttwsavegameinfo.h - -CONFIG(debug, debug|release) { - LIBS += -L"$${OUT_PWD}/../gameGamebryo/debug" - PRE_TARGETDEPS += \ - $$OUT_PWD/../gameGamebryo/debug/gameGamebryo.lib -} else { - LIBS += -L"$${OUT_PWD}/../gameGamebryo/release" - PRE_TARGETDEPS += \ - $$OUT_PWD/../gameGamebryo/release/gameGamebryo.lib -} - -include(../plugin_template.pri) - -INCLUDEPATH += "$${BOOSTPATH}" "$${PWD}/../gamefeatures" "$${PWD}/../gamegamebryo" - -LIBS += -ladvapi32 -lole32 -lgameGamebryo - -OTHER_FILES += \ - gamefalloutttw.json\ - SConscript \ - CMakeLists.txt - diff --git a/src/game_ttw_en.ts b/src/game_ttw_en.ts index 5784cf8..e06609b 100644 --- a/src/game_ttw_en.ts +++ b/src/game_ttw_en.ts @@ -13,165 +13,7 @@ Adds support for the game Fallout TTW - - - GamebryoModDataContent - - - Plugins (ESP/ESM/ESL) - - - - - Optional Plugins - - - - - Interface - - - - - Meshes - - - - - Bethesda Archive - - - - - Scripts (Papyrus) - - - - - Script Extender Plugin - - - - - Script Extender Files - - - - - SkyProc Patcher - - - - - Sound or Music - - - - - Textures - - - - - MCM Configuration - - - - - INI Files - - - - - FaceGen Data - - - - - ModGroup Files - - - - - GamebryoSaveGameInfoWidget - - - Save # - - - - - Character - - - - - Level - - - - - Location - - - - - Date - - - - - Has Script Extender Data - - - - - Missing ESPs - - - - - - None - - - - - Missing ESLs - - - - - QObject - - - - Some of your plugins have invalid names! These plugins can not be loaded by the game. Please see mo_interface.log for a list of affected plugins and rename them. - - - - - %1, #%2, Level %3, %4 - - - - - failed to open %1 - - - - - wrong file format - expected %1 got %2 - - - - - failed to query registry path (preflight): %1 - - - - failed to query registry path (read): %1 While not recommended by the TTW modding community, enables LOOT sorting