mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00: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() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Add the card to the hidden cards
|
||||
cardsHidden.add(cardIdPopupMenu);
|
||||
pickedCardsShown.remove(cardIdPopupMenu);
|
||||
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
|
||||
hideThisCard(cardIdPopupMenu);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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() {
|
||||
// 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();
|
||||
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCards), bigCard, null);
|
||||
draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null);
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
|
|
Loading…
Reference in a new issue