mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Prevent mulligans resulting in face down cards
This commit is contained in:
@@ -472,6 +472,7 @@ public final class CMatchUI
|
||||
if (hand != null) {
|
||||
CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
|
||||
if (cp != null) {
|
||||
cp.setCard(c); //ensure card view updated
|
||||
cp.repaintOverlays();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,14 +125,8 @@ public class CHand implements ICDoc {
|
||||
}
|
||||
|
||||
synchronized (ordering) {
|
||||
// Remove old cards from ordering
|
||||
ordering.retainAll(cards);
|
||||
// Append new cards to ordering
|
||||
for (final CardView c : cards) {
|
||||
if (!ordering.contains(c)) {
|
||||
ordering.add(c);
|
||||
}
|
||||
}
|
||||
ordering.clear();
|
||||
ordering.addAll(cards);
|
||||
}
|
||||
|
||||
final List<CardPanel> placeholders = new ArrayList<CardPanel>();
|
||||
@@ -145,6 +139,9 @@ public class CHand implements ICDoc {
|
||||
cardPanel.setDisplayEnabled(false);
|
||||
placeholders.add(cardPanel);
|
||||
}
|
||||
else {
|
||||
cardPanel.setCard(card); //ensure card view is updated
|
||||
}
|
||||
cardPanels.add(cardPanel);
|
||||
}
|
||||
|
||||
|
||||
@@ -533,16 +533,15 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void setCard(final CardView cardView) {
|
||||
if ((getCard() != null) && getCard().equals(cardView) && isAnimationPanel
|
||||
&& imagePanel.hasImage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
card = cardView;
|
||||
CardView oldCard = card;
|
||||
card = cardView; //always update card in case new card view instance for same card
|
||||
|
||||
if (imagePanel == null) {
|
||||
return;
|
||||
}
|
||||
if (oldCard != null && oldCard.equals(card) && isAnimationPanel && imagePanel.hasImage()) {
|
||||
return; //prevent unnecessary update logic for animation panel
|
||||
}
|
||||
|
||||
updateText();
|
||||
updatePTOverlay();
|
||||
|
||||
@@ -264,7 +264,7 @@ public class FloatingCardArea extends CardArea {
|
||||
cardPanel.setDisplayEnabled(true);
|
||||
}
|
||||
else {
|
||||
cardPanel.updateImage(); //ensure image updated in case visibility changed
|
||||
cardPanel.setCard(card); //ensure card view updated
|
||||
}
|
||||
cardPanels.add(cardPanel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user