diff options
| -rw-r--r-- | src/mainwindow.cpp | 4 | ||||
| -rw-r--r-- | src/shared/SConscript | 10 | ||||
| -rw-r--r-- | src/shared/fallout3info.cpp | 17 | ||||
| -rw-r--r-- | src/shared/fallout3info.h | 31 | ||||
| -rw-r--r-- | src/shared/falloutnvinfo.cpp | 17 | ||||
| -rw-r--r-- | src/shared/falloutnvinfo.h | 63 | ||||
| -rw-r--r-- | src/shared/gameinfo.cpp | 13 | ||||
| -rw-r--r-- | src/shared/gameinfo.h | 30 | ||||
| -rw-r--r-- | src/shared/oblivioninfo.cpp | 31 | ||||
| -rw-r--r-- | src/shared/oblivioninfo.h | 63 | ||||
| -rw-r--r-- | src/shared/skyriminfo.cpp | 17 | ||||
| -rw-r--r-- | src/shared/skyriminfo.h | 26 |
12 files changed, 137 insertions, 185 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1dca599d..9982e928 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3120,7 +3120,9 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
}
- if (info->getURL() != "") {
+ if (info->getURL() != "" &&
+ !GameInfo::instance().isValidModURL(info->getNexusID(),
+ info->getURL().toStdWString())) {
menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
}
diff --git a/src/shared/SConscript b/src/shared/SConscript index 69a95289..24ca5b19 100644 --- a/src/shared/SConscript +++ b/src/shared/SConscript @@ -1,8 +1,6 @@ -Import('qt_env')
+Import('env')
-env = qt_env.Clone()
-
-env.EnableQtModules('Core', 'Gui')
+env = env.Clone()
env.AppendUnique(CPPDEFINES = [
'UNICODE',
@@ -21,5 +19,5 @@ env.AppendUnique(CPPPATH = [ # Not sure if renaming this helps much as it's static
env.StaticLibrary('mo_shared', env.Glob('*.cpp'))
-res = env['QT_USED_MODULES']
-Return('res')
+#res = env['QT_USED_MODULES']
+#Return('res')
diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 0b369b50..f0776a7d 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -63,7 +63,7 @@ std::wstring Fallout3Info::getRegPathStatic() }
-std::vector<std::wstring> Fallout3Info::getDLCPlugins()
+std::vector<std::wstring> Fallout3Info::getDLCPlugins() const
{
return boost::assign::list_of (L"ThePitt.esm")
(L"Anchorage.esm")
@@ -73,22 +73,22 @@ std::vector<std::wstring> Fallout3Info::getDLCPlugins() ;
}
-std::vector<std::wstring> Fallout3Info::getSavegameAttachmentExtensions()
+std::vector<std::wstring> Fallout3Info::getSavegameAttachmentExtensions() const
{
return std::vector<std::wstring>();
}
-std::vector<std::wstring> Fallout3Info::getIniFileNames()
+std::vector<std::wstring> Fallout3Info::getIniFileNames() const
{
return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini");
}
-std::wstring Fallout3Info::getReferenceDataFile()
+std::wstring Fallout3Info::getReferenceDataFile() const
{
return L"Fallout - Meshes.bsa";
}
-std::wstring Fallout3Info::getNexusPage(bool nmmScheme)
+std::wstring Fallout3Info::getNexusPage(bool nmmScheme) const
{
if (nmmScheme) {
return L"http://nmm.nexusmods.com/fallout3";
@@ -107,7 +107,7 @@ int Fallout3Info::getNexusModIDStatic() return 16348;
}
-bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*)
+bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
{
static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr };
@@ -119,4 +119,9 @@ bool Fallout3Info::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false;
}
+bool Fallout3Info::isValidModURL(int modID, const std::wstring &url) const
+{
+ return GameInfo::isValidModURL(modID, url, L"http://fallout3.nexusmods.com");
+}
+
} // namespace MOShared
diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index 0045581d..0a2b0ebe 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -20,7 +20,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #ifndef FALLOUT3INFO_H
#define FALLOUT3INFO_H
-
#include "gameinfo.h"
namespace MOShared {
@@ -36,36 +35,34 @@ public: virtual ~Fallout3Info() {}
static std::wstring getRegPathStatic();
- virtual std::wstring getRegPath() { return getRegPathStatic(); }
- virtual std::wstring getBinaryName() { return L"Fallout3.exe"; }
+ virtual std::wstring getRegPath() const { return getRegPathStatic(); }
+ virtual std::wstring getBinaryName() const { return L"Fallout3.exe"; }
- virtual GameInfo::Type getType() { return TYPE_FALLOUT3; }
+ virtual GameInfo::Type getType() const { return TYPE_FALLOUT3; }
virtual std::wstring getGameName() const { return L"Fallout 3"; }
virtual std::wstring getGameShortName() const { return L"Fallout3"; }
- virtual std::vector<std::wstring> getDLCPlugins();
- virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
+ virtual std::vector<std::wstring> getDLCPlugins() const;
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions() const;
// file name of this games ini (no path)
- virtual std::vector<std::wstring> getIniFileNames();
+ virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile();
+ virtual std::wstring getReferenceDataFile() const;
- virtual std::wstring getNexusPage(bool nmmScheme = true);
+ virtual std::wstring getNexusPage(bool nmmScheme = true) const;
static std::wstring getNexusInfoUrlStatic();
- virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); }
+ virtual std::wstring getNexusInfoUrl() const { return getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
- virtual int getNexusModID() { return getNexusModIDStatic(); }
- virtual int getNexusGameID() { return 120; }
+ virtual int getNexusModID() const { return getNexusModIDStatic(); }
+ virtual int getNexusGameID() const { return 120; }
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath);
+ virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
- // 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() const { return L"SArchiveList"; }
- virtual std::wstring archiveListKey() { return L"SArchiveList"; }
+ virtual bool isValidModURL(int modID, std::wstring const &url) const;
private:
diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index 1203bd25..f6de72e3 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -63,7 +63,7 @@ std::wstring FalloutNVInfo::getRegPathStatic() }
}
-std::vector<std::wstring> FalloutNVInfo::getDLCPlugins()
+std::vector<std::wstring> FalloutNVInfo::getDLCPlugins() const
{
return boost::assign::list_of (L"DeadMoney.esm")
(L"HonestHearts.esm")
@@ -77,22 +77,22 @@ std::vector<std::wstring> FalloutNVInfo::getDLCPlugins() ;
}
-std::vector<std::wstring> FalloutNVInfo::getSavegameAttachmentExtensions()
+std::vector<std::wstring> FalloutNVInfo::getSavegameAttachmentExtensions() const
{
return std::vector<std::wstring>();
}
-std::vector<std::wstring> FalloutNVInfo::getIniFileNames()
+std::vector<std::wstring> FalloutNVInfo::getIniFileNames() const
{
return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini");
}
-std::wstring FalloutNVInfo::getReferenceDataFile()
+std::wstring FalloutNVInfo::getReferenceDataFile() const
{
return L"Fallout - Meshes.bsa";
}
-std::wstring FalloutNVInfo::getNexusPage(bool nmmScheme)
+std::wstring FalloutNVInfo::getNexusPage(bool nmmScheme) const
{
if (nmmScheme) {
return L"http://nmm.nexusmods.com/newvegas";
@@ -114,7 +114,7 @@ int FalloutNVInfo::getNexusModIDStatic() }
-bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*)
+bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
{
static LPCWSTR profileFiles[] = { L"fallout.ini", L"falloutprefs.ini", L"plugins.txt", nullptr };
@@ -126,4 +126,9 @@ bool FalloutNVInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false;
}
+bool FalloutNVInfo::isValidModURL(int modID, std::wstring const &url) const
+{
+ return GameInfo::isValidModURL(modID, url, L"http://newvegas.nexusmods.com");
+}
+
} // namespace MOShared
diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index e1a614d2..d03add9c 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -36,69 +36,34 @@ public: virtual ~FalloutNVInfo() {}
static std::wstring getRegPathStatic();
- virtual std::wstring getRegPath() { return getRegPathStatic(); }
- virtual std::wstring getBinaryName() { return L"FalloutNV.exe"; }
+ virtual std::wstring getRegPath() const { return getRegPathStatic(); }
+ virtual std::wstring getBinaryName() const { return L"FalloutNV.exe"; }
- virtual GameInfo::Type getType() { return TYPE_FALLOUTNV; }
+ virtual GameInfo::Type getType() const { return TYPE_FALLOUTNV; }
virtual std::wstring getGameName() const { return L"New Vegas"; }
virtual std::wstring getGameShortName() const { return L"FalloutNV"; }
-// virtual bool requiresSteam() const { return true; }
-
-/* 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<std::wstring> 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<std::wstring> getPrimaryPlugins()
- {
- return boost::assign::list_of(L"falloutnv.esm");
- }*/
- virtual std::vector<std::wstring> getDLCPlugins();
- virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
+ virtual std::vector<std::wstring> getDLCPlugins() const;
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions() const;
// file name of this games ini (no path)
- virtual std::vector<std::wstring> getIniFileNames();
+ virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile();
+ virtual std::wstring getReferenceDataFile() const;
- virtual std::wstring getNexusPage(bool nmmScheme = true);
+ virtual std::wstring getNexusPage(bool nmmScheme = true) const;
static std::wstring getNexusInfoUrlStatic();
- virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); }
+ virtual std::wstring getNexusInfoUrl() const { return getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
- virtual int getNexusModID() { return getNexusModIDStatic(); }
- virtual int getNexusGameID() { return 130; }
+ virtual int getNexusModID() const { return getNexusModIDStatic(); }
+ virtual int getNexusGameID() const { return 130; }
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath);
+ virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
- // 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() const { return L"SArchiveList"; }
- virtual std::wstring archiveListKey() { return L"SArchiveList"; }
+ virtual bool isValidModURL(int modID, const std::wstring &url) const;
private:
diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index 1f25cec1..5338c069 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -86,6 +86,19 @@ void GameInfo::identifyMyGamesDirectory(const std::wstring &file) }
}
+bool GameInfo::isValidModURL(int modID, const std::wstring &url, const std::wstring &alt) const
+{
+ std::wostringstream os;
+ os << getNexusPage(false) << "/mods/" << modID;
+ if (url == os.str()) {
+ return true;
+ }
+ os.clear();
+ os.str(L"");
+ os << alt << "/mods/" << modID;
+ return url == os.str();
+}
+
bool GameInfo::identifyGame(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &searchPath)
{
diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index a32b6b82..8caa5937 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -56,12 +56,12 @@ public: virtual ~GameInfo() {}
- std::wstring getOrganizerDirectory() { return m_OrganizerDirectory; }
+ std::wstring getOrganizerDirectory() const { return m_OrganizerDirectory; }
- virtual std::wstring getRegPath() = 0;
- virtual std::wstring getBinaryName() = 0;
+ virtual std::wstring getRegPath() const = 0;
+ virtual std::wstring getBinaryName() const = 0;
- virtual GameInfo::Type getType() = 0;
+ virtual GameInfo::Type getType() const = 0;
virtual std::wstring getGameName() const = 0;
virtual std::wstring getGameShortName() const = 0;
@@ -75,22 +75,24 @@ public: virtual bool requiresSteam() const;
// get a list of file extensions for additional files belonging to a save game
- virtual std::vector<std::wstring> getSavegameAttachmentExtensions() = 0;
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions() const = 0;
// get a set of esp/esm files that are part of known dlcs
- virtual std::vector<std::wstring> getDLCPlugins() = 0;
+ virtual std::vector<std::wstring> getDLCPlugins() const = 0;
// file name of this games ini file(s)
- virtual std::vector<std::wstring> getIniFileNames() = 0;
+ virtual std::vector<std::wstring> getIniFileNames() const = 0;
- virtual std::wstring getReferenceDataFile() = 0;
+ virtual std::wstring getReferenceDataFile() const = 0;
- virtual std::wstring getNexusPage(bool nmmScheme = true) = 0;
- virtual std::wstring getNexusInfoUrl() = 0;
- virtual int getNexusModID() = 0;
- virtual int getNexusGameID() = 0;
+ virtual std::wstring getNexusPage(bool nmmScheme = true) const = 0;
+ virtual std::wstring getNexusInfoUrl() const = 0;
+ virtual int getNexusModID() const = 0;
+ virtual int getNexusGameID() const = 0;
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) = 0;
+ virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const = 0;
+
+ virtual bool isValidModURL(int modID, std::wstring const &url) const = 0;
public:
@@ -108,6 +110,8 @@ protected: const std::wstring &getMyGamesDirectory() const { return m_MyGamesDirectory; }
void identifyMyGamesDirectory(const std::wstring &file);
+ bool isValidModURL(int modID, const std::wstring &url, const std::wstring &alt) const;
+
private:
static bool identifyGame(const std::wstring &moDirectory, const std::wstring &moDataDirectory, const std::wstring &searchPath);
diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index 16748f58..730c186b 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -63,17 +63,7 @@ std::wstring OblivionInfo::getRegPathStatic() }
}
-
-
-
-
-
-
-
-
-
-
-std::vector<std::wstring> OblivionInfo::getDLCPlugins()
+std::vector<std::wstring> OblivionInfo::getDLCPlugins() const
{
return boost::assign::list_of (L"DLCShiveringIsles.esp")
(L"Knights.esp")
@@ -89,22 +79,18 @@ std::vector<std::wstring> OblivionInfo::getDLCPlugins() }
-std::vector<std::wstring> OblivionInfo::getSavegameAttachmentExtensions()
+std::vector<std::wstring> OblivionInfo::getSavegameAttachmentExtensions() const
{
return boost::assign::list_of(L"obse");
}
-std::vector<std::wstring> OblivionInfo::getIniFileNames()
+std::vector<std::wstring> OblivionInfo::getIniFileNames() const
{
return boost::assign::list_of(L"oblivion.ini")(L"oblivionprefs.ini");
}
-
-
-
-
-std::wstring OblivionInfo::getNexusPage(bool nmmScheme)
+std::wstring OblivionInfo::getNexusPage(bool nmmScheme) const
{
if (nmmScheme) {
return L"http://nmm.nexusmods.com/oblivion";
@@ -125,7 +111,7 @@ int OblivionInfo::getNexusModIDStatic() return 38277;
}
-bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*)
+bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) const
{
static LPCWSTR profileFiles[] = { L"oblivion.ini", L"oblivionprefs.ini", L"plugins.txt", nullptr };
@@ -137,9 +123,14 @@ bool OblivionInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t*) return false;
}
-std::wstring OblivionInfo::getReferenceDataFile()
+std::wstring OblivionInfo::getReferenceDataFile() const
{
return L"Oblivion - Meshes.bsa";
}
+bool OblivionInfo::isValidModURL(int modID, const std::wstring &url) const
+{
+ return GameInfo::isValidModURL(modID, url, L"http://oblivion.nexusmods.com");
+}
+
} // namespace MOShared
diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index 87ba26ff..1adf9cab 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -34,69 +34,34 @@ public: virtual ~OblivionInfo() {}
static std::wstring getRegPathStatic();
- virtual std::wstring getRegPath() { return getRegPathStatic(); }
- virtual std::wstring getBinaryName() { return L"Oblivion.exe"; }
+ virtual std::wstring getRegPath() const { return getRegPathStatic(); }
+ virtual std::wstring getBinaryName() const { return L"Oblivion.exe"; }
- virtual GameInfo::Type getType() { return TYPE_OBLIVION; }
+ virtual GameInfo::Type getType() const { return TYPE_OBLIVION; }
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<std::wstring> 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<std::wstring> getPrimaryPlugins()
- {
- return boost::assign::list_of(L"oblivion.esm");
- }*/
- virtual std::vector<std::wstring> getDLCPlugins();
- virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
+ virtual std::vector<std::wstring> getDLCPlugins() const;
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions() const;
// file name of this games ini (no path)
- virtual std::vector<std::wstring> getIniFileNames();
+ virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile();
+ virtual std::wstring getReferenceDataFile() const;
- virtual std::wstring getNexusPage(bool nmmScheme = true);
+ virtual std::wstring getNexusPage(bool nmmScheme = true) const;
static std::wstring getNexusInfoUrlStatic();
- virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); }
+ virtual std::wstring getNexusInfoUrl() const { return getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
- virtual int getNexusModID() { return getNexusModIDStatic(); }
- virtual int getNexusGameID() { return 101; }
+ virtual int getNexusModID() const { return getNexusModIDStatic(); }
+ virtual int getNexusGameID() const { return 101; }
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath);
+ virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
- // 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() const { return L"SArchiveList"; }
- virtual std::wstring archiveListKey() { return L"SArchiveList"; }
+ virtual bool isValidModURL(int modID, std::wstring const &url) const;
private:
diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index f66fcef4..7c85fe10 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -91,7 +91,7 @@ GameInfo::LoadOrderMechanism SkyrimInfo::getLoadOrderMechanism() const }
}
-std::vector<std::wstring> SkyrimInfo::getDLCPlugins()
+std::vector<std::wstring> SkyrimInfo::getDLCPlugins() const
{
return boost::assign::list_of (L"Dawnguard.esm")
(L"Dragonborn.esm")
@@ -102,23 +102,23 @@ std::vector<std::wstring> SkyrimInfo::getDLCPlugins() ;
}
-std::vector<std::wstring> SkyrimInfo::getSavegameAttachmentExtensions()
+std::vector<std::wstring> SkyrimInfo::getSavegameAttachmentExtensions() const
{
return boost::assign::list_of(L"skse");
}
-std::vector<std::wstring> SkyrimInfo::getIniFileNames()
+std::vector<std::wstring> SkyrimInfo::getIniFileNames() const
{
return boost::assign::list_of(L"skyrim.ini")(L"skyrimprefs.ini");
}
-std::wstring SkyrimInfo::getReferenceDataFile()
+std::wstring SkyrimInfo::getReferenceDataFile() const
{
return L"Skyrim - Meshes.bsa";
}
-std::wstring SkyrimInfo::getNexusPage(bool nmmScheme)
+std::wstring SkyrimInfo::getNexusPage(bool nmmScheme) const
{
if (nmmScheme) {
return L"http://nmm.nexusmods.com/skyrim";
@@ -139,7 +139,7 @@ int SkyrimInfo::getNexusModIDStatic() return 1334;
}
-bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath)
+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 };
@@ -157,5 +157,10 @@ bool SkyrimInfo::rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPa return false;
}
+bool SkyrimInfo::isValidModURL(int modID, const std::wstring &url) const
+{
+ return GameInfo::isValidModURL(modID, url, L"http://skyrim.nexusmods.com");
+}
+
} // namespace MOShared
diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index 5951f910..e2766688 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -36,35 +36,37 @@ public: virtual ~SkyrimInfo() {}
static std::wstring getRegPathStatic();
- virtual std::wstring getRegPath() { return getRegPathStatic(); }
- virtual std::wstring getBinaryName() { return L"TESV.exe"; }
+ virtual std::wstring getRegPath() const { return getRegPathStatic(); }
+ virtual std::wstring getBinaryName() const { return L"TESV.exe"; }
- virtual GameInfo::Type getType() { return TYPE_SKYRIM; }
+ virtual GameInfo::Type getType() const { return TYPE_SKYRIM; }
virtual std::wstring getGameName() const { return L"Skyrim"; }
virtual std::wstring getGameShortName() const { return L"Skyrim"; }
virtual LoadOrderMechanism getLoadOrderMechanism() const;
- virtual std::vector<std::wstring> getDLCPlugins();
+ virtual std::vector<std::wstring> getDLCPlugins() const;
- virtual std::vector<std::wstring> getSavegameAttachmentExtensions();
+ virtual std::vector<std::wstring> getSavegameAttachmentExtensions() const;
// file name of this games ini (no path)
- virtual std::vector<std::wstring> getIniFileNames();
+ virtual std::vector<std::wstring> getIniFileNames() const;
- virtual std::wstring getReferenceDataFile();
+ virtual std::wstring getReferenceDataFile() const;
- virtual std::wstring getNexusPage(bool nmmScheme = true);
+ virtual std::wstring getNexusPage(bool nmmScheme = true) const;
static std::wstring getNexusInfoUrlStatic();
- virtual std::wstring getNexusInfoUrl() { return getNexusInfoUrlStatic(); }
+ virtual std::wstring getNexusInfoUrl() const { return getNexusInfoUrlStatic(); }
static int getNexusModIDStatic();
- virtual int getNexusModID() { return getNexusModIDStatic(); }
+ virtual int getNexusModID() const { return getNexusModIDStatic(); }
static int getNexusGameIDStatic() { return 110; }
- virtual int getNexusGameID() { return getNexusGameIDStatic(); }
+ virtual int getNexusGameID() const { return getNexusGameIDStatic(); }
- virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath);
+ virtual bool rerouteToProfile(const wchar_t *fileName, const wchar_t *fullPath) const;
+
+ virtual bool isValidModURL(int modID, std::wstring const &url) const;
private:
|
