Permalink
Browse files

add option to remove grayed out secrets from list

  • Loading branch information...
1 parent eca28d7 commit 3ae806590f7c7f689a4e5ecaa706f415adeb3a31 @azeier azeier committed Jan 10, 2017
@@ -762,6 +762,9 @@ public class Config
[DefaultValue(false)]
public bool RemoveCardsFromDeck = false;
+ [DefaultValue(false)]
+ public bool RemoveSecretsFromList = false;
+
[DefaultValue(true)]
public bool ReplayViewerShowAttack = true;
@@ -92,6 +92,13 @@
HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top"
Checked="CheckboxAutoGrayoutSecrets_Checked"
Unchecked="CheckboxAutoGrayoutSecrets_Unchecked" />
+ <CheckBox x:Name="CheckBoxRemoveSecrets"
+ Foreground="{Binding Color, Source={x:Static options:AdvancedOptions.Instance}}"
+ Visibility="{Binding Visibility, Source={x:Static options:AdvancedOptions.Instance}}"
+ Content="{lex:Loc Options_Overlay_General_CheckBox_RemoveSecrets}"
+ HorizontalAlignment="Left" Margin="10,5,0,0" VerticalAlignment="Top"
+ Checked="CheckBoxRemoveSecrets_Checked"
+ Unchecked="CheckBoxRemoveSecrets_Unchecked" />
<CheckBox x:Name="CheckboxKeepDecksVisible"
Foreground="{Binding Color, Source={x:Static options:AdvancedOptions.Instance}}"
Visibility="{Binding Visibility, Source={x:Static options:AdvancedOptions.Instance}}"
@@ -1,4 +1,4 @@
-#region
+#region
using System;
using System.Windows;
@@ -47,6 +47,7 @@ public void Load(GameV2 game)
CheckBoxBatteryStatusText.IsChecked = Config.Instance.ShowBatteryLifePercent;
CheckBoxFlavorText.IsChecked = Config.Instance.ShowFlavorText;
CheckBoxOverlayUseAnimations.IsChecked = Config.Instance.OverlayCardAnimations;
+ CheckBoxRemoveSecrets.IsChecked = Config.Instance.RemoveSecretsFromList;
_initialized = true;
}
@@ -454,5 +455,21 @@ private void CheckboxOverlayUseAnimations_Unchecked(object sender, RoutedEventAr
Config.Instance.OverlayCardAnimations = false;
Config.Save();
}
+
+ private void CheckBoxRemoveSecrets_Checked(object sender, RoutedEventArgs e)
+ {
+ if(!_initialized)
+ return;
+ Config.Instance.RemoveSecretsFromList = true;
+ Config.Save();
+ }
+
+ private void CheckBoxRemoveSecrets_Unchecked(object sender, RoutedEventArgs e)
+ {
+ if(!_initialized)
+ return;
+ Config.Instance.RemoveSecretsFromList = false;
+ Config.Save();
+ }
}
-}
+}
@@ -157,9 +157,12 @@ public void ShowSecrets(bool force = false, HeroClass? heroClass = null)
var secrets = heroClass == null ? _game.OpponentSecrets.GetSecrets() : _game.OpponentSecrets.GetDefaultSecrets(heroClass.Value);
foreach(var id in secrets)
{
- var cardObj = new Controls.Card();
+ var count = id.AdjustedCount(_game);
+ if(count <= 0 && Config.Instance.RemoveSecretsFromList)
+ continue;
var card = Database.GetCardFromId(id.CardId);
- card.Count = id.AdjustedCount(_game);
+ card.Count = count;
+ var cardObj = new Controls.Card();
cardObj.SetValue(DataContextProperty, card);
StackPanelSecrets.Children.Add(cardObj);
}

0 comments on commit 3ae8065

Please sign in to comment.