Skip to content

Commit 66bfb1e

Browse files
authored
Merge pull request #37 from ModOrganizer2/ci/gh-action
* Fix formatting. * Ignore formatting revision. * Add github action for build and formatting. * Remove old build files.
2 parents e1a0b1e + b03e137 commit 66bfb1e

17 files changed

+113
-343
lines changed

.git-blame-ignore-revs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f40a37e2704e7b9ec0376ec0f04dd6eff7f3950b

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.cpp text eol=crlf
7+
*.h text eol=crlf

.github/workflows/build.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build TTW Plugin
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-2022
12+
steps:
13+
- name: Build TTW Plugin
14+
uses: ModOrganizer2/build-with-mob-action@master
15+
with:
16+
mo2-dependencies: cmake_common uibase game_gamebryo

.github/workflows/linting.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint TTW Plugin
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Check format
14+
uses: ModOrganizer2/check-formatting-action@master
15+
with:
16+
check-path: "."
17+
exclude-regex: "third-party"

appveyor.yml

-40
This file was deleted.

src/SConscript

-13
This file was deleted.

src/falloutttwbsainvalidation.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "falloutttwbsainvalidation.h"
22

3-
FalloutTTWBSAInvalidation::FalloutTTWBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game)
4-
: GamebryoBSAInvalidation(dataArchives, "fallout.ini", game)
5-
{
6-
}
3+
FalloutTTWBSAInvalidation::FalloutTTWBSAInvalidation(DataArchives* dataArchives,
4+
MOBase::IPluginGame const* game)
5+
: GamebryoBSAInvalidation(dataArchives, "fallout.ini", game)
6+
{}
77

88
QString FalloutTTWBSAInvalidation::invalidationBSAName() const
99
{

src/falloutttwbsainvalidation.h

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
#ifndef FALLOUTTTWBSAINVALIDATION_H
22
#define FALLOUTTTWBSAINVALIDATION_H
33

4-
5-
#include "gamebryobsainvalidation.h"
64
#include "falloutttwdataarchives.h"
5+
#include "gamebryobsainvalidation.h"
76

87
#include <memory>
98

109
class FalloutTTWBSAInvalidation : public GamebryoBSAInvalidation
1110
{
1211
public:
13-
14-
FalloutTTWBSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game);
12+
FalloutTTWBSAInvalidation(DataArchives* dataArchives,
13+
MOBase::IPluginGame const* game);
1514

1615
private:
17-
1816
virtual QString invalidationBSAName() const override;
1917
virtual unsigned long bsaVersion() const override;
20-
2118
};
2219

23-
#endif // FALLOUTTTWBSAINVALIDATION_H
20+
#endif // FALLOUTTTWBSAINVALIDATION_H

src/falloutttwdataarchives.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
#include "falloutttwdataarchives.h"
22
#include <utility.h>
33

4-
FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir &myGamesDir) :
5-
GamebryoDataArchives(myGamesDir)
6-
{
7-
}
4+
FalloutTTWDataArchives::FalloutTTWDataArchives(const QDir& myGamesDir)
5+
: GamebryoDataArchives(myGamesDir)
6+
{}
87

98
QStringList FalloutTTWDataArchives::vanillaArchives() const
109
{
11-
return { "Fallout - Textures.bsa"
12-
, "Fallout - Textures2.bsa"
13-
, "Fallout - Meshes.bsa"
14-
, "Fallout - Voices1.bsa"
15-
, "Fallout - Sound.bsa"
16-
, "Fallout - Misc.bsa" };
10+
return {"Fallout - Textures.bsa", "Fallout - Textures2.bsa", "Fallout - Meshes.bsa",
11+
"Fallout - Voices1.bsa", "Fallout - Sound.bsa", "Fallout - Misc.bsa"};
1712
}
1813

19-
QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile *profile) const
14+
QStringList FalloutTTWDataArchives::archives(const MOBase::IProfile* profile) const
2015
{
2116
QStringList result;
2217

23-
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") : m_LocalGameDir.absoluteFilePath("fallout.ini");
18+
QString iniFile = profile->localSettingsEnabled()
19+
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
20+
: m_LocalGameDir.absoluteFilePath("fallout.ini");
2421
result.append(getArchivesFromKey(iniFile, "SArchiveList"));
2522

2623
return result;
2724
}
2825

