Skip to content

Commit

Permalink
Refactoring of game features for better management. (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 authored Jun 9, 2024
1 parent 9c92049 commit 45b8212
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 184 deletions.
2 changes: 1 addition & 1 deletion src/fallout3bsainvalidation.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fallout3bsainvalidation.h"

Fallout3BSAInvalidation::Fallout3BSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game)
Fallout3BSAInvalidation::Fallout3BSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game)
: GamebryoBSAInvalidation(dataArchives, "fallout.ini", game)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/fallout3bsainvalidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Fallout3BSAInvalidation : public GamebryoBSAInvalidation
{
public:

Fallout3BSAInvalidation(DataArchives *dataArchives, MOBase::IPluginGame const *game);
Fallout3BSAInvalidation(MOBase::DataArchives* dataArchives, MOBase::IPluginGame const* game);

private:

Expand Down
2 changes: 1 addition & 1 deletion src/fallout3moddatacontent.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Fallout3ModDataContent : public GamebryoModDataContent {
/**
*
*/
Fallout3ModDataContent(GameGamebryo const* gamePlugin) : GamebryoModDataContent(gamePlugin) {
Fallout3ModDataContent(MOBase::IGameFeatures const* gameFeatures) : GamebryoModDataContent(gameFeatures) {
// Just need to disable some contents:
m_Enabled[CONTENT_MCM] = false;
m_Enabled[CONTENT_SKYPROC] = false;
Expand Down
165 changes: 2 additions & 163 deletions src/game_fallout3_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,175 +4,14 @@
<context>
<name>GameFallout3</name>
<message>
<location filename="gamefallout3.cpp" line="87"/>
<location filename="gamefallout3.cpp" line="107"/>
<source>Fallout 3 Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamefallout3.cpp" line="97"/>
<location filename="gamefallout3.cpp" line="117"/>
<source>Adds support for the game Fallout 3.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GamebryoModDataContent</name>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="12"/>
<source>Plugins (ESP/ESM/ESL)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="13"/>
<source>Optional Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="14"/>
<source>Interface</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="15"/>
<source>Meshes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="16"/>
<source>Bethesda Archive</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="17"/>
<source>Scripts (Papyrus)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="18"/>
<source>Script Extender Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="19"/>
<source>Script Extender Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="20"/>
<source>SkyProc Patcher</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="21"/>
<source>Sound or Music</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="22"/>
<source>Textures</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="23"/>
<source>MCM Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="24"/>
<source>INI Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="25"/>
<source>FaceGen Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryomoddatacontent.cpp" line="26"/>
<source>ModGroup Files</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GamebryoSaveGameInfoWidget</name>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="39"/>
<source>Save #</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="51"/>
<source>Character</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="63"/>
<source>Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="75"/>
<source>Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.ui" line="87"/>
<source>Date</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="72"/>
<source>Has Script Extender Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="77"/>
<source>Missing ESPs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="110"/>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="148"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegameinfowidget.cpp" line="116"/>
<source>Missing ESLs</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../../game_gamebryo/src/creation/creationgameplugins.cpp" line="105"/>
<location filename="../../game_gamebryo/src/gamebryo/gamebryogameplugins.cpp" line="127"/>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="47"/>
<source>%1, #%2, Level %3, %4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="97"/>
<source>failed to open %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamebryosavegame.cpp" line="107"/>
<source>wrong file format - expected %1 got %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamegamebryo.cpp" line="323"/>
<source>failed to query registry path (preflight): %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../game_gamebryo/src/gamebryo/gamegamebryo.cpp" line="330"/>
<source>failed to query registry path (read): %1</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
38 changes: 20 additions & 18 deletions src/gamefallout3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ GameFallout3::GameFallout3()
{
}

bool GameFallout3::init(IOrganizer *moInfo)
bool GameFallout3::init(IOrganizer* moInfo)
{
if (!GameGamebryo::init(moInfo)) {
return false;
}
registerFeature<ScriptExtender>(new Fallout3ScriptExtender(this));
registerFeature<DataArchives>(new Fallout3DataArchives(myGamesPath()));
registerFeature<BSAInvalidation>(new Fallout3BSAInvalidation(feature<DataArchives>(), this));
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
registerFeature<LocalSavegames>(new GamebryoLocalSavegames(myGamesPath(), "fallout.ini"));
registerFeature<ModDataChecker>(new Fallout3ModDataChecker(this));
registerFeature<ModDataContent>(new Fallout3ModDataContent(this));
registerFeature<GamePlugins>(new GamebryoGamePlugins(moInfo));
registerFeature<UnmanagedMods>(new GamebryoUnmangedMods(this));

auto dataArchives = std::make_shared<Fallout3DataArchives>(myGamesPath());
registerFeature(std::make_shared<Fallout3ScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(std::make_shared<Fallout3BSAInvalidation>(dataArchives.get(), this));
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
registerFeature(std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "fallout.ini"));
registerFeature(std::make_shared<Fallout3ModDataChecker>(this));
registerFeature(std::make_shared<Fallout3ModDataContent>(m_Organizer->gameFeatures()));
registerFeature(std::make_shared<GamebryoGamePlugins>(moInfo));
registerFeature(std::make_shared<GamebryoUnmangedMods>(this));
return true;
}

Expand Down Expand Up @@ -80,14 +82,14 @@ void GameFallout3::detectGame()
QList<ExecutableInfo> GameFallout3::executables() const
{
return QList<ExecutableInfo>()
<< ExecutableInfo("FOSE", findInGameFolder(feature<ScriptExtender>()->loaderName()))
<< ExecutableInfo("Fallout 3", findInGameFolder(binaryName()))
<< ExecutableInfo("Fallout Mod Manager", findInGameFolder("fomm/fomm.exe"))
<< ExecutableInfo("Construction Kit", findInGameFolder("geck.exe"))
<< ExecutableInfo("Fallout Launcher", findInGameFolder(getLauncherName()))
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
<< ExecutableInfo("LOOT", QFileInfo(getLootPath())).withArgument("--game=\"Fallout3\"")
;
<< ExecutableInfo("FOSE", findInGameFolder(m_Organizer->gameFeatures()->gameFeature<MOBase::ScriptExtender>()->loaderName()))
<< ExecutableInfo("Fallout 3", findInGameFolder(binaryName()))
<< ExecutableInfo("Fallout Mod Manager", findInGameFolder("fomm/fomm.exe"))
<< ExecutableInfo("Construction Kit", findInGameFolder("geck.exe"))
<< ExecutableInfo("Fallout Launcher", findInGameFolder(getLauncherName()))
<< ExecutableInfo("BOSS", findInGameFolder("BOSS/BOSS.exe"))
<< ExecutableInfo("LOOT", QFileInfo(getLootPath())).withArgument("--game=\"Fallout3\"")
;
}

QList<ExecutableForcedLoadSetting> GameFallout3::executableForcedLoads() const
Expand Down

0 comments on commit 45b8212

Please sign in to comment.