Skip to content

Commit

Permalink
Changes for release v0.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
rembound committed Jun 9, 2015
1 parent e487f8f commit 4af77b5
Show file tree
Hide file tree
Showing 13 changed files with 1,026 additions and 101 deletions.
16 changes: 15 additions & 1 deletion ArenaHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<Reference Include="Hearthstone Deck Tracker">
<HintPath>..\..\..\..\..\..\Software\Games\Hearthstone Deck Tracker\Hearthstone Deck Tracker.exe</HintPath>
<Private>False</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="MahApps.Metro">
<HintPath>packages\MahApps.Metro.1.1.2.0\lib\net45\MahApps.Metro.dll</HintPath>
Expand Down Expand Up @@ -74,11 +73,18 @@
<Compile Include="ArenaWindow.xaml.cs">
<DependentUpon>ArenaWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\AdviceOverlay.xaml.cs">
<DependentUpon>AdviceOverlay.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Card.xaml.cs">
<DependentUpon>Card.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\OutlinedTextBlock.cs" />
<Compile Include="Controls\ValueOverlay.xaml.cs">
<DependentUpon>ValueOverlay.xaml</DependentUpon>
</Compile>
<Compile Include="Plugin.cs" />
<Compile Include="Plugins.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Update.cs" />
</ItemGroup>
Expand All @@ -90,10 +96,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\AdviceOverlay.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Card.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\ValueOverlay.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
8 changes: 7 additions & 1 deletion ArenaHelper.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.30110.0
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArenaHelper", "ArenaHelper.csproj", "{57D6FEFC-CD63-40B5-B83E-EACA3E3B105E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPlugin", "TestPlugin\TestPlugin.csproj", "{9DBE89DA-8673-4657-A0DC-EC1F26C70B8A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{57D6FEFC-CD63-40B5-B83E-EACA3E3B105E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57D6FEFC-CD63-40B5-B83E-EACA3E3B105E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57D6FEFC-CD63-40B5-B83E-EACA3E3B105E}.Release|Any CPU.Build.0 = Release|Any CPU
{9DBE89DA-8673-4657-A0DC-EC1F26C70B8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DBE89DA-8673-4657-A0DC-EC1F26C70B8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DBE89DA-8673-4657-A0DC-EC1F26C70B8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DBE89DA-8673-4657-A0DC-EC1F26C70B8A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
50 changes: 41 additions & 9 deletions ArenaWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@
xmlns:localcontrols="clr-namespace:ArenaHelper.Controls"
Title="Arena Helper" Height="255" MinHeight="255" MaxHeight="255" Width="400" MinWidth="400" MaxWidth="400"
Background="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" Topmost="True" LocationChanged="MetroWindow_LocationChanged">
<controls:MetroWindow.RightWindowCommands>
<controls:WindowCommands>
<Button Click="ButtonOptions_Click">
<StackPanel Orientation="Horizontal">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<VisualBrush Visual="{StaticResource appbar_settings}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock Margin="4" VerticalAlignment="Center" Text="Options" />
</StackPanel>
</Button>
<Button Click="ButtonAbout_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Margin="4" VerticalAlignment="Center" Text="About" />
</StackPanel>
</Button>
</controls:WindowCommands>
</controls:MetroWindow.RightWindowCommands>
<controls:MetroWindow.Flyouts>
<controls:FlyoutsControl Margin="{Binding TitleBarMargin, RelativeSource={RelativeSource AncestorType=local:ArenaWindow}}">
<controls:Flyout x:Name="FlyoutOptions" Header="Options" Position="Left" Width="400">
<StackPanel>
<CheckBox x:Name="CheckBoxOverlay" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="8,0,0,0" Checked="CheckBoxOverlay_Checked" Unchecked="CheckBoxOverlay_Unchecked" Content="Show values in overlay" />
<CheckBox x:Name="CheckBoxManual" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="8,8,0,0" Checked="CheckBoxManual_Checked" Unchecked="CheckBoxManual_Unchecked">
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top">Manual card picking<LineBreak />Pick a card in Hearthstone, afterwards, click the card in the Arena Helper window. Don't detect picks automatically.</TextBlock>
</CheckBox>
</StackPanel>
</controls:Flyout>
</controls:FlyoutsControl>
</controls:MetroWindow.Flyouts>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
Expand All @@ -25,13 +57,13 @@
</WrapPanel>

<WrapPanel Grid.Column="1" VerticalAlignment="Center">
<Button x:Name="Button1" Width="70" Content="New Arena" Margin="0 0 8 0" Click="Button1_Click" />
<Button x:Name="Button2" Width="70" Content="Save Deck" Margin="0 0 8 0" Click="Button2_Click" />
<Button x:Name="Button1" Width="70" Content="New Arena" Margin="0 0 8 0" Click="ButtonNewArena_Click" />
<Button x:Name="Button2" Width="70" Content="Save Deck" Margin="0 0 8 0" Click="ButtonSave_Click" />
</WrapPanel>
</Grid>
<Separator/>
</StackPanel>
<StackPanel x:Name="DetectingPanel" Grid.Row="1" Width="200" Visibility="Hidden">
<StackPanel x:Name="DetectingPanel" Grid.Row="1" Width="200" Visibility="Visible">
<local:OutlinedTextBlock x:Name="DetectingHeader" HorizontalAlignment="Center" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" FontSize="20" Text="Title" Margin="0,4,0,0" />
<TextBlock x:Name="DetectingText" TextWrapping="Wrap" TextAlignment="Center" Foreground="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" Margin="0,12,0,0">text</TextBlock>
</StackPanel>
Expand All @@ -47,21 +79,21 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
<Border x:Name="HeroBorder0" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0">
<Border x:Name="HeroBorder0" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0" MouseUp="HeroBorder0_MouseUp">
<Image x:Name="HeroImage0" Width="32" Height="32" Margin="0,0,0,0" />
</Border>
<local:OutlinedTextBlock x:Name="Hero0" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="Paladin" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" TextAlignment="Left" FontSize="13" Margin="0,4,0,0" />
</StackPanel>

<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<Border x:Name="HeroBorder1" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0">
<Border x:Name="HeroBorder1" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0" MouseUp="HeroBorder1_MouseUp">
<Image x:Name="HeroImage1" Width="32" Height="32" Margin="0,0,0,0" />
</Border>
<local:OutlinedTextBlock x:Name="Hero1" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="Paladin" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" TextAlignment="Left" FontSize="13" Margin="0,4,0,0" />
</StackPanel>

<StackPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">
<Border x:Name="HeroBorder2" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0">
<Border x:Name="HeroBorder2" Height="40" Width="40" Grid.Row="0" Grid.Column="0" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Margin="0,16,0,0" MouseUp="HeroBorder2_MouseUp">
<Image x:Name="HeroImage2" Width="32" Height="32" Margin="0,0,0,0" />
</Border>
<local:OutlinedTextBlock x:Name="Hero2" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="Paladin" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" TextAlignment="Left" FontSize="13" Margin="0,4,0,0" />
Expand All @@ -76,9 +108,9 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<local:OutlinedTextBlock x:Name="Header" HorizontalAlignment="Center" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" FontSize="20" Text="header" Margin="0,4,0,0" />
<localcontrols:Card x:Name="CardControl0" DataContext="{Binding Card0}" HorizontalAlignment="Center" Margin="0,12,0,0" />
<localcontrols:Card x:Name="CardControl1" DataContext="{Binding Card1}" HorizontalAlignment="Center" Margin="0,4,0,0" />
<localcontrols:Card x:Name="CardControl2" DataContext="{Binding Card2}" HorizontalAlignment="Center" Margin="0,4,0,0" />
<localcontrols:Card x:Name="CardControl0" DataContext="{Binding Card0}" HorizontalAlignment="Center" Margin="0,12,0,0" MouseUp="CardControl0_MouseUp" />
<localcontrols:Card x:Name="CardControl1" DataContext="{Binding Card1}" HorizontalAlignment="Center" Margin="0,4,0,0" MouseUp="CardControl1_MouseUp" />
<localcontrols:Card x:Name="CardControl2" DataContext="{Binding Card2}" HorizontalAlignment="Center" Margin="0,4,0,0" MouseUp="CardControl2_MouseUp" />
</StackPanel>
<StackPanel Grid.Column="1" Visibility="Visible" HorizontalAlignment="Center" Margin="32,0,0,0">
<local:OutlinedTextBlock HorizontalAlignment="Center" FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT" FontSize="20" Text="Value" Margin="0,4,0,0" />
Expand Down
138 changes: 127 additions & 11 deletions ArenaWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Point = System.Drawing.Point;
using Hearthstone_Deck_Tracker.Hearthstone.Entities;
using Hearthstone_Deck_Tracker.Hearthstone;
using MahApps.Metro.Controls.Dialogs;

#endregion

Expand All @@ -23,9 +24,20 @@ public partial class ArenaWindow
private Card _card2;

public delegate void OnEvent();
public OnEvent onbutton1click = null;
public OnEvent onbutton2click = null;
public OnEvent onbuttonnewarenaclick = null;
public OnEvent onbuttonsaveclick = null;
public OnEvent onwindowlocation = null;
public OnEvent onaboutclick = null;

public delegate void OnOverrideClick(int index);
public OnOverrideClick onheroclick = null;
public OnOverrideClick oncardclick = null;

public delegate void OnCheckbox(bool check);
public OnCheckbox oncheckboxoverlay = null;
public OnCheckbox oncheckboxmanual = null;

public bool initconfig = false;

public ArenaWindow()
{
Expand Down Expand Up @@ -67,27 +79,131 @@ public void Update()
DataContext = this;
}

private void Button1_Click(object sender, RoutedEventArgs e)
private void MetroWindow_LocationChanged(object sender, EventArgs e)
{
if (onbutton1click != null)
if (onwindowlocation != null)
{
onbutton1click();
onwindowlocation();
}
}

private void Button2_Click(object sender, RoutedEventArgs e)
public Thickness TitleBarMargin
{
get { return new Thickness(0, TitlebarHeight, 0, 0); }
}

private void ButtonOptions_Click(object sender, RoutedEventArgs e)
{
if (onbutton2click != null)
FlyoutOptions.IsOpen = true;
}

private void ButtonAbout_Click(object sender, RoutedEventArgs e)
{
if (onaboutclick != null)
{
onbutton2click();
onaboutclick();
}
}

private void MetroWindow_LocationChanged(object sender, EventArgs e)
private void ButtonNewArena_Click(object sender, RoutedEventArgs e)
{
if (onwindowlocation != null)
if (onbuttonnewarenaclick != null)
{
onwindowlocation();
onbuttonnewarenaclick();
}
}

private void ButtonSave_Click(object sender, RoutedEventArgs e)
{
if (onbuttonsaveclick != null)
{
onbuttonsaveclick();
}
}

private void HeroBorder0_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (onheroclick != null)
{
onheroclick(0);
}
}

private void HeroBorder1_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (onheroclick != null)
{
onheroclick(1);
}
}

private void HeroBorder2_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (onheroclick != null)
{
onheroclick(2);
}
}