29-
void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before)
26+
void FalloutTTWDataArchives::writeArchiveList(MOBase::IProfile* profile,
27+
const QStringList& before)
3028
{
3129
QString list = before.join(", ");
3230

33-
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini") : m_LocalGameDir.absoluteFilePath("fallout.ini");
31+
QString iniFile = profile->localSettingsEnabled()
32+
? QDir(profile->absolutePath()).absoluteFilePath("fallout.ini")
33+
: m_LocalGameDir.absoluteFilePath("fallout.ini");
3434
setArchivesToKey(iniFile, "SArchiveList", list);
3535
}

src/falloutttwdataarchives.h

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
#ifndef FALLOUTTTWDATAARCHIVES_H
22
#define FALLOUTTTWDATAARCHIVES_H
33

4-
5-
#include <gamebryodataarchives.h>
6-
#include <iprofile.h>
4+
#include <QDir>
75
#include <QString>
86
#include <QStringList>
9-
#include <QDir>
7+
#include <gamebryodataarchives.h>
8+
#include <iprofile.h>
109

1110
class FalloutTTWDataArchives : public GamebryoDataArchives
1211
{
1312
public:
14-
FalloutTTWDataArchives(const QDir &myGamesDir);
13+
FalloutTTWDataArchives(const QDir& myGamesDir);
1514

1615
public:
1716
virtual QStringList vanillaArchives() const override;
18-
virtual QStringList archives(const MOBase::IProfile *profile) const override;
17+
virtual QStringList archives(const MOBase::IProfile* profile) const override;
1918

2019
private:
21-
virtual void writeArchiveList(MOBase::IProfile *profile, const QStringList &before) override;
22-
20+
virtual void writeArchiveList(MOBase::IProfile* profile,
21+
const QStringList& before) override;
2322
};
2423

25-
#endif // FALLOUTTTWDATAARCHIVES_H
24+
#endif // FALLOUTTTWDATAARCHIVES_H

src/falloutttwmoddatacontent.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
#include <gamebryomoddatacontent.h>
55
#include <ifiletree.h>
66

