diff --git a/Graveyard/CultivationView.cs b/Graveyard/CultivationView.cs new file mode 100644 index 0000000..36ac15f --- /dev/null +++ b/Graveyard/CultivationView.cs @@ -0,0 +1,30 @@ +using Hearthstone_Deck_Tracker.API; +using static HearthDb.CardIds.Collectible; + +namespace HDT.Plugins.Graveyard +{ + public class CultivationView + { + private static ViewConfig _Config; + internal static ViewConfig Config + { + get => _Config ?? (_Config = new ViewConfig(Druid.Cultivation) + { + ShowFirst = () => true, + CreateView = () => new NormalView(), + UpdateOn = GameEvents.OnPlayerPlay, + Condition = card => card.Name.Contains("Treant"), + }); + } + + internal class ViewConfig : Plugins.Graveyard.ViewConfig + { + public ViewConfig(params string[] showOn) : base(showOn) { } + public override void RegisterView(ViewBase view, bool isDefault = false) + { + base.RegisterView(view, isDefault); + Plugin.Events.OnPlayerCreateInPlay.Register(view.Update); + } + } + } +} diff --git a/Graveyard/Graveyard.cs b/Graveyard/Graveyard.cs index 52d0b92..b73bcd7 100644 --- a/Graveyard/Graveyard.cs +++ b/Graveyard/Graveyard.cs @@ -72,6 +72,7 @@ public class Graveyard TyrView.Config, TyrsTearsView.Config, MinionsCreatedView.Config, + CultivationView.Config, }; private readonly StackPanel FriendlyPanel; diff --git a/Graveyard/Graveyard.csproj b/Graveyard/Graveyard.csproj index 163113c..bc75042 100644 --- a/Graveyard/Graveyard.csproj +++ b/Graveyard/Graveyard.csproj @@ -79,6 +79,7 @@ + diff --git a/Graveyard/MulchmuncherView.cs b/Graveyard/MulchmuncherView.cs index 50d7de1..07af75c 100644 --- a/Graveyard/MulchmuncherView.cs +++ b/Graveyard/MulchmuncherView.cs @@ -15,7 +15,7 @@ internal static ViewConfig Config ShowFirst = () => true, CreateView = () => new NormalView(), UpdateOn = GameEvents.OnPlayerPlayToGraveyard, - Condition = card => card.Name == "Treant", + Condition = card => card.Name.Contains("Treant"), }); } }