Skip to content

Commit f8b0635

Browse files
committed
Steam infra
Signed-off-by: Isaac Marovitz <[email protected]>
1 parent 32028d8 commit f8b0635

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Source/Libraries/HedgeModManager.Steam/SteamLocator.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,21 @@ public class SteamLocator : IGameLocator
3232
return null;
3333
}
3434

35+
[SupportedOSPlatform("macos")]
36+
private string? FindSteamLibraryMacOS()
37+
{
38+
// TODO: Open a folder selection window
39+
return "";
40+
}
41+
3542
private string? FindSteamLibraryUnix()
3643
{
3744
var pathList = new[]
3845
{
3946
Path.Combine(".steam", "steam"),
4047
Path.Combine(".local", "share", "Steam"),
4148
Path.Combine(".var", "app", "com.valvesoftware.Steam", ".steam", "steam"),
42-
Path.Combine("snap", "steam", "common", ".steam", "steam"),
43-
};
49+
Path.Combine("snap", "steam", "common", ".steam", "steam"), };
4450

4551
foreach (string path in pathList)
4652
{
@@ -62,6 +68,12 @@ public class SteamLocator : IGameLocator
6268
return SteamInstallPath;
6369
}
6470

71+
if (OperatingSystem.IsMacOS())
72+
{
73+
SteamInstallPath = FindSteamLibraryMacOS();
74+
return SteamInstallPath;
75+
}
76+
6577
SteamInstallPath = FindSteamLibraryUnix();
6678
return SteamInstallPath;
6779
}
@@ -128,7 +140,7 @@ public List<SteamGame> Locate()
128140
continue;
129141
}
130142

131-
// Paths will be encoded by Windows steam and will need to be adapted for macOS Paths.
143+
// Paths will be encoded by Windows Steam and will need to be adapted for macOS paths.
132144
// C:\ is equivalent to the Wine prefix.
133145
// Any other drive letter should be removed and treated as raw Unix path.
134146
if (OperatingSystem.IsMacOS())

0 commit comments

Comments
 (0)