Skip to content

Commit

Permalink
Release: v1.0.7: With a MinSimilarity of 0, the most popular deck for…
Browse files Browse the repository at this point in the history
… the enemy's class can be shown at mulligan now, even if no cards were played yet. Removed initial string. Increased some delays so that the HDT and plugin communication works as intended. Decklist ist reset at gamestart now, before a new list is determined.
  • Loading branch information
djdookie committed Oct 18, 2017
1 parent be91243 commit dc46fd5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions Advisor/Advisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Advisor(AdvisorOverlay overlay)
//trackerRepository = new TrackerRepository();
//LoadArchetypeDecks();

_advisorOverlay.LblArchetype.Text = "No matching archetype yet";
_advisorOverlay.LblArchetype.Text = "";
_advisorOverlay.LblStats.Text = "";
//_advisorOverlay.Update(new List<Card>());
UpdateCardList();
Expand Down Expand Up @@ -160,14 +160,20 @@ private void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
//internal Entity Opponent => Entities?.FirstOrDefault(x => x.IsOpponent);

// Reset on when a new game starts
internal void GameStart()
internal async void GameStart()
{
// Only continue if in valid game mode and game format
if (IsValidGameMode && IsValidGameFormat)
{
_advisorOverlay.UpdatePosition();
_advisorOverlay.LblArchetype.Text = "No matching archetype yet";
_advisorOverlay.LblArchetype.Text = "";
_advisorOverlay.LblStats.Text = "";

await Task.Delay(2000);

_advisorOverlay.Update(new List<Card>(), true);
currentArchetypeDeckGuid = Guid.Empty;

UpdateCardList();
_advisorOverlay.Show();
}
Expand Down Expand Up @@ -236,8 +242,9 @@ internal async void UpdateCardList()
//var opponentCardlist = Core.Game.Opponent.RevealedCards;
IList<Card> opponentCardlist = Core.Game.Opponent.OpponentCardList.Where(x => !x.IsCreated).ToList();

// If no opponent's cards were revealed yet or we have no imported archetype decks in the database, return empty card list
if (!opponentCardlist.Any() || !ArchetypeDecks.Any())
// If opponent's class is unknown yet or we have no imported archetype decks in the database, return empty card list
//if (!opponentCardlist.Any() || !ArchetypeDecks.Any())
if (CoreAPI.Game.Opponent.Class == "" || !ArchetypeDecks.Any())
{
currentArchetypeDeckGuid = Guid.Empty;
_advisorOverlay.Update(new List<Card>(), true);
Expand Down
4 changes: 2 additions & 2 deletions Advisor/AdvisorPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void OnButtonPress()
public async void OnLoad()
{
// Small delay to guarantee all game variables are set correctly by now (especially CoreAPI.Game.IsInMenu)
await Task.Delay(500);
await Task.Delay(2000);

_advisorOverlay = new AdvisorOverlay();
Core.OverlayCanvas.Children.Add(_advisorOverlay);
Expand Down Expand Up @@ -92,7 +92,7 @@ public void OnUpdate()
{
}

public Version Version => new Version(1, 0, 6);
public Version Version => new Version(1, 0, 7);

public async Task CheckForUpdate()
{
Expand Down
4 changes: 2 additions & 2 deletions Advisor/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.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]

0 comments on commit dc46fd5

Please sign in to comment.