Skip to content

Commit

Permalink
Add hover label on game name
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed May 19, 2024
1 parent bdccad6 commit 3c7391a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions Launcher/Views/GameViewSmall.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public partial class GameViewSmall : UserControlExt<GameViewSmall>
public GameViewSmall()
{
InitializeComponent();
OnUpdateView += () => ToolTip.SetTip(GameLabel, GameName);
}

public GameViewSmall(IGame game, Loader.App app) : this()
Expand Down
18 changes: 16 additions & 2 deletions RemoteDownloaderPlugin/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class Plugin : IGameSource

private Remote _cachedRemote = new();
private List<OnlineGame> _onlineGames = new();
private List<string> _platforms = new();

public async Task<InitResult?> Initialize(IApp app)
{
Expand Down Expand Up @@ -78,7 +79,7 @@ public async Task<List<IGame>> GetGames()

List<string> installedIds = installedGames.Select(x => x.Game.Id).ToList();

return _onlineGames.Where(x => !installedIds.Contains(x.Entry.GameId))
return _onlineGames.Where(x => !(installedIds.Contains(x.Entry.GameId) || Storage.Data.HiddenRemotePlatforms.Contains(x.Platform)))
.Select(x => (IGame)x)
.Concat(installedGames.Select(x => (IGame)x))
.ToList();
Expand All @@ -97,6 +98,8 @@ public async Task<bool> FetchRemote()

_onlineGames = _cachedRemote.Emu.Select(x => new OnlineGame(x, this))
.Concat(_cachedRemote.Pc.Select(x => new OnlineGame(x, this))).ToList();

_platforms = _onlineGames.Select(x => x.Platform).Distinct().ToList();

return true;
}
Expand Down Expand Up @@ -129,7 +132,18 @@ public List<Command> GetGlobalCommands()
App.ReloadGlobalCommands();
App.HideForm();
}, _ => App.HideForm());
})).ToList())
})).ToList()),
new Command("Hide Platforms", _platforms.Select(x =>
new Command(Storage.Data.HiddenRemotePlatforms.Contains(x) ? $"Show {x}" : $"Hide {x}", () =>
{
if (!Storage.Data.HiddenRemotePlatforms.Remove(x))
{
Storage.Data.HiddenRemotePlatforms.Add(x);
}

Storage.Save();
App.ReloadGames();
})).ToList())
};

return commands;
Expand Down
1 change: 1 addition & 0 deletions RemoteDownloaderPlugin/Store.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ public class Store
public List<InstalledEmuGame> EmuGames { get; set; } = new();
public List<InstalledPcGame> PcGames { get; set; } = new();
public List<EmuProfile> EmuProfiles { get; set; } = new();
public List<string> HiddenRemotePlatforms { get; set; } = new();
public string IndexUrl { get; set; } = "";
}

0 comments on commit 3c7391a

Please sign in to comment.