mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Simplifying the process of disabling gameType
This commit is contained in:
parent
99113507c4
commit
5e5c1bb384
@ -30,8 +30,6 @@ namespace Wabbajack
|
|||||||
|
|
||||||
private const string ALL_GAME_TYPE = "All";
|
private const string ALL_GAME_TYPE = "All";
|
||||||
|
|
||||||
public ICommand OnlyInstalledCheckedCommand { get; }
|
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public IErrorResponse Error { get; set; }
|
public IErrorResponse Error { get; set; }
|
||||||
|
|
||||||
@ -46,9 +44,6 @@ namespace Wabbajack
|
|||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string GameType { get; set; }
|
public string GameType { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
|
||||||
public bool GameTypeEnabled { get; set; }
|
|
||||||
|
|
||||||
public List<string> GameTypeEntries { get { return GetGameTypeEntries(); } }
|
public List<string> GameTypeEntries { get { return GetGameTypeEntries(); } }
|
||||||
|
|
||||||
@ -61,7 +56,6 @@ namespace Wabbajack
|
|||||||
: base(mainWindowVM)
|
: base(mainWindowVM)
|
||||||
{
|
{
|
||||||
MWVM = mainWindowVM;
|
MWVM = mainWindowVM;
|
||||||
GameTypeEnabled = true;
|
|
||||||
|
|
||||||
// load persistent filter settings
|
// load persistent filter settings
|
||||||
settings = MWVM.Settings.Filters;
|
settings = MWVM.Settings.Filters;
|
||||||
@ -70,8 +64,6 @@ namespace Wabbajack
|
|||||||
GameType = !string.IsNullOrEmpty(settings.Game) ? settings.Game : ALL_GAME_TYPE;
|
GameType = !string.IsNullOrEmpty(settings.Game) ? settings.Game : ALL_GAME_TYPE;
|
||||||
ShowNSFW = settings.ShowNSFW;
|
ShowNSFW = settings.ShowNSFW;
|
||||||
OnlyInstalled = settings.OnlyInstalled;
|
OnlyInstalled = settings.OnlyInstalled;
|
||||||
if (OnlyInstalled)
|
|
||||||
GameTypeEnabled = false;
|
|
||||||
Search = settings.Search;
|
Search = settings.Search;
|
||||||
// subscribe to save signal
|
// subscribe to save signal
|
||||||
MWVM.Settings.SaveSignal
|
MWVM.Settings.SaveSignal
|
||||||
@ -88,7 +80,6 @@ namespace Wabbajack
|
|||||||
ShowNSFW = false;
|
ShowNSFW = false;
|
||||||
Search = string.Empty;
|
Search = string.Empty;
|
||||||
GameType = ALL_GAME_TYPE;
|
GameType = ALL_GAME_TYPE;
|
||||||
GameTypeEnabled = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var random = new Random();
|
var random = new Random();
|
||||||
@ -124,17 +115,6 @@ namespace Wabbajack
|
|||||||
.Select(c => c > 0)
|
.Select(c => c > 0)
|
||||||
.ToProperty(this, nameof(Loaded));
|
.ToProperty(this, nameof(Loaded));
|
||||||
|
|
||||||
OnlyInstalledCheckedCommand = ReactiveCommand.Create(() =>
|
|
||||||
{
|
|
||||||
if (OnlyInstalled)
|
|
||||||
{
|
|
||||||
GameType = ALL_GAME_TYPE;
|
|
||||||
GameTypeEnabled = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
GameTypeEnabled = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Convert to VM and bind to resulting list
|
// Convert to VM and bind to resulting list
|
||||||
sourceList
|
sourceList
|
||||||
.ObserveOnGuiThread()
|
.ObserveOnGuiThread()
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
ItemsSource="{Binding Path=GameTypeEntries}"
|
ItemsSource="{Binding Path=GameTypeEntries}"
|
||||||
SelectedItem="{Binding GameType, Mode=TwoWay}"
|
SelectedItem="{Binding GameType, Mode=TwoWay}"
|
||||||
ToolTip="Select a game"
|
ToolTip="Select a game"
|
||||||
IsEnabled="{Binding GameTypeEnabled}"
|
IsEnabled="{Binding OnlyInstalled, Converter={StaticResource InverseBooleanConverter}}"
|
||||||
Width="130" />
|
Width="130" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,0,5,0"
|
Margin="0,0,5,0"
|
||||||
@ -130,7 +130,6 @@
|
|||||||
Margin="10,0,10,0"
|
Margin="10,0,10,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content="Only Installed"
|
Content="Only Installed"
|
||||||
Command="{Binding OnlyInstalledCheckedCommand}"
|
|
||||||
Foreground="{StaticResource ForegroundBrush}" />
|
Foreground="{StaticResource ForegroundBrush}" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="ClearFiltersButton"
|
x:Name="ClearFiltersButton"
|
||||||
|
Loading…
Reference in New Issue
Block a user