Skip to content

Commit

Permalink
Fixed Plug-In is disabling itself. Fixed window initial sizing. Added…
Browse files Browse the repository at this point in the history
… Version indicator.
  • Loading branch information
VeXHarbinger committed Nov 6, 2018
1 parent c5351e4 commit b25e26b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DrawPool/Core/DrawPoolHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class DrawPoolHelpers
/// <summary>
/// Fixes the card's "Is Created" indicator and merges them into one big pile.
/// </summary>
/// <param name="cards">The list of cards cards.</param>
/// <param name="cards">The list of drawable <see cref="Card">Cards</see>.</param>
/// <returns></returns>
public static List<Card> FixCreatedCards(this List<Card> cards)
{
Expand Down
3 changes: 2 additions & 1 deletion DrawPool/DrawLogic/WitchWoodPiperControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void DoMath()
public void LoadCards()
{
this.QueryDeck = BuildQueryDeck();
this.CardList.Update(QueryDeck, true);
this.CardList.Update(QueryDeck.FixCreatedCards(), true);
}

/// <summary>
Expand All @@ -121,6 +121,7 @@ public void PlayerHandMouseOver(Card card)
if (CheckDeckChanged())
{
LoadCards();
// ToDo: Should do math be moved into the load cards process?
DoMath();
}
ShowDisplay(new CurtainCall { CallingView = ViewModes.WitchWoodPiper, ShouldShow = true }, new EventArgs());
Expand Down
13 changes: 6 additions & 7 deletions DrawPool/DrawPoolWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Hearthstone_Deck_Tracker.API;
using MahApps.Metro.Controls;
using System;
using System.Reflection;
using System.Windows;
using Settings = DrawPool.Properties.Settings;

Expand Down Expand Up @@ -120,7 +121,7 @@ private void InitializeWinOpts()
/// </summary>
public void InitializeOpts()
{
var uc = (UserOptionsControl)DisplayBox.FindChild<System.Windows.Controls.UserControl>(ViewModes.Options.ToString());
UserOptionsControl uc = (UserOptionsControl)DisplayBox.FindChild<System.Windows.Controls.UserControl>(ViewModes.Options.ToString());
if (uc != null)
{
uc.btnToggle.Checked += (sender, args) =>
Expand All @@ -136,9 +137,10 @@ public void InitializeOpts()
uc.btnDone.Click += (sender, args) =>
{
uc.btnToggle.IsChecked = false;
uc.Visibility = Visibility.Collapsed;
uc.Visibility = Visibility.Hidden;
Visibility = Visibility.Collapsed;
};
uc.lblVersionValue.Content = Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}

Expand All @@ -148,12 +150,9 @@ public void InitializeOpts()
public void Reset()
{
// ToDo : see how this loop needs to evolve with mechanics for recruit
foreach (var dc in DisplayBox.Children)
foreach (IDraw dc in DisplayBox.Children)
{
if (dc is IDraw)
{
((IDraw)dc).Reset();
}
dc.Reset();
}
Visibility = Visibility.Collapsed;
}
Expand Down
2 changes: 1 addition & 1 deletion DrawPool/Models/CurtainCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using static Hearthstone_Deck_Tracker.Windows.MessageDialogs;

/// <summary>
/// Helper for Hiding and showing internal controls
/// Helper for Hiding and showing internal display controls
/// </summary>
public class CurtainCall
{
Expand Down
2 changes: 1 addition & 1 deletion DrawPool/Models/DrawDataModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Card = Hearthstone_Deck_Tracker.Hearthstone.Card;

/// <summary>
/// Draw Data Model
/// Draw Data View Model
/// </summary>
public class DrawDataModel
{
Expand Down
4 changes: 2 additions & 2 deletions DrawPool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.1.1")]
[assembly: AssemblyFileVersion("1.0.1.1")]
17 changes: 16 additions & 1 deletion DrawPool/UserOptionsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<RowDefinition Height="2*" />
<RowDefinition Height="2*" />
<RowDefinition x:Name="LastRow" Height="2*" />
<RowDefinition x:Name="VersionRow" Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand Down Expand Up @@ -118,7 +119,7 @@

<Button
x:Name="btnDone"
Grid.Row="9"
Grid.Row="8"
Grid.Column="0"
Grid.ColumnSpan="2"
Width="100"
Expand All @@ -130,5 +131,19 @@
FontStretch="Expanded"
Grid.IsSharedSizeScope="True"
ToolTip="Save and Close" />
<Label
x:Name="lblVersion"
Grid.Row="11"
Grid.Column="0"
Content="Version"
FontFamily="Times New Roman"
FontSize="9" />
<Label
x:Name="lblVersionValue"
Grid.Row="11"
Grid.Column="1"
Content="0.0.0.0"
FontFamily="Times New Roman"
FontSize="9" />
</Grid>
</UserControl>

0 comments on commit b25e26b

Please sign in to comment.