Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ ZoneType.Flashback, new Color(80, 20, 100)
private OutlinedLabel cardIdText;
private boolean displayEnabled = true;
private boolean ghost; // faded stand-in for a card this permanent holds in exile
private boolean dimmed;
private boolean isAnimationPanel;
private int cardXOffset, cardYOffset, cardWidth, cardHeight;
private boolean isSelected;
Expand Down Expand Up @@ -271,6 +272,10 @@ public final void setDisplayEnabled(final boolean displayEnabled0) {
displayEnabled = displayEnabled0;
}

public final void setDimmed(final boolean dimmed0) {
dimmed = dimmed0;
}

public int getGroupCount() {
return groupCount;
}
Expand Down Expand Up @@ -457,8 +462,8 @@ protected final void paintChildren(final Graphics g) {
}

boolean nonselectable = matchUI.isSelecting() && !matchUI.isSelectable(getCard());
// if selecting, darken non-selectable cards
if (nonselectable) {
// darken non-selectable cards while selecting, and panels explicitly dimmed
if (nonselectable || dimmed) {
boolean noBorderPref = !isPreferenceEnabled(FPref.UI_RENDER_BLACK_BORDERS);
boolean cardImgHasAlpha = imagePanel != null && imagePanel.getSrcImage() != null && imagePanel.getSrcImage().getColorModel().hasAlpha();
final int cornerSize = noBorderPref && !cardImgHasAlpha ? 0 : Math.max(4, Math.round(cardWidth * CardPanel.ROUNDED_CORNER_SIZE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ protected void hideWindow() {
@Override
protected void doRefresh() {
List<CardPanel> cardPanels = new ArrayList<>();
boolean anyViewable = false;

for (final CardView card : getCards()) {
CardPanel cardPanel = getCardPanel(card.getId());
Expand All @@ -657,6 +658,11 @@ protected void doRefresh() {
}
}
cardPanels.add(cardPanel);
anyViewable |= getMatchUI().mayView(card);
}
// When only some cards in a zone are revealed, dim the un-revealed ones which render as blank cards
for (final CardPanel panel : cardPanels) {
panel.setDimmed(anyViewable && !getMatchUI().mayView(panel.getCard()));
}
setCardPanels(cardPanels);
final int shown = cardPanels.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,14 @@ protected void reveal(final CardCollectionView cards, final ZoneType zone, final
final PlayerZoneUpdates zonesToUpdate = new PlayerZoneUpdates();
zonesToUpdate.add(new PlayerZoneUpdate(owner, zone));
final Iterable<PlayerZoneUpdate>[] zonesShown = new Iterable[1];
final InputConfirm inp = new InputConfirm(this, fm,
localizer.getMessage("lblOK"), localizer.getMessage("lblEndTurn"), true);
inputQueue.setInput(inp);
FThreads.invokeInEdtNowOrLater(() -> {
getGui().updateZones(zonesToUpdate);
zonesShown[0] = getGui().tempShowZones(getLocalPlayerView(), zonesToUpdate);
});
final InputConfirm inp = new InputConfirm(this, fm,
localizer.getMessage("lblOK"), localizer.getMessage("lblEndTurn"), true);
inp.showAndWait();
inp.awaitLatchRelease();
if (!inp.getResult()) {
FThreads.invokeInEdtLater(this::autoPassUntilEndOfTurn);
}
Expand Down
Loading