Skip to content

Commit 3663f55

Browse files
authored
Refactoring following uibase change for game features. (#20)
1 parent 1d6adf1 commit 3663f55

7 files changed

+35
-29
lines changed

src/game_starfield_en.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,52 @@
4444
<translation type="unfinished"></translation>
4545
</message>
4646
<message>
47-
<location filename="gamestarfield.cpp" line="451"/>
47+
<location filename="gamestarfield.cpp" line="452"/>
4848
<source>You have active ESP plugins in Starfield</source>
4949
<translation type="unfinished"></translation>
5050
</message>
5151
<message>
52-
<location filename="gamestarfield.cpp" line="453"/>
52+
<location filename="gamestarfield.cpp" line="454"/>
5353
<source>You have active ESL plugins in Starfield</source>
5454
<translation type="unfinished"></translation>
5555
</message>
5656
<message>
57-
<location filename="gamestarfield.cpp" line="455"/>
57+
<location filename="gamestarfield.cpp" line="456"/>
5858
<source>You have active overlay plugins</source>
5959
<translation type="unfinished"></translation>
6060
</message>
6161
<message>
62-
<location filename="gamestarfield.cpp" line="457"/>
62+
<location filename="gamestarfield.cpp" line="458"/>
6363
<source>sTestFile entries are present</source>
6464
<translation type="unfinished"></translation>
6565
</message>
6666
<message>
67-
<location filename="gamestarfield.cpp" line="459"/>
67+
<location filename="gamestarfield.cpp" line="460"/>
6868
<source>Plugins.txt Enabler missing</source>
6969
<translation type="unfinished"></translation>
7070
</message>
7171
<message>
72-
<location filename="gamestarfield.cpp" line="468"/>
72+
<location filename="gamestarfield.cpp" line="470"/>
7373
<source>&lt;p&gt;ESP plugins are not ideal for Starfield. In addition to being unable to sort them alongside ESM or master-flagged plugins, certain record references are always kept loaded by the game. This consumes unnecessary resources and limits the game&apos;s ability to load what it needs.&lt;/p&gt;&lt;p&gt;Ideally, plugins should be saved as ESM files upon release. It can also be released as an ESL plugin, however there are additional concerns with the way light plugins are currently handled and should only be used when absolutely certain about what you&apos;re doing.&lt;/p&gt;&lt;p&gt;Notably, xEdit does not currently support saving ESP files.&lt;/p&gt;&lt;h4&gt;Current ESPs:&lt;/h4&gt;&lt;p&gt;%1&lt;/p&gt;</source>
7474
<translation type="unfinished"></translation>
7575
</message>
7676
<message>
77-
<location filename="gamestarfield.cpp" line="483"/>
77+
<location filename="gamestarfield.cpp" line="485"/>
7878
<source>&lt;p&gt;Light plugins work differently in Starfield. They use a different base form ID compared with standard plugin files.&lt;/p&gt;&lt;p&gt;What this means is that you can&apos;t just change a standard plugin to a light plugin at will, it can and will break any dependent plugin. If you do so, be absolutely certain no other plugins use that plugin as a master.&lt;/p&gt;&lt;p&gt;Notably, xEdit does not currently support saving or loading ESL files under these conditions.&lt;p&gt;&lt;h4&gt;Current ESLs:&lt;/h4&gt;&lt;p&gt;%1&lt;/p&gt;</source>
7979
<translation type="unfinished"></translation>
8080
</message>
8181
<message>
82-
<location filename="gamestarfield.cpp" line="496"/>
82+
<location filename="gamestarfield.cpp" line="498"/>
8383
<source>&lt;p&gt;Overlay-flagged plugins are not currently recommended. In theory, they should allow you to update existing records without utilizing additional load order slots. Unfortunately, it appears that the game still allocates the slots as if these were standard plugins. Therefore, at the moment there is no real use for this plugin flag.&lt;/p&gt;&lt;p&gt;Notably, xEdit does not currently support saving or loading overlay-flagged files under these conditions.&lt;/p&gt;&lt;h4&gt;Current Overlays:&lt;/h4&gt;&lt;p&gt;%1&lt;/p&gt;</source>
8484
<translation type="unfinished"></translation>
8585
</message>
8686
<message>
87-
<location filename="gamestarfield.cpp" line="507"/>
87+
<location filename="gamestarfield.cpp" line="509"/>
8888
<source>&lt;p&gt;You have plugin managment enabled but you still have sTestFile settings in your StarfieldCustom.ini. These must be removed or the game will not read the plugins.txt file. Management is still disabled.&lt;/p&gt;</source>
8989
<translation type="unfinished"></translation>
9090
</message>
9191
<message>
92-
<location filename="gamestarfield.cpp" line="512"/>
92+
<location filename="gamestarfield.cpp" line="514"/>
9393
<source>&lt;p&gt;You have plugin management turned on but do not have the Plugins.txt Enabler SFSE plugin installed. Plugin file management for Starfield will not work without this SFSE plugin.&lt;/p&gt;</source>
9494
<translation type="unfinished"></translation>
9595
</message>

src/gamestarfield.cpp

+18-13
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,19 @@ bool GameStarfield::init(IOrganizer* moInfo)
4141
return false;
4242
}
4343

