- Added Steam detection for Stife: Veteran Edition.

- Added Steam install scanning for Linux and OS X. (OS X and Win32 not yet tested.)
This commit is contained in:
Braden Obrzut 2014-12-12 16:19:37 -05:00
commit 86372fce34
7 changed files with 257 additions and 27 deletions

View file

@ -1524,20 +1524,36 @@ static bool QueryPathKey(HKEY key, const char *keypath, const char *valname, FSt
//
//==========================================================================
FString I_GetSteamPath()
TArray<FString> I_GetSteamPath()
{
TArray<FString> result;
static const char *const steam_dirs[] =
{
"doom 2/base",
"final doom/base",
"heretic shadow of the serpent riders/base",
"hexen/base",
"hexen deathkings of the dark citadel/base",
"ultimate doom/base",
"DOOM 3 BFG Edition/base/wads",
"Strife"
};
FString path;
if (QueryPathKey(HKEY_CURRENT_USER, "Software\\Valve\\Steam", "SteamPath", path))
if (!QueryPathKey(HKEY_CURRENT_USER, "Software\\Valve\\Steam", "SteamPath", path))
{
return path;
if (!QueryPathKey(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", "InstallPath", path))
return result;
}
if (QueryPathKey(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", "InstallPath", path))
path += "/SteamApps/common/";
for(unsigned int i = 0; i < countof(steam_dirs); ++i)
{
return path;
result.Push(path + steam_dirs[i]);
}
path = "";
return path;
return result;
}
//==========================================================================