From 9edc39633b82b5e02d33c4b0a395fe110af28eb4 Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 6 Jan 2015 19:31:53 +0100 Subject: - bugfixes - moved more functionality to game-plugins - further decoupled management functionality from the UI - created another "tutorial" which is only a single page with relevant parts of the ui highlighted with info as tooltips --- src/shared/appconfig.inc | 5 +- src/shared/fallout3info.cpp | 105 ----------------------------------------- src/shared/fallout3info.h | 10 ---- src/shared/falloutnvinfo.cpp | 81 -------------------------------- src/shared/falloutnvinfo.h | 11 ----- src/shared/gameinfo.cpp | 43 +---------------- src/shared/gameinfo.h | 15 +----- src/shared/oblivioninfo.cpp | 105 ----------------------------------------- src/shared/oblivioninfo.h | 11 ----- src/shared/skyriminfo.cpp | 109 +------------------------------------------ src/shared/skyriminfo.h | 16 ------- 11 files changed, 8 insertions(+), 503 deletions(-) (limited to 'src/shared') diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index 4450763f..e2dbfe20 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -6,8 +6,11 @@ APPPARAM(std::wstring, downloadPath, L"downloads") APPPARAM(std::wstring, overwritePath, L"overwrite") APPPARAM(std::wstring, stylesheetsPath, L"stylesheets") APPPARAM(std::wstring, cachePath, L"webcache") +APPPARAM(std::wstring, tutorialsPath, L"tutorials") +APPPARAM(std::wstring, logPath, L"logs") APPPARAM(std::wstring, profileTweakIni, L"profile_tweaks.ini") -APPPARAM(std::wstring, logFile, L"ModOrganizer.log") +APPPARAM(std::wstring, logFileName, L"ModOrganizer.log") +APPPARAM(std::wstring, iniFileName, L"ModOrganizer.ini") APPPARAM(std::wstring, proxyDLLTarget, L"steam_api.dll") APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be identical to the value used in proxydll-project APPPARAM(std::wstring, proxyDLLSource, L"proxy.dll") diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 6c420044..c8688cc4 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -84,21 +84,6 @@ bool Fallout3Info::isInvalidationBSA(const std::wstring &bsaName) return false; } -std::wstring Fallout3Info::getDocumentsDir() -{ - std::wostringstream temp; - temp << getMyGamesDirectory() << L"\\Fallout3"; - - return temp.str(); -} - -std::wstring Fallout3Info::getSaveGameDir() -{ - std::wostringstream temp; - temp << getDocumentsDir() << L"\\Saves"; - return temp.str(); -} - std::vector Fallout3Info::getPrimaryPlugins() { return boost::assign::list_of(L"fallout3.esm"); @@ -134,11 +119,6 @@ std::vector Fallout3Info::getIniFileNames() return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini"); } -std::wstring Fallout3Info::getSaveGameExtension() -{ - return L"*.fos"; -} - std::wstring Fallout3Info::getReferenceDataFile() { return L"Fallout - Meshes.bsa"; @@ -155,21 +135,11 @@ std::vector Fallout3Info::getSteamVariants() const return boost::assign::list_of(L"Regular")(L"Game Of The Year"); } -std::wstring Fallout3Info::getSteamAPPId(int variant) const -{ - switch (variant) { - case 1: return L"22370"; - default: return L"22300"; - } -} - - std::wstring Fallout3Info::getSEName() { return L"fose"; } - std::wstring Fallout3Info::getNexusPage(bool nmmScheme) { if (nmmScheme) { @@ -192,68 +162,6 @@ int Fallout3Info::getNexusModIDStatic() } -void Fallout3Info::createProfile(const std::wstring &directory, bool useDefaults) -{ - std::wostringstream target; - - // copy plugins.txt - target << directory << "\\plugins.txt"; - - if (!FileExists(target.str())) { - std::wostringstream source; - source << getLocalAppFolder() << "\\Fallout3\\plugins.txt"; - if (!::CopyFileW(source.str().c_str(), target.str().c_str(), true)) { - HANDLE file = ::CreateFileW(target.str().c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - ::CloseHandle(file); - } - } - - // copy ini-file - target.str(L""); target.clear(); - target << directory << L"\\fallout.ini"; - - if (!FileExists(target.str())) { - std::wostringstream source; - if (useDefaults) { - source << getGameDirectory() << L"\\fallout_default.ini"; - } else { - source << getMyGamesDirectory() << L"\\Fallout3"; - if (FileExists(source.str(), L"fallout.ini")) { - source << L"\\fallout.ini"; - } else { - source.str(L""); - source << getGameDirectory() << L"\\fallout_default.ini"; - } - } - - if (!::CopyFileW(source.str().c_str(), target.str().c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - std::ostringstream stream; - stream << "failed to copy ini file: " << ToString(source.str(), false); - throw windows_error(stream.str()); - } - } - } - { // copy falloutprefs.ini-file - std::wstring target = directory + L"\\falloutprefs.ini"; - if (!FileExists(target)) { - std::wstring source = getMyGamesDirectory() + L"\\Fallout3\\falloutprefs.ini"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - throw windows_error(std::string("failed to copy ini file: ") + ToString(source, false)); - } - } - } - } -} - - -void Fallout3Info::repairProfile(const std::wstring &directory) -{ - createProfile(directory, false); -} - - bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) { static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr }; @@ -266,17 +174,4 @@ bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false; } - -/*std::vector Fallout3Info::getExecutables() -{ - std::vector result; - result.push_back(ExecutableInfo(L"FOSE", L"fose_loader.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Fallout 3", L"fallout3.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"FalloutLauncher.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/fallout3info.h b/src/shared/fallout3info.h index 7e39cce4..6a211d4f 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -50,11 +50,6 @@ public: virtual bool isInvalidationBSA(const std::wstring &bsaName); - // full path to this games "My Games"-directory - virtual std::wstring getDocumentsDir(); - - virtual std::wstring getSaveGameDir(); - virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); @@ -64,12 +59,10 @@ public: // file name of this games ini (no path) virtual std::vector getIniFileNames(); - virtual std::wstring getSaveGameExtension(); virtual std::wstring getReferenceDataFile(); virtual std::wstring getOMODExt(); virtual std::vector getSteamVariants() const; - virtual std::wstring getSteamAPPId(int variant = 0) const; virtual std::wstring getSEName(); @@ -80,9 +73,6 @@ public: virtual int getNexusModID() { return getNexusModIDStatic(); } virtual int getNexusGameID() { return 120; } - virtual void createProfile(const std::wstring &directory, bool useDefaults); - virtual void repairProfile(const std::wstring &directory); - virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath); // get a list of executables (game binary and known-to-work 3rd party tools). All of these are relative to diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index f589124a..8e701887 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -85,21 +85,6 @@ bool FalloutNVInfo::isInvalidationBSA(const std::wstring &bsaName) return false; } -std::wstring FalloutNVInfo::getDocumentsDir() -{ - std::wostringstream temp; - temp << getMyGamesDirectory() << L"\\FalloutNV"; - - return temp.str(); -} - -std::wstring FalloutNVInfo::getSaveGameDir() -{ - std::wostringstream temp; - temp << getDocumentsDir() << L"\\Saves"; - return temp.str(); -} - std::vector FalloutNVInfo::getPrimaryPlugins() { return boost::assign::list_of(L"falloutnv.esm"); @@ -139,11 +124,6 @@ std::vector FalloutNVInfo::getIniFileNames() return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini"); } -std::wstring FalloutNVInfo::getSaveGameExtension() -{ - return L"*.fos"; -} - std::wstring FalloutNVInfo::getReferenceDataFile() { return L"Fallout - Meshes.bsa"; @@ -156,61 +136,6 @@ std::wstring FalloutNVInfo::getOMODExt() } -std::wstring FalloutNVInfo::getSteamAPPId(int) const -{ - return L"22380"; -} - - -void FalloutNVInfo::createProfile(const std::wstring &directory, bool useDefaults) -{ - std::wstring target = directory + L"\\plugins.txt"; - - // copy plugins.txt - if (!FileExists(target)) { - std::wstring source = getLocalAppFolder() + L"\\FalloutNV\\plugins.txt"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - HANDLE file = ::CreateFileW(target.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - ::CloseHandle(file); - } - } - - // copy ini-file - target = directory + L"\\fallout.ini"; - - if (!FileExists(target)) { - std::wstring source; - if (useDefaults) { - source = getGameDirectory() + L"\\fallout_default.ini"; - } else { - source = getMyGamesDirectory() + L"\\FalloutNV"; - if (FileExists(source, L"fallout.ini")) { - source += L"\\fallout.ini"; - } else { - source = getGameDirectory() + L"\\fallout_default.ini"; - } - } - - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - throw windows_error("failed to copy ini file: " + ToString(source, false)); - } - } - } - { // copy falloutprefs.ini-file - std::wstring target = directory + L"\\falloutprefs.ini"; - if (!FileExists(target)) { - std::wstring source = getMyGamesDirectory() + L"\\FalloutNV\\falloutprefs.ini"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - throw windows_error("failed to copy ini file: " + ToString(source, false)); - } - } - } - } -} - - std::wstring FalloutNVInfo::getSEName() { return L"nvse"; @@ -239,12 +164,6 @@ int FalloutNVInfo::getNexusModIDStatic() } -void FalloutNVInfo::repairProfile(const std::wstring &directory) -{ - createProfile(directory, false); -} - - bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) { static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr }; diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 231311de..513b7218 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -52,11 +52,6 @@ public: virtual bool isInvalidationBSA(const std::wstring &bsaName); - // full path to this games "My Games"-directory - virtual std::wstring getDocumentsDir(); - - virtual std::wstring getSaveGameDir(); - virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); @@ -66,12 +61,9 @@ public: // file name of this games ini (no path) virtual std::vector getIniFileNames(); - virtual std::wstring getSaveGameExtension(); virtual std::wstring getReferenceDataFile(); virtual std::wstring getOMODExt(); - virtual std::wstring getSteamAPPId(int variant = 0) const; - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); @@ -81,9 +73,6 @@ public: virtual int getNexusModID() { return getNexusModIDStatic(); } virtual int getNexusGameID() { return 130; } - virtual void createProfile(const std::wstring &directory, bool useDefaults); - virtual void repairProfile(const std::wstring &directory); - virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath); // get a list of executables (game binary and known-to-work 3rd party tools). All of these are relative to diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index 3727ea49..6d8957ad 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -135,49 +135,9 @@ std::wstring GameInfo::getGameDirectory() const return m_GameDirectory; } -std::wstring GameInfo::getModsDir() const -{ - return m_OrganizerDirectory + L"\\mods"; -} - -std::wstring GameInfo::getProfilesDir() const -{ - return m_OrganizerDirectory + L"\\profiles"; -} - -std::wstring GameInfo::getIniFilename() const -{ - return m_OrganizerDirectory + L"\\ModOrganizer.ini"; -} - - -std::wstring GameInfo::getOverwriteDir() const -{ - return m_OrganizerDirectory + L"\\overwrite"; -} - - -std::wstring GameInfo::getLogDir() const -{ - return m_OrganizerDirectory + L"\\logs"; -} - - -std::wstring GameInfo::getLootDir() const -{ - return m_OrganizerDirectory + L"\\loot"; -} - - -std::wstring GameInfo::getTutorialDir() const -{ - return m_OrganizerDirectory + L"\\tutorials"; -} - - bool GameInfo::requiresSteam() const { - return FileExists(getGameDirectory().append(L"\\steam_api.dll")); + return FileExists(getGameDirectory() + L"\\steam_api.dll"); } std::vector GameInfo::getSteamVariants() const @@ -185,7 +145,6 @@ std::vector GameInfo::getSteamVariants() const return boost::assign::list_of(L"Regular"); } - std::wstring GameInfo::getLocalAppFolder() const { wchar_t localAppFolder[MAX_PATH]; diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index a9da0b97..dbb935f6 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -93,18 +93,13 @@ public: virtual std::wstring getGameName() const = 0; virtual std::wstring getGameShortName() const = 0; - // full path to this games "My Games"-directory - virtual std::wstring getDocumentsDir() = 0; - - virtual std::wstring getSaveGameDir() = 0; - /// determine the load order mechanism used by this game. this may throw an /// exception if the mechanism can't be determined 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; +/* virtual std::wstring getModsDir() const; // get absolute path to the directory where omo stores its profiles virtual std::wstring getProfilesDir() const; @@ -112,7 +107,7 @@ public: virtual std::wstring getOverwriteDir() const; virtual std::wstring getLogDir() const; virtual std::wstring getLootDir() const; - virtual std::wstring getTutorialDir() const; + virtual std::wstring getTutorialDir() const;*/ virtual bool requiresBSAInvalidation() const { return true; } virtual bool requiresSteam() const; @@ -137,13 +132,11 @@ public: // file name of this games ini file(s) virtual std::vector getIniFileNames() = 0; - virtual std::wstring getSaveGameExtension() = 0; virtual std::wstring getReferenceDataFile() = 0; virtual std::wstring getOMODExt() = 0; virtual std::vector getSteamVariants() const; - virtual std::wstring getSteamAPPId(int variant = 0) const = 0; virtual std::wstring getSEName() = 0; @@ -152,10 +145,6 @@ public: virtual int getNexusModID() = 0; virtual int getNexusGameID() = 0; - // clone relevant files to the specified directory - virtual void createProfile(const std::wstring &directory, bool useDefaults) = 0; - virtual void repairProfile(const std::wstring &directory) = 0; - virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) = 0; public: diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index 586bcaef..c945dcf4 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -86,22 +86,6 @@ bool OblivionInfo::isInvalidationBSA(const std::wstring &bsaName) return false; } -std::wstring OblivionInfo::getDocumentsDir() -{ - std::wostringstream temp; - temp << getMyGamesDirectory() << L"\\Oblivion"; - - return temp.str(); -} - -std::wstring OblivionInfo::getSaveGameDir() -{ - std::wostringstream temp; - temp << getDocumentsDir() << L"\\Saves"; - return temp.str(); -} - - std::vector OblivionInfo::getPrimaryPlugins() { return boost::assign::list_of(L"oblivion.esm"); @@ -147,63 +131,6 @@ std::vector OblivionInfo::getIniFileNames() } -void OblivionInfo::createProfile(const std::wstring &directory, bool useDefaults) -{ - std::wostringstream target; - - // copy plugins.txt - target << directory << "\\plugins.txt"; - - if (!FileExists(target.str())) { - std::wostringstream source; - source << getLocalAppFolder() << "\\Oblivion\\plugins.txt"; - if (!::CopyFileW(source.str().c_str(), target.str().c_str(), true)) { - HANDLE file = ::CreateFileW(target.str().c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - ::CloseHandle(file); - } - } - - // copy ini-file - target.str(L""); target.clear(); - target << directory << L"\\oblivion.ini"; - - if (!FileExists(target.str())) { - std::wostringstream source; - if (useDefaults) { - source << getGameDirectory() << L"\\oblivion_default.ini"; - } else { - source << getMyGamesDirectory() << L"Oblivion"; - if (FileExists(source.str(), L"oblivion.ini")) { - source << L"\\oblivion.ini"; - } else { - source.str(L""); - source << getGameDirectory() << L"\\oblivion_default.ini"; - } - } - if (!::CopyFileW(source.str().c_str(), target.str().c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - std::ostringstream stream; - stream << "failed to copy ini file: " << ToString(source.str(), false); - throw windows_error(stream.str()); - } - } - } - - { // copy oblivionprefs.ini-file - std::wstring target = directory + L"\\oblivionprefs.ini"; - if (!FileExists(target)) { - std::wstring source = getMyGamesDirectory() + L"\\Oblivion\\oblivionprefs.ini"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - if ((::CreateFileW(target.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr) == INVALID_HANDLE_VALUE) && - (::GetLastError() != ERROR_FILE_EXISTS)) { - throw windows_error(std::string("failed to create ini file: ") + ToString(target, false)); - } - } - } - } -} - - std::wstring OblivionInfo::getSEName() { return L"obse"; @@ -231,13 +158,6 @@ int OblivionInfo::getNexusModIDStatic() return 38277; } - -void OblivionInfo::repairProfile(const std::wstring &directory) -{ - createProfile(directory, false); -} - - bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) { static LPCWSTR profileFiles[] = { L"oblivion.ini", L"oblivionprefs.ini", L"plugins.txt", nullptr }; @@ -250,12 +170,6 @@ bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false; } - -std::wstring OblivionInfo::getSaveGameExtension() -{ - return L"*.ess"; -} - std::wstring OblivionInfo::getReferenceDataFile() { return L"Oblivion - Meshes.bsa"; @@ -268,23 +182,4 @@ std::wstring OblivionInfo::getOMODExt() } -std::wstring OblivionInfo::getSteamAPPId(int) const -{ - return L"22330"; -} - -/* -std::vector OblivionInfo::getExecutables() -{ - std::vector result; - result.push_back(ExecutableInfo(L"OBSE", L"obse_loader.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Oblivion", L"oblivion.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Oblivion Mod Manager", L"OblivionModManager.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Construction Set", L"TESConstructionSet.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Oblivion Launcher", L"OblivionLauncher.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", NEVER_CLOSE)); - result.push_back(ExecutableInfo(L"BOSS (old)", L"Data/BOSS.exe", L"", L"", NEVER_CLOSE)); - - return result; -}*/ } // namespace MOShared diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index cb506c01..a93f510e 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -48,11 +48,6 @@ public: virtual bool isInvalidationBSA(const std::wstring &bsaName); - // full path to this games "My Games"-directory - virtual std::wstring getDocumentsDir(); - - virtual std::wstring getSaveGameDir(); - virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); @@ -62,12 +57,9 @@ public: // file name of this games ini (no path) virtual std::vector getIniFileNames(); - virtual std::wstring getSaveGameExtension(); virtual std::wstring getReferenceDataFile(); virtual std::wstring getOMODExt(); - virtual std::wstring getSteamAPPId(int variant = 0) const; - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); @@ -77,9 +69,6 @@ public: virtual int getNexusModID() { return getNexusModIDStatic(); } virtual int getNexusGameID() { return 101; } - virtual void createProfile(const std::wstring &directory, bool useDefaults); - virtual void repairProfile(const std::wstring &directory); - virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath); // get a list of executables (game binary and known-to-work 3rd party tools). All of these are relative to diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index 1d00c4f3..feaf88a3 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -97,7 +97,7 @@ bool SkyrimInfo::isInvalidationBSA(const std::wstring &bsaName) GameInfo::LoadOrderMechanism SkyrimInfo::getLoadOrderMechanism() const { - std::wstring fileName = getGameDirectory().append(L"\\TESV.exe"); + std::wstring fileName = getGameDirectory() + L"\\TESV.exe"; try { VS_FIXEDFILEINFO versionInfo = GetFileVersion(fileName); @@ -113,21 +113,6 @@ GameInfo::LoadOrderMechanism SkyrimInfo::getLoadOrderMechanism() const } } -std::wstring SkyrimInfo::getDocumentsDir() -{ - std::wostringstream temp; - temp << getMyGamesDirectory() << L"\\Skyrim"; - - return temp.str(); -} - -std::wstring SkyrimInfo::getSaveGameDir() -{ - std::wostringstream temp; - temp << getDocumentsDir() << L"\\Saves"; - return temp.str(); -} - std::vector SkyrimInfo::getPrimaryPlugins() { return boost::assign::list_of(L"skyrim.esm")(L"update.esm"); @@ -170,11 +155,6 @@ std::vector SkyrimInfo::getIniFileNames() return boost::assign::list_of(L"skyrim.ini")(L"skyrimprefs.ini"); } -std::wstring SkyrimInfo::getSaveGameExtension() -{ - return L"*.ess"; -} - std::wstring SkyrimInfo::getReferenceDataFile() { return L"Skyrim - Meshes.bsa"; @@ -186,13 +166,6 @@ std::wstring SkyrimInfo::getOMODExt() return L"fomod"; } - -std::wstring SkyrimInfo::getSteamAPPId(int) const -{ - return L"72850"; -} - - std::wstring SkyrimInfo::getSEName() { return L"skse"; @@ -220,73 +193,6 @@ int SkyrimInfo::getNexusModIDStatic() return 1334; } - -void SkyrimInfo::createProfile(const std::wstring &directory, bool useDefaults) -{ - { // copy plugins.txt - std::wstring target = directory + L"\\plugins.txt"; - if (!FileExists(target)) { - std::wostringstream source; - source << getLocalAppFolder() << "\\Skyrim\\plugins.txt"; - if (!::CopyFileW(source.str().c_str(), target.c_str(), true)) { - HANDLE file = ::CreateFileW(target.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - ::CloseHandle(file); - } - } - target = directory + L"\\loadorder.txt"; - if (!FileExists(target)) { - std::wstring source = getLocalAppFolder() + L"\\Skyrim\\loadorder.txt"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - HANDLE file = ::CreateFileW(target.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); - ::CloseHandle(file); - } - } - } - - { // copy skyrim.ini-file - std::wstring target = directory + L"\\skyrim.ini"; - if (!FileExists(target)) { - std::wstring source; - if (useDefaults) { - source = getGameDirectory() + L"\\skyrim_default.ini"; - } else { - source = getMyGamesDirectory() + L"\\Skyrim"; - if (FileExists(source, L"skyrim.ini")) { - source += L"\\skyrim.ini"; - } else { - source = getGameDirectory() + L"\\skyrim_default.ini"; - } - } - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - if (::GetLastError() != ERROR_FILE_EXISTS) { - throw windows_error(std::string("failed to copy ini file: ") + ToString(source, false) + " to " + ToString(target, false)); - } - } - } - } - - { // copy skyrimprefs.ini-file - std::wstring target = directory + L"\\skyrimprefs.ini"; - if (!FileExists(target)) { - std::wstring source = getMyGamesDirectory() + L"\\Skyrim\\skyrimprefs.ini"; - if (!::CopyFileW(source.c_str(), target.c_str(), true)) { - log("failed to copy ini file %ls", source.c_str()); - // create empty - if (::CreateFileW(target.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr) == INVALID_HANDLE_VALUE) { - throw windows_error(std::string("failed to copy ini file: ") + ToString(source, false)); - } - } - } - } -} - - -void SkyrimInfo::repairProfile(const std::wstring &directory) -{ - createProfile(directory, false); -} - - bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) { static LPCWSTR profileFiles[] = { L"skyrim.ini", L"skyrimprefs.ini", L"loadorder.txt", nullptr }; @@ -306,17 +212,4 @@ bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPa } -/*std::vector SkyrimInfo::getExecutables() -{ - std::vector result; - result.push_back(ExecutableInfo(L"SKSE", L"skse_loader.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"SBW", L"SBW.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Skyrim", L"TESV.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"Skyrim Launcher", L"SkyrimLauncher.exe", L"", L"", DEFAULT_CLOSE)); - result.push_back(ExecutableInfo(L"BOSS", L"BOSS/BOSS.exe", L"", L"", DEFAULT_STAY)); - result.push_back(ExecutableInfo(L"Creation Kit", L"CreationKit.exe", L"", L"", DEFAULT_STAY, L"202480")); - - return result; -}*/ - } // namespace MOShared diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index ad6ab95d..bf08fb25 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -49,17 +49,11 @@ public: virtual LoadOrderMechanism getLoadOrderMechanism() const; virtual bool requiresBSAInvalidation() const { return true; } -// virtual bool requiresSteam() const { return true; } virtual std::wstring getInvalidationBSA(); virtual bool isInvalidationBSA(const std::wstring &bsaName); - // full path to this games "My Games"-directory - virtual std::wstring getDocumentsDir(); - - virtual std::wstring getSaveGameDir(); - virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); @@ -70,12 +64,9 @@ public: // file name of this games ini (no path) virtual std::vector getIniFileNames(); - virtual std::wstring getSaveGameExtension(); virtual std::wstring getReferenceDataFile(); virtual std::wstring getOMODExt(); - virtual std::wstring getSteamAPPId(int variant = 0) const; - virtual std::wstring getSEName(); virtual std::wstring getNexusPage(bool nmmScheme = true); @@ -87,15 +78,8 @@ public: static int getNexusGameIDStatic() { return 110; } virtual int getNexusGameID() { return getNexusGameIDStatic(); } - virtual void createProfile(const std::wstring &directory, bool useDefaults); - virtual void repairProfile(const std::wstring &directory); - virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath); - // get a list of executables (game binary and known-to-work 3rd party tools). All of these are relative to - // the game directory - //virtual std::vector getExecutables(); - virtual std::wstring archiveListKey() { return L"SResourceArchiveList"; } private: -- cgit v1.3.1