7-
class FalloutTTWModDataContent : public GamebryoModDataContent {
7+
class FalloutTTWModDataContent : public GamebryoModDataContent
8+
{
89
public:
9-
1010
/**
1111
*
1212
*/
13-
FalloutTTWModDataContent(GameGamebryo const* gamePlugin) : GamebryoModDataContent(gamePlugin) {
13+
FalloutTTWModDataContent(GameGamebryo const* gamePlugin)
14+
: GamebryoModDataContent(gamePlugin)
15+
{
1416
// Just need to disable some contents:
15-
m_Enabled[CONTENT_MCM] = false;
17+
m_Enabled[CONTENT_MCM] = false;
1618
m_Enabled[CONTENT_SKYPROC] = false;
1719
}
18-
1920
};
2021

21-
#endif // FALLOUTTTW_MODDATACONTENT_H
22+
#endif // FALLOUTTTW_MODDATACONTENT_H

src/falloutttwsavegame.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,33 @@
22

33
#include "gamefalloutttw.h"
44

5-
FalloutTTWSaveGame::FalloutTTWSaveGame(QString const &fileName, GameFalloutTTW const *game) :
6-
GamebryoSaveGame(fileName, game)
5+
FalloutTTWSaveGame::FalloutTTWSaveGame(QString const& fileName,
6+
GameFalloutTTW const* game)
7+
: GamebryoSaveGame(fileName, game)
78
{
89
FileWrapper file(getFilepath(), "FO3SAVEGAME");
910
unsigned long width, height;
10-
fetchInformationFields(file, width, height, m_SaveNumber, m_PCName, m_PCLevel, m_PCLocation);
11-
11+
fetchInformationFields(file, width, height, m_SaveNumber, m_PCName, m_PCLevel,
12+
m_PCLocation);
1213
}
1314

14-
void FalloutTTWSaveGame::fetchInformationFields(
15-
FileWrapper& file,
16-
unsigned long& width,
17-
unsigned long& height,
18-
unsigned long& saveNumber,
19-
QString& playerName,
20-
unsigned short& playerLevel,
21-
QString& playerLocation) const
15+
void FalloutTTWSaveGame::fetchInformationFields(FileWrapper& file, unsigned long& width,
16+
unsigned long& height,
17+
unsigned long& saveNumber,
18+
QString& playerName,
19+
unsigned short& playerLevel,
20+
QString& playerLocation) const
2221
{
23-
file.skip<unsigned long>(); //Save header size
22+
file.skip<unsigned long>(); // Save header size
2423

25-
file.skip<unsigned long>(); //File version?
26-
file.skip<unsigned char>(); //Delimiter
24+
file.skip<unsigned long>(); // File version?
25+
file.skip<unsigned char>(); // Delimiter
2726

28-
//A huge wodge of text with no length but a delimiter. Given the null bytes
29-
//in it I presume it's fixed length (64 bytes + delim) but I have no
30-
//definite spec
31-
for (unsigned char ignore = 0; ignore != 0x7c; ) {
32-
file.read(ignore); // unknown
27+
// A huge wodge of text with no length but a delimiter. Given the null bytes
28+
// in it I presume it's fixed length (64 bytes + delim) but I have no
29+
// definite spec
30+
for (unsigned char ignore = 0; ignore != 0x7c;) {
31+
file.read(ignore); // unknown
3332
}
3433

3534
file.setHasFieldMarkers(true);
@@ -49,7 +48,8 @@ void FalloutTTWSaveGame::fetchInformationFields(
4948
file.read(playerLocation);
5049
}
5150

52-
std::unique_ptr<GamebryoSaveGame::DataFields> FalloutTTWSaveGame::fetchDataFields() const
51+
std::unique_ptr<GamebryoSaveGame::DataFields>
52+
FalloutTTWSaveGame::fetchDataFields() const
5353
{
5454
FileWrapper file(getFilepath(), "FO3SAVEGAME");
5555

@@ -61,16 +61,16 @@ std::unique_ptr<GamebryoSaveGame::DataFields> FalloutTTWSaveGame::fetchDataField
6161
unsigned short dummyLevel;
6262
unsigned long dummySaveNumber;
6363

64-
fetchInformationFields(file, width, height,
65-
dummySaveNumber, dummyName, dummyLevel, dummyLocation);
64+
fetchInformationFields(file, width, height, dummySaveNumber, dummyName, dummyLevel,
65+
dummyLocation);
6666
}
6767

6868
QString playtime;
6969
file.read(playtime);
7070

7171
fields->Screenshot = file.readImage(width, height, 256);
7272

73-
file.skip<char>(5); // unknown (1 byte), plugin size (4 bytes)
73+
file.skip<char>(5); // unknown (1 byte), plugin size (4 bytes)
7474

7575
file.setPluginString(GamebryoSaveGame::StringType::TYPE_BSTRING);
7676
fields->Plugins = file.readPlugins();

src/falloutttwsavegame.h

+6-11
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@ class GameFalloutTTW;
88
class FalloutTTWSaveGame : public GamebryoSaveGame
99
{
1010
public:
11-
FalloutTTWSaveGame(QString const &fileName, GameFalloutTTW const *game);
11+
FalloutTTWSaveGame(QString const& fileName, GameFalloutTTW const* game);
1212

1313
protected:
14-
1514
// Fetch easy-to-access information.
16-
void fetchInformationFields(
17-
FileWrapper& wrapper,
18-
unsigned long& width,
19-
unsigned long& height,
20-
unsigned long& saveNumber,
21-
QString& playerName,
22-
unsigned short& playerLevel,
23-
QString& playerLocation) const;
15+
void fetchInformationFields(FileWrapper& wrapper, unsigned long& width,
16+
unsigned long& height, unsigned long& saveNumber,
17+
QString& playerName, unsigned short& playerLevel,
18+
QString& playerLocation) const;
2419

2520
std::unique_ptr<DataFields> fetchDataFields() const override;
2621
};
2722

28-
#endif // FALLOUTTTWSAVEGAME_H
23+
#endif // FALLOUTTTWSAVEGAME_H

src/falloutttwscriptextender.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
#include <QString>
44
#include <QStringList>
55

6-
FalloutTTWScriptExtender::FalloutTTWScriptExtender(GameGamebryo const *game) :
7-
GamebryoScriptExtender(game)
8-
{
9-
}
6+
FalloutTTWScriptExtender::FalloutTTWScriptExtender(GameGamebryo const* game)
7+
: GamebryoScriptExtender(game)
8+
{}
109

1110
QString FalloutTTWScriptExtender::BinaryName() const
1211
{

src/falloutttwscriptextender.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ class GameGamebryo;
88
class FalloutTTWScriptExtender : public GamebryoScriptExtender
99
{
1010
public:
11-
FalloutTTWScriptExtender(const GameGamebryo *game);
11+
FalloutTTWScriptExtender(const GameGamebryo* game);
1212

1313
virtual QString BinaryName() const override;
1414
virtual QString PluginPath() const override;
15-
1615
};
1716

18-
#endif // FALLOUTTTWSCRIPTEXTENDER_H
17+
#endif // FALLOUTTTWSCRIPTEXTENDER_H

0 commit comments

Comments
 (0)