Skip to content

Commit

Permalink
New feature
Browse files Browse the repository at this point in the history
Added support for multiple Steam libraries that exist outside of the
folder where Steam is installed.
  • Loading branch information
Kapiainen committed Apr 29, 2015
1 parent b005aec commit f933e6d
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 33 deletions.
3 changes: 3 additions & 0 deletions Lauhdutin/@Resources/UserSettings.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ SteamPath=
;UserDataID corresponding to your Steam account.
UserDataID=

;Paths to Steam libraries that are not located in the same place as your Steam installation. Multiple paths can be separated with a semicolon (;).
SteamLibraryPaths=

;Width of a game's banner in pixels. Default value is 274.
BannerWidth=274
Expand Down
69 changes: 44 additions & 25 deletions Lauhdutin/Lauhdutin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function Initialize()
end
S_PATH_STEAM = Trim(S_PATH_STEAM)
end
S_PATH_STEAM_LIBRARIES = SKIN:GetVariable('SteamLibraryPaths', nil)
S_STEAM_USER_DATA_ID = SKIN:GetVariable('UserDataID', nil)
if S_STEAM_USER_DATA_ID ~= nil then
S_STEAM_USER_DATA_ID = Trim(S_STEAM_USER_DATA_ID)
Expand Down Expand Up @@ -235,6 +236,20 @@ end
tNonSteamGames = nil
end

local tSteamLibraryPaths = {}
table.insert(tSteamLibraryPaths, S_PATH_STEAM)
if S_PATH_STEAM_LIBRARIES ~= nil then
for sLibraryPath in S_PATH_STEAM_LIBRARIES:gmatch('([^;]+)') do
if sLibraryPath ~= nil then
if sLibraryPath ~= '' and EndsWith(sPath, '\\') == false then
sLibraryPath = sLibraryPath .. '\\'
end
sLibraryPath = Trim(sLibraryPath)
end
table.insert(tSteamLibraryPaths, sLibraryPath)
end
end

-- Steam games and non-Steam games that have been added to the Steam library.
if S_PATH_STEAM ~= nil and S_PATH_STEAM ~= '' then
if S_STEAM_USER_DATA_ID == nil or S_STEAM_USER_DATA_ID == '' then
Expand All @@ -251,36 +266,40 @@ end
local tExceptions = ParseVDFFile(S_PATH_RESOURCES .. S_INCLUDE_FILE_EXCEPTIONS)
if tLocalConfigApps ~= nil and tLocalConfigAppTickets ~= nil and tSharedConfigApps ~= nil then

-- Steam games.
for sAppID, tTable in pairs(tLocalConfigAppTickets) do
if tExceptions[sAppID] == nil then
local tGame = {}
tGame[S_VDF_KEY_STEAM] = 'true'
tGame[S_VDF_KEY_APPID] = sAppID
if tLocalConfigApps[sAppID] ~= nil and tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED] ~= nil then
tGame[S_VDF_KEY_LAST_PLAYED] = tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED]
local tAppManifest = ParseVDFFile(S_PATH_STEAM .. 'SteamApps\\appmanifest_' .. sAppID .. '.acf')
if tAppManifest ~= nil then
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_NAME]
if tGame[S_VDF_KEY_NAME] == nil then
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_USER_CONFIG][S_VDF_KEY_NAME]
end
local tGameSharedConfig = RecursiveTableSearch(tSharedConfigApps, sAppID)
if tGameSharedConfig ~= nil then
tGame[S_VDF_KEY_TAGS] = RecursiveTableSearch(tGameSharedConfig, S_VDF_KEY_TAGS)
tGame[S_VDF_KEY_HIDDEN] = tGameSharedConfig[S_VDF_KEY_HIDDEN]
end
tGameSharedConfig = nil
if tGame[S_VDF_KEY_HIDDEN] == nil or tGame[S_VDF_KEY_HIDDEN] == '0' then
table.insert(tGames, tGame)
if BannerExists(tGame[S_VDF_KEY_APPID]) == nil then
table.insert(T_LOGO_QUEUE, tGame[S_VDF_KEY_APPID])
for i = 1, #tSteamLibraryPaths do

-- Steam games.
for sAppID, tTable in pairs(tLocalConfigAppTickets) do
if tExceptions[sAppID] == nil then
local tGame = {}
tGame[S_VDF_KEY_STEAM] = 'true'
tGame[S_VDF_KEY_APPID] = sAppID
if tLocalConfigApps[sAppID] ~= nil and tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED] ~= nil then
tGame[S_VDF_KEY_LAST_PLAYED] = tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED]
local tAppManifest = ParseVDFFile(tSteamLibraryPaths[i] .. 'SteamApps\\appmanifest_' .. sAppID .. '.acf')
if tAppManifest ~= nil then
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_NAME]
if tGame[S_VDF_KEY_NAME] == nil then
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_USER_CONFIG][S_VDF_KEY_NAME]
end
local tGameSharedConfig = RecursiveTableSearch(tSharedConfigApps, sAppID)
if tGameSharedConfig ~= nil then
tGame[S_VDF_KEY_TAGS] = RecursiveTableSearch(tGameSharedConfig, S_VDF_KEY_TAGS)
tGame[S_VDF_KEY_HIDDEN] = tGameSharedConfig[S_VDF_KEY_HIDDEN]
end
tGameSharedConfig = nil
if tGame[S_VDF_KEY_HIDDEN] == nil or tGame[S_VDF_KEY_HIDDEN] == '0' then
table.insert(tGames, tGame)
if BannerExists(tGame[S_VDF_KEY_APPID]) == nil then
table.insert(T_LOGO_QUEUE, tGame[S_VDF_KEY_APPID])
end
end
end
end
tGame = nil
end
tGame = nil
end

end

-- Non-Steam games that have been added to the Steam library.
Expand Down
15 changes: 7 additions & 8 deletions Lauhdutin/Main.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[Metadata]
Name=Lauhdutin
Author=Kapiainen
Information=A launcher for Steam and non-Steam games, movies, misc. software, etc.
Version=1.1.0
License=MIT

[Rainmeter]
Update=1000
Blur=1
Expand All @@ -11,14 +18,6 @@ ContextAction2=[notepad "#@#SteamShortcuts.inc"]
ContextTitle3=Exceptions
ContextAction3=[notepad "#@#Exceptions.inc"]


[Metadata]
Name=Lauhdutin
Author=Kapiainen
Information=A launcher for Steam and non-Steam games, movies, misc. software, etc.
Version=1.0.1
License=MIT

[Variables]
@Include=#@#Variables.inc
@Include2=#@#UserSettings.inc
Expand Down
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ The UserDataID corresponding to your Steam account. This can be found by looking
UserDataID=123456789
```

##SteamLibraryPaths
One or more absolute paths to folders containing Steam libraries. Multiple paths should be separated by a semicolon (;).

```
SteamLibraryPaths=D:\Steam Library;E:\Steam Library
```

##BannerWidth
The width of a banner in pixels.

Expand Down

0 comments on commit f933e6d

Please sign in to comment.