Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GameFinder to 4.5.0 #2653

Merged
merged 3 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<PackageVersion Include="BitFaster.Caching" Version="2.5.2" />
<PackageVersion Include="CliWrap" Version="3.6.7" />
<PackageVersion Include="DynamicData" Version="9.0.4" />
<PackageVersion Include="GameFinder" Version="4.4.0" />
<PackageVersion Include="GameFinder" Version="4.5.0" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="ini-parser-netstandard" Version="2.5.2" />
<PackageVersion Include="Mutagen.Bethesda.Skyrim" Version="0.44.0" />
Expand Down
9 changes: 7 additions & 2 deletions src/NexusMods.StandardGameLocators/HeroicGogLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ public IEnumerable<GameLocatorResult> Find(ILocatableGame game)
if (!_cachedGames.TryGetValue(GOGGameId.From(id), out var found)) continue;
var fs = found.Path.FileSystem;

if (found is HeroicGOGGame heroicGOGGame && heroicGOGGame.WinePrefixPath.DirectoryExists())
if (found is HeroicGOGGame heroicGOGGame)
{
fs = heroicGOGGame.GetWinePrefix().CreateOverlayFileSystem(fs);
var wineData = heroicGOGGame.WineData;
if (wineData is not null)
{
if (wineData.WinePrefixPath.DirectoryExists())
fs = heroicGOGGame.GetWinePrefix()!.CreateOverlayFileSystem(fs);
}
}

yield return new GameLocatorResult(found.Path, fs, GameStore.GOG, new HeroicGOGLocatorResultMetadata
Expand Down
3 changes: 2 additions & 1 deletion src/NexusMods.StandardGameLocators/Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using GameFinder.Wine;
using GameFinder.Wine.Bottles;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NexusMods.Abstractions.GameLocators;
using NexusMods.Abstractions.GameLocators.Stores.EGS;
using NexusMods.Abstractions.GameLocators.Stores.GOG;
Expand Down Expand Up @@ -103,7 +104,7 @@ public static IServiceCollection AddStandardGameLocators(
onLinux: () =>
{
services.AddSingleton<AHandler<SteamGame, AppId>>(provider => new SteamHandler(provider.GetRequiredService<IFileSystem>(), registry: null));
services.AddSingleton<HeroicGOGHandler>(provider => new HeroicGOGHandler(provider.GetRequiredService<IFileSystem>()));
services.AddSingleton<HeroicGOGHandler>(provider => new HeroicGOGHandler(provider.GetRequiredService<IFileSystem>(), provider.GetRequiredService<ILogger<HeroicGogLocator>>()));

if (registerWine)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/NexusMods.StandardGameLocators.TestHelpers/Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using GameFinder.Wine;
using GameFinder.Wine.Bottles;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NexusMods.Abstractions.Games;
using NexusMods.Abstractions.Loadouts;
using NexusMods.Extensions.DependencyInjection;
Expand Down Expand Up @@ -158,7 +159,7 @@ public static IServiceCollection AddStubbedGameLocators(this IServiceCollection

if (OSInformation.Shared.IsLinux)
{
coll.AddSingleton<HeroicGOGHandler>(s => new HeroicGOGHandler(s.GetRequiredService<IFileSystem>()));
coll.AddSingleton<HeroicGOGHandler>(s => new HeroicGOGHandler(s.GetRequiredService<IFileSystem>(), s.GetRequiredService<ILogger<HeroicGOGHandler>>()));

coll.AddSingleton<IWinePrefixManager<WinePrefix>>(s =>
new StubbedWinePrefixManager<WinePrefix>(s.GetRequiredService<TemporaryFileManager>(),
Expand Down
Loading