Skip to content

Commit

Permalink
Refactoring following uibase change for game features. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 authored Jun 9, 2024
1 parent 1d6adf1 commit 3663f55
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
20 changes: 10 additions & 10 deletions src/game_starfield_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,52 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="451"/>
<location filename="gamestarfield.cpp" line="452"/>
<source>You have active ESP plugins in Starfield</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="453"/>
<location filename="gamestarfield.cpp" line="454"/>
<source>You have active ESL plugins in Starfield</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="455"/>
<location filename="gamestarfield.cpp" line="456"/>
<source>You have active overlay plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="457"/>
<location filename="gamestarfield.cpp" line="458"/>
<source>sTestFile entries are present</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="459"/>
<location filename="gamestarfield.cpp" line="460"/>
<source>Plugins.txt Enabler missing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="468"/>
<location filename="gamestarfield.cpp" line="470"/>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="483"/>
<location filename="gamestarfield.cpp" line="485"/>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="496"/>
<location filename="gamestarfield.cpp" line="498"/>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="507"/>
<location filename="gamestarfield.cpp" line="509"/>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="512"/>
<location filename="gamestarfield.cpp" line="514"/>
<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>
<translation type="unfinished"></translation>
</message>
Expand Down
31 changes: 18 additions & 13 deletions src/gamestarfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@ bool GameStarfield::init(IOrganizer* moInfo)
return false;
}

registerFeature<ScriptExtender>(new StarfieldScriptExtender(this));
registerFeature<DataArchives>(
new StarfieldDataArchives(myGamesPath(), gameDirectory()));
registerFeature<LocalSavegames>(
new GamebryoLocalSavegames(myGamesPath(), "StarfieldCustom.ini"));
registerFeature<ModDataChecker>(new StarfieldModDataChecker(this));
registerFeature<ModDataContent>(new StarfieldModDataContent(this));
registerFeature<SaveGameInfo>(new GamebryoSaveGameInfo(this));
registerFeature<GamePlugins>(new StarfieldGamePlugins(moInfo));
registerFeature<UnmanagedMods>(new StarfieldUnmangedMods(this));
registerFeature<BSAInvalidation>(
new StarfieldBSAInvalidation(feature<DataArchives>(), this));
auto dataArchives =
std::make_shared<StarfieldDataArchives>(myGamesPath(), gameDirectory());
registerFeature(std::make_shared<StarfieldScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "StarfieldCustom.ini"));
registerFeature(std::make_shared<StarfieldModDataChecker>(this));
registerFeature(
std::make_shared<StarfieldModDataContent>(m_Organizer->gameFeatures()));
registerFeature(std::make_shared<GamebryoSaveGameInfo>(this));
registerFeature(std::make_shared<StarfieldGamePlugins>(moInfo));
registerFeature(std::make_shared<StarfieldUnmangedMods>(this));
registerFeature(std::make_shared<StarfieldBSAInvalidation>(dataArchives.get(), this));

return true;
}
Expand Down Expand Up @@ -92,7 +93,9 @@ QList<ExecutableInfo> GameStarfield::executables() const
{
return QList<ExecutableInfo>()
<< ExecutableInfo("SFSE",
findInGameFolder(feature<ScriptExtender>()->loaderName()))
findInGameFolder(m_Organizer->gameFeatures()
->gameFeature<MOBase::ScriptExtender>()
->loaderName()))
<< ExecutableInfo("Starfield", findInGameFolder(binaryName()))
<< ExecutableInfo("LOOT", QFileInfo(getLootPath()))
.withArgument("--game=\"Starfield\"");
Expand Down Expand Up @@ -459,6 +462,7 @@ QString GameStarfield::shortDescription(unsigned int key) const
case PROBLEM_PLUGINS_TXT:
return tr("Plugins.txt Enabler missing");
}
return "";
}

QString GameStarfield::fullDescription(unsigned int key) const
Expand Down Expand Up @@ -515,6 +519,7 @@ QString GameStarfield::fullDescription(unsigned int key) const
"will not work without this SFSE plugin.</p>");
}
}
return "";
}

bool GameStarfield::hasGuidedFix(unsigned int key) const
Expand Down
2 changes: 1 addition & 1 deletion src/starfieldbsainvalidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <imoinfo.h>
#include <utility.h>

StarfieldBSAInvalidation::StarfieldBSAInvalidation(DataArchives* dataArchives,
StarfieldBSAInvalidation::StarfieldBSAInvalidation(MOBase::DataArchives* dataArchives,
MOBase::IPluginGame const* game)
: GamebryoBSAInvalidation(dataArchives, "StarfieldCustom.ini", game)
{
Expand Down
3 changes: 2 additions & 1 deletion src/starfieldbsainvalidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class IPluginGame;
class StarfieldBSAInvalidation : public GamebryoBSAInvalidation
{
public:
StarfieldBSAInvalidation(DataArchives* dataArchives, MOBase::IPluginGame const* game);
StarfieldBSAInvalidation(MOBase::DataArchives* dataArchives,
MOBase::IPluginGame const* game);
virtual bool isInvalidationBSA(const QString& bsaName) override;
virtual bool prepareProfile(MOBase::IProfile* profile) override;

Expand Down
2 changes: 1 addition & 1 deletion src/starfielddataarchives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ void StarfieldDataArchives::addArchive(MOBase::IProfile* profile, int index,

void StarfieldDataArchives::removeArchive(MOBase::IProfile* profile,
const QString& archiveName)
{}
{}
2 changes: 1 addition & 1 deletion src/starfieldgameplugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ QStringList StarfieldGamePlugins::readPluginList(MOBase::IPluginList* pluginList
return CreationGamePlugins::readPluginList(pluginList);
}
return {};
}
}
4 changes: 2 additions & 2 deletions src/starfieldmoddatacontent.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class StarfieldModDataContent : public GamebryoModDataContent
};

public:
StarfieldModDataContent(GameGamebryo const* gamePlugin)
: GamebryoModDataContent(gamePlugin)
StarfieldModDataContent(MOBase::IGameFeatures const* gameFeatures)
: GamebryoModDataContent(gameFeatures)
{
m_Enabled[CONTENT_SKYPROC] = false;
m_Enabled[CONTENT_MATERIAL] = true;
Expand Down

0 comments on commit 3663f55

Please sign in to comment.