Merge pull request #1340 from LostDragonist/gallery_alpha

Minor improvements to the gallery
This commit is contained in:
Timothy Baldridge 2021-02-27 03:58:05 -07:00 committed by GitHub
commit 5f53ecaab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 16 deletions

View File

@ -36,14 +36,21 @@ namespace Wabbajack.Common
[Description("Darkest Dungeon")]
DarkestDungeon,
Dishonored,
[Description("Witcher 3")]
Witcher3,
[Description("Stardew Valley")]
StardewValley,
[Description("Kingdom Come: Deliverance")]
KingdomComeDeliverance,
[Description("MechWarrior 5: Mercenaries")]
MechWarrior5Mercenaries,
[Description("No Man's Sky")]
NoMansSky,
[Description("Dragon Age: Origins")]
DragonAgeOrigins,
[Description("Dragon Age 2")]
DragonAge2,
[Description("Dragon Age: Inquisition")]
DragonAgeInquisition,
[Description("Kerbal Space Program")]
KerbalSpaceProgram,

View File

@ -92,7 +92,13 @@ namespace Wabbajack.Lib.ModListRegistry
// ignored
}
return metadata.OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0, m.Title)).ToList();
var random = new Random();
return metadata
// Sort randomly initially, just to give each list a fair shake
.Shuffle(random)
// Put broken lists at bottom
.OrderBy(m => (m.ValidationSummary?.HasFailures ?? false ? 1 : 0))
.ToList();
}
public static async Task<List<ModlistMetadata>> LoadUnlistedFromGithub()

View File

@ -95,7 +95,6 @@ namespace Wabbajack
})
.DisposeWith(CompositeDisposable);
var random = new Random();
var sourceList = Observable.Return(Unit.Default)
.ObserveOn(RxApp.TaskpoolScheduler)
.SelectTask(async _ =>
@ -106,8 +105,6 @@ namespace Wabbajack
var list = await ModlistMetadata.LoadFromGithub();
Error = ErrorResponse.Success;
return list
// Sort randomly initially, just to give each list a fair shake
.Shuffle(random)
.AsObservableChangeSet(x => x.DownloadMetadata?.Hash ?? Hash.Empty);
}
catch (Exception ex)
@ -170,8 +167,6 @@ namespace Wabbajack
return GameType == vm.Metadata.Game.GetDescription<Game>().ToString();
}))
// Put broken lists at bottom
.Sort(Comparer<ModListMetadataVM>.Create((a, b) => a.IsBroken.CompareTo(b.IsBroken)))
.Bind(ModLists)
.Subscribe()
.DisposeWith(CompositeDisposable);
@ -197,6 +192,7 @@ namespace Wabbajack
{
List<string> gameEntries = new List<string> { ALL_GAME_TYPE };
gameEntries.AddRange(EnumExtensions.GetAllItems<Game>().Select(gameType => gameType.GetDescription<Game>()));
gameEntries.Sort();
return gameEntries;
}

View File

@ -93,7 +93,7 @@
VerticalAlignment="Center"
Content="Game" />
<ComboBox
Width="130"
Width="150"
Margin="0,0,10,0"
VerticalAlignment="Center"
Foreground="{StaticResource ForegroundBrush}"