44-
registerFeature<ScriptExtender>(new StarfieldScriptExtender(this));
45-
registerFeature<DataArchives>(
46-
new StarfieldDataArchives(myGamesPath(), gameDirectory()));
47-
registerFeature<LocalSavegames>(
48-
new GamebryoLocalSavegames(myGamesPath(), "StarfieldCustom.ini"));
49-
registerFeature<ModDataChecker>(new StarfieldModDataChecker(this));
50-
registerFeature<ModDataContent>(new StarfieldModDataContent(this));
51-
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
52-
registerFeature<GamePlugins>(new StarfieldGamePlugins(moInfo));
53-
registerFeature<UnmanagedMods>(new StarfieldUnmangedMods(this));
54-
registerFeature<BSAInvalidation>(
55-
new StarfieldBSAInvalidation(feature<DataArchives>(), this));
44+
auto dataArchives =
45+
std::make_shared<StarfieldDataArchives>(myGamesPath(), gameDirectory());
46+
registerFeature(std::make_shared<StarfieldScriptExtender>(this));
47+
registerFeature(dataArchives);
48+
registerFeature(
49+
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "StarfieldCustom.ini"));
50+
registerFeature(std::make_shared<StarfieldModDataChecker>(this));
51+
registerFeature(
52+
std::make_shared<StarfieldModDataContent>(m_Organizer->gameFeatures()));
53+
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
54+
registerFeature(std::make_shared<StarfieldGamePlugins>(moInfo));
55+
registerFeature(std::make_shared<StarfieldUnmangedMods>(this));
56+
registerFeature(std::make_shared<StarfieldBSAInvalidation>(dataArchives.get(), this));
5657

5758
return true;
5859
}
@@ -92,7 +93,9 @@ QList<ExecutableInfo> GameStarfield::executables() const
9293
{
9394
return QList<ExecutableInfo>()
9495
<< ExecutableInfo("SFSE",
95-
findInGameFolder(feature<ScriptExtender>()->loaderName()))
96+
findInGameFolder(m_Organizer->gameFeatures()
97+
->gameFeature<MOBase::ScriptExtender>()
98+
->loaderName()))
9699
<< ExecutableInfo("Starfield", findInGameFolder(binaryName()))
97100
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
98101
.withArgument("--game=\"Starfield\"");
@@ -459,6 +462,7 @@ QString GameStarfield::shortDescription(unsigned int key) const
459462
case PROBLEM_PLUGINS_TXT:
460463
return tr("Plugins.txt Enabler missing");
461464
}
465+
return "";
462466
}
463467

464468
QString GameStarfield::fullDescription(unsigned int key) const
@@ -515,6 +519,7 @@ QString GameStarfield::fullDescription(unsigned int key) const
515519
"will not work without this SFSE plugin.</p>");
516520
}
517521
}
522+
return "";
518523
}
519524

520525
bool GameStarfield::hasGuidedFix(unsigned int key) const

src/starfieldbsainvalidation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <imoinfo.h>
88
#include <utility.h>
99

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

src/starfieldbsainvalidation.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class IPluginGame;
1616
class StarfieldBSAInvalidation : public GamebryoBSAInvalidation
1717
{
1818
public:
19-
StarfieldBSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game);
19+
StarfieldBSAInvalidation(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

src/starfielddataarchives.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ void StarfieldDataArchives::addArchive(MOBase::IProfile* profile, int index,
100100

101101
void StarfieldDataArchives::removeArchive(MOBase::IProfile* profile,
102102
const QString& archiveName)
103-
{}
103+
{}

src/starfieldgameplugins.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ QStringList StarfieldGamePlugins::readPluginList(MOBase::IPluginList* pluginList
2727
return CreationGamePlugins::readPluginList(pluginList);
2828
}
2929
return {};
30-
}
30+
}

src/starfieldmoddatacontent.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class StarfieldModDataContent : public GamebryoModDataContent
1515
};
1616

1717
public:
18-
StarfieldModDataContent(GameGamebryo const* gamePlugin)
19-
: GamebryoModDataContent(gamePlugin)
18+
StarfieldModDataContent(MOBase::IGameFeatures const* gameFeatures)
19+
: GamebryoModDataContent(gameFeatures)
2020
{
2121
m_Enabled[CONTENT_SKYPROC] = false;
2222
m_Enabled[CONTENT_MATERIAL] = true;

0 commit comments

Comments
 (0)