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