Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with HDT 1.9.2 (bug) #22

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
21 changes: 21 additions & 0 deletions PackHistorian/Controls/CardSelector.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<UserControl x:Class="PackTracker.Controls.CardSelector"
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:controls="clr-namespace:Hearthstone_Deck_Tracker.Controls;assembly=HearthstoneDeckTracker"
x:Name="UcCardSelector"
mc:Ignorable="d"
>

<StackPanel Margin="10 5" Orientation="Horizontal">
<ComboBox MinWidth="256" ItemsSource="{Binding SetHdtCards, ElementName=UcCardSelector}" SelectedItem="{Binding HDTCard}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:Card />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ComboBox>
<CheckBox IsChecked="{Binding Premium}" Content="Golden" Margin="10" VerticalAlignment="Center"></CheckBox>
</StackPanel>
</UserControl>
38 changes: 38 additions & 0 deletions PackHistorian/Controls/CardSelector.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using Hearthstone_Deck_Tracker.Hearthstone;
using HDTCard = Hearthstone_Deck_Tracker.Hearthstone.Card;

namespace PackTracker.Controls
{
/// <summary>
/// Logica di interazione per CardSelector.xaml
/// </summary>
public partial class CardSelector : UserControl
{
private Entity.Card _selectedCard;

public Entity.Card SelectedCard
{
get { return _selectedCard; }
set { _selectedCard = value; }
}


public ObservableCollection<HDTCard> SetHdtCards
{
get { return (ObservableCollection<HDTCard>)GetValue(SetHdtCardsProperty); }
set { SetValue(SetHdtCardsProperty, value); }
}

public static readonly DependencyProperty SetHdtCardsProperty = DependencyProperty.Register("SetHdtCards", typeof(ObservableCollection<HDTCard>), typeof(CardSelector), null);


public CardSelector()
{
InitializeComponent();
}
}
}
74 changes: 74 additions & 0 deletions PackHistorian/Controls/ManualPackInsert.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<controls:MetroWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:DTcontrols="clr-namespace:Hearthstone_Deck_Tracker.Controls;assembly=HearthstoneDeckTracker"
xmlns:view="clr-namespace:PackTracker.View"
xmlns:local="clr-namespace:PackTracker.Controls"
x:Class="PackTracker.Controls.ManualPackInsert"
x:Name="ManualPackInsertWindow"
mc:Ignorable="d"
Title="MANUAL ADD"
BorderBrush="Black" BorderThickness="1"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
ResizeMode="CanMinimize"
ShowInTaskbar="False"
d:DataContext="{d:DesignInstance view:ManualPackInsert, IsDesignTimeCreatable=True}"
>

<DockPanel>
<StackPanel DockPanel.Dock="Top" Margin="4">
<controls:DateTimePicker SelectedDate="{Binding SelectedDateTime}"></controls:DateTimePicker>
</StackPanel>

<Button
Margin="4"
Content="Add new Pack"
DockPanel.Dock="Bottom"
IsEnabled="{Binding AddNewPackEnabled}"
Command="{Binding AddNewPackCommand}"></Button>

<Border Margin="4" Padding="1" BorderBrush="Black" BorderThickness="1">
<StackPanel>
<DockPanel Margin="10">
<controls:SplitButton DockPanel.Dock="Right" HorizontalAlignment="Right" ItemsSource="{Binding Sets}" SelectedItem="{Binding SelectedSet}">
<controls:SplitButton.Resources>
<view:PackNameConverter x:Key="PackNameConverter"/>
</controls:SplitButton.Resources>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource PackNameConverter}}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</controls:SplitButton>
<Label Content="Set"/>
</DockPanel>

<ListView ItemsSource="{Binding PackCards}">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>

<ListView.ItemTemplate>
<DataTemplate>
<local:CardSelector SetHdtCards="{Binding DataContext.CardsInCurrentSet, ElementName=ManualPackInsertWindow }"></local:CardSelector>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

</StackPanel>
</Border>
</DockPanel>
</controls:MetroWindow>
32 changes: 32 additions & 0 deletions PackHistorian/Controls/ManualPackInsert.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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.Shapes;
using System.Collections.Specialized;
using PackTracker.Entity;

namespace PackTracker.Controls
{
/// <summary>
/// Interaktionslogik für ManualPackInsert.xaml
/// </summary>
public partial class ManualPackInsert
{
public ManualPackInsert(PackTracker.History History)
{
DataContext = new View.ManualPackInsert(History);

InitializeComponent();
}
}
}
7 changes: 7 additions & 0 deletions PackHistorian/Controls/Menu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,11 @@
</MenuItem.Icon>
<MenuItem.Header>Search</MenuItem.Header>
</MenuItem>

<MenuItem Name="mnu_ManualInsert">
<MenuItem.Icon>
<Image Source="pack://application:,,,/PackTracker;component/Resources/Icons/1497613802_feather.ico" />
</MenuItem.Icon>
<MenuItem.Header>Add manual</MenuItem.Header>
</MenuItem>
</MenuItem>
2 changes: 1 addition & 1 deletion PackHistorian/Controls/PityTimer/Label.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<Popup Name="pu_Popup" StaysOpen="False" PlacementTarget="{Binding ElementName=btn_Popup}" Placement="Bottom" IsOpen="{Binding Popup, UpdateSourceTrigger=PropertyChanged}">
<Border BorderThickness="1" Background="LemonChiffon" Padding="2">
<TextBlock Text="{Binding PopupText, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Text="{Binding PopupText, UpdateSourceTrigger=PropertyChanged}" Foreground="Black" />
</Border>
</Popup>
<Button Name="btn_Popup" Margin="0,5,5,0" Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" Click="btn_Popup_Click">
Expand Down
53 changes: 40 additions & 13 deletions PackHistorian/PackTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PackTracker</RootNamespace>
<AssemblyName>PackTracker</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -49,31 +50,36 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="HearthDb, Version=8.0.4.18792, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.3.2\HearthDb.dll</HintPath>
<Reference Include="HearthDb">
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\HearthDb.dll</HintPath>
</Reference>
<Reference Include="HearthMirror">
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.2.5\HearthMirror.dll</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\HearthMirror.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthstoneDeckTracker, Version=1.3.5.3102, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.4.0\HearthstoneDeckTracker.exe</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\HearthstoneDeckTracker.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthWatcher">
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.2.5\HearthWatcher.dll</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\HearthWatcher.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LiveCharts, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.3.5\LiveCharts.dll</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\LiveCharts.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LiveCharts.Wpf, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.3.5\LiveCharts.Wpf.dll</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\LiveCharts.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.3.2\MahApps.Metro.dll</HintPath>
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\MahApps.Metro.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand All @@ -90,18 +96,24 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="XAMLMarkupExtensions, Version=1.2.1.3, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.3.2\XAMLMarkupExtensions.dll</HintPath>
<Reference Include="XAMLMarkupExtensions">
<HintPath>..\..\..\..\..\AppData\Local\HearthstoneDeckTracker\app-1.13.13\XAMLMarkupExtensions.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\CardSelector.xaml.cs">
<DependentUpon>CardSelector.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\PityTimer\BarChartSingle.xaml.cs">
<DependentUpon>BarChartSingle.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\PityTimer\PityTimerOverlay.xaml.cs">
<DependentUpon>PityTimerOverlay.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\ManualPackInsert.xaml.cs">
<DependentUpon>ManualPackInsert.xaml</DependentUpon>
</Compile>
<Compile Include="PackWatcher.cs" />
<Compile Include="Controls\Cards.xaml.cs">
<DependentUpon>Cards.xaml</DependentUpon>
Expand Down Expand Up @@ -170,14 +182,17 @@
<Compile Include="Update\Updater.cs" />
<Compile Include="View\AbstractValueConverter.cs" />
<Compile Include="View\Cache\PityTimerRepository.cs" />
<Compile Include="View\CardViewModel.cs" />
<Compile Include="View\DateConverter.cs" />
<Compile Include="View\DateTimeConverter.cs" />
<Compile Include="View\DecimalConverter.cs" />
<Compile Include="SetProvider.cs" />
<Compile Include="View\PackNameConverter.cs" />
<Compile Include="View\Average.cs" />
<Compile Include="View\AverageCollection.cs" />
<Compile Include="View\PercentConverter.cs" />
<Compile Include="View\PityTimer.cs" />
<Compile Include="View\ManualPackInsert.cs" />
<Compile Include="View\Statistic.cs" />
<Compile Include="View\TimeConverter.cs" />
<Compile Include="WindowManager.cs" />
Expand All @@ -187,6 +202,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\CardSelector.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\History.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -251,6 +270,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\ManualPackInsert.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Controls\Statistic.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -282,4 +305,8 @@
<Resource Include="Resources\Icons\if_circle-help-question-mark-glyph_763459.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
Loading