Skip to content

Commit

Permalink
SteamExporterPlugin: Seperate proton prefixes by version
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed May 19, 2024
1 parent e75dc32 commit b24aa81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SteamExporterPlugin/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace SteamExporterPlugin;
public class Exporter : IGameSource
{
public string ServiceName => "Steam Exporter";
public string Version => "v1.2.8";
public string Version => "v1.2.9";
public string SlugServiceName => "steam-exporter";
public string ShortServiceName => "Steam";
public PluginType Type => PluginType.BootProfile;
Expand Down
7 changes: 6 additions & 1 deletion SteamExporterPlugin/ProtonWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private string GetPrefixFolder(GameConfig config, IGame game)
{
string homeFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string prefixBaseFolder = Path.Join(homeFolder, ".proton_alfae");
string defaultString = $"default_{Name.Replace(" ", "_")}";

if (!Directory.Exists(prefixBaseFolder))
Directory.CreateDirectory(prefixBaseFolder);
Expand All @@ -87,7 +88,11 @@ private string GetPrefixFolder(GameConfig config, IGame game)
if (Directory.Exists(Path.Join(homeFolder, ".proton_launcher")) && !Directory.Exists(Path.Join(prefixBaseFolder, "default")))
Directory.Move(Path.Join(homeFolder, ".proton_launcher"), Path.Join(prefixBaseFolder, "default"));

string prefixFolder = Path.Join(prefixBaseFolder, (config.SeparateProtonPath) ? $"{game.Source.SlugServiceName}.{game.InternalName}" : "default");
// To keep compatibility with Alfae <= 1.4.3
if (Directory.Exists(Path.Join(prefixBaseFolder, "default")))
Directory.Move(Path.Join(prefixBaseFolder, "default"), Path.Join(prefixBaseFolder, defaultString));

string prefixFolder = Path.Join(prefixBaseFolder, (config.SeparateProtonPath) ? $"{game.Source.SlugServiceName}.{game.InternalName}" : defaultString);

if (!Directory.Exists(prefixFolder))
Directory.CreateDirectory(prefixFolder);
Expand Down

0 comments on commit b24aa81

Please sign in to comment.