Skip to content

Commit

Permalink
v0.3.5,
Browse files Browse the repository at this point in the history
fixed freeze on start,
fixed new deck not being cleared
  • Loading branch information
epix37 committed Jun 29, 2014
1 parent 6c72c95 commit e075d3e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
33 changes: 25 additions & 8 deletions Hearthstone Deck Tracker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,10 +1151,14 @@ private void DeckPickerListOnSelectedDeckChanged(DeckPicker sender, Deck deck)
while (_deckList.LastDeckClass.Any(ldc => ldc.Class == deck.Class))
{
var lastSelected = _deckList.LastDeckClass.FirstOrDefault(ldc => ldc.Class == deck.Class);
if (DeckPickerList.SelectedDeck != null)
if (lastSelected != null)
{
_deckList.LastDeckClass.Remove(lastSelected);
}
else
{
break;
}
}
_deckList.LastDeckClass.Add(new DeckInfo(){Class = deck.Class, Name = deck.Name});
_xmlManager.Save("PlayerDecks.xml", _deckList);
Expand Down Expand Up @@ -1378,7 +1382,11 @@ private void Grid_Drop(object sender, DragEventArgs e)
UpdateDbListView();
}
}


private void TextBoxDBFilter_TextChanged(object sender, TextChangedEventArgs e)
{
UpdateDbListView();
}

#endregion

Expand Down Expand Up @@ -1521,10 +1529,10 @@ private void ClearNewDeckSection()
TextBoxDeckName.Text = string.Empty;
TextBoxDBFilter.Text = string.Empty;
ComboBoxFilterMana.SelectedIndex = 0;
_newDeck.Cards.Clear();
_newDeck.Class = string.Empty;
_newDeck.Name = string.Empty;
_newDeck = new Deck();
ListViewNewDeck.ItemsSource = _newDeck.Cards;
_newContainsDeck = false;
_editingDeck = false;
}

private void RemoveCardFromDeck(Card card)
Expand Down Expand Up @@ -1569,11 +1577,18 @@ private void AddCardToDeck(Card card)
UpdateNewDeckHeader(true);
}

private void TextBoxDBFilter_TextChanged(object sender, TextChangedEventArgs e)

private async void ShowClearNewDeckMessage()
{
UpdateDbListView();
var settings = new MetroDialogSettings();
settings.AffirmativeButtonText = "Yes";
settings.NegativeButtonText = "No";
var result = await this.ShowMessageAsync("Clear deck?", "", MessageDialogStyle.AffirmativeAndNegative, settings);
if (result == MessageDialogResult.Affirmative)
{
ClearNewDeckSection();
}
}


#endregion

Expand Down Expand Up @@ -2275,5 +2290,7 @@ private void CheckboxExportName_Unchecked(object sender, RoutedEventArgs e)
}
#endregion



}
}
2 changes: 1 addition & 1 deletion Hearthstone Deck Tracker/Version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<Version>
<Major>0</Major>
<Minor>3</Minor>
<Revision>4</Revision>
<Revision>5</Revision>
<Build>0</Build>
</Version>

0 comments on commit e075d3e

Please sign in to comment.