Skip to content

Commit

Permalink
highlight Reno Jackson in list when his effect is active
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Zeier committed Dec 9, 2015
1 parent 24a99eb commit f4dd1ae
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
3 changes: 3 additions & 0 deletions Hearthstone Deck Tracker/Hearthstone Deck Tracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,9 @@
<Content Include="Images\board_damage.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\frame_golden.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\gold_progress_frame_center.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
36 changes: 22 additions & 14 deletions Hearthstone Deck Tracker/Hearthstone/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ public SolidColorBrush ColorPlayer
}
}

public bool HighlightFrame { get; set; }

public SolidColorBrush ColorOpponent
{
get { return new SolidColorBrush(Colors.White); }
Expand Down Expand Up @@ -456,21 +458,26 @@ public ImageBrush Background
var frame = "Images/frame.png";
if(Config.Instance.RarityCardFrames)
{
switch(Rarity)
if(HighlightFrame)
frame = "Images/frame_golden.png";
else
{
case Rarity.Free:
case Rarity.Common:
frame = "Images/frame_rarity_common.png";
break;
case Rarity.Rare:
frame = "Images/frame_rarity_rare.png";
break;
case Rarity.Epic:
frame = "Images/frame_rarity_epic.png";
break;
case Rarity.Legendary:
frame = "Images/frame_rarity_legendary.png";
break;
switch(Rarity)
{
case Rarity.Free:
case Rarity.Common:
frame = "Images/frame_rarity_common.png";
break;
case Rarity.Rare:
frame = "Images/frame_rarity_rare.png";
break;
case Rarity.Epic:
frame = "Images/frame_rarity_epic.png";
break;
case Rarity.Legendary:
frame = "Images/frame_rarity_legendary.png";
break;
}
}
}
drawingGroup.Children.Add(new ImageDrawing(new BitmapImage(new Uri(frame, UriKind.Relative)), new Rect(0, 0, 218, 35)));
Expand All @@ -495,6 +502,7 @@ public ImageBrush Background

if(Math.Abs(Count) > 1 || Rarity == Rarity.Legendary)
{

drawingGroup.Children.Add(new ImageDrawing(new BitmapImage(new Uri("Images/frame_countbox.png", UriKind.Relative)),
new Rect(189, 6, 25, 24)));

Expand Down
11 changes: 10 additions & 1 deletion Hearthstone Deck Tracker/Hearthstone/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public List<Card> DisplayCards
var card = (Card)c.Clone();
card.Count = 0;
card.HighlightInHand = true;
if(IsLocalPlayer && card.Id == HearthDb.CardIds.Collectible.Neutral.RenoJackson
&& Deck.Where(x => !string.IsNullOrEmpty(x.CardId)).Select(x => x.CardId).GroupBy(x => x).All(x => x.Count() <= 1))
card.HighlightFrame = true;
return card;
});
;
Expand All @@ -134,7 +137,13 @@ public List<Card> DisplayCards
var card = (Card)c.Clone();
card.Count = 0;
card.HighlightDraw = _hightlightedCards.Contains(c.Id);
card.HighlightInHand = Hand.Any(ce => ce.CardId == c.Id);
if(Hand.Any(ce => ce.CardId == c.Id))
{
card.HighlightInHand = true;
if(IsLocalPlayer && card.Id == HearthDb.CardIds.Collectible.Neutral.RenoJackson
&& Deck.Where(x => !string.IsNullOrEmpty(x.CardId)).Select(x => x.CardId).GroupBy(x => x).All(x => x.Count() <= 1))
card.HighlightFrame = true;
}
return card;
});
return stillInDeck.Concat(notInDeck).Concat(createdInHand).ToSortedCardList();
Expand Down
Binary file added Hearthstone Deck Tracker/Images/frame_golden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f4dd1ae

Please sign in to comment.