private void CardControl0_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (oncardclick != null)
{
oncardclick(0);
}
}

private void CardControl1_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (oncardclick != null)
{
oncardclick(1);
}
}

private void CardControl2_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Override mouse detection
if (oncardclick != null)
{
oncardclick(2);
}
}

private void CheckBoxOverlay_Checked(object sender, RoutedEventArgs e)
{
if (oncheckboxoverlay != null)
{
oncheckboxoverlay(true);
}
}

private void CheckBoxOverlay_Unchecked(object sender, RoutedEventArgs e)
{
if (oncheckboxoverlay != null)
{
oncheckboxoverlay(false);
}
}

private void CheckBoxManual_Checked(object sender, RoutedEventArgs e)
{
if (oncheckboxmanual != null)
{
oncheckboxmanual(true);
}
}

private void CheckBoxManual_Unchecked(object sender, RoutedEventArgs e)
{
if (oncheckboxmanual != null)
{
oncheckboxmanual(false);
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions Controls/AdviceOverlay.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<UserControl x:Class="ArenaHelper.Controls.AdviceOverlay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ArenaHelper"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="500">
<Grid Width="500">
<local:OutlinedTextBlock x:Name="AdviceText" VerticalAlignment="Bottom" HorizontalAlignment="Left"
Text="text"
FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT"
TextAlignment="Left" FontSize="16" />
</Grid>
</UserControl>
28 changes: 28 additions & 0 deletions Controls/AdviceOverlay.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ArenaHelper.Controls
{
/// <summary>
/// Interaction logic for AdviceOverlay.xaml
/// </summary>
public partial class AdviceOverlay : UserControl
{
public AdviceOverlay()
{
InitializeComponent();
}
}
}
15 changes: 15 additions & 0 deletions Controls/ValueOverlay.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<UserControl x:Class="ArenaHelper.Controls.ValueOverlay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ArenaHelper"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid Width="150">
<local:OutlinedTextBlock x:Name="ValueText" VerticalAlignment="Bottom" HorizontalAlignment="Center"
Text="text"
FontFamily="/HearthstoneDeckTracker;component/Resources/#Belwe Bd BT"
TextAlignment="Center" FontSize="24" />
</Grid>
</UserControl>
Loading

0 comments on commit 4af77b5

Please sign in to comment.