Skip to content

Commit f933e6d

Browse files
committed
New feature
Added support for multiple Steam libraries that exist outside of the folder where Steam is installed.
1 parent b005aec commit f933e6d

File tree

4 files changed

+61
-33
lines changed

4 files changed

+61
-33
lines changed

Lauhdutin/@Resources/UserSettings.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ SteamPath=
55
;UserDataID corresponding to your Steam account.
66
UserDataID=
77

8+
;Paths to Steam libraries that are not located in the same place as your Steam installation. Multiple paths can be separated with a semicolon (;).
9+
SteamLibraryPaths=
10+
811
;Width of a game's banner in pixels. Default value is 274.
912
BannerWidth=274
1013

Lauhdutin/Lauhdutin.lua

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function Initialize()
3636
end
3737
S_PATH_STEAM = Trim(S_PATH_STEAM)
3838
end
39+
S_PATH_STEAM_LIBRARIES = SKIN:GetVariable('SteamLibraryPaths', nil)
3940
S_STEAM_USER_DATA_ID = SKIN:GetVariable('UserDataID', nil)
4041
if S_STEAM_USER_DATA_ID ~= nil then
4142
S_STEAM_USER_DATA_ID = Trim(S_STEAM_USER_DATA_ID)
@@ -235,6 +236,20 @@ end
235236
tNonSteamGames = nil
236237
end
237238

239+
local tSteamLibraryPaths = {}
240+
table.insert(tSteamLibraryPaths, S_PATH_STEAM)
241+
if S_PATH_STEAM_LIBRARIES ~= nil then
242+
for sLibraryPath in S_PATH_STEAM_LIBRARIES:gmatch('([^;]+)') do
243+
if sLibraryPath ~= nil then
244+
if sLibraryPath ~= '' and EndsWith(sPath, '\\') == false then
245+
sLibraryPath = sLibraryPath .. '\\'
246+
end
247+
sLibraryPath = Trim(sLibraryPath)
248+
end
249+
table.insert(tSteamLibraryPaths, sLibraryPath)
250+
end
251+
end
252+
238253
-- Steam games and non-Steam games that have been added to the Steam library.
239254
if S_PATH_STEAM ~= nil and S_PATH_STEAM ~= '' then
240255
if S_STEAM_USER_DATA_ID == nil or S_STEAM_USER_DATA_ID == '' then
@@ -251,36 +266,40 @@ end
251266
local tExceptions = ParseVDFFile(S_PATH_RESOURCES .. S_INCLUDE_FILE_EXCEPTIONS)
252267
if tLocalConfigApps ~= nil and tLocalConfigAppTickets ~= nil and tSharedConfigApps ~= nil then
253268

254-
-- Steam games.
255-
for sAppID, tTable in pairs(tLocalConfigAppTickets) do
256-
if tExceptions[sAppID] == nil then
257-
local tGame = {}
258-
tGame[S_VDF_KEY_STEAM] = 'true'
259-
tGame[S_VDF_KEY_APPID] = sAppID
260-
if tLocalConfigApps[sAppID] ~= nil and tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED] ~= nil then
261-
tGame[S_VDF_KEY_LAST_PLAYED] = tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED]
262-
local tAppManifest = ParseVDFFile(S_PATH_STEAM .. 'SteamApps\\appmanifest_' .. sAppID .. '.acf')
263-
if tAppManifest ~= nil then
264-
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_NAME]
265-
if tGame[S_VDF_KEY_NAME] == nil then
266-
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_USER_CONFIG][S_VDF_KEY_NAME]
267-
end
268-
local tGameSharedConfig = RecursiveTableSearch(tSharedConfigApps, sAppID)
269-
if tGameSharedConfig ~= nil then
270-
tGame[S_VDF_KEY_TAGS] = RecursiveTableSearch(tGameSharedConfig, S_VDF_KEY_TAGS)
271-
tGame[S_VDF_KEY_HIDDEN] = tGameSharedConfig[S_VDF_KEY_HIDDEN]
272-
end
273-
tGameSharedConfig = nil
274-
if tGame[S_VDF_KEY_HIDDEN] == nil or tGame[S_VDF_KEY_HIDDEN] == '0' then
275-
table.insert(tGames, tGame)
276-
if BannerExists(tGame[S_VDF_KEY_APPID]) == nil then
277-
table.insert(T_LOGO_QUEUE, tGame[S_VDF_KEY_APPID])
269+
for i = 1, #tSteamLibraryPaths do
270+
271+
-- Steam games.
272+
for sAppID, tTable in pairs(tLocalConfigAppTickets) do
273+
if tExceptions[sAppID] == nil then
274+
local tGame = {}
275+
tGame[S_VDF_KEY_STEAM] = 'true'
276+
tGame[S_VDF_KEY_APPID] = sAppID
277+
if tLocalConfigApps[sAppID] ~= nil and tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED] ~= nil then
278+
tGame[S_VDF_KEY_LAST_PLAYED] = tLocalConfigApps[sAppID][S_VDF_KEY_LAST_PLAYED]
279+
local tAppManifest = ParseVDFFile(tSteamLibraryPaths[i] .. 'SteamApps\\appmanifest_' .. sAppID .. '.acf')
280+
if tAppManifest ~= nil then
281+
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_NAME]
282+
if tGame[S_VDF_KEY_NAME] == nil then
283+
tGame[S_VDF_KEY_NAME] = tAppManifest[S_VDF_KEY_APP_STATE][S_VDF_KEY_USER_CONFIG][S_VDF_KEY_NAME]
284+
end
285+
local tGameSharedConfig = RecursiveTableSearch(tSharedConfigApps, sAppID)
286+
if tGameSharedConfig ~= nil then
287+
tGame[S_VDF_KEY_TAGS] = RecursiveTableSearch(tGameSharedConfig, S_VDF_KEY_TAGS)
288+
tGame[S_VDF_KEY_HIDDEN] = tGameSharedConfig[S_VDF_KEY_HIDDEN]
289+
end
290+
tGameSharedConfig = nil
291+
if tGame[S_VDF_KEY_HIDDEN] == nil or tGame[S_VDF_KEY_HIDDEN] == '0' then
292+
table.insert(tGames, tGame)
293+
if BannerExists(tGame[S_VDF_KEY_APPID]) == nil then
294+
table.insert(T_LOGO_QUEUE, tGame[S_VDF_KEY_APPID])
295+
end
278296
end
279297
end
280298
end
299+
tGame = nil
281300
end
282-
tGame = nil
283301
end
302+
284303
end
285304

286305
-- Non-Steam games that have been added to the Steam library.

Lauhdutin/Main.ini

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[Metadata]
2+
Name=Lauhdutin
3+
Author=Kapiainen
4+
Information=A launcher for Steam and non-Steam games, movies, misc. software, etc.
5+
Version=1.1.0
6+
License=MIT
7+
18
[Rainmeter]
29
Update=1000
310
Blur=1
@@ -11,14 +18,6 @@ ContextAction2=[notepad "#@#SteamShortcuts.inc"]
1118
ContextTitle3=Exceptions
1219
ContextAction3=[notepad "#@#Exceptions.inc"]
1320

14-
15-
[Metadata]
16-
Name=Lauhdutin
17-
Author=Kapiainen
18-
Information=A launcher for Steam and non-Steam games, movies, misc. software, etc.
19-
Version=1.0.1
20-
License=MIT
21-
2221
[Variables]
2322
@Include=#@#Variables.inc
2423
@Include2=#@#UserSettings.inc

Readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ The UserDataID corresponding to your Steam account. This can be found by looking
182182
UserDataID=123456789
183183
```
184184

185+
##SteamLibraryPaths
186+
One or more absolute paths to folders containing Steam libraries. Multiple paths should be separated by a semicolon (;).
187+
188+
```
189+
SteamLibraryPaths=D:\Steam Library;E:\Steam Library
190+
```
191+
185192
##BannerWidth
186193
The width of a banner in pixels.
187194

0 commit comments

Comments
 (0)