summaryrefslogtreecommitdiff
path: root/src/shared/falloutnvinfo.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-03-09 12:34:34 +0100
committerTannin <devnull@localhost>2015-03-09 12:34:34 +0100
commit7a1ae9b0f1560c9eda32e032796fbb3fd56ff236 (patch)
treedea71435ac1042cb008fcd9f7b1ec57e6ea91227 /src/shared/falloutnvinfo.cpp
parentd45ebf134819e1559718681becca9c4139fb7151 (diff)
parentdb2954e8eb41da715b9e7d79a72e225797401413 (diff)
Merge with branch1.2
Diffstat (limited to 'src/shared/falloutnvinfo.cpp')
-rw-r--r--src/shared/falloutnvinfo.cpp154
1 files changed, 5 insertions, 149 deletions
diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp
index ff441f13..1203bd25 100644
--- a/src/shared/falloutnvinfo.cpp
+++ b/src/shared/falloutnvinfo.cpp
@@ -31,8 +31,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
namespace MOShared {
-FalloutNVInfo::FalloutNVInfo(const std::wstring &omoDirectory, const std::wstring &gameDirectory)
- : GameInfo(omoDirectory, gameDirectory)
+FalloutNVInfo::FalloutNVInfo(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &gameDirectory)
+ : GameInfo(moDirectory, moDataDirectory, gameDirectory)
{
identifyMyGamesDirectory(L"falloutnv");
}
@@ -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;
@@ -61,60 +56,13 @@ std::wstring FalloutNVInfo::getRegPathStatic()
WCHAR temp[MAX_PATH];
DWORD bufferSize = MAX_PATH;
- if (::RegQueryValueExW(key, L"Installed Path", NULL, NULL, (LPBYTE)temp, &bufferSize) == ERROR_SUCCESS) {
+ if (::RegQueryValueExW(key, L"Installed Path", nullptr, nullptr, (LPBYTE)temp, &bufferSize) == ERROR_SUCCESS) {
return std::wstring(temp);
} else {
return std::wstring();
}
}
-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", NULL };
-
- for (int i = 0; invalidation[i] != NULL; ++i) {
- if (wcscmp(bsaName.c_str(), invalidation[i]) == 0) {
- return true;
- }
- }
- 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<std::wstring> FalloutNVInfo::getPrimaryPlugins()
-{
- return boost::assign::list_of(L"falloutnv.esm");
-}
-
-std::vector<std::wstring> 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<std::wstring> FalloutNVInfo::getDLCPlugins()
{
return boost::assign::list_of (L"DeadMoney.esm")
@@ -139,84 +87,11 @@ std::vector<std::wstring> 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";
}
-
-std::wstring FalloutNVInfo::getOMODExt()
-{
- return L"fomod";
-}
-
-
-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, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- ::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";
-}
-
-
std::wstring FalloutNVInfo::getNexusPage(bool nmmScheme)
{
if (nmmScheme) {
@@ -239,17 +114,11 @@ 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", NULL };
+ static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr };
- for (int i = 0; profileFiles[i] != NULL; ++i) {
+ for (int i = 0; profileFiles[i] != nullptr; ++i) {
if (_wcsicmp(fileName, profileFiles[i]) == 0) {
return true;
}
@@ -257,17 +126,4 @@ bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*)
return false;
}
-
-std::vector<ExecutableInfo> FalloutNVInfo::getExecutables()
-{
- std::vector<ExecutableInfo> 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