mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- A better fix for Morph cards leaking their color in CardDetailPanel when face-down.
This commit is contained in:
@@ -34,7 +34,6 @@ import forge.card.CardDetailUtil;
|
|||||||
import forge.card.CardDetailUtil.DetailColors;
|
import forge.card.CardDetailUtil.DetailColors;
|
||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
import forge.card.CardRarity;
|
import forge.card.CardRarity;
|
||||||
import forge.card.CardStateName;
|
|
||||||
import forge.game.GameView;
|
import forge.game.GameView;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.card.CardView;
|
import forge.game.card.CardView;
|
||||||
@@ -173,6 +172,10 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void setCard(final CardView card, final boolean isInAltState) {
|
public final void setCard(final CardView card, final boolean isInAltState) {
|
||||||
|
setCard(card, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setCard(final CardView card, final boolean isInAltState, final boolean canShow) {
|
||||||
nameCostLabel.setText("");
|
nameCostLabel.setText("");
|
||||||
typeLabel.setVisible(true);
|
typeLabel.setVisible(true);
|
||||||
typeLabel.setText("");
|
typeLabel.setText("");
|
||||||
@@ -196,8 +199,6 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canShow = true;
|
|
||||||
|
|
||||||
if (state.getManaCost().isNoCost() || !canShow) {
|
if (state.getManaCost().isNoCost() || !canShow) {
|
||||||
nameCostLabel.setText(CardDetailUtil.formatCardName(card, canShow, isInAltState));
|
nameCostLabel.setText(CardDetailUtil.formatCardName(card, canShow, isInAltState));
|
||||||
}
|
}
|
||||||
@@ -262,11 +263,7 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
setInfoLabel.setBorder(BorderFactory.createLineBorder(foreColor));
|
setInfoLabel.setBorder(BorderFactory.createLineBorder(foreColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.getState() == CardStateName.FaceDown) {
|
updateBorder(state, canShow);
|
||||||
updateBorder(state, false); // do not spoil the color of face-down cards
|
|
||||||
} else {
|
|
||||||
updateBorder(state, canShow);
|
|
||||||
}
|
|
||||||
|
|
||||||
powerToughnessLabel.setText(CardDetailUtil.formatPowerToughness(state, canShow));
|
powerToughnessLabel.setText(CardDetailUtil.formatPowerToughness(state, canShow));
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class CDetail implements ICDoc {
|
|||||||
void showCard(final CardView c, final boolean isInAltState, final boolean mayView, final boolean mayFlip) {
|
void showCard(final CardView c, final boolean isInAltState, final boolean mayView, final boolean mayFlip) {
|
||||||
final CardView toShow = mayView ? c : null;
|
final CardView toShow = mayView ? c : null;
|
||||||
view.getLblFlipcard().setVisible(toShow != null && mayFlip);
|
view.getLblFlipcard().setVisible(toShow != null && mayFlip);
|
||||||
view.getPnlDetail().setCard(toShow, isInAltState);
|
view.getPnlDetail().setCard(toShow, isInAltState, mayView);
|
||||||
if (view.getParentCell() != null) {
|
if (view.getParentCell() != null) {
|
||||||
view.getParentCell().repaintSelf();
|
view.getParentCell().repaintSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user