Skip to content

Commit

Permalink
Refactoring of game features for better management. (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 authored Jun 9, 2024
1 parent 09a15e3 commit de678f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/inibakery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <iplugingame.h>
#include <localsavegames.h>
#include <bsainvalidation.h>
#include <igamefeatures.h>
#include <QFile>
#include <QCoreApplication>
#include <QStringList>
Expand Down Expand Up @@ -58,14 +59,14 @@ QStringList IniBakery::iniFileNames() const

bool IniBakery::prepareIni(const QString&)
{
const IPluginGame *game = m_MOInfo->managedGame();
const auto* features = m_MOInfo->gameFeatures();

LocalSavegames *savegames = game->feature<LocalSavegames>();
auto savegames = features->gameFeature<MOBase::LocalSavegames>();
if (savegames != nullptr) {
savegames->prepareProfile(m_MOInfo->profile());
}

BSAInvalidation *invalidation = game->feature<BSAInvalidation>();
auto invalidation = features->gameFeature<BSAInvalidation>();
if (invalidation != nullptr) {
invalidation->prepareProfile(m_MOInfo->profile());
}
Expand Down
4 changes: 2 additions & 2 deletions src/inibakery_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<context>
<name>IniBakery</name>
<message>
<location filename="inibakery.cpp" line="31"/>
<location filename="inibakery.cpp" line="32"/>
<source>INI Bakery</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="inibakery.cpp" line="41"/>
<location filename="inibakery.cpp" line="42"/>
<source>Manages game ini files</source>
<translation type="unfinished"></translation>
</message>
Expand Down

0 comments on commit de678f7

Please sign in to comment.