diff --git a/CMakeLists.txt b/CMakeLists.txt index ba8e4e0..4731285 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -SET(PROJ_NAME game_skyrimse) +SET(PROJ_NAME game_skyrimvr) PROJECT(${PROJ_NAME}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 838e9a4..a0cdda1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,7 +43,7 @@ ADD_LIBRARY(${PROJ_NAME} SHARED ${${PROJ_NAME}_HDRS} ${${PROJ_NAME}_SRCS} ${${PR TARGET_LINK_LIBRARIES(${PROJ_NAME} Qt5::Widgets ${Boost_LIBRARIES} - DbgHelp + DbgHelp uibase game_gamebryo liblz4 diff --git a/src/SConscript b/src/SConscript index 287c324..42e6f0a 100644 --- a/src/SConscript +++ b/src/SConscript @@ -2,11 +2,11 @@ Import('qt_env') env = qt_env.Clone() -env.AppendUnique(CPPDEFINES = [ 'GAMESKYRIMSE_LIBRARY' ]) +env.AppendUnique(CPPDEFINES = [ 'GAMESKYRIMVR_LIBRARY' ]) env.RequiresGamebryo() -lib = env.SharedLibrary('gameSkyrimSE', env.Glob('*.cpp')) +lib = env.SharedLibrary('gameSkyrimVR', env.Glob('*.cpp')) env.InstallModule(lib) res = env['QT_USED_MODULES'] diff --git a/src/game_skyrimse_en.ts b/src/game_skyrimvr_en.ts similarity index 70% rename from src/game_skyrimse_en.ts rename to src/game_skyrimvr_en.ts index f1e8340..069b6cf 100644 --- a/src/game_skyrimse_en.ts +++ b/src/game_skyrimvr_en.ts @@ -2,27 +2,27 @@ - GameSkyrimSE + GameSkyrimVR - - Adds support for the game Skyrim Special Edition. + + Adds support for the game Skyrim VR. QObject - + failed to query registry path (preflight): %1 - + failed to query registry path (read): %1 - + Some of your plugins have invalid names! These plugins can not be loaded by the game. Please see mo_interface.log for a list of affected plugins and rename them. diff --git a/src/gameskyrimse.cpp b/src/gameskyrimvr.cpp similarity index 67% rename from src/gameskyrimse.cpp rename to src/gameskyrimvr.cpp index b852836..11690e4 100644 --- a/src/gameskyrimse.cpp +++ b/src/gameskyrimvr.cpp @@ -1,10 +1,10 @@ -#include "gameskyrimse.h" +#include "gameskyrimvr.h" -#include "skyrimsedataarchives.h" -#include "skyrimsescriptextender.h" -#include "skyrimsesavegameinfo.h" -#include "skyrimsegameplugins.h" -#include "skyrimseunmanagedmods.h" +#include "skyrimvrdataarchives.h" +#include "skyrimvrscriptextender.h" +#include "skyrimvrsavegameinfo.h" +#include "skyrimvrgameplugins.h" +#include "skyrimvrunmanagedmods.h" #include #include "iplugingame.h" @@ -121,185 +121,176 @@ namespace { using namespace MOBase; -GameSkyrimSE::GameSkyrimSE() +GameSkyrimVR::GameSkyrimVR() { } -void GameSkyrimSE::setGamePath(const QString &path) +void GameSkyrimVR::setGamePath(const QString &path) { m_GamePath = path; } -QDir GameSkyrimSE::documentsDirectory() const +QDir GameSkyrimVR::documentsDirectory() const { return m_MyGamesPath; } -QString GameSkyrimSE::identifyGamePath() const +QString GameSkyrimVR::identifyGamePath() const { QString path = "Software\\Bethesda Softworks\\" + gameName(); return findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(), L"Installed Path"); } -QDir GameSkyrimSE::savesDirectory() const +QDir GameSkyrimVR::savesDirectory() const { return QDir(m_MyGamesPath + "/Saves"); } -QString GameSkyrimSE::myGamesPath() const +QString GameSkyrimVR::myGamesPath() const { return m_MyGamesPath; } -bool GameSkyrimSE::isInstalled() const +bool GameSkyrimVR::isInstalled() const { return !m_GamePath.isEmpty(); } -bool GameSkyrimSE::init(IOrganizer *moInfo) +bool GameSkyrimVR::init(IOrganizer *moInfo) { if (!GameGamebryo::init(moInfo)) { return false; } m_Organizer = moInfo; - m_GamePath = GameSkyrimSE::identifyGamePath(); + m_GamePath = GameSkyrimVR::identifyGamePath(); m_MyGamesPath = determineMyGamesPath(gameName()); - registerFeature(new SkyrimSEScriptExtender(this)); - registerFeature(new SkyrimSEDataArchives(myGamesPath())); - registerFeature(new GamebryoLocalSavegames(myGamesPath(), "Skyrim.ini")); - registerFeature(new SkyrimSESaveGameInfo(this)); - registerFeature(new SkyrimSEGamePlugins(moInfo)); - registerFeature(new SkyrimSEUnmangedMods(this)); + registerFeature(new SkyrimVRScriptExtender(this)); + registerFeature(new SkyrimVRDataArchives(myGamesPath())); + registerFeature(new GamebryoLocalSavegames(myGamesPath(), "SkyrimPrefs.ini")); + registerFeature(new SkyrimVRSaveGameInfo(this)); + registerFeature(new SkyrimVRGamePlugins(moInfo)); + registerFeature(new SkyrimVRUnmangedMods(this)); return true; } -QString GameSkyrimSE::gameName() const +QString GameSkyrimVR::gameName() const { - return "Skyrim Special Edition"; + return "Skyrim VR"; } -QList GameSkyrimSE::executables() const +QList GameSkyrimVR::executables() const { return QList() << ExecutableInfo("SKSE", findInGameFolder(feature()->loaderName())) - << ExecutableInfo("Skyrim Special Edition", findInGameFolder(binaryName())) - << ExecutableInfo("Skyrim Special Edition Launcher", findInGameFolder(getLauncherName())) + << ExecutableInfo("Skyrim VR", findInGameFolder(binaryName())) << ExecutableInfo("Creation Kit", findInGameFolder("CreationKit.exe")) << ExecutableInfo("LOOT", getLootPath()).withArgument("--game=\"Skyrim Special Edition\"") ; } -QFileInfo GameSkyrimSE::findInGameFolder(const QString &relativePath) const +QFileInfo GameSkyrimVR::findInGameFolder(const QString &relativePath) const { return QFileInfo(m_GamePath + "/" + relativePath); } -QString GameSkyrimSE::name() const +QString GameSkyrimVR::name() const { - return "Skyrim Special Edition Support Plugin"; + return "Skyrim VR Support Plugin"; } -QString GameSkyrimSE::author() const +QString GameSkyrimVR::author() const { - return "Archost & ZachHaber"; + return "Brixified"; } -QString GameSkyrimSE::description() const +QString GameSkyrimVR::description() const { - return tr("Adds support for the game Skyrim Special Edition."); + return tr("Adds support for the game Skyrim VR."); } -MOBase::VersionInfo GameSkyrimSE::version() const +MOBase::VersionInfo GameSkyrimVR::version() const { return VersionInfo(0, 1, 5, VersionInfo::RELEASE_ALPHA); } -bool GameSkyrimSE::isActive() const +bool GameSkyrimVR::isActive() const { return qApp->property("managed_game").value() == this; } -QList GameSkyrimSE::settings() const +QList GameSkyrimVR::settings() const { return QList(); } -void GameSkyrimSE::initializeProfile(const QDir &path, ProfileSettings settings) const +void GameSkyrimVR::initializeProfile(const QDir &path, ProfileSettings settings) const { if (settings.testFlag(IPluginGame::MODS)) { - copyToProfile(localAppFolder() + "/Skyrim Special Edition", path, "plugins.txt"); - copyToProfile(localAppFolder() + "/Skyrim Special Edition", path, "loadorder.txt"); + copyToProfile(localAppFolder() + "/Skyrim VR", path, "plugins.txt"); + copyToProfile(localAppFolder() + "/Skyrim VR", path, "loadorder.txt"); } if (settings.testFlag(IPluginGame::CONFIGURATION)) { - if (settings.testFlag(IPluginGame::PREFER_DEFAULTS) - || !QFileInfo(myGamesPath() + "/skyrim.ini").exists()) { - copyToProfile(gameDirectory().absolutePath(), path, "skyrim_default.ini", "skyrim.ini"); - } - else { - copyToProfile(myGamesPath(), path, "skyrim.ini"); - } - copyToProfile(myGamesPath(), path, "skyrimprefs.ini"); } } -QString GameSkyrimSE::savegameExtension() const +QString GameSkyrimVR::savegameExtension() const { return "ess"; } -QString GameSkyrimSE::savegameSEExtension() const +QString GameSkyrimVR::savegameSEExtension() const { return "skse"; } -QString GameSkyrimSE::steamAPPId() const +QString GameSkyrimVR::steamAPPId() const { - return "489830"; + return "611670"; } -QStringList GameSkyrimSE::primaryPlugins() const { - QStringList plugins = { "skyrim.esm", "update.esm", "dawnguard.esm", "hearthfires.esm", "dragonborn.esm" }; +QStringList GameSkyrimVR::primaryPlugins() const { + QStringList plugins = { "skyrim.esm", "update.esm", "dawnguard.esm", "hearthfires.esm", "dragonborn.esm", "skyrimvr.esm" }; plugins.append(CCPlugins()); return plugins; } -QStringList GameSkyrimSE::gameVariants() const +QStringList GameSkyrimVR::gameVariants() const { return{ "Regular" }; } -QString GameSkyrimSE::gameShortName() const +QString GameSkyrimVR::gameShortName() const { - return "skyrimse"; + return "Skyrim VR"; } -QString GameSkyrimSE::gameNexusName() const +QString GameSkyrimVR::gameNexusName() const { return "skyrimspecialedition"; } -QStringList GameSkyrimSE::iniFiles() const +QStringList GameSkyrimVR::iniFiles() const { - return{ "skyrim.ini", "skyrimprefs.ini" }; + return{ "skyrimprefs.ini" }; } -QStringList GameSkyrimSE::DLCPlugins() const +QStringList GameSkyrimVR::DLCPlugins() const { return{ "dawnguard.esm", "hearthfires.esm", "dragonborn.esm" }; } -QStringList GameSkyrimSE::CCPlugins() const +QStringList GameSkyrimVR::CCPlugins() const { QStringList plugins = {}; QFile file(gameDirectory().filePath("Skyrim.ccc")); @@ -326,28 +317,38 @@ QStringList GameSkyrimSE::CCPlugins() const return plugins; } -IPluginGame::LoadOrderMechanism GameSkyrimSE::loadOrderMechanism() const +IPluginGame::LoadOrderMechanism GameSkyrimVR::loadOrderMechanism() const { return IPluginGame::LoadOrderMechanism::PluginsTxt; } -int GameSkyrimSE::nexusModOrganizerID() const +int GameSkyrimVR::nexusModOrganizerID() const { return 6194; //... Should be 0? } -int GameSkyrimSE::nexusGameID() const +int GameSkyrimVR::nexusGameID() const { return 1704; //1704 } -QDir GameSkyrimSE::gameDirectory() const +QString GameSkyrimVR::getLauncherName() const +{ + return binaryName(); // Skyrim VR has no Launcher, so we just return the name of the game binary +} + +QDir GameSkyrimVR::gameDirectory() const { return QDir(m_GamePath); } +QString GameSkyrimVR::binaryName() const +{ + return "SkyrimVR.exe"; +} + // Not to delete all the spaces... -MappingType GameSkyrimSE::mappings() const +MappingType GameSkyrimVR::mappings() const { MappingType result; diff --git a/src/gameskyrimse.h b/src/gameskyrimvr.h similarity index 83% rename from src/gameskyrimse.h rename to src/gameskyrimvr.h index 14811d0..0504770 100644 --- a/src/gameskyrimse.h +++ b/src/gameskyrimvr.h @@ -1,26 +1,22 @@ -#ifndef _GAMESKYRIMSE_H -#define _GAMESKYRIMSE_H - +#ifndef _GAMESKYRIMVR_H +#define _GAMESKYRIMVR_H #include "gamegamebryo.h" #include #include -class GameSkyrimSE : public GameGamebryo +class GameSkyrimVR : public GameGamebryo { Q_OBJECT - - Q_PLUGIN_METADATA(IID "com.soundcontactstudio.GameSkyrimSE" FILE "gameskyrimse.json") + Q_PLUGIN_METADATA(IID "com.soundcontactstudio.GameSkyrimVR" FILE "gameskyrimVR.json") public: - - GameSkyrimSE(); + GameSkyrimVR(); virtual bool init(MOBase::IOrganizer *moInfo) override; public: // IPluginGame interface - virtual QString gameName() const override; virtual QList executables() const override; @@ -31,20 +27,21 @@ class GameSkyrimSE : public GameGamebryo virtual QStringList primaryPlugins() const override; virtual QStringList gameVariants() const override; virtual QString gameShortName() const override; - virtual QString gameNexusName() const override; + virtual QString gameNexusName() const override; virtual QStringList iniFiles() const override; virtual QStringList DLCPlugins() const override; virtual QStringList CCPlugins() const override; virtual LoadOrderMechanism loadOrderMechanism() const override; virtual int nexusModOrganizerID() const override; virtual int nexusGameID() const override; + virtual QString getLauncherName() const override; + virtual QString GameSkyrimVR::binaryName() const; virtual bool isInstalled() const override; virtual void setGamePath(const QString &path) override; virtual QDir gameDirectory() const override; public: // IPlugin interface - virtual QString name() const override; virtual QString author() const override; virtual QString description() const override; @@ -52,6 +49,8 @@ class GameSkyrimSE : public GameGamebryo virtual bool isActive() const override; virtual QList settings() const override; +public: // IPluginFileMapper + virtual MappingType mappings() const; protected: QDir documentsDirectory() const; @@ -59,16 +58,11 @@ class GameSkyrimSE : public GameGamebryo QFileInfo findInGameFolder(const QString &relativePath) const; QString myGamesPath() const; -public: // IPluginFileMapper - virtual MappingType mappings() const; - - private: MOBase::IOrganizer *m_Organizer; QString identifyGamePath() const; QString m_GamePath; QString m_MyGamesPath; - }; -#endif // _GAMESKYRIMSE_H +#endif // _GAMESKYRIMVR_H diff --git a/src/gameskyrimse.json b/src/gameskyrimvr.json similarity index 100% rename from src/gameskyrimse.json rename to src/gameskyrimvr.json diff --git a/src/gameskyrimse.pro b/src/gameskyrimvr.pro similarity index 62% rename from src/gameskyrimse.pro rename to src/gameskyrimvr.pro index 8636c0f..5237d62 100644 --- a/src/gameskyrimse.pro +++ b/src/gameskyrimvr.pro @@ -5,27 +5,27 @@ #------------------------------------------------- -TARGET = gameSkyrimSE +TARGET = gameSkyrimVR TEMPLATE = lib CONFIG += plugins CONFIG += dll -DEFINES += GAMESKYRIMSE_LIBRARY +DEFINES += GAMESKYRIMVR_LIBRARY -SOURCES += gameskyrimse.cpp \ - skyrimsebsainvalidation.cpp \ - skyrimsescriptextender.cpp \ - skyrimsedataarchives.cpp \ - skyrimsesavegame.cpp \ - skyrimsesavegameinfo.cpp +SOURCES += gameskyrimvr.cpp \ + skyrimvrbsainvalidation.cpp \ + skyrimvrscriptextender.cpp \ + skyrimvrdataarchives.cpp \ + skyrimvrsavegame.cpp \ + skyrimvrsavegameinfo.cpp -HEADERS += gameskyrimse.h \ - skyrimsebsainvalidation.h \ - skyrimsescriptextender.h \ - skyrimsedataarchives.h \ - skyrimsesavegame.h \ - skyrimsesavegameinfo.h +HEADERS += gameskyrimvr.h \ + skyrimvrbsainvalidation.h \ + skyrimvrscriptextender.h \ + skyrimvrdataarchives.h \ + skyrimvrsavegame.h \ + skyrimvrsavegameinfo.h CONFIG(debug, debug|release) { LIBS += -L"$${OUT_PWD}/../gameGamebryo/debug" @@ -44,7 +44,7 @@ INCLUDEPATH += "$${BOOSTPATH}" "$${PWD}/../gamefeatures" "$${PWD}/../gamegamebry LIBS += -ladvapi32 -lole32 -lgameGamebryo OTHER_FILES += \ - gameskyrimse.json\ + gameskyrimvr.json\ SConscript \ CMakeLists.txt diff --git a/src/skyrimsesavegame.h b/src/skyrimsesavegame.h deleted file mode 100644 index 0fe7c3d..0000000 --- a/src/skyrimsesavegame.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _SKYRIMSESAVEGAME_H -#define _SKYRIMSESAVEGAME_H - -#include "gamebryosavegame.h" - -namespace MOBase { class IPluginGame; } - -class SkyrimSESaveGame : public GamebryoSaveGame -{ -public: - SkyrimSESaveGame(QString const &fileName, MOBase::IPluginGame const *game, bool const lightEnabled = true); -}; - -#endif // _SKYRIMSESAVEGAME_H diff --git a/src/skyrimsesavegameinfo.cpp b/src/skyrimsesavegameinfo.cpp deleted file mode 100644 index c5339c0..0000000 --- a/src/skyrimsesavegameinfo.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "skyrimSEsavegameinfo.h" - -#include "skyrimSEsavegame.h" -#include "gamegamebryo.h" - -SkyrimSESaveGameInfo::SkyrimSESaveGameInfo(GameGamebryo const *game) : - GamebryoSaveGameInfo(game) -{ -} - -SkyrimSESaveGameInfo::~SkyrimSESaveGameInfo() -{ -} - -const MOBase::ISaveGame *SkyrimSESaveGameInfo::getSaveGameInfo(const QString &file) const -{ - return new SkyrimSESaveGame(file, m_Game); -} - diff --git a/src/skyrimsesavegameinfo.h b/src/skyrimsesavegameinfo.h deleted file mode 100644 index c1a8fe3..0000000 --- a/src/skyrimsesavegameinfo.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SKYRIMSAVEGAMEINFO_H -#define _SKYRIMSAVEGAMEINFO_H - -#include "gamebryosavegameinfo.h" - -class GameGamebryo; - -class SkyrimSESaveGameInfo : public GamebryoSaveGameInfo -{ -public: - SkyrimSESaveGameInfo(GameGamebryo const *game); - ~SkyrimSESaveGameInfo(); - - virtual MOBase::ISaveGame const *getSaveGameInfo(QString const &file) const override; -}; - -#endif // _SKYRIMSAVEGAMEINFO_H diff --git a/src/skyrimsescriptextender.cpp b/src/skyrimsescriptextender.cpp deleted file mode 100644 index 5e09f3c..0000000 --- a/src/skyrimsescriptextender.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "skyrimSEscriptextender.h" - -#include -#include - -SkyrimSEScriptExtender::SkyrimSEScriptExtender(GameGamebryo const *game) : - GamebryoScriptExtender(game) -{ -} - -QString SkyrimSEScriptExtender::BinaryName() const -{ - return "skse64_loader.exe"; -} - -QString SkyrimSEScriptExtender::PluginPath() const -{ - return "skse/plugins"; -} - -QStringList SkyrimSEScriptExtender::saveGameAttachmentExtensions() const -{ - return { }; -} diff --git a/src/skyrimseunmanagedmods.h b/src/skyrimseunmanagedmods.h deleted file mode 100644 index c9be037..0000000 --- a/src/skyrimseunmanagedmods.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _SKYRIMSEUNMANAGEDMODS_H -#define _SKYRIMSEUNMANAGEDMODS_H - - -#include "gamebryounmanagedmods.h" -#include - - -class SkyrimSEUnmangedMods : public GamebryoUnmangedMods { -public: - SkyrimSEUnmangedMods(const GameGamebryo *game); - ~SkyrimSEUnmangedMods(); - - virtual QStringList mods(bool onlyOfficial) const override; -}; - - - -#endif // _SKYRIMSEUNMANAGEDMODS_H diff --git a/src/skyrimsedataarchives.cpp b/src/skyrimvrdataarchives.cpp similarity index 80% rename from src/skyrimsedataarchives.cpp rename to src/skyrimvrdataarchives.cpp index 91921ea..e286faf 100644 --- a/src/skyrimsedataarchives.cpp +++ b/src/skyrimvrdataarchives.cpp @@ -1,13 +1,13 @@ -#include "skyrimSEdataarchives.h" +#include "skyrimvrdataarchives.h" #include "iprofile.h" #include -SkyrimSEDataArchives::SkyrimSEDataArchives(const QDir &myGamesDir) : +SkyrimVRDataArchives::SkyrimVRDataArchives(const QDir &myGamesDir) : GamebryoDataArchives(myGamesDir) {} -QStringList SkyrimSEDataArchives::vanillaArchives() const +QStringList SkyrimVRDataArchives::vanillaArchives() const { return{ "Skyrim - Textures0.bsa" , "Skyrim - Textures1.bsa" @@ -25,11 +25,13 @@ QStringList SkyrimSEDataArchives::vanillaArchives() const , "Skyrim - Interface.bsa" , "Skyrim - Animations.bsa" , "Skyrim - Shaders.bsa" - , "Skyrim - Misc.bsa" }; + , "Skyrim - Misc.bsa" + , "Skyrim - Patch.bsa" + , "Skyrim_VR - Main.bsa" }; } -QStringList SkyrimSEDataArchives::archives(const MOBase::IProfile *profile) const +QStringList SkyrimVRDataArchives::archives(const MOBase::IProfile *profile) const { QStringList result; @@ -40,7 +42,7 @@ QStringList SkyrimSEDataArchives::archives(const MOBase::IProfile *profile) cons return result; } -void SkyrimSEDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before) +void SkyrimVRDataArchives::writeArchiveList(MOBase::IProfile *profile, const QStringList &before) { QString list = before.join(", "); diff --git a/src/skyrimsedataarchives.h b/src/skyrimvrdataarchives.h similarity index 65% rename from src/skyrimsedataarchives.h rename to src/skyrimvrdataarchives.h index 5f4fbef..7ed603b 100644 --- a/src/skyrimsedataarchives.h +++ b/src/skyrimvrdataarchives.h @@ -1,5 +1,5 @@ -#ifndef _SKYRIMSEDATAARCHIVES_H -#define _SKYRIMSEDATAARCHIVES_H +#ifndef _SKYRIMVRDATAARCHIVES_H +#define _SKYRIMVRDATAARCHIVES_H #include "gamebryodataarchives.h" #include @@ -8,12 +8,12 @@ namespace MOBase { class IProfile; } -class SkyrimSEDataArchives : public GamebryoDataArchives +class SkyrimVRDataArchives : public GamebryoDataArchives { public: - SkyrimSEDataArchives(const QDir &myGamesDir); + SkyrimVRDataArchives(const QDir &myGamesDir); public: @@ -26,4 +26,4 @@ class SkyrimSEDataArchives : public GamebryoDataArchives }; -#endif // _SKYRIMSEDATAARCHIVES_H +#endif // _SKYRIMVRDATAARCHIVES_H diff --git a/src/skyrimsegameplugins.cpp b/src/skyrimvrgameplugins.cpp similarity index 74% rename from src/skyrimsegameplugins.cpp rename to src/skyrimvrgameplugins.cpp index 7657ab9..df0700b 100644 --- a/src/skyrimsegameplugins.cpp +++ b/src/skyrimvrgameplugins.cpp @@ -1,4 +1,4 @@ -#include "skyrimSEgameplugins.h" +#include "skyrimvrgameplugins.h" #include #include #include @@ -16,12 +16,12 @@ using MOBase::IOrganizer; using MOBase::SafeWriteFile; using MOBase::reportError; -SkyrimSEGamePlugins::SkyrimSEGamePlugins(IOrganizer *organizer) +SkyrimVRGamePlugins::SkyrimVRGamePlugins(IOrganizer *organizer) : GamebryoGamePlugins(organizer) { } -void SkyrimSEGamePlugins::writePluginList(const IPluginList *pluginList, +void SkyrimVRGamePlugins::writePluginList(const IPluginList *pluginList, const QString &filePath) { SafeWriteFile file(filePath); @@ -45,23 +45,22 @@ void SkyrimSEGamePlugins::writePluginList(const IPluginList *pluginList, //TODO: do not write plugins in OFFICIAL_FILES container for (const QString &pluginName : plugins) { - if (!PrimaryPlugins.contains(pluginName,Qt::CaseInsensitive)) { + if (!PrimaryPlugins.contains(pluginName,Qt::CaseInsensitive)) { if (pluginList->state(pluginName) == IPluginList::STATE_ACTIVE) { if (!textCodec->canEncode(pluginName)) { invalidFileNames = true; qCritical("invalid plugin name %s", qPrintable(pluginName)); } else - { + { file->write("*"); file->write(textCodec->fromUnicode(pluginName)); - } file->write("\r\n"); ++writtenCount; } - else - { + else + { if (!textCodec->canEncode(pluginName)) { invalidFileNames = true; qCritical("invalid plugin name %s", qPrintable(pluginName)); @@ -72,7 +71,7 @@ void SkyrimSEGamePlugins::writePluginList(const IPluginList *pluginList, } file->write("\r\n"); ++writtenCount; - } + } } } @@ -88,7 +87,7 @@ void SkyrimSEGamePlugins::writePluginList(const IPluginList *pluginList, } } -bool SkyrimSEGamePlugins::readPluginList(MOBase::IPluginList *pluginList, +bool SkyrimVRGamePlugins::readPluginList(MOBase::IPluginList *pluginList, bool useLoadOrder) { QStringList plugins = pluginList->pluginNames(); @@ -122,33 +121,33 @@ bool SkyrimSEGamePlugins::readPluginList(MOBase::IPluginList *pluginList, if ((line.size() > 0) && (line.at(0) != '#')) { pluginName = localCodec()->toUnicode(line.trimmed().constData()); } - if (!primaryPlugins.contains(pluginName, Qt::CaseInsensitive)) { - if (pluginName.startsWith('*')) { - pluginName.remove(0, 1); - if (pluginName.size() > 0) { - pluginList->setState(pluginName, IPluginList::STATE_ACTIVE); - plugins.removeAll(pluginName); - if (!loadOrder.contains(pluginName, Qt::CaseInsensitive)) { - loadOrder.append(pluginName); - } - } - } - else - { - if (pluginName.size() > 0) { - pluginList->setState(pluginName, IPluginList::STATE_INACTIVE); - plugins.removeAll(pluginName); - if (!loadOrder.contains(pluginName, Qt::CaseInsensitive)) { - loadOrder.append(pluginName); - } - } - } - } - else - { - pluginName.remove(0, 1); - plugins.removeAll(pluginName); - } + if (!primaryPlugins.contains(pluginName, Qt::CaseInsensitive)) { + if (pluginName.startsWith('*')) { + pluginName.remove(0, 1); + if (pluginName.size() > 0) { + pluginList->setState(pluginName, IPluginList::STATE_ACTIVE); + plugins.removeAll(pluginName); + if (!loadOrder.contains(pluginName, Qt::CaseInsensitive)) { + loadOrder.append(pluginName); + } + } + } + else + { + if (pluginName.size() > 0) { + pluginList->setState(pluginName, IPluginList::STATE_INACTIVE); + plugins.removeAll(pluginName); + if (!loadOrder.contains(pluginName, Qt::CaseInsensitive)) { + loadOrder.append(pluginName); + } + } + } + } + else + { + pluginName.remove(0, 1); + plugins.removeAll(pluginName); + } } file.close(); diff --git a/src/skyrimsegameplugins.h b/src/skyrimvrgameplugins.h similarity index 68% rename from src/skyrimsegameplugins.h rename to src/skyrimvrgameplugins.h index 3ef14f7..775e2a7 100644 --- a/src/skyrimsegameplugins.h +++ b/src/skyrimvrgameplugins.h @@ -1,5 +1,5 @@ -#ifndef _SKYRIMSEGAMEPLUGINS_H -#define _SKYRIMSEGAMEPLUGINS_H +#ifndef _SKYRIMVRGAMEPLUGINS_H +#define _SKYRIMVRGAMEPLUGINS_H #include @@ -8,10 +8,10 @@ #include -class SkyrimSEGamePlugins : public GamebryoGamePlugins +class SkyrimVRGamePlugins : public GamebryoGamePlugins { public: - SkyrimSEGamePlugins(MOBase::IOrganizer *organizer); + SkyrimVRGamePlugins(MOBase::IOrganizer *organizer); protected: virtual void writePluginList(const MOBase::IPluginList *pluginList, @@ -23,4 +23,4 @@ class SkyrimSEGamePlugins : public GamebryoGamePlugins std::map m_LastSaveHash; }; -#endif // _SKYRIMSEGAMEPLUGINS_H +#endif // _SKYRIMVRGAMEPLUGINS_H diff --git a/src/skyrimsesavegame.cpp b/src/skyrimvrsavegame.cpp similarity index 72% rename from src/skyrimsesavegame.cpp rename to src/skyrimvrsavegame.cpp index dbc4f10..b05b914 100644 --- a/src/skyrimsesavegame.cpp +++ b/src/skyrimvrsavegame.cpp @@ -1,12 +1,12 @@ -#include "skyrimSEsavegame.h" +#include "skyrimvrsavegame.h" #include -SkyrimSESaveGame::SkyrimSESaveGame(QString const &fileName, MOBase::IPluginGame const *game, bool const lightEnabled) : +SkyrimVRSaveGame::SkyrimVRSaveGame(QString const &fileName, MOBase::IPluginGame const *game, bool const lightEnabled) : GamebryoSaveGame(fileName, game, lightEnabled) { FileWrapper file(this, "TESV_SAVEGAME"); //10bytes - unsigned long headerSize; + unsigned long headerSize; file.read(headerSize); // header size "TESV_SAVEGAME" file.skip(); // header version 74. Original Skyrim is 79 file.read(m_SaveNumber); @@ -37,11 +37,11 @@ SkyrimSESaveGame::SkyrimSESaveGame(QString const &fileName, MOBase::IPluginGame //For some reason, the file time is off by about 6 hours. //So we need to subtract those 6 hours from the filetime. _ULARGE_INTEGER time; - time.LowPart=ftime.dwLowDateTime; - time.HighPart=ftime.dwHighDateTime; - time.QuadPart-=2.16e11; - ftime.dwHighDateTime=time.HighPart; - ftime.dwLowDateTime=time.LowPart; + time.LowPart = ftime.dwLowDateTime; + time.HighPart = ftime.dwHighDateTime; + time.QuadPart -= 2.16e11; + ftime.dwHighDateTime = time.HighPart; + ftime.dwLowDateTime = time.LowPart; SYSTEMTIME ctime; ::FileTimeToSystemTime(&ftime, &ctime); @@ -55,19 +55,19 @@ SkyrimSESaveGame::SkyrimSESaveGame(QString const &fileName, MOBase::IPluginGame file.read(m_CompressionType); - file.readImage(width,height,320,true); + file.readImage(width, height, 320, true); file.openCompressedData(); - uint8_t saveGameVersion = file.readChar(); - uint8_t pluginInfoSize = file.readChar(); - uint16_t other = file.readShort(); //Unknown + uint8_t saveGameVersion = file.readChar(); + uint8_t pluginInfoSize = file.readChar(); + uint16_t other = file.readShort(); //Unknown file.readPlugins(1); // Just empty data - if (saveGameVersion >= 78) { - file.readLightPlugins(); - } + if (saveGameVersion >= 78) { + file.readLightPlugins(); + } file.closeCompressedData(); } diff --git a/src/skyrimvrsavegame.h b/src/skyrimvrsavegame.h new file mode 100644 index 0000000..5f274da --- /dev/null +++ b/src/skyrimvrsavegame.h @@ -0,0 +1,14 @@ +#ifndef _SKYRIMVRSAVEGAME_H +#define _SKYRIMVRSAVEGAME_H + +#include "gamebryosavegame.h" + +namespace MOBase { class IPluginGame; } + +class SkyrimVRSaveGame : public GamebryoSaveGame +{ +public: + SkyrimVRSaveGame(QString const &fileName, MOBase::IPluginGame const *game, bool const lightEnabled = true); +}; + +#endif // _SKYRIMVRSAVEGAME_H diff --git a/src/skyrimvrsavegameinfo.cpp b/src/skyrimvrsavegameinfo.cpp new file mode 100644 index 0000000..9f1bd18 --- /dev/null +++ b/src/skyrimvrsavegameinfo.cpp @@ -0,0 +1,18 @@ +#include "skyrimvrsavegameinfo.h" + +#include "skyrimvrsavegame.h" +#include "gamegamebryo.h" + +SkyrimVRSaveGameInfo::SkyrimVRSaveGameInfo(GameGamebryo const *game) : + GamebryoSaveGameInfo(game) +{ +} + +SkyrimVRSaveGameInfo::~SkyrimVRSaveGameInfo() +{ +} + +const MOBase::ISaveGame *SkyrimVRSaveGameInfo::getSaveGameInfo(const QString &file) const +{ + return new SkyrimVRSaveGame(file, m_Game); +} diff --git a/src/skyrimvrsavegameinfo.h b/src/skyrimvrsavegameinfo.h new file mode 100644 index 0000000..677ec1d --- /dev/null +++ b/src/skyrimvrsavegameinfo.h @@ -0,0 +1,17 @@ +#ifndef _SKYRIMVRSAVEGAMEINFO_H +#define _SKYRIMVRSAVEGAMEINFO_H + +#include "gamebryosavegameinfo.h" + +class GameGamebryo; + +class SkyrimVRSaveGameInfo : public GamebryoSaveGameInfo +{ +public: + SkyrimVRSaveGameInfo(GameGamebryo const *game); + ~SkyrimVRSaveGameInfo(); + + virtual MOBase::ISaveGame const *getSaveGameInfo(QString const &file) const override; +}; + +#endif // _SKYRIMVRSAVEGAMEINFO_H diff --git a/src/skyrimvrscriptextender.cpp b/src/skyrimvrscriptextender.cpp new file mode 100644 index 0000000..6a13354 --- /dev/null +++ b/src/skyrimvrscriptextender.cpp @@ -0,0 +1,24 @@ +#include "skyrimvrscriptextender.h" + +#include +#include + +SkyrimVRScriptExtender::SkyrimVRScriptExtender(GameGamebryo const *game) : + GamebryoScriptExtender(game) +{ +} + +QString SkyrimVRScriptExtender::BinaryName() const +{ + return "skse64_loader.exe"; +} + +QString SkyrimVRScriptExtender::PluginPath() const +{ + return "skse/plugins"; +} + +QStringList SkyrimVRScriptExtender::saveGameAttachmentExtensions() const +{ + return { }; +} diff --git a/src/skyrimsescriptextender.h b/src/skyrimvrscriptextender.h similarity index 52% rename from src/skyrimsescriptextender.h rename to src/skyrimvrscriptextender.h index df1337a..4afc8a0 100644 --- a/src/skyrimsescriptextender.h +++ b/src/skyrimvrscriptextender.h @@ -1,14 +1,14 @@ -#ifndef _SKYRIMSESCRIPTEXTENDER_H -#define _SKYRIMSESCRIPTEXTENDER_H +#ifndef _SKYRIMVRSCRIPTEXTENDER_H +#define _SKYRIMVRSCRIPTEXTENDER_H #include "gamebryoscriptextender.h" class GameGamebryo; -class SkyrimSEScriptExtender : public GamebryoScriptExtender +class SkyrimVRScriptExtender : public GamebryoScriptExtender { public: - SkyrimSEScriptExtender(GameGamebryo const *game); + SkyrimVRScriptExtender(GameGamebryo const *game); virtual QString BinaryName() const override; virtual QString PluginPath() const override; @@ -17,4 +17,4 @@ class SkyrimSEScriptExtender : public GamebryoScriptExtender }; -#endif // _SKYRIMSESCRIPTEXTENDER_H +#endif // _SKYRIMVRSCRIPTEXTENDER_H diff --git a/src/skyrimseunmanagedmods.cpp b/src/skyrimvrunmanagedmods.cpp similarity index 76% rename from src/skyrimseunmanagedmods.cpp rename to src/skyrimvrunmanagedmods.cpp index 14fd3e4..a75a43d 100644 --- a/src/skyrimseunmanagedmods.cpp +++ b/src/skyrimvrunmanagedmods.cpp @@ -1,14 +1,13 @@ -#include "skyrimSEunmanagedmods.h" +#include "skyrimvrunmanagedmods.h" - -SkyrimSEUnmangedMods::SkyrimSEUnmangedMods(const GameGamebryo *game) +SkyrimVRUnmangedMods::SkyrimVRUnmangedMods(const GameGamebryo *game) : GamebryoUnmangedMods(game) {} -SkyrimSEUnmangedMods::~SkyrimSEUnmangedMods() +SkyrimVRUnmangedMods::~SkyrimVRUnmangedMods() {} -QStringList SkyrimSEUnmangedMods::mods(bool onlyOfficial) const { +QStringList SkyrimVRUnmangedMods::mods(bool onlyOfficial) const { QStringList result; QStringList pluginList = game()->primaryPlugins(); @@ -29,4 +28,3 @@ QStringList SkyrimSEUnmangedMods::mods(bool onlyOfficial) const { return result; } - diff --git a/src/skyrimvrunmanagedmods.h b/src/skyrimvrunmanagedmods.h new file mode 100644 index 0000000..67846b6 --- /dev/null +++ b/src/skyrimvrunmanagedmods.h @@ -0,0 +1,15 @@ +#ifndef _SKYRIMVRUNMANAGEDMODS_H +#define _SKYRIMVRUNMANAGEDMODS_H + +#include "gamebryounmanagedmods.h" +#include + +class SkyrimVRUnmangedMods : public GamebryoUnmangedMods { +public: + SkyrimVRUnmangedMods(const GameGamebryo *game); + ~SkyrimVRUnmangedMods(); + + virtual QStringList mods(bool onlyOfficial) const override; +}; + +#endif // _SKYRIMVRUNMANAGEDMODS_H