From 8aa6dc4c7dcf4139cd0144207a327013bd3cb1dc Mon Sep 17 00:00:00 2001 From: Tannin Date: Thu, 29 Jan 2015 19:26:42 +0100 Subject: extended the game-plugin interface --- src/shared/fallout3info.cpp | 46 ++------------------------------ src/shared/fallout3info.h | 45 ++++++++++++++++++++++--------- src/shared/falloutnvinfo.cpp | 63 -------------------------------------------- src/shared/falloutnvinfo.h | 43 +++++++++++++++++++++--------- src/shared/gameinfo.h | 55 +------------------------------------- src/shared/oblivioninfo.cpp | 48 +++------------------------------ src/shared/oblivioninfo.h | 45 ++++++++++++++++++++++--------- src/shared/skyriminfo.cpp | 56 +-------------------------------------- src/shared/skyriminfo.h | 16 ----------- 9 files changed, 104 insertions(+), 313 deletions(-) (limited to 'src/shared') diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index c8688cc4..37238a2a 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -42,11 +42,6 @@ bool Fallout3Info::identifyGame(const std::wstring &searchPath) FileExists(searchPath, L"FalloutLauncher.exe"); } -unsigned long Fallout3Info::getBSAVersion() -{ - return 0x68; -} - std::wstring Fallout3Info::getRegPathStatic() { HKEY key; @@ -67,37 +62,6 @@ std::wstring Fallout3Info::getRegPathStatic() } } -std::wstring Fallout3Info::getInvalidationBSA() -{ - return L"Fallout - Invalidation.bsa"; -} - -bool Fallout3Info::isInvalidationBSA(const std::wstring &bsaName) -{ - static LPCWSTR invalidation[] = { L"Fallout - AI!.bsa", L"Fallout - Invalidation.bsa", nullptr }; - - for (int i = 0; invalidation[i] != nullptr; ++i) { - if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { - return true; - } - } - return false; -} - -std::vector Fallout3Info::getPrimaryPlugins() -{ - return boost::assign::list_of(L"fallout3.esm"); -} - -std::vector Fallout3Info::getVanillaBSAs() -{ - return boost::assign::list_of (L"Fallout - Textures.bsa") - (L"Fallout - Meshes.bsa") - (L"Fallout - Voices.bsa") - (L"Fallout - Sound.bsa") - (L"Fallout - MenuVoices.bsa") - (L"Fallout - Misc.bsa"); -} std::vector Fallout3Info::getDLCPlugins() { @@ -125,20 +89,14 @@ std::wstring Fallout3Info::getReferenceDataFile() } -std::wstring Fallout3Info::getOMODExt() -{ - return L"fomod"; -} + std::vector Fallout3Info::getSteamVariants() const { return boost::assign::list_of(L"Regular")(L"Game Of The Year"); } -std::wstring Fallout3Info::getSEName() -{ - return L"fose"; -} + std::wstring Fallout3Info::getNexusPage(bool nmmScheme) { diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index 6a211d4f..1f3a381d 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -35,8 +35,6 @@ public: virtual ~Fallout3Info() {} - virtual unsigned long getBSAVersion(); - static std::wstring getRegPathStatic(); virtual std::wstring getRegPath() { return getRegPathStatic(); } virtual std::wstring getBinaryName() { return L"Fallout3.exe"; } @@ -45,14 +43,38 @@ public: virtual std::wstring getGameName() const { return L"Fallout 3"; } virtual std::wstring getGameShortName() const { return L"Fallout3"; } - - virtual std::wstring getInvalidationBSA(); - - virtual bool isInvalidationBSA(const std::wstring &bsaName); - - virtual std::vector getPrimaryPlugins(); - - virtual std::vector getVanillaBSAs(); +/* + virtual std::wstring getInvalidationBSA() + { + return L"Fallout - Invalidation.bsa"; + } + + virtual bool isInvalidationBSA(const std::wstring &bsaName) + { + static LPCWSTR invalidation[] = { L"Fallout - AI!.bsa", L"Fallout - Invalidation.bsa", nullptr }; + + for (int i = 0; invalidation[i] != nullptr; ++i) { + if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { + return true; + } + } + return false; + } + + virtual std::vector getVanillaBSAs() + { + return boost::assign::list_of (L"Fallout - Textures.bsa") + (L"Fallout - Meshes.bsa") + (L"Fallout - Voices.bsa") + (L"Fallout - Sound.bsa") + (L"Fallout - MenuVoices.bsa") + (L"Fallout - Misc.bsa"); + } + + virtual std::vector getPrimaryPlugins() + { + return boost::assign::list_of(L"fallout3.esm"); + }*/ virtual std::vector getDLCPlugins(); virtual std::vector getSavegameAttachmentExtensions(); @@ -60,12 +82,9 @@ public: virtual std::vector getIniFileNames(); virtual std::wstring getReferenceDataFile(); - virtual std::wstring getOMODExt(); virtual std::vector getSteamVariants() const; - virtual std::wstring getSEName(); - virtual std::wstring getNexusPage(bool nmmScheme = true); static std::wstring getNexusInfoUrlStatic(); virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); } diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index 8e701887..1203bd25 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -43,11 +43,6 @@ bool FalloutNVInfo::identifyGame(const std::wstring &searchPath) FileExists(searchPath, L"FalloutNVLauncher.exe"); } -unsigned long FalloutNVInfo::getBSAVersion() -{ - return 0x68; -} - std::wstring FalloutNVInfo::getRegPathStatic() { HKEY key; @@ -68,38 +63,6 @@ std::wstring FalloutNVInfo::getRegPathStatic() } } -std::wstring FalloutNVInfo::getInvalidationBSA() -{ - return L"Fallout - Invalidation.bsa"; -} - -bool FalloutNVInfo::isInvalidationBSA(const std::wstring &bsaName) -{ - static LPCWSTR invalidation[] = { L"Fallout - AI!.bsa", L"Fallout - Invalidation.bsa", nullptr }; - - for (int i = 0; invalidation[i] != nullptr; ++i) { - if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { - return true; - } - } - return false; -} - -std::vector FalloutNVInfo::getPrimaryPlugins() -{ - return boost::assign::list_of(L"falloutnv.esm"); -} - -std::vector FalloutNVInfo::getVanillaBSAs() -{ - return boost::assign::list_of (L"Fallout - Textures.bsa") - (L"Fallout - Textures2.bsa") - (L"Fallout - Meshes.bsa") - (L"Fallout - Voices1.bsa") - (L"Fallout - Sound.bsa") - (L"Fallout - Misc.bsa"); -} - std::vector FalloutNVInfo::getDLCPlugins() { return boost::assign::list_of (L"DeadMoney.esm") @@ -129,19 +92,6 @@ std::wstring FalloutNVInfo::getReferenceDataFile() return L"Fallout - Meshes.bsa"; } - -std::wstring FalloutNVInfo::getOMODExt() -{ - return L"fomod"; -} - - -std::wstring FalloutNVInfo::getSEName() -{ - return L"nvse"; -} - - std::wstring FalloutNVInfo::getNexusPage(bool nmmScheme) { if (nmmScheme) { @@ -176,17 +126,4 @@ bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false; } -/* -std::vector FalloutNVInfo::getExecutables() -{ - std::vector result; - result.push_back(ExecutableInfo(L"NVSE", L"nvse_loader.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"New Vegas", L"falloutnv.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Fallout Mod Manager", L"fomm/fomm.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Construction Kit", L"geck.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Fallout Launcher", L"FalloutNVLauncher.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", NEVER_CLOSE)); - - return result; -}*/ } // namespace MOShared diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 513b7218..e1a614d2 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -35,8 +35,6 @@ public: virtual ~FalloutNVInfo() {} - virtual unsigned long getBSAVersion(); - static std::wstring getRegPathStatic(); virtual std::wstring getRegPath() { return getRegPathStatic(); } virtual std::wstring getBinaryName() { return L"FalloutNV.exe"; } @@ -48,13 +46,37 @@ public: // virtual bool requiresSteam() const { return true; } - virtual std::wstring getInvalidationBSA(); - - virtual bool isInvalidationBSA(const std::wstring &bsaName); - - virtual std::vector getPrimaryPlugins(); - - virtual std::vector getVanillaBSAs(); +/* virtual std::wstring getInvalidationBSA() + { + return L"Fallout - Invalidation.bsa"; + } + + virtual bool isInvalidationBSA(const std::wstring &bsaName) + { + static LPCWSTR invalidation[] = { L"Fallout - AI!.bsa", L"Fallout - Invalidation.bsa", nullptr }; + + for (int i = 0; invalidation[i] != nullptr; ++i) { + if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { + return true; + } + } + return false; + } + + virtual std::vector getVanillaBSAs() + { + return boost::assign::list_of (L"Fallout - Textures.bsa") + (L"Fallout - Textures2.bsa") + (L"Fallout - Meshes.bsa") + (L"Fallout - Voices1.bsa") + (L"Fallout - Sound.bsa") + (L"Fallout - Misc.bsa"); + } + + virtual std::vector getPrimaryPlugins() + { + return boost::assign::list_of(L"falloutnv.esm"); + }*/ virtual std::vector getDLCPlugins(); virtual std::vector getSavegameAttachmentExtensions(); @@ -62,9 +84,6 @@ public: virtual std::vector getIniFileNames(); virtual std::wstring getReferenceDataFile(); - virtual std::wstring getOMODExt(); - - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); static std::wstring getNexusInfoUrlStatic(); diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index dbb935f6..77ed4d3c 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -28,32 +28,7 @@ along with Mod Organizer. If not, see . #include namespace MOShared { -/* -enum CloseMOStyle { - DEFAULT_CLOSE, - DEFAULT_STAY, - NEVER_CLOSE -}; -struct ExecutableInfo { - - ExecutableInfo(const std::wstring &aTitle, const std::wstring &aBinary, - const std::wstring &aArguments, const std::wstring &aWorkingDirectory, CloseMOStyle aCloseMO) - : title(aTitle), binary(aBinary), arguments(aArguments), workingDirectory(aWorkingDirectory), - closeMO(aCloseMO), steamAppID(L"") {} - ExecutableInfo(const std::wstring &aTitle, const std::wstring &aBinary, - const std::wstring &aArguments, const std::wstring &aWorkingDirectory, - CloseMOStyle aCloseMO, const std::wstring &aSteamAppID) - : title(aTitle), binary(aBinary), arguments(aArguments), workingDirectory(aWorkingDirectory), - closeMO(aCloseMO), steamAppID(aSteamAppID) {} - std::wstring title; - std::wstring binary; - std::wstring arguments; - std::wstring workingDirectory; - CloseMOStyle closeMO; - std::wstring steamAppID; -}; -*/ /** Class to manage information that depends on the used game type. The intention is to keep @@ -86,8 +61,6 @@ public: virtual std::wstring getRegPath() = 0; virtual std::wstring getBinaryName() = 0; - virtual unsigned long getBSAVersion() = 0; - virtual GameInfo::Type getType() = 0; virtual std::wstring getGameName() const = 0; @@ -98,30 +71,8 @@ public: virtual LoadOrderMechanism getLoadOrderMechanism() const { return TYPE_FILETIME; } virtual std::wstring getGameDirectory() const; - // get absolute path to the directory where omo stores its mods -/* virtual std::wstring getModsDir() const; - // get absolute path to the directory where omo stores its profiles - virtual std::wstring getProfilesDir() const; - - virtual std::wstring getIniFilename() const; - virtual std::wstring getOverwriteDir() const; - virtual std::wstring getLogDir() const; - virtual std::wstring getLootDir() const; - virtual std::wstring getTutorialDir() const;*/ - - virtual bool requiresBSAInvalidation() const { return true; } - virtual bool requiresSteam() const; - - virtual std::wstring getInvalidationBSA() = 0; - virtual bool isInvalidationBSA(const std::wstring &bsaName) = 0; - - // the key in the game's ini-file that defines the list of bsas to load - virtual std::wstring archiveListKey() = 0; - - virtual std::vector getPrimaryPlugins() = 0; - - virtual std::vector getVanillaBSAs() = 0; + virtual bool requiresSteam() const; // get a list of file extensions for additional files belonging to a save game virtual std::vector getSavegameAttachmentExtensions() = 0; @@ -134,12 +85,8 @@ public: virtual std::wstring getReferenceDataFile() = 0; - virtual std::wstring getOMODExt() = 0; - virtual std::vector getSteamVariants() const; - virtual std::wstring getSEName() = 0; - virtual std::wstring getNexusPage(bool nmmScheme = true) = 0; virtual std::wstring getNexusInfoUrl() = 0; virtual int getNexusModID() = 0; diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index c945dcf4..16748f58 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -43,11 +43,6 @@ bool OblivionInfo::identifyGame(const std::wstring &searchPath) FileExists(searchPath, L"OblivionLauncher.exe"); } -unsigned long OblivionInfo::getBSAVersion() -{ - return 0x67; -} - std::wstring OblivionInfo::getRegPathStatic() { HKEY key; @@ -68,39 +63,14 @@ std::wstring OblivionInfo::getRegPathStatic() } } -std::wstring OblivionInfo::getInvalidationBSA() -{ - return L"Oblivion - Invalidation.bsa"; -} -bool OblivionInfo::isInvalidationBSA(const std::wstring &bsaName) -{ - static LPCWSTR invalidation[] = { L"Oblivion - Invalidation.bsa", L"ArchiveInvalidationInvalidated!.bsa", - L"BSARedirection.bsa", nullptr }; - for (int i = 0; invalidation[i] != nullptr; ++i) { - if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { - return true; - } - } - return false; -} -std::vector OblivionInfo::getPrimaryPlugins() -{ - return boost::assign::list_of(L"oblivion.esm"); -} -std::vector OblivionInfo::getVanillaBSAs() -{ - return boost::assign::list_of(L"Oblivion - Meshes.bsa") - (L"Oblivion - Textures - Compressed.bsa") - (L"Oblivion - Sounds.bsa") - (L"Oblivion - Voices1.bsa") - (L"Oblivion - Voices2.bsa") - (L"Oblivion - Misc.bsa"); -} + + + std::vector OblivionInfo::getDLCPlugins() @@ -131,10 +101,7 @@ std::vector OblivionInfo::getIniFileNames() } -std::wstring OblivionInfo::getSEName() -{ - return L"obse"; -} + std::wstring OblivionInfo::getNexusPage(bool nmmScheme) @@ -175,11 +142,4 @@ std::wstring OblivionInfo::getReferenceDataFile() return L"Oblivion - Meshes.bsa"; } - -std::wstring OblivionInfo::getOMODExt() -{ - return L"omod"; -} - - } // namespace MOShared diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index a93f510e..87ba26ff 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -33,8 +33,6 @@ public: virtual ~OblivionInfo() {} - virtual unsigned long getBSAVersion(); - static std::wstring getRegPathStatic(); virtual std::wstring getRegPath() { return getRegPathStatic(); } virtual std::wstring getBinaryName() { return L"Oblivion.exe"; } @@ -43,14 +41,40 @@ public: virtual std::wstring getGameName() const { return L"Oblivion"; } virtual std::wstring getGameShortName() const { return L"Oblivion"; } +/* + virtual std::wstring getInvalidationBSA() + { + return L"Oblivion - Invalidation.bsa"; + } + + virtual bool isInvalidationBSA(const std::wstring &bsaName) + { + static LPCWSTR invalidation[] = { L"Oblivion - Invalidation.bsa", L"ArchiveInvalidationInvalidated!.bsa", + L"BSARedirection.bsa", nullptr }; + + for (int i = 0; invalidation[i] != nullptr; ++i) { + if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { + return true; + } + } + return false; + } + + virtual std::vector getVanillaBSAs() + { + return boost::assign::list_of(L"Oblivion - Meshes.bsa") + (L"Oblivion - Textures - Compressed.bsa") + (L"Oblivion - Sounds.bsa") + (L"Oblivion - Voices1.bsa") + (L"Oblivion - Voices2.bsa") + (L"Oblivion - Misc.bsa"); + } + + virtual std::vector getPrimaryPlugins() + { + return boost::assign::list_of(L"oblivion.esm"); + }*/ - virtual std::wstring getInvalidationBSA(); - - virtual bool isInvalidationBSA(const std::wstring &bsaName); - - virtual std::vector getPrimaryPlugins(); - - virtual std::vector getVanillaBSAs(); virtual std::vector getDLCPlugins(); virtual std::vector getSavegameAttachmentExtensions(); @@ -58,9 +82,6 @@ public: virtual std::vector getIniFileNames(); virtual std::wstring getReferenceDataFile(); - virtual std::wstring getOMODExt(); - - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); static std::wstring getNexusInfoUrlStatic(); diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index feaf88a3..f66fcef4 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -50,10 +50,7 @@ bool SkyrimInfo::identifyGame(const std::wstring &searchPath) FileExists(searchPath, L"SkyrimLauncher.exe"); } -unsigned long SkyrimInfo::getBSAVersion() -{ - return 0x68; -} + std::wstring SkyrimInfo::getRegPathStatic() @@ -76,25 +73,6 @@ std::wstring SkyrimInfo::getRegPathStatic() } } - -std::wstring SkyrimInfo::getInvalidationBSA() -{ - return L"Skyrim - Invalidation.bsa"; -} - -bool SkyrimInfo::isInvalidationBSA(const std::wstring &bsaName) -{ - static LPCWSTR invalidation[] = { L"Skyrim - Invalidation.bsa", nullptr }; - - for (int i = 0; invalidation[i] != nullptr; ++i) { - if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) { - return true; - } - } - return false; -} - - GameInfo::LoadOrderMechanism SkyrimInfo::getLoadOrderMechanism() const { std::wstring fileName = getGameDirectory() + L"\\TESV.exe"; @@ -113,27 +91,6 @@ GameInfo::LoadOrderMechanism SkyrimInfo::getLoadOrderMechanism() const } } -std::vector SkyrimInfo::getPrimaryPlugins() -{ - return boost::assign::list_of(L"skyrim.esm")(L"update.esm"); -} - -std::vector SkyrimInfo::getVanillaBSAs() -{ - return boost::assign::list_of(L"Skyrim - Misc.bsa") - (L"Skyrim - Shaders.bsa") - (L"Skyrim - Textures.bsa") - (L"HighResTexturePack01.bsa") - (L"HighResTexturePack02.bsa") - (L"HighResTexturePack03.bsa") - (L"Skyrim - Interface.bsa") - (L"Skyrim - Animations.bsa") - (L"Skyrim - Meshes.bsa") - (L"Skyrim - Sounds.bsa") - (L"Skyrim - Voices.bsa") - (L"Skyrim - VoicesExtra.bsa"); -} - std::vector SkyrimInfo::getDLCPlugins() { return boost::assign::list_of (L"Dawnguard.esm") @@ -161,17 +118,6 @@ std::wstring SkyrimInfo::getReferenceDataFile() } -std::wstring SkyrimInfo::getOMODExt() -{ - return L"fomod"; -} - -std::wstring SkyrimInfo::getSEName() -{ - return L"skse"; -} - - std::wstring SkyrimInfo::getNexusPage(bool nmmScheme) { if (nmmScheme) { diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index bf08fb25..5951f910 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -35,8 +35,6 @@ public: virtual ~SkyrimInfo() {} - virtual unsigned long getBSAVersion(); - static std::wstring getRegPathStatic(); virtual std::wstring getRegPath() { return getRegPathStatic(); } virtual std::wstring getBinaryName() { return L"TESV.exe"; } @@ -48,15 +46,6 @@ public: virtual LoadOrderMechanism getLoadOrderMechanism() const; - virtual bool requiresBSAInvalidation() const { return true; } - - virtual std::wstring getInvalidationBSA(); - - virtual bool isInvalidationBSA(const std::wstring &bsaName); - - virtual std::vector getPrimaryPlugins(); - - virtual std::vector getVanillaBSAs(); virtual std::vector getDLCPlugins(); virtual std::vector getSavegameAttachmentExtensions(); @@ -65,9 +54,6 @@ public: virtual std::vector getIniFileNames(); virtual std::wstring getReferenceDataFile(); - virtual std::wstring getOMODExt(); - - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); @@ -80,8 +66,6 @@ public: virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath); - virtual std::wstring archiveListKey() { return L"SResourceArchiveList"; } - private: SkyrimInfo(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gameDirectory); -- cgit v1.3.1