diff --git a/src/gamestarfield.cpp b/src/gamestarfield.cpp index 8f39e83..5307f2e 100644 --- a/src/gamestarfield.cpp +++ b/src/gamestarfield.cpp @@ -125,17 +125,12 @@ QString GameStarfield::description() const MOBase::VersionInfo GameStarfield::version() const { - return VersionInfo(0, 5, 0, VersionInfo::RELEASE_BETA); + return VersionInfo(1, 0, 0, VersionInfo::RELEASE_CANDIDATE); } QList GameStarfield::settings() const { return QList() - << PluginSetting("enable_plugin_management", - tr("Turn on plugin management. As of Starfield 1.7.33 this " - "REQUIRES fixing 'plugins.txt' with a SFSE plugin. This " - "will do nothing otherwise."), - false) << PluginSetting( "enable_esp_warning", tr("Show a warning when ESP plugins are enabled in the load order."), @@ -153,8 +148,7 @@ QList GameStarfield::settings() const MappingType GameStarfield::mappings() const { MappingType result; - if (m_Organizer->pluginSetting(name(), "enable_plugin_management").toBool() && - testFilePlugins().isEmpty()) { + if (testFilePlugins().isEmpty()) { for (const QString& profileFile : {"plugins.txt", "loadorder.txt"}) { result.push_back({m_Organizer->profilePath() + "/" + profileFile, localAppFolder() + "/" + gameShortName() + "/" + profileFile, @@ -300,16 +294,14 @@ QStringList GameStarfield::CCPlugins() const IPluginGame::SortMechanism GameStarfield::sortMechanism() const { - if (m_Organizer->pluginSetting(name(), "enable_plugin_management").toBool() && - testFilePlugins().isEmpty()) + if (testFilePlugins().isEmpty()) return IPluginGame::SortMechanism::LOOT; return IPluginGame::SortMechanism::NONE; } IPluginGame::LoadOrderMechanism GameStarfield::loadOrderMechanism() const { - if (m_Organizer->pluginSetting(name(), "enable_plugin_management").toBool() && - testFilePlugins().isEmpty()) + if (testFilePlugins().isEmpty()) return IPluginGame::LoadOrderMechanism::PluginsTxt; return IPluginGame::LoadOrderMechanism::None; } @@ -422,8 +414,7 @@ bool GameStarfield::activeOverlay() const bool GameStarfield::testFilePresent() const { - if (m_Organizer->pluginSetting(name(), "enable_plugin_management").toBool() && - !testFilePlugins().isEmpty()) + if (!testFilePlugins().isEmpty()) return true; return false; } diff --git a/src/starfielddataarchives.cpp b/src/starfielddataarchives.cpp index ffbbc7c..3604bed 100644 --- a/src/starfielddataarchives.cpp +++ b/src/starfielddataarchives.cpp @@ -71,30 +71,33 @@ QStringList StarfieldDataArchives::archives(const MOBase::IProfile* profile) con { QStringList result; - QString iniFile = m_GamePath.absoluteFilePath("Starfield.ini"); - result.append(getArchivesFromKey(iniFile, "SResourceArchiveList")); - result.append(getArchivesFromKey(iniFile, "sResourceIndexFileList")); - result.append(getArchivesFromKey(iniFile, "SResourceArchiveMemoryCacheList")); - result.append(getArchivesFromKey(iniFile, "sResourceStartUpArchiveList")); - result.append(getArchivesFromKey(iniFile, "sResourceEnglishVoiceList")); + QString defaultIniFile = m_GamePath.absoluteFilePath("Starfield.ini"); + QString customIniFile = + profile->localSettingsEnabled() + ? QDir(profile->absolutePath()).absoluteFilePath("StarfieldCustom.ini") + : m_LocalGameDir.absoluteFilePath("StarfieldCustom.ini"); + QStringList archiveSettings = {"SResourceArchiveList", "sResourceIndexFileList", + "SResourceArchiveMemoryCacheList", + "sResourceStartUpArchiveList", + "sResourceEnglishVoiceList"}; + for (auto setting : archiveSettings) { + auto archives = getArchivesFromKey(customIniFile, setting, 1023); + if (archives.isEmpty()) + archives = getArchivesFromKey(defaultIniFile, setting, 1023); + result.append(archives); + } return result; } void StarfieldDataArchives::writeArchiveList(MOBase::IProfile* profile, const QStringList& before) -{ - QString list = before.join(", "); +{} - QString iniFile = - profile->localSettingsEnabled() - ? QDir(profile->absolutePath()).absoluteFilePath("Starfield.ini") - : m_LocalGameDir.absoluteFilePath("Starfield.ini"); - if (list.length() > 255) { - int splitIdx = list.lastIndexOf(",", 256); - setArchivesToKey(iniFile, "SResourceArchiveList", list.mid(0, splitIdx)); - setArchivesToKey(iniFile, "SResourceArchiveList2", list.mid(splitIdx + 2)); - } else { - setArchivesToKey(iniFile, "SResourceArchiveList", list); - } -} +void StarfieldDataArchives::addArchive(MOBase::IProfile* profile, int index, + const QString& archiveName) +{} + +void StarfieldDataArchives::removeArchive(MOBase::IProfile* profile, + const QString& archiveName) +{} \ No newline at end of file diff --git a/src/starfielddataarchives.h b/src/starfielddataarchives.h index 9da5c81..f889c00 100644 --- a/src/starfielddataarchives.h +++ b/src/starfielddataarchives.h @@ -20,6 +20,10 @@ class StarfieldDataArchives : public 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; diff --git a/src/starfieldsavegame.cpp b/src/starfieldsavegame.cpp index f5a2710..1b75c65 100644 --- a/src/starfieldsavegame.cpp +++ b/src/starfieldsavegame.cpp @@ -28,16 +28,26 @@ StarfieldSaveGame::StarfieldSaveGame(QString const& fileName, GameStarfield cons void StarfieldSaveGame::getData(FileWrapper& file) const { file.skip(); // header version - file.skip(); // zip start location - file.skip(); // unknown + file.skip(); // chunk compressed size array start location + file.skip(); // unknown (0?) file.setCompressionType(1); - file.openCompressedData(); // long = start, long = size - // double - // float - // long - // long - // short - return; + /* + * Parse following variables then begin decompressing data + * - 64-bit int = compressed data start location + * - 64-bit int = complete uncompressed data size + */ + file.openCompressedData(); + /* + * Remaining headers before start of compressed data: + * - 32-bit float (version? appears to be 2.0) + * - 64-bit int - size of uncompressed chunks (250 KiB) + * - 64-bit int - size of byte rows? (16 bytes) used to determine start of each + * compressed chunk + * - 32-bit int - number of chunks? + * - 'ZIP ' - denotes start of chunk compressed size array + * - compressed size array - array of 32-bit ints containing the compressed size of + * each compressed chunk (see number of chunks above) + */ } void StarfieldSaveGame::fetchInformationFields( @@ -102,10 +112,8 @@ std::unique_ptr StarfieldSaveGame::fetchDataFields file.read(ignore); // game version again? file.readInt(); // plugin info size - fields->Plugins = file.readPlugins(); - if (saveGameVersion >= 82) { - fields->LightPlugins = file.readLightPlugins(); - } + fields->Plugins = file.readPlugins(); + fields->LightPlugins = file.readLightPlugins(); file.closeCompressedData(); file.close();