From 6a48522f80c707892a0d4f3dd4283bf71cc2565b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Fri, 14 Jun 2024 18:05:12 +0200 Subject: [PATCH] Update following gamebryo updates for myGamesPath() in game feature. --- src/game_skyrimse_en.ts | 4 ++-- src/gameskyrimse.cpp | 10 ++-------- src/skyrimsedataarchives.cpp | 8 ++------ src/skyrimsedataarchives.h | 5 +---- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/game_skyrimse_en.ts b/src/game_skyrimse_en.ts index 903011a..53d72ca 100644 --- a/src/game_skyrimse_en.ts +++ b/src/game_skyrimse_en.ts @@ -4,12 +4,12 @@ GameSkyrimSE - + Skyrim Special Edition Support Plugin - + Adds support for the game Skyrim Special Edition. diff --git a/src/gameskyrimse.cpp b/src/gameskyrimse.cpp index f911b94..75197cf 100644 --- a/src/gameskyrimse.cpp +++ b/src/gameskyrimse.cpp @@ -93,10 +93,6 @@ void GameSkyrimSE::setGamePath(const QString& path) m_GamePath = path; checkVariants(); m_MyGamesPath = determineMyGamesPath(gameDirectoryName()); - - registerFeature(std::make_shared(myGamesPath())); - registerFeature( - std::make_shared(myGamesPath(), "Skyrimcustom.ini")); } QDir GameSkyrimSE::savesDirectory() const @@ -120,11 +116,9 @@ bool GameSkyrimSE::init(IOrganizer* moInfo) return false; } - registerFeature(std::make_shared(myGamesPath())); registerFeature(std::make_shared(this)); - registerFeature(std::make_shared(myGamesPath())); - registerFeature( - std::make_shared(myGamesPath(), "Skyrimcustom.ini")); + registerFeature(std::make_shared(this)); + registerFeature(std::make_shared(this, "Skyrimcustom.ini")); registerFeature(std::make_shared(this)); registerFeature( std::make_shared(m_Organizer->gameFeatures())); diff --git a/src/skyrimsedataarchives.cpp b/src/skyrimsedataarchives.cpp index b4d338f..d92ad21 100644 --- a/src/skyrimsedataarchives.cpp +++ b/src/skyrimsedataarchives.cpp @@ -3,10 +3,6 @@ #include "iprofile.h" #include -SkyrimSEDataArchives::SkyrimSEDataArchives(const QDir& myGamesDir) - : GamebryoDataArchives(myGamesDir) -{} - QStringList SkyrimSEDataArchives::vanillaArchives() const { return {"Skyrim - Textures0.bsa", "Skyrim - Textures1.bsa", "Skyrim - Textures2.bsa", @@ -23,7 +19,7 @@ QStringList SkyrimSEDataArchives::archives(const MOBase::IProfile* profile) cons QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : m_LocalGameDir.absoluteFilePath("skyrim.ini"); + : localGameDirectory().absoluteFilePath("skyrim.ini"); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); result.append(getArchivesFromKey(iniFile, "SResourceArchiveList2")); @@ -37,7 +33,7 @@ void SkyrimSEDataArchives::writeArchiveList(MOBase::IProfile* profile, QString iniFile = profile->localSettingsEnabled() ? QDir(profile->absolutePath()).absoluteFilePath("skyrim.ini") - : m_LocalGameDir.absoluteFilePath("skyrim.ini"); + : localGameDirectory().absoluteFilePath("skyrim.ini"); if (list.length() > 255) { int splitIdx = list.lastIndexOf(",", 256); setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); diff --git a/src/skyrimsedataarchives.h b/src/skyrimsedataarchives.h index edd5838..b3d70c1 100644 --- a/src/skyrimsedataarchives.h +++ b/src/skyrimsedataarchives.h @@ -12,11 +12,8 @@ class IProfile; class SkyrimSEDataArchives : public GamebryoDataArchives { + using GamebryoDataArchives::GamebryoDataArchives; -public: - SkyrimSEDataArchives(const QDir& myGamesDir); - -public: virtual QStringList vanillaArchives() const override; virtual QStringList archives(const MOBase::IProfile* profile) const override;