Fix (hopefully) attack icons on cards and a possible NPE.

This commit is contained in:
elcnesh
2014-09-16 21:05:39 +00:00
parent 8bade53caa
commit d3b6893d33
10 changed files with 35 additions and 15 deletions

View File

@@ -11,7 +11,6 @@ import java.net.URI;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.swing.JFileChooser;
import javax.swing.JPopupMenu;
@@ -440,7 +439,7 @@ public class GuiDesktop implements IGuiBase {
}
@Override
public void updateCards(final Set<CardView> cardsToUpdate) {
public void updateCards(final Iterable<CardView> cardsToUpdate) {
CMatchUI.SINGLETON_INSTANCE.updateCards(cardsToUpdate);
}

View File

@@ -388,7 +388,7 @@ public enum CMatchUI implements ICDoc, IMenuProvider {
}
public void updateCards(final Set<CardView> cardsToUpdate) {
public void updateCards(final Iterable<CardView> cardsToUpdate) {
for (final CardView c : cardsToUpdate) {
updateSingleCard(c);
}

View File

@@ -386,7 +386,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
displayCardNameOverlay(showText && showCardNameOverlay(), imgSize, imgPos);
displayPTOverlay(showText && showCardPowerOverlay(), imgSize, imgPos);
displayCardIdOverlay(showText && showCardIdOverlay(), imgSize, imgPos);
displayIconOverlay(getGraphics());
}
private void displayCardIdOverlay(boolean isVisible, Dimension imgSize, Point imgPos) {
@@ -656,11 +655,9 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
return;
}
if (this.card != cardView) {
this.updatePTOverlay(); //update PT Overlay if card changes
}
this.card = cardView;
this.doLayout();
if (!this.isShowing()) {
return;
}

View File

@@ -707,7 +707,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
toPanel.setAttachedToPanel(null);
}
toPanel.setCard(toPanel.getCard());
toPanel.setCard(card);
if (fromRefresh) {
toPanel.updatePTOverlay(); //ensure PT Overlay updated on refresh
}