Skip to content

Commit

Permalink
Update following gamebryo updates for myGamesPath() in game feature. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 authored Jun 22, 2024
1 parent 6936659 commit 5379505
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 76 deletions.
61 changes: 8 additions & 53 deletions src/game_starfield_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,50 @@
<context>
<name>GameStarfield</name>
<message>
<location filename="gamestarfield.cpp" line="116"/>
<location filename="gamestarfield.cpp" line="117"/>
<source>Starfield Support Plugin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="126"/>
<location filename="gamestarfield.cpp" line="127"/>
<source>Adds support for the game Starfield.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="139"/>
<location filename="gamestarfield.cpp" line="140"/>
<source>Show a warning when ESP plugins are enabled in the load order.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="143"/>
<source>Show a warning when light plugins are enabled in the load order.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="146"/>
<source>Show a warning when overlay-flagged plugins ar enabled in the load order.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="150"/>
<source>Show a warning when plugins.txt management is invalid.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="153"/>
<source>Bypass check for Plugins.txt Enabler. This may be useful if you use the ASI loader.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="157"/>
<location filename="gamestarfield.cpp" line="146"/>
<source>As of this release LOOT Starfield support is minimal to nonexistant. Toggle this to enable it anyway.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="455"/>
<location filename="gamestarfield.cpp" line="374"/>
<source>You have active ESP plugins in Starfield</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="457"/>
<source>You have active ESL plugins in Starfield</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="459"/>
<source>You have active overlay plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="461"/>
<location filename="gamestarfield.cpp" line="376"/>
<source>sTestFile entries are present</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="463"/>
<source>Plugins.txt Enabler missing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="gamestarfield.cpp" line="473"/>
<location filename="gamestarfield.cpp" line="386"/>
<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="488"/>
<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="501"/>
<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="512"/>
<location filename="gamestarfield.cpp" line="400"/>
<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="517"/>
<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>
</context>
<context>
<name>StarfieldModDataContent</name>
Expand Down
5 changes: 2 additions & 3 deletions src/gamestarfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ bool GameStarfield::init(IOrganizer* moInfo)
return false;
}

auto dataArchives =
std::make_shared<StarfieldDataArchives>(myGamesPath(), gameDirectory());
auto dataArchives = std::make_shared<StarfieldDataArchives>(this);
registerFeature(std::make_shared<StarfieldScriptExtender>(this));
registerFeature(dataArchives);
registerFeature(
std::make_shared<GamebryoLocalSavegames>(myGamesPath(), "StarfieldCustom.ini"));
std::make_shared<GamebryoLocalSavegames>(this, "StarfieldCustom.ini"));
registerFeature(std::make_shared<StarfieldModDataChecker>(this));
registerFeature(
std::make_shared<StarfieldModDataContent>(m_Organizer->gameFeatures()));
Expand Down
9 changes: 2 additions & 7 deletions src/starfielddataarchives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
#include "iprofile.h"
#include <utility.h>

StarfieldDataArchives::StarfieldDataArchives(const QDir& myGamesDir,
const QDir& gamePath)
: GamebryoDataArchives(myGamesDir), m_GamePath(gamePath.absolutePath())
{}

QStringList StarfieldDataArchives::vanillaArchives() const
{
return {"Starfield - Animations.ba2",
Expand Down Expand Up @@ -71,11 +66,11 @@ QStringList StarfieldDataArchives::archives(const MOBase::IProfile* profile) con
{
QStringList result;

QString defaultIniFile = m_GamePath.absoluteFilePath("Starfield.ini");
QString defaultIniFile = gameDirectory().absoluteFilePath("Starfield.ini");
QString customIniFile =
profile->localSettingsEnabled()
? QDir(profile->absolutePath()).absoluteFilePath("StarfieldCustom.ini")
: m_LocalGameDir.absoluteFilePath("StarfieldCustom.ini");
: localGameDirectory().absoluteFilePath("StarfieldCustom.ini");
QStringList archiveSettings = {"SResourceArchiveList", "sResourceIndexFileList",
"SResourceArchiveMemoryCacheList",
"sResourceStartUpArchiveList",
Expand Down
18 changes: 5 additions & 13 deletions src/starfielddataarchives.h
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
#ifndef STARFIELDDATAARCHIVES_H
#define STARFIELDDATAARCHIVES_H

#include "gamebryodataarchives.h"

namespace MOBase
{
class IProfile;
}

#include <QDir>
#include <QStringList>

#include "gamebryodataarchives.h"

class GameGamebryo;

class StarfieldDataArchives : public GamebryoDataArchives
{

public:
StarfieldDataArchives(const QDir& myGamesDir, const QDir& gamePath);
using GamebryoDataArchives::GamebryoDataArchives;

public:
virtual QStringList vanillaArchives() const override;
virtual QStringList archives(const MOBase::IProfile* profile) const override;
virtual void addArchive(MOBase::IProfile* profile, int index,
const QString& archiveName) override;
virtual void removeArchive(MOBase::IProfile* profile,
const QString& archiveName) override;

protected:
const QDir m_GamePath;

private:
virtual void writeArchiveList(MOBase::IProfile* profile,
const QStringList& before) override;
Expand Down

0 comments on commit 5379505

Please sign in to comment.