mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Binding fixes for utility lists
This commit is contained in:
parent
73d3168d2c
commit
ae358e270d
@ -107,6 +107,7 @@ namespace Wabbajack
|
||||
|
||||
private bool _useCompression = false;
|
||||
public bool UseCompression { get => _useCompression; set => RaiseAndSetIfChanged(ref _useCompression, value); }
|
||||
public bool ShowUtilityLists { get; set; }
|
||||
}
|
||||
|
||||
[JsonName("PerformanceSettings")]
|
||||
|
@ -64,6 +64,7 @@ namespace Wabbajack
|
||||
{
|
||||
GameType = !string.IsNullOrEmpty(settings.Game) ? settings.Game : ALL_GAME_TYPE;
|
||||
ShowNSFW = settings.ShowNSFW;
|
||||
ShowUtilityLists = settings.ShowUtilityLists;
|
||||
OnlyInstalled = settings.OnlyInstalled;
|
||||
Search = settings.Search;
|
||||
}
|
||||
@ -155,11 +156,7 @@ namespace Wabbajack
|
||||
return vm.Metadata.NSFW && showNSFW;
|
||||
}))
|
||||
.Filter(this.WhenAny(x => x.ShowUtilityLists)
|
||||
.Select<bool, Func<ModListMetadataVM, bool>>(showNSFW => vm =>
|
||||
{
|
||||
if (!vm.Metadata.UtilityList) return true;
|
||||
return vm.Metadata.UtilityList && showNSFW;
|
||||
}))
|
||||
.Select<bool, Func<ModListMetadataVM, bool>>(showUtilityLists => vm => showUtilityLists ? vm.Metadata.UtilityList : !vm.Metadata.UtilityList))
|
||||
// Filter by Game
|
||||
.Filter(this.WhenAny(x => x.GameType)
|
||||
.Debounce(TimeSpan.FromMilliseconds(150), RxApp.MainThreadScheduler)
|
||||
@ -173,18 +170,6 @@ namespace Wabbajack
|
||||
return GameType == vm.Metadata.Game.GetDescription<Game>().ToString();
|
||||
|
||||
}))
|
||||
.Filter(this.WhenAny(x => x.ShowNSFW)
|
||||
.Select<bool, Func<ModListMetadataVM, bool>>(showNSFW => vm =>
|
||||
{
|
||||
if (!vm.Metadata.NSFW) return true;
|
||||
return vm.Metadata.NSFW && showNSFW;
|
||||
}))
|
||||
.Filter(this.WhenAny(x => x.ShowUtilityLists)
|
||||
.Select<bool, Func<ModListMetadataVM, bool>>(showUtilityLists => vm =>
|
||||
{
|
||||
if (!vm.Metadata.UtilityList) return true;
|
||||
return vm.Metadata.UtilityList && showUtilityLists;
|
||||
}))
|
||||
// Put broken lists at bottom
|
||||
.Sort(Comparer<ModListMetadataVM>.Create((a, b) => a.IsBroken.CompareTo(b.IsBroken)))
|
||||
.Bind(ModLists)
|
||||
@ -220,6 +205,7 @@ namespace Wabbajack
|
||||
settings.Game = GameType;
|
||||
settings.Search = Search;
|
||||
settings.ShowNSFW = ShowNSFW;
|
||||
settings.ShowUtilityLists = ShowUtilityLists;
|
||||
settings.OnlyInstalled = OnlyInstalled;
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ namespace Wabbajack
|
||||
.DisposeWith(dispose);
|
||||
this.BindStrict(ViewModel, vm => vm.ShowNSFW, x => x.ShowNSFW.IsChecked)
|
||||
.DisposeWith(dispose);
|
||||
this.BindStrict(ViewModel, vm => vm.ShowUtilityLists, x => x.ShowUtilityLists.IsChecked)
|
||||
.DisposeWith(dispose);
|
||||
|
||||
this.WhenAny(x => x.ViewModel.ClearFiltersCommand)
|
||||
.BindToStrict(this, x => x.ClearFiltersButton.Command)
|
||||
|
Loading…
Reference in New Issue
Block a user