From 0feb4b702d8a9eb1465c79c49ada5de01b67083d Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 8 Jun 2014 15:10:08 +0200 Subject: - loot client now only updates the masterlist once per MO session - new event to notify plugins of changed mod priority - overwrite now shows up in the "checked" category instead of "unchecked" - display of "foreign" mods can now be limited to only official content - bugfix: bsa extraction dialog showed up even if the plugin was disabled - bugfix: after detection of foreign mods the priority of the overwrite folder could get messed up - bugfix: when displaying only the context menu for the mod list as a whole, the menu didn't disappear - bugfix: MO crashed when trying to download via the integrated browser --- src/shared/fallout3info.cpp | 10 ++++++++++ src/shared/fallout3info.h | 1 + src/shared/falloutnvinfo.cpp | 15 +++++++++++++++ src/shared/falloutnvinfo.h | 1 + src/shared/gameinfo.cpp | 8 +++++++- src/shared/gameinfo.h | 3 +++ src/shared/oblivioninfo.cpp | 16 ++++++++++++++++ src/shared/oblivioninfo.h | 1 + src/shared/skyriminfo.cpp | 16 +++++++++++++++- src/shared/skyriminfo.h | 1 + 10 files changed, 70 insertions(+), 2 deletions(-) (limited to 'src/shared') diff --git a/src/shared/fallout3info.cpp b/src/shared/fallout3info.cpp index 1808d1d9..68fd515e 100644 --- a/src/shared/fallout3info.cpp +++ b/src/shared/fallout3info.cpp @@ -112,6 +112,16 @@ std::vector Fallout3Info::getVanillaBSAs() (L"Fallout - Misc.bsa"); } +std::vector Fallout3Info::getDLCPlugins() +{ + return boost::assign::list_of (L"ThePitt.esm") + (L"Anchorage.esm") + (L"BrokenSteel.esm") + (L"PointLookout.esm") + (L"Zeta.esm") + ; +} + std::vector Fallout3Info::getIniFileNames() { return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini"); diff --git a/src/shared/fallout3info.h b/src/shared/fallout3info.h index 9575103b..e9a818e2 100644 --- a/src/shared/fallout3info.h +++ b/src/shared/fallout3info.h @@ -58,6 +58,7 @@ public: virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); + virtual std::vector getDLCPlugins(); // file name of this games ini (no path) virtual std::vector getIniFileNames(); diff --git a/src/shared/falloutnvinfo.cpp b/src/shared/falloutnvinfo.cpp index e7e747e2..366c72c3 100644 --- a/src/shared/falloutnvinfo.cpp +++ b/src/shared/falloutnvinfo.cpp @@ -113,6 +113,21 @@ std::vector FalloutNVInfo::getVanillaBSAs() (L"Fallout - Misc.bsa"); } +std::vector FalloutNVInfo::getDLCPlugins() +{ + return boost::assign::list_of (L"DeadMoney.esm") + (L"HonestHearts.esm") + (L"OldWorldBlues.esm") + (L"LonesomeRoad.esm") + (L"GunRunnersArsenal.esm") + (L"CaravanPack.esm") + (L"ClassicPack.esm") + (L"MercenaryPack.esm") + (L"TribalPack.esm") + ; +} + + std::vector FalloutNVInfo::getIniFileNames() { return boost::assign::list_of(L"fallout.ini")(L"falloutprefs.ini"); diff --git a/src/shared/falloutnvinfo.h b/src/shared/falloutnvinfo.h index 8767fdb0..e6f6b5d0 100644 --- a/src/shared/falloutnvinfo.h +++ b/src/shared/falloutnvinfo.h @@ -60,6 +60,7 @@ public: virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); + virtual std::vector getDLCPlugins(); // file name of this games ini (no path) virtual std::vector getIniFileNames(); diff --git a/src/shared/gameinfo.cpp b/src/shared/gameinfo.cpp index b580a226..ebeff55a 100644 --- a/src/shared/gameinfo.cpp +++ b/src/shared/gameinfo.cpp @@ -222,7 +222,13 @@ std::wstring GameInfo::getSpecialPath(LPCWSTR name) const throw windows_error("failed to look up special folder", errorcode); } - return temp; + WCHAR temp2[MAX_PATH]; + // try to expand variables in the path, if any + if (::ExpandEnvironmentStringsW(temp, temp2, MAX_PATH) != 0) { + return temp2; + } else { + return temp; + } } } // namespace MOShared diff --git a/src/shared/gameinfo.h b/src/shared/gameinfo.h index 89c9402d..69cd38f6 100644 --- a/src/shared/gameinfo.h +++ b/src/shared/gameinfo.h @@ -130,6 +130,9 @@ public: virtual std::vector getVanillaBSAs() = 0; + // get a set of esp/esm files that are part of known dlcs + virtual std::vector getDLCPlugins() = 0; + // file name of this games ini file(s) virtual std::vector getIniFileNames() = 0; diff --git a/src/shared/oblivioninfo.cpp b/src/shared/oblivioninfo.cpp index d8daa0f7..85f31042 100644 --- a/src/shared/oblivioninfo.cpp +++ b/src/shared/oblivioninfo.cpp @@ -117,6 +117,22 @@ std::vector OblivionInfo::getVanillaBSAs() } +std::vector OblivionInfo::getDLCPlugins() +{ + return boost::assign::list_of (L"DLCShiveringIsles.esp") + (L"Knights.esp") + (L"DLCFrostcrag.esp") + (L"DLCSpellTomes.esp") + (L"DLCMehrunesRazor.esp") + (L"DLCOrrery.esp") + (L"DLCSpellTomes.esp") + (L"DLCThievesDen.esp") + (L"DLCVileLair.esp") + (L"DLCHorseArmor.esp") + ; +} + + std::vector OblivionInfo::getIniFileNames() { return boost::assign::list_of(L"oblivion.ini")(L"oblivionprefs.ini"); diff --git a/src/shared/oblivioninfo.h b/src/shared/oblivioninfo.h index ba27aa40..f9c8fa47 100644 --- a/src/shared/oblivioninfo.h +++ b/src/shared/oblivioninfo.h @@ -56,6 +56,7 @@ public: virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); + virtual std::vector getDLCPlugins(); // file name of this games ini (no path) virtual std::vector getIniFileNames(); diff --git a/src/shared/skyriminfo.cpp b/src/shared/skyriminfo.cpp index bf7500e6..00cdd4d0 100644 --- a/src/shared/skyriminfo.cpp +++ b/src/shared/skyriminfo.cpp @@ -144,7 +144,18 @@ std::vector SkyrimInfo::getVanillaBSAs() (L"Skyrim - Meshes.bsa") (L"Skyrim - Sounds.bsa") (L"Skyrim - Voices.bsa") - (L"Skyrim - VoicesExtra.bsa"); + (L"Skyrim - VoicesExtra.bsa"); +} + +std::vector SkyrimInfo::getDLCPlugins() +{ + return boost::assign::list_of (L"Dawnguard.esm") + (L"Dragonborn.esm") + (L"HearthFires.esm") + (L"HighResTexturePack01.esp") + (L"HighResTexturePack02.esp") + (L"HighResTexturePack03.esp") + ; } std::vector SkyrimInfo::getIniFileNames() @@ -210,7 +221,9 @@ void SkyrimInfo::createProfile(const std::wstring &directory, bool useDefaults) if (!FileExists(target)) { std::wostringstream source; source << getLocalAppFolder() << "\\Skyrim\\plugins.txt"; +printf("copy %ls -> %ls\n", source.str().c_str(), target.c_str()); if (!::CopyFileW(source.str().c_str(), target.c_str(), true)) { +printf("failed to copy plugins.txt!"); HANDLE file = ::CreateFileW(target.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); ::CloseHandle(file); } @@ -305,4 +318,5 @@ std::vector SkyrimInfo::getExecutables() return result; } + } // namespace MOShared diff --git a/src/shared/skyriminfo.h b/src/shared/skyriminfo.h index 438beb41..61fb3fa2 100644 --- a/src/shared/skyriminfo.h +++ b/src/shared/skyriminfo.h @@ -63,6 +63,7 @@ public: virtual std::vector getPrimaryPlugins(); virtual std::vector getVanillaBSAs(); + virtual std::vector getDLCPlugins(); // file name of this games ini (no path) virtual std::vector getIniFileNames(); -- cgit v1.3.1