summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/appconfig.inc1
-rw-r--r--src/shared/directoryentry.cpp4
-rw-r--r--src/shared/directoryentry.h9
-rw-r--r--src/shared/fallout3info.cpp17
-rw-r--r--src/shared/fallout3info.h4
-rw-r--r--src/shared/fallout4info.cpp100
-rw-r--r--src/shared/fallout4info.h75
-rw-r--r--src/shared/falloutnvinfo.cpp17
-rw-r--r--src/shared/falloutnvinfo.h6
-rw-r--r--src/shared/gameinfo.cpp3
-rw-r--r--src/shared/gameinfo.h6
-rw-r--r--src/shared/oblivioninfo.cpp17
-rw-r--r--src/shared/oblivioninfo.h4
-rw-r--r--src/shared/skyriminfo.cpp23
-rw-r--r--src/shared/skyriminfo.h4
15 files changed, 185 insertions, 105 deletions
diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc
index e2dbfe20..ac6c210f 100644
--- a/src/shared/appconfig.inc
+++ b/src/shared/appconfig.inc
@@ -14,7 +14,6 @@ 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")
-APPPARAM(std::wstring, hookDLLName, L"hook.dll") // needs to be identical to the value used in proxydll-project
APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\")
APPPARAM(std::wstring, firstStepsTutorial, L"tutorial_firststeps_main.js")
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp
index 54b6efff..e081c006 100644
--- a/src/shared/directoryentry.cpp
+++ b/src/shared/directoryentry.cpp
@@ -704,7 +704,7 @@ FilesOrigin &DirectoryEntry::getOriginByName(const std::wstring &name) const
return m_OriginConnection->getByName(name);
}
-
+/*
int DirectoryEntry::getOrigin(const std::wstring &path, bool &archive)
{
const DirectoryEntry *directory = nullptr;
@@ -718,7 +718,7 @@ int DirectoryEntry::getOrigin(const std::wstring &path, bool &archive)
return -1;
}
}
-}
+}*/
std::vector<FileEntry::Ptr> DirectoryEntry::getFiles() const
{
diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h
index 2d32450a..04b8782b 100644
--- a/src/shared/directoryentry.h
+++ b/src/shared/directoryentry.h
@@ -207,7 +207,8 @@ public:
DirectoryEntry(const std::wstring &name, DirectoryEntry *parent, int originID);
DirectoryEntry(const std::wstring &name, DirectoryEntry *parent, int originID,
- boost::shared_ptr<FileRegister> fileRegister, boost::shared_ptr<OriginConnection> originConnection);
+ boost::shared_ptr<FileRegister> fileRegister,
+ boost::shared_ptr<OriginConnection> originConnection);
~DirectoryEntry();
@@ -232,7 +233,9 @@ public:
FilesOrigin &getOriginByID(int ID) const;
FilesOrigin &getOriginByName(const std::wstring &name) const;
- int getOrigin(const std::wstring &path, bool &archive);
+ int anyOrigin() const;
+
+ //int getOrigin(const std::wstring &path, bool &archive);
std::vector<FileEntry::Ptr> getFiles() const;
@@ -316,8 +319,6 @@ private:
DirectoryEntry *getSubDirectoryRecursive(const std::wstring &path, bool create, int originID = -1);
- int anyOrigin() const;
-
void removeDirRecursive();
private:
diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp
index 797d68ec..446d4afe 100644
--- a/src/shared/fallout3info.cpp
+++ b/src/shared/fallout3info.cpp
@@ -68,21 +68,4 @@ std::vector<std::wstring> Fallout3Info::getIniFileNames() const
return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini");
}
-std::wstring Fallout3Info::getReferenceDataFile() const
-{
- return L"Fallout - Meshes.bsa";
-}
-
-bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
-{
- static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr };
-
- for (int i = 0; profileFiles[i] != nullptr; ++i) {
- if (_wcsicmp(fileName, profileFiles[i]) == 0) {
- return true;
- }
- }
- return false;
-}
-
} // namespace MOShared
diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h
index 5cf98e3b..601fc346 100644
--- a/src/shared/fallout3info.h
+++ b/src/shared/fallout3info.h
@@ -40,10 +40,6 @@ public:
// file name of this games ini (no path)
virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile() const;
-
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
-
virtual std::wstring archiveListKey() const { return L"SArchiveList"; }
private:
diff --git a/src/shared/fallout4info.cpp b/src/shared/fallout4info.cpp
new file mode 100644
index 00000000..aab431ad
--- /dev/null
+++ b/src/shared/fallout4info.cpp
@@ -0,0 +1,100 @@
+/*
+Copyright (C) 2012 Sebastian Herbord. All rights reserved.
+
+This file is part of Mod Organizer.
+
+Mod Organizer is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Mod Organizer is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "fallout4info.h"
+#include "util.h"
+#include <tchar.h>
+#include <ShlObj.h>
+#include <sstream>
+#include "windows_error.h"
+#include "error_report.h"
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+#include <boost/assign.hpp>
+
+namespace MOShared {
+
+Fallout4Info::Fallout4Info(const std::wstring &gameDirectory)
+ : GameInfo(gameDirectory)
+{
+ identifyMyGamesDirectory(L"fallout4");
+}
+
+bool Fallout4Info::identifyGame(const std::wstring &searchPath)
+{
+ return FileExists(searchPath, L"Fallout4.exe") &&
+ FileExists(searchPath, L"Fallout4Launcher.exe");
+}
+
+std::wstring Fallout4Info::getRegPathStatic()
+{
+ HKEY key;
+ LONG errorcode = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Bethesda Softworks\\Fallout4",
+ 0, KEY_QUERY_VALUE, &key);
+
+ if (errorcode != ERROR_SUCCESS) {
+ return std::wstring();
+ }
+
+ WCHAR temp[MAX_PATH];
+ DWORD bufferSize = MAX_PATH;
+
+ if (::RegQueryValueExW(key, L"Installed Path", nullptr, nullptr, (LPBYTE)temp, &bufferSize) == ERROR_SUCCESS) {
+ return std::wstring(temp);
+ } else {
+ return std::wstring();
+ }
+}
+
+
+std::vector<std::wstring> Fallout4Info::getDLCPlugins()
+{
+ return std::vector<std::wstring>();
+}
+
+std::vector<std::wstring> Fallout4Info::getSavegameAttachmentExtensions()
+{
+ return std::vector<std::wstring>();
+}
+
+std::vector<std::wstring> Fallout4Info::getIniFileNames() const
+{
+ return boost::assign::list_of(L"fallout4.ini")(L"fallout4prefs.ini");
+}
+
+std::wstring Fallout4Info::getNexusPage(bool nmmScheme)
+{
+ if (nmmScheme) {
+ return L"http://nmm.nexusmods.com/fallout4";
+ } else {
+ return L"http://www.nexusmods.com/fallout4";
+ }
+}
+
+std::wstring Fallout4Info::getNexusInfoUrlStatic()
+{
+ return L"http://nmm.nexusmods.com/fallout4";
+}
+
+int Fallout4Info::getNexusModIDStatic()
+{
+ return 377160;
+}
+
+} // namespace MOShared
diff --git a/src/shared/fallout4info.h b/src/shared/fallout4info.h
new file mode 100644
index 00000000..70c9b7d3
--- /dev/null
+++ b/src/shared/fallout4info.h
@@ -0,0 +1,75 @@
+/*
+Copyright (C) 2012 Sebastian Herbord. All rights reserved.
+
+This file is part of Mod Organizer.
+
+Mod Organizer is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Mod Organizer is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef FALLOUT4INFO_H
+#define FALLOUT4INFO_H
+
+
+#include "gameinfo.h"
+
+namespace MOShared {
+
+
+class Fallout4Info : public GameInfo
+{
+
+ friend class GameInfo;
+
+public:
+
+ virtual ~Fallout4Info() {}
+
+ static std::wstring getRegPathStatic();
+ virtual std::wstring getRegPath() const { return getRegPathStatic(); }
+ virtual std::wstring getBinaryName() { return L"Fallout4.exe"; }
+
+ virtual std::wstring getGameName() const { return L"Fallout 4"; }
+ virtual std::wstring getGameShortName() const { return L"Fallout4"; }
+
+ virtual std::vector<std::wstring> getDLCPlugins();
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
+
+ // file name of this games ini (no path)
+ virtual std::vector<std::wstring> getIniFileNames() const;
+
+ virtual std::wstring getNexusPage(bool nmmScheme = true);
+ static std::wstring getNexusInfoUrlStatic();
+ virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); }
+ static int getNexusModIDStatic();
+ virtual int getNexusModID() { return getNexusModIDStatic(); }
+ virtual int getNexusGameID() { return 1151; }
+
+ // 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<ExecutableInfo> getExecutables();
+
+ virtual std::wstring archiveListKey() { return L"SArchiveList"; }
+
+private:
+
+ Fallout4Info(const std::wstring &gameDirectory);
+
+ static bool identifyGame(const std::wstring &searchPath);
+
+
+};
+
+} // namespace MOShared
+
+#endif // FALLOUT3INFO_H
diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp
index 6347224d..510dfa01 100644
--- a/src/shared/falloutnvinfo.cpp
+++ b/src/shared/falloutnvinfo.cpp
@@ -68,21 +68,4 @@ std::vector<std::wstring> FalloutNVInfo::getIniFileNames() const
return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini");
}
-std::wstring FalloutNVInfo::getReferenceDataFile() const
-{
- return L"Fallout - Meshes.bsa";
-}
-
-bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
-{
- static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr };
-
- for (int i = 0; profileFiles[i] != nullptr; ++i) {
- if (_wcsicmp(fileName, profileFiles[i]) == 0) {
- return true;
- }
- }
- return false;
-}
-
} // namespace MOShared
diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h
index 04c13c7d..a9b3b9ec 100644
--- a/src/shared/falloutnvinfo.h
+++ b/src/shared/falloutnvinfo.h
@@ -41,12 +41,6 @@ public:
// file name of this games ini (no path)
virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile() const;
-
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
-
- virtual std::wstring archiveListKey() const { return L"SArchiveList"; }
-
private:
FalloutNVInfo(const std::wstring &gameDirectory);
diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp
index 5c13a520..9b097053 100644
--- a/src/shared/gameinfo.cpp
+++ b/src/shared/gameinfo.cpp
@@ -23,6 +23,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "oblivioninfo.h"
#include "fallout3info.h"
+#include "fallout4info.h"
#include "falloutnvinfo.h"
#include "skyriminfo.h"
#include "util.h"
@@ -96,6 +97,8 @@ bool GameInfo::identifyGame(const std::wstring &searchPath)
s_Instance = new FalloutNVInfo(searchPath);
} else if (SkyrimInfo::identifyGame(searchPath)) {
s_Instance = new SkyrimInfo(searchPath);
+ } else if (Fallout4Info::identifyGame(searchPath)) {
+ s_Instance = new Fallout4Info(searchPath);
}
return s_Instance != nullptr;
diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h
index 7bc86d3a..c99ebef7 100644
--- a/src/shared/gameinfo.h
+++ b/src/shared/gameinfo.h
@@ -60,12 +60,6 @@ public:
// file name of this games ini file(s)
virtual std::vector<std::wstring> getIniFileNames() const = 0;
- //**USED ONLY IN HOOKDLL
- virtual std::wstring getReferenceDataFile() const = 0;
-
- //**USED ONLY IN HOOKDLL
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const = 0;
-
protected:
GameInfo(const std::wstring &gameDirectory);
diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp
index b50f1daa..b290fb36 100644
--- a/src/shared/oblivioninfo.cpp
+++ b/src/shared/oblivioninfo.cpp
@@ -68,21 +68,4 @@ std::vector<std::wstring> OblivionInfo::getIniFileNames() const
return boost::assign::list_of(L"oblivion.ini")(L"oblivionprefs.ini");
}
-bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
-{
- static LPCWSTR profileFiles[] = { L"oblivion.ini", L"oblivionprefs.ini", L"plugins.txt", nullptr };
-
- for (int i = 0; profileFiles[i] != nullptr; ++i) {
- if (_wcsicmp(fileName, profileFiles[i]) == 0) {
- return true;
- }
- }
- return false;
-}
-
-std::wstring OblivionInfo::getReferenceDataFile() const
-{
- return L"Oblivion - Meshes.bsa";
-}
-
} // namespace MOShared
diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h
index bf0b2707..6609921a 100644
--- a/src/shared/oblivioninfo.h
+++ b/src/shared/oblivioninfo.h
@@ -39,10 +39,6 @@ public:
// file name of this games ini (no path)
virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile() const;
-
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
-
virtual std::wstring archiveListKey() const { return L"SArchiveList"; }
private:
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp
index 9662e66d..fbe13ae0 100644
--- a/src/shared/skyriminfo.cpp
+++ b/src/shared/skyriminfo.cpp
@@ -78,27 +78,4 @@ std::vector<std::wstring> SkyrimInfo::getIniFileNames() const
return boost::assign::list_of(L"skyrim.ini")(L"skyrimprefs.ini");
}
-std::wstring SkyrimInfo::getReferenceDataFile() const
-{
- return L"Skyrim - Meshes.bsa";
-}
-
-bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const
-{
- static LPCWSTR profileFiles[] = { L"skyrim.ini", L"skyrimprefs.ini", L"loadorder.txt", nullptr };
-
- for (int i = 0; profileFiles[i] != nullptr; ++i) {
- if (_wcsicmp(fileName, profileFiles[i]) == 0) {
- return true;
- }
- }
-
- if ((_wcsicmp(fileName, L"plugins.txt") == 0) &&
- (m_AppData.empty() || (StrStrIW(fullPath, m_AppData.c_str()) != nullptr))) {
- return true;
- }
-
- return false;
-}
-
} // namespace MOShared
diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h
index bd329403..a13b834e 100644
--- a/src/shared/skyriminfo.h
+++ b/src/shared/skyriminfo.h
@@ -41,10 +41,6 @@ public:
// file name of this games ini (no path)
virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile() const;
-
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
-
private:
SkyrimInfo(const std::wstring &gameDirectory);