Skip to content

Commit

Permalink
PacificDriveLoadoutSynchronizerOld
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeWanderer committed Jul 26, 2024
1 parent e0c4224 commit 22bf842
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Games/NexusMods.Games.UnrealEngine/PacificDrive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ protected override IReadOnlyDictionary<LocationId, AbsolutePath> GetLocations(IF
public override List<IModInstallDestination> GetInstallDestinations(IReadOnlyDictionary<LocationId, AbsolutePath> locations)
=> ModInstallDestinationHelpers.GetCommonLocations(locations);

protected override ILoadoutSynchronizerOld MakeSynchronizerOld(IServiceProvider provider)
{
return new PacificDriveLoadoutSynchronizerOld(provider);
}

protected override ILoadoutSynchronizer MakeSynchronizer(IServiceProvider provider)
{
return new PacificDriveLoadoutSynchronizer(provider);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Extensions.DependencyInjection;
using NexusMods.Abstractions.GameLocators;
using NexusMods.Abstractions.Loadouts.Synchronizers;
using NexusMods.Abstractions.Settings;

namespace NexusMods.Games.UnrealEngine;

public class PacificDriveLoadoutSynchronizerOld : ALoadoutSynchronizerOld
{
private PacificDriveSettings _settings;

protected internal PacificDriveLoadoutSynchronizerOld(IServiceProvider provider) : base(provider)
{
var settingsManager = provider.GetRequiredService<ISettingsManager>();

_settings = settingsManager.Get<PacificDriveSettings>();
settingsManager.GetChanges<PacificDriveSettings>().Subscribe(value => _settings = value);
}

public override bool IsIgnoredBackupPath(GamePath path)
{
return !_settings.DoFullGameBackup;
}
}

0 comments on commit 22bf842

Please sign in to comment.