Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit 10a6432

Browse files
authored
Merge pull request #27 from ModOrganizer2/dev/format-and-gh-actions
Formatting and Github Actions
2 parents 796be48 + 4bb97ed commit 10a6432

19 files changed

+249
-205
lines changed

.clang-format

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# We'll use defaults from the LLVM style, but with 4 columns indentation.
3+
BasedOnStyle: LLVM
4+
IndentWidth: 2
5+
---
6+
Language: Cpp
7+
DeriveLineEnding: false
8+
UseCRLF: true
9+
DerivePointerAlignment: false
10+
PointerAlignment: Left
11+
AlignConsecutiveAssignments: true
12+
AllowShortFunctionsOnASingleLine: Inline
13+
AllowShortIfStatementsOnASingleLine: Never
14+
AllowShortLambdasOnASingleLine: Empty
15+
AlwaysBreakTemplateDeclarations: Yes
16+
AccessModifierOffset: -2
17+
AlignTrailingComments: true
18+
SpacesBeforeTrailingComments: 2
19+
NamespaceIndentation: Inner
20+
MaxEmptyLinesToKeep: 1
21+
BreakBeforeBraces: Custom
22+
BraceWrapping:
23+
AfterCaseLabel: false
24+
AfterClass: true
25+
AfterControlStatement: false
26+
AfterEnum: true
27+
AfterFunction: true
28+
AfterNamespace: true
29+
AfterStruct: true
30+
AfterUnion: true
31+
AfterExternBlock: true
32+
BeforeCatch: false
33+
BeforeElse: false
34+
BeforeLambdaBody: false
35+
BeforeWhile: false
36+
IndentBraces: false
37+
SplitEmptyFunction: false
38+
SplitEmptyRecord: false
39+
SplitEmptyNamespace: true
40+
ColumnLimit: 88
41+
ForEachMacros: ['Q_FOREACH', 'foreach']

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ca290eff60953a6c4a395522694b83a92a6052ea

.gitattributes

Lines changed: 7 additions & 0 deletions
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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build Fallout 4 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 Fallout 4 Plugin
14+
uses: ModOrganizer2/build-with-mob-action@master
15+
with:
16+
mo2-dependencies: cmake_common uibase game_gamebryo

.github/workflows/linting.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint Fallout 4 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: "."

appveyor.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/fallout4bsainvalidation.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class IPluginGame;
1616
class Fallout4BSAInvalidation : public GamebryoBSAInvalidation
1717
{
1818
public:
19-
Fallout4BSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game);
19+
Fallout4BSAInvalidation(MOBase::DataArchives* dataArchives,
20+
MOBase::IPluginGame const* game);
2021
virtual bool isInvalidationBSA(const QString& bsaName) override;
2122
virtual bool prepareProfile(MOBase::IProfile* profile) override;
2223

@@ -29,4 +30,4 @@ class Fallout4BSAInvalidation : public GamebryoBSAInvalidation
2930
MOBase::IPluginGame const* m_Game;
3031
};
3132

32-
#endif // FALLOUT4BSAINVALIDATION_H
33+
#endif // FALLOUT4BSAINVALIDATION_H

src/fallout4dataarchives.cpp

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,45 @@
33
#include "iprofile.h"
44
#include <utility.h>
55

6-
Fallout4DataArchives::Fallout4DataArchives(const QDir &myGamesDir) :
7-
GamebryoDataArchives(myGamesDir)
6+
Fallout4DataArchives::Fallout4DataArchives(const QDir& myGamesDir)
7+
: GamebryoDataArchives(myGamesDir)
88
{}
99

1010
QStringList Fallout4DataArchives::vanillaArchives() const
1111
{
12-
return { "Fallout4 - Textures1.ba2"
13-
, "Fallout4 - Textures2.ba2"
14-
, "Fallout4 - Textures3.ba2"
15-
, "Fallout4 - Textures4.ba2"
16-
, "Fallout4 - Textures5.ba2"
17-
, "Fallout4 - Textures6.ba2"
18-
, "Fallout4 - Textures7.ba2"
19-
, "Fallout4 - Textures8.ba2"
20-
, "Fallout4 - Textures9.ba2"
21-
, "Fallout4 - Meshes.ba2"
22-
, "Fallout4 - MeshesExtra.ba2"
23-
, "Fallout4 - Voices.ba2"
24-
, "Fallout4 - Sounds.ba2"
25-
, "Fallout4 - Interface.ba2"
26-
, "Fallout4 - Animations.ba2"
27-
, "Fallout4 - Materials.ba2"
28-
, "Fallout4 - Shaders.ba2"
29-
, "Fallout4 - Startup.ba2"
30-
, "Fallout4 - Misc.ba2" };
12+
return {"Fallout4 - Textures1.ba2", "Fallout4 - Textures2.ba2",
13+
"Fallout4 - Textures3.ba2", "Fallout4 - Textures4.ba2",
14+
"Fallout4 - Textures5.ba2", "Fallout4 - Textures6.ba2",
15+
"Fallout4 - Textures7.ba2", "Fallout4 - Textures8.ba2",
16+
"Fallout4 - Textures9.ba2", "Fallout4 - Meshes.ba2",
17+
"Fallout4 - MeshesExtra.ba2", "Fallout4 - Voices.ba2",
18+
"Fallout4 - Sounds.ba2", "Fallout4 - Interface.ba2",
19+
"Fallout4 - Animations.ba2", "Fallout4 - Materials.ba2",
20+
"Fallout4 - Shaders.ba2", "Fallout4 - Startup.ba2",
21+
"Fallout4 - Misc.ba2"};
3122
}
3223

33-
34-
QStringList Fallout4DataArchives::archives(const MOBase::IProfile *profile) const
24+
QStringList Fallout4DataArchives::archives(const MOBase::IProfile* profile) const
3525
{
3626
QStringList result;
3727

38-
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") : m_LocalGameDir.absoluteFilePath("fallout4.ini");
28+
QString iniFile = profile->localSettingsEnabled()
29+
? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini")
30+
: m_LocalGameDir.absoluteFilePath("fallout4.ini");
3931
result.append(getArchivesFromKey(iniFile, "SResourceArchiveList"));
4032
result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2"));
4133

4234
return result;
4335
}
4436

45-
void Fallout4DataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before)
37+
void Fallout4DataArchives::writeArchiveList(MOBase::IProfile* profile,
38+
const QStringList& before)
4639
{
4740
QString list = before.join(", ");
4841

49-
QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini") : m_LocalGameDir.absoluteFilePath("fallout4.ini");
42+
QString iniFile = profile->localSettingsEnabled()
43+
? QDir(profile->absolutePath()).absoluteFilePath("fallout4.ini")
44+
: m_LocalGameDir.absoluteFilePath("fallout4.ini");
5045
if (list.length() > 255) {
5146
int splitIdx = list.lastIndexOf(",", 256);
5247
setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx));

src/fallout4dataarchives.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33

44
#include "gamebryodataarchives.h"
55

6-
namespace MOBase { class IProfile; }
6+
namespace MOBase
7+
{
8+
class IProfile;
9+
}
710

8-
#include <QStringList>
911
#include <QDir>
12+
#include <QStringList>
1013

1114
class Fallout4DataArchives : public GamebryoDataArchives
1215
{
1316

1417
public:
15-
16-
Fallout4DataArchives(const QDir &myGamesDir);
18+
Fallout4DataArchives(const QDir& myGamesDir);
1719

1820
public:
19-
2021
virtual QStringList vanillaArchives() const override;
21-
virtual QStringList archives(const MOBase::IProfile *profile) const override;
22+
virtual QStringList archives(const MOBase::IProfile* profile) const override;
2223

2324
private:
24-
25-
virtual void writeArchiveList(MOBase::IProfile *profile, const QStringList &before) override;
26-
25+
virtual void writeArchiveList(MOBase::IProfile* profile,
26+
const QStringList& before) override;
2727
};
2828

29-
#endif // FALLOUT4DATAARCHIVES_H
29+
#endif // FALLOUT4DATAARCHIVES_H

src/fallout4moddatachecker.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@ class Fallout4ModDataChecker : public GamebryoModDataChecker
99
using GamebryoModDataChecker::GamebryoModDataChecker;
1010

1111
protected:
12-
virtual const FileNameSet& possibleFolderNames() const override {
12+
virtual const FileNameSet& possibleFolderNames() const override
13+
{
1314
static FileNameSet result{
14-
"interface", "meshes", "music", "scripts", "sound", "strings", "textures",
15-
"trees", "video", "materials", "f4se", "distantlod", "asi", "Tools", "MCM",
16-
"distantland", "mits", "dllplugins", "CalienteTools", "shadersfx", "aaf"
17-
};
15+
"interface", "meshes", "music", "scripts", "sound", "strings",
16+
"textures", "trees", "video", "materials", "f4se", "distantlod",
17+
"asi", "Tools", "MCM", "distantland", "mits", "dllplugins",
18+
"CalienteTools", "shadersfx", "aaf"};
1819
return result;
1920
}
20-
virtual const FileNameSet& possibleFileExtensions() const override {
21-
static FileNameSet result{
22-
"esp", "esm", "esl", "ba2", "modgroups", "ini", "csg", "cdx"
23-
};
21+
virtual const FileNameSet& possibleFileExtensions() const override
22+
{
23+
static FileNameSet result{"esp", "esm", "esl", "ba2",
24+
"modgroups", "ini", "csg", "cdx"};
2425
return result;
2526
}
2627
};
2728

28-
#endif // FALLOUT4_MODATACHECKER_H
29+
#endif // FALLOUT4_MODATACHECKER_H

src/fallout4moddatacontent.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,41 @@
44
#include <gamebryomoddatacontent.h>
55
#include <ifiletree.h>
66

7-
class Fallout4ModDataContent : public GamebryoModDataContent {
7+
class Fallout4ModDataContent : public GamebryoModDataContent
8+
{
89
protected:
9-
enum Fallout4Content {
10+
enum Fallout4Content
11+
{
1012
CONTENT_MATERIAL = CONTENT_NEXT_VALUE
1113
};
1214

1315
public:
14-
Fallout4ModDataContent(const MOBase::IGameFeatures* gameFeatures) :
15-
GamebryoModDataContent(gameFeatures)
16+
Fallout4ModDataContent(const MOBase::IGameFeatures* gameFeatures)
17+
: GamebryoModDataContent(gameFeatures)
1618
{
1719
m_Enabled[CONTENT_SKYPROC] = false;
1820
}
1921

2022
std::vector<Content> getAllContents() const override
2123
{
2224
auto contents = GamebryoModDataContent::getAllContents();
23-
contents.push_back(Content(CONTENT_MATERIAL, "Materials", ":/MO/gui/content/material"));
25+
contents.push_back(
26+
Content(CONTENT_MATERIAL, "Materials", ":/MO/gui/content/material"));
2427
return contents;
2528
}
2629

27-
std::vector<int> getContentsFor(
28-
std::shared_ptr<const MOBase::IFileTree> fileTree) const override
30+
std::vector<int>
31+
getContentsFor(std::shared_ptr<const MOBase::IFileTree> fileTree) const override
2932
{
3033
auto contents = GamebryoModDataContent::getContentsFor(fileTree);
3134
for (auto e : *fileTree) {
3235
if (e->compare("materials") == 0) {
3336
contents.push_back(CONTENT_MATERIAL);
34-
break; // Early break if you have nothing else to check.
37+
break; // Early break if you have nothing else to check.
3538
}
3639
}
3740
return contents;
3841
}
3942
};
4043

41-
#endif // FALLOUT4_MODDATACONTENT_H
44+
#endif // FALLOUT4_MODDATACONTENT_H

0 commit comments

Comments
 (0)