Skip to content

Commit

Permalink
Update pack names, hopefully add backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Apr 6, 2021
1 parent d6ac570 commit be97beb
Show file tree
Hide file tree
Showing 7 changed files with 805 additions and 398 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: GitHub CI

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Setup MSBuild
uses: microsoft/[email protected]

- name: Setup HDT
shell: pwsh
run: |
Invoke-WebRequest https://mirror.sgkoi.dev/HDT -OutFile HDT.zip
Expand-Archive HDT.zip
Rename-Item '.\HDT\Hearthstone Deck Tracker\Hearthstone Deck Tracker.exe' HearthstoneDeckTracker.exe
- name: Build
shell: pwsh
run: |
msbuild PackTracker.sln
- name: Upload
uses: actions/upload-artifact@v1
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
with:
name: Artifact
path: PackHistorian/bin/Debug
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,6 @@ __pycache__/
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
*.xsd.cs
/HDT.zip
/HDT
13 changes: 10 additions & 3 deletions PackHistorian/Controls/Settings/Credits.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<metro:MetroContentControl
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PackTracker.Controls.Settings"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="PackTracker.Controls.Settings.Credits"
xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
>
<metro:MetroContentControl.Resources>
Expand Down Expand Up @@ -45,6 +45,13 @@
<TextBlock FontFamily="{StaticResource FontFamily}" Foreground="{StaticResource Foreground}" Padding="2,0">Icons&#160;Solid &lt;<Hyperlink NavigateUri="http://www.iconsolid.com/" RequestNavigate="Hyperlink_RequestNavigate">www.iconsolid.com</Hyperlink>&gt;</TextBlock>
</StackPanel>
</Border>

<Border Margin="4">
<StackPanel>
<TextBlock FontFamily="{StaticResource FontFamily}" Background="{StaticResource HeadlineBackground}" Foreground="{StaticResource Foreground}" FontSize="{StaticResource HeadlineFontSize}" Padding="2,0">Modded:</TextBlock>
<TextBlock FontFamily="{StaticResource FontFamily}" Foreground="{StaticResource Foreground}" Padding="2,0">SGKoishi &lt;<Hyperlink NavigateUri="http://github.com/sgkoishi/" RequestNavigate="Hyperlink_RequestNavigate">GitHub@SGKoishi</Hyperlink>&gt;</TextBlock>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</metro:MetroContentControl>
47 changes: 31 additions & 16 deletions PackHistorian/PackTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,44 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="HearthDb, Version=8.2.0.19506, Culture=neutral, processorArchitecture=x86">
<Reference Include="HearthDb">
<HintPath>..\HDT\Hearthstone Deck Tracker\HearthDb.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthMirror">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\HearthDb.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\HearthMirror.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthMirror, Version=17.0.2.45932, Culture=neutral, processorArchitecture=x86">
<Reference Include="HearthstoneDeckTracker">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.14.4\HearthMirror.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\HearthstoneDeckTracker.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthstoneDeckTracker, Version=1.4.0.3216, Culture=neutral, processorArchitecture=x86">
<Reference Include="HearthWatcher">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\HearthstoneDeckTracker.exe</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\HearthWatcher.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HearthWatcher, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<Reference Include="LiveCharts">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\HearthWatcher.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\LiveCharts.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LiveCharts, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<Reference Include="LiveCharts.Wpf">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\LiveCharts.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\LiveCharts.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LiveCharts.Wpf, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<Reference Include="MahApps.Metro">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\LiveCharts.Wpf.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\MahApps.Metro.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\MahApps.Metro.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand All @@ -93,9 +104,10 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="XAMLMarkupExtensions, Version=1.2.1.3, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="XAMLMarkupExtensions">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Fetti\AppData\Local\HearthstoneDeckTracker\app-1.11.1\XAMLMarkupExtensions.dll</HintPath>
<HintPath>..\HDT\Hearthstone Deck Tracker\XAMLMarkupExtensions.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -284,5 +296,8 @@
<ItemGroup>
<Resource Include="Resources\Icons\if_circle-help-question-mark-glyph_763459.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\packs.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
11 changes: 10 additions & 1 deletion PackHistorian/PackWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ private void NewPack(object sender, PackEventArgs e) {

foreach(var Card in e.Cards) {
HDTCard cardFromId = Database.GetCardFromId(Card.Id);
Cards.Add(new Entity.Card(cardFromId, 1 == Card.PremiumType));
bool isPremium;
try
{
isPremium = ((dynamic)Card).Premium;
}
catch
{
isPremium = ((dynamic)Card).PremiumType == 1;
}
Cards.Add(new Entity.Card(cardFromId, isPremium));
}

OnPackOpened(new Pack(e.PackId, Time, Cards));
Expand Down
Loading

0 comments on commit be97beb

Please sign in to comment.