Skip to content

Commit

Permalink
SGDB: Only allow editing covers for installed games
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Jun 23, 2024
1 parent ddd6e8a commit 2bd57f4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions SteamGridDbMiddleware/Middleware.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using LauncherGamePlugin.Commands;
using LauncherGamePlugin.Enums;
using LauncherGamePlugin.Interfaces;
using LauncherGamePlugin.Launcher;
using SteamGridDbMiddleware.Gui;
Expand All @@ -24,14 +25,14 @@ public async Task<List<IGame>> GetGames(IGameSource next)
public List<Command> GetGameCommands(IGame game, IGameSource next)
{
List<Command> commands = new(next.GetGameCommands(game));

if (_instance.Api == null || game.InstalledStatus != InstalledStatus.Installed)
return commands;

if (_instance.Api != null)
{
commands.Add(new Command());
commands.AddRange(SteamGridDb.ImageTypes
.Select(x => new Command($"Edit {x}", () => new OnImageEdit(game, _instance, x).ShowGui()))
.ToList());
}
commands.Add(new Command());
commands.AddRange(SteamGridDb.ImageTypes
.Select(x => new Command($"Edit {x}", () => new OnImageEdit(game, _instance, x).ShowGui()))
.ToList());

return commands;
}
Expand Down

0 comments on commit 2bd57f4

Please sign in to comment.