-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2248 from Nexus-Mods/loadorder-v1
Load Order v1 (REDmods, simple list ui)
- Loading branch information
Showing
323 changed files
with
2,070 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Abstractions/NexusMods.Abstractions.GameLocators/GameInstallation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Abstractions/NexusMods.Abstractions.GameLocators/GameLocatorResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using NexusMods.Abstractions.Games; | ||
using NexusMods.Paths; | ||
|
||
namespace NexusMods.Abstractions.GameLocators; | ||
|
3 changes: 1 addition & 2 deletions
3
src/Abstractions/NexusMods.Abstractions.GameLocators/IGameLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Abstractions/NexusMods.Abstractions.GameLocators/IGameRegistry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ns/NexusMods.Abstractions.GameLocators/Stores/EADesktop/EADesktopLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/Abstractions/NexusMods.Abstractions.GameLocators/Stores/EGS/EpicLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/Abstractions/NexusMods.Abstractions.GameLocators/Stores/GOG/GOGLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ractions/NexusMods.Abstractions.GameLocators/Stores/Origin/OriginLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...stractions/NexusMods.Abstractions.GameLocators/Stores/Steam/SteamLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...Abstractions/NexusMods.Abstractions.GameLocators/Stores/Xbox/XboxLocatorResultMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Abstractions/NexusMods.Abstractions.GameLocators/Trees/AGamePathNodeTree.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/Abstractions/NexusMods.Abstractions.GameLocators/Trees/GamePathNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/Abstractions/NexusMods.Abstractions.Games/ILoadoutSortableItemProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections.ObjectModel; | ||
using NexusMods.Abstractions.Loadouts; | ||
|
||
namespace NexusMods.Abstractions.Games; | ||
|
||
/// <summary> | ||
/// A loadout specific provider and manager of sortable items. | ||
/// </summary> | ||
public interface ILoadoutSortableItemProvider | ||
{ | ||
/// <summary> | ||
/// The ISortableItemProviderFactory that created this provider | ||
/// </summary> | ||
public ISortableItemProviderFactory ParentFactory { get; } | ||
|
||
/// <summary> | ||
/// The id of the loadout that the sortable items are associated with | ||
/// </summary> | ||
public LoadoutId LoadoutId { get; } | ||
|
||
/// <summary> | ||
/// Observable collection of sorted sortable items in the sort order | ||
/// </summary> | ||
public ReadOnlyObservableCollection<ISortableItem> SortableItems { get; } | ||
|
||
/// <summary> | ||
/// Sets the relative position of a sortable item in the sort order | ||
/// </summary> | ||
/// <param name="sortableItem">item to move</param> | ||
/// <param name="delta">positive or negative index delta</param> | ||
Task SetRelativePosition(ISortableItem sortableItem, int delta); | ||
} |
40 changes: 40 additions & 0 deletions
40
src/Abstractions/NexusMods.Abstractions.Games/ISortableItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using NexusMods.MnemonicDB.Abstractions; | ||
|
||
namespace NexusMods.Abstractions.Games; | ||
|
||
/// <summary> | ||
/// An abstraction for a sortable item that can be moved around in a list relative to its siblings. | ||
/// All items in the list will have a non-gaming sort index. If a item is moved the other items will | ||
/// adjust to compensate for the positional change. | ||
/// </summary> | ||
public interface ISortableItem : IComparable<ISortableItem> | ||
{ | ||
/// <summary> | ||
/// Reference to the provider that manages this item | ||
/// </summary> | ||
public ILoadoutSortableItemProvider SortableItemProvider { get; } | ||
|
||
/// <summary> | ||
/// The index of the item in a sorted list of item as given by the provider | ||
/// </summary> | ||
public int SortIndex { get; set; } | ||
|
||
/// <summary> | ||
/// Name of the item for display purposes | ||
/// </summary> | ||
public string DisplayName { get; } | ||
|
||
/// <summary> | ||
/// The name of the winning mod containing the item | ||
/// </summary> | ||
public string ModName { get; set; } | ||
|
||
/// <summary> | ||
/// Represents whether the item is active in the sort order or not | ||
/// An item is considered active if it is part of the sort order and will be loaded by the game | ||
/// An item is considered inactive if it is for some reason not going to be loaded by the game, | ||
/// e.g. it is disabled in the sort order, or parent mod is disabled. | ||
/// </summary> | ||
public bool IsActive { get; set; } | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/Abstractions/NexusMods.Abstractions.Games/ISortableItemProviderFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using NexusMods.Abstractions.Loadouts; | ||
|
||
namespace NexusMods.Abstractions.Games; | ||
|
||
|
||
/// <summary> | ||
/// A factory for creating providers for sortable items for specific loadouts | ||
/// </summary> | ||
public interface ISortableItemProviderFactory | ||
{ | ||
/// <summary> | ||
/// Returns a provider of sortable items for a specific loadout | ||
/// </summary> | ||
ILoadoutSortableItemProvider GetLoadoutSortableItemProvider(LoadoutId loadoutId); | ||
|
||
|
||
/// <summary> | ||
/// Returns id of the type of the loadout | ||
/// </summary> | ||
Guid StaticSortOrderTypeId { get; } | ||
|
||
/// <summary> | ||
/// Display name for this sort order type | ||
/// </summary> | ||
string SortOrderName { get; } | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Abstractions/NexusMods.Abstractions.Games/ISortableItemViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NexusMods.Abstractions.UI; | ||
using ReactiveUI; | ||
using Unit = System.Reactive.Unit; | ||
|
||
namespace NexusMods.Abstractions.Games; | ||
|
||
/// <summary> | ||
/// View model interface for a sortable item in the generic load order view | ||
/// </summary> | ||
public interface ISortableItemViewModel : IViewModelInterface | ||
{ | ||
public ISortableItem SortableItem { get; } | ||
|
||
public ReactiveCommand<Unit, Unit> MoveUp { get; } | ||
|
||
public ReactiveCommand<Unit, Unit> MoveDown { get; } | ||
|
||
public ReactiveCommand<int, Unit> MoveTo { get; } | ||
|
||
public int SortIndex { get; } | ||
|
||
public string DisplayName { get; } | ||
|
||
public string GroupName { get; } | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Abstractions/NexusMods.Abstractions.Games/Models/SortableEntry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using JetBrains.Annotations; | ||
using NexusMods.Abstractions.Loadouts; | ||
using NexusMods.MnemonicDB.Abstractions.Attributes; | ||
using NexusMods.MnemonicDB.Abstractions.Models; | ||
|
||
namespace NexusMods.Abstractions.Games; | ||
|
||
/// <summary> | ||
/// Represents an item that is sorted in a Load Order | ||
/// This should not be used directly, but rather be extended by the game-specific implementation. | ||
/// | ||
/// Each implementation should provide the game specific identifier used to map entries of the Load Order to items of the loadout. | ||
/// E.g. the plugin name for Skyrim plugins, or the module uuid for BG3 pak files. | ||
/// </summary> | ||
[PublicAPI] | ||
public partial class SortableEntry : IModelDefinition | ||
{ | ||
private const string Namespace = "NexusMods.Loadouts.SortableEntry"; | ||
|
||
/// <summary> | ||
/// Reference to the Load Order that this item is part of. | ||
/// </summary> | ||
public static readonly ReferenceAttribute<SortOrder> ParentSortOrder = new(Namespace, nameof(ParentSortOrder)) | ||
{ | ||
IsIndexed = true, | ||
}; | ||
|
||
/// <summary> | ||
/// The order in which this item should be loaded relative to other items in the Load Order. | ||
/// </summary> | ||
public static readonly Int32Attribute SortIndex = new(Namespace, nameof(SortIndex)); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...Abstractions/NexusMods.Abstractions.Games/NexusMods.Abstractions.Games.csproj.DotSettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.