forked from External/mage
* UI: added playable card marks in look-at windows;
This commit is contained in:
parent
ff1299cca9
commit
cde9957f54
15 changed files with 200 additions and 122 deletions
|
|
@ -1205,11 +1205,11 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
needSelectable = new HashSet<>();
|
||||
}
|
||||
|
||||
Set<UUID> needPlayable;
|
||||
Map<UUID, Integer> needPlayable;
|
||||
if (showPlayable && gameView.getCanPlayObjects() != null) {
|
||||
needPlayable = gameView.getCanPlayObjects();
|
||||
} else {
|
||||
needPlayable = new HashSet<>();
|
||||
needPlayable = new HashMap<>();
|
||||
}
|
||||
|
||||
if (needChoosen.isEmpty() && needSelectable.isEmpty() && needPlayable.isEmpty()) {
|
||||
|
|
@ -1225,8 +1225,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(card.getId())) {
|
||||
card.setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(card.getId())) {
|
||||
if (needPlayable.containsKey(card.getId())) {
|
||||
card.setPlayable(true);
|
||||
card.setPlayableAmount(needPlayable.get(card.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1254,8 +1255,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(perm.getKey())) {
|
||||
perm.getValue().setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(perm.getKey())) {
|
||||
if (needPlayable.containsKey(perm.getKey())) {
|
||||
perm.getValue().setPlayable(true);
|
||||
perm.getValue().setPlayableAmount(needPlayable.get(perm.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1271,8 +1273,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(card.getKey())) {
|
||||
card.getValue().setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(card.getKey())) {
|
||||
if (needPlayable.containsKey(card.getKey())) {
|
||||
card.getValue().setPlayable(true);
|
||||
card.getValue().setPlayableAmount(needPlayable.get(card.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1288,8 +1291,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(card.getKey())) {
|
||||
card.getValue().setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(card.getKey())) {
|
||||
if (needPlayable.containsKey(card.getKey())) {
|
||||
card.getValue().setPlayable(true);
|
||||
card.getValue().setPlayableAmount(needPlayable.get(card.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1305,8 +1309,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(com.getId())) {
|
||||
com.setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(com.getId())) {
|
||||
if (needPlayable.containsKey(com.getId())) {
|
||||
com.setPlayable(true);
|
||||
com.setPlayableAmount(needPlayable.get(com.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1321,8 +1326,19 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (needChoosen.contains(card.getKey())) {
|
||||
card.getValue().setSelected(true);
|
||||
}
|
||||
if (needPlayable.contains(card.getKey())) {
|
||||
if (needPlayable.containsKey(card.getKey())) {
|
||||
card.getValue().setPlayable(true);
|
||||
card.getValue().setPlayableAmount(needPlayable.get(card.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// looked at
|
||||
for (LookedAtView look : gameView.getLookedAt()) {
|
||||
for (Map.Entry<UUID, SimpleCardView> card : look.getCards().entrySet()) {
|
||||
if (needPlayable.containsKey(card.getKey())) {
|
||||
card.getValue().setPlayable(true);
|
||||
card.getValue().setPlayableAmount(needPlayable.get(card.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue