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

Commit 796be48

Browse files
authored
Refactoring following uibase change for game features. (#26)
1 parent d5d53d3 commit 796be48

File tree

5 files changed

+22
-172
lines changed

5 files changed

+22
-172
lines changed

src/fallout4bsainvalidation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <imoinfo.h>
88
#include <utility.h>
99

10-
Fallout4BSAInvalidation::Fallout4BSAInvalidation(DataArchives* dataArchives,
10+
Fallout4BSAInvalidation::Fallout4BSAInvalidation(MOBase::DataArchives* dataArchives,
1111
MOBase::IPluginGame const* game)
1212
: GamebryoBSAInvalidation(dataArchives, "Fallout4Custom.ini", game)
1313
{

src/fallout4bsainvalidation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IPluginGame;
1616
class Fallout4BSAInvalidation : public GamebryoBSAInvalidation
1717
{
1818
public:
19-
Fallout4BSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game);
19+
Fallout4BSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game);
2020
virtual bool isInvalidationBSA(const QString& bsaName) override;
2121
virtual bool prepareProfile(MOBase::IProfile* profile) override;
2222

src/fallout4moddatacontent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Fallout4ModDataContent : public GamebryoModDataContent {
1111
};
1212

1313
public:
14-
Fallout4ModDataContent(GameGamebryo const* gamePlugin) :
15-
GamebryoModDataContent(gamePlugin)
14+
Fallout4ModDataContent(const MOBase::IGameFeatures* gameFeatures) :
15+
GamebryoModDataContent(gameFeatures)
1616
{
1717
m_Enabled[CONTENT_SKYPROC] = false;
1818
}

src/game_fallout4_en.ts

Lines changed: 6 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -4,175 +4,24 @@
44
<context>
55
<name>GameFallout4</name>
66
<message>
7-
<location filename="gamefallout4.cpp" line="87"/>
7+
<location filename="gamefallout4.cpp" line="91"/>
88
<source>Fallout 4 Support Plugin</source>
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="gamefallout4.cpp" line="98"/>
12+
<location filename="gamefallout4.cpp" line="102"/>
1313
<source>Adds support for the game Fallout 4.
1414
Splash by %1</source>
1515
<translation type="unfinished"></translation>
1616
</message>
17-
</context>
18-
<context>
19-
<name>GamebryoModDataContent</name>
20-
<message>
21-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="12"/>
22-
<source>Plugins (ESP/ESM/ESL)</source>
23-
<translation type="unfinished"></translation>
24-
</message>
25-
<message>
26-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="13"/>
27-
<source>Optional Plugins</source>
28-
<translation type="unfinished"></translation>
29-
</message>
30-
<message>
31-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="14"/>
32-
<source>Interface</source>
33-
<translation type="unfinished"></translation>
34-
</message>
35-
<message>
36-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="15"/>
37-
<source>Meshes</source>
38-
<translation type="unfinished"></translation>
39-
</message>
40-
<message>
41-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="16"/>
42-
<source>Bethesda Archive</source>
43-
<translation type="unfinished"></translation>
44-
</message>
45-
<message>
46-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="17"/>
47-
<source>Scripts (Papyrus)</source>
48-
<translation type="unfinished"></translation>
49-
</message>
50-
<message>
51-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="18"/>
52-
<source>Script Extender Plugin</source>
53-
<translation type="unfinished"></translation>
54-
</message>
55-
<message>
56-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="19"/>
57-
<source>Script Extender Files</source>
58-
<translation type="unfinished"></translation>
59-
</message>
60-
<message>
61-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="20"/>
62-
<source>SkyProc Patcher</source>
63-
<translation type="unfinished"></translation>
64-
</message>
65-
<message>
66-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="21"/>
67-
<source>Sound or Music</source>
68-
<translation type="unfinished"></translation>
69-
</message>
70-
<message>
71-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="22"/>
72-
<source>Textures</source>
73-
<translation type="unfinished"></translation>
74-
</message>
75-
<message>
76-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="23"/>
77-
<source>MCM Configuration</source>
78-
<translation type="unfinished"></translation>
79-
</message>
80-
<message>
81-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="24"/>
82-
<source>INI Files</source>
83-
<translation type="unfinished"></translation>
84-
</message>
85-
<message>
86-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="25"/>
87-
<source>FaceGen Data</source>
88-
<translation type="unfinished"></translation>
89-
</message>
90-
<message>
91-
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="26"/>
92-
<source>ModGroup Files</source>
93-
<translation type="unfinished"></translation>
94-
</message>
95-
</context>
96-
<context>
97-
<name>GamebryoSaveGameInfoWidget</name>
98-
<message>
99-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="39"/>
100-
<source>Save #</source>
101-
<translation type="unfinished"></translation>
102-
</message>
103-
<message>
104-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="51"/>
105-
<source>Character</source>
106-
<translation type="unfinished"></translation>
107-
</message>
108-
<message>
109-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="63"/>
110-
<source>Level</source>
111-
<translation type="unfinished"></translation>
112-
</message>
113-
<message>
114-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="75"/>
115-
<source>Location</source>
116-
<translation type="unfinished"></translation>
117-
</message>
118-
<message>
119-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="87"/>
120-
<source>Date</source>
121-
<translation type="unfinished"></translation>
122-
</message>
123-
<message>
124-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="72"/>
125-
<source>Has Script Extender Data</source>
126-
<translation type="unfinished"></translation>
127-
</message>
128-
<message>
129-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="77"/>
130-
<source>Missing ESPs</source>
131-
<translation type="unfinished"></translation>
132-
</message>
133-
<message>
134-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="110"/>
135-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="148"/>
136-
<source>None</source>
137-
<translation type="unfinished"></translation>
138-
</message>
139-
<message>
140-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="116"/>
141-
<source>Missing ESLs</source>
142-
<translation type="unfinished"></translation>
143-
</message>
144-
</context>
145-
<context>
146-
<name>QObject</name>
147-
<message>
148-
<location filename="../../game_gamebryo/src/creation/creationgameplugins.cpp" line="105"/>
149-
<location filename="../../game_gamebryo/src/gamebryo/gamebryogameplugins.cpp" line="127"/>
150-
<source>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.</source>
151-
<translation type="unfinished"></translation>
152-
</message>
153-
<message>
154-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="47"/>
155-
<source>%1, #%2, Level %3, %4</source>
156-
<translation type="unfinished"></translation>
157-
</message>
158-
<message>
159-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="97"/>
160-
<source>failed to open %1</source>
161-
<translation type="unfinished"></translation>
162-
</message>
163-
<message>
164-
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="107"/>
165-
<source>wrong file format - expected %1 got %2</source>
166-
<translation type="unfinished"></translation>
167-
</message>
16817
<message>
169-
<location filename="../../game_gamebryo/src/gamebryo/gamegamebryo.cpp" line="323"/>
170-
<source>failed to query registry path (preflight): %1</source>
18+
<location filename="gamefallout4.cpp" line="309"/>
19+
<source>sTestFile entries are present</source>
17120
<translation type="unfinished"></translation>
17221
</message>
17322
<message>
174-
<location filename="../../game_gamebryo/src/gamebryo/gamegamebryo.cpp" line="330"/>
175-
<source>failed to query registry path (read): %1</source>
23+
<location filename="gamefallout4.cpp" line="316"/>
24+
<source>&lt;p&gt;You have sTestFile settings in your Fallout4Custom.ini. These must be removed or the game will not read the plugins.txt file. Management is disabled.&lt;/p&gt;</source>
17625
<translation type="unfinished"></translation>
17726
</message>
17827
</context>

src/gamefallout4.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@ bool GameFallout4::init(IOrganizer *moInfo)
3939
return false;
4040
}
4141

42-
registerFeature<ScriptExtender>(new Fallout4ScriptExtender(this));
43-
registerFeature<DataArchives>(new Fallout4DataArchives(myGamesPath()));
44-
registerFeature<LocalSavegames>(new GamebryoLocalSavegames(myGamesPath(), "fallout4custom.ini"));
45-
registerFeature<ModDataChecker>(new Fallout4ModDataChecker(this));
46-
registerFeature<ModDataContent>(new Fallout4ModDataContent(this));
47-
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
48-
registerFeature<GamePlugins>(new CreationGamePlugins(moInfo));
49-
registerFeature<UnmanagedMods>(new Fallout4UnmangedMods(this));
50-
registerFeature<BSAInvalidation>(
51-
new Fallout4BSAInvalidation(feature<DataArchives>(), this));
42+
auto dataArchives = std::make_shared<Fallout4DataArchives>(myGamesPath());
43+
44+
registerFeature(std::make_shared<Fallout4ScriptExtender>(this));
45+
registerFeature(dataArchives);
46+
registerFeature(std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout4custom.ini"));
47+
registerFeature(std::make_shared<Fallout4ModDataChecker>(this));
48+
registerFeature(std::make_shared<Fallout4ModDataContent>(m_Organizer->gameFeatures()));
49+
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
50+
registerFeature(std::make_shared<CreationGamePlugins>(moInfo));
51+
registerFeature(std::make_shared<Fallout4UnmangedMods>(this));
52+
registerFeature(std::make_shared<Fallout4BSAInvalidation>(dataArchives.get(), this));
5253

5354
return true;
5455
}
@@ -67,7 +68,7 @@ void GameFallout4::detectGame()
6768
QList<ExecutableInfo> GameFallout4::executables() const
6869
{
6970
return QList<ExecutableInfo>()
70-
<< ExecutableInfo("F4SE", findInGameFolder(feature<ScriptExtender>()->loaderName()))
71+
<< ExecutableInfo("F4SE", findInGameFolder(m_Organizer->gameFeatures()->gameFeature<MOBase::ScriptExtender>()->loaderName()))
7172
<< ExecutableInfo("Fallout 4", findInGameFolder(binaryName()))
7273
<< ExecutableInfo("Fallout Launcher", findInGameFolder(getLauncherName()))
7374
<< ExecutableInfo("Creation Kit", findInGameFolder("CreationKit.exe")).withSteamAppId("1946160")

0 commit comments

Comments
 (0)