mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09:00
Fixed a bug when showing and hiding drafted cards
This commit fixes the following bug: 1) Draft a couple of cards in draft mode 2) Hide a card 3) Show all cards 4) Hide another card Here both cards got hidden, this commit makes sure only the card in 4) gets hidden
This commit is contained in:
parent
5d0a94c1b9
commit
f8dd3a1491
1 changed files with 12 additions and 6 deletions
|
@ -382,10 +382,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
||||||
menuItem.addActionListener(new ActionListener() {
|
menuItem.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
// Add the card to the hidden cards
|
hideThisCard(cardIdPopupMenu);
|
||||||
cardsHidden.add(cardIdPopupMenu);
|
|
||||||
pickedCardsShown.remove(cardIdPopupMenu);
|
|
||||||
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -393,11 +390,20 @@ public class DraftPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void hideThisCard(UUID card) {
|
||||||
|
// Add the card to the hidden cards
|
||||||
|
cardsHidden.add(card);
|
||||||
|
pickedCardsShown.remove(card);
|
||||||
|
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
|
||||||
|
}
|
||||||
|
|
||||||
private void showAgainAllHiddenCards() {
|
private void showAgainAllHiddenCards() {
|
||||||
// show again all hidden cards
|
// Add back the hidden cards to the shown set
|
||||||
|
for (UUID card : cardsHidden) {
|
||||||
|
pickedCardsShown.put(card, pickedCards.get(card));
|
||||||
|
}
|
||||||
cardsHidden.clear();
|
cardsHidden.clear();
|
||||||
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCards), bigCard, null);
|
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
|
|
Loading…
Add table
Reference in a new issue