* UI: improved and fixed possible targets highlighting:

* added blockers highlighting on declare blockers step;
   * fixed that blocker targets highlights all attackers instead real;
   * fixed wrong attackers draw in images render mode;
This commit is contained in:
Oleg Agafonov 2019-03-28 09:29:15 +04:00
parent c58b28f94f
commit 0e6dbb4eed
7 changed files with 167 additions and 132 deletions

View file

@ -696,6 +696,13 @@ public final class GamePanel extends javax.swing.JPanel {
}
}
List<UUID> possibleBlockers = new ArrayList<>();
if (options != null && options.containsKey(Constants.Option.POSSIBLE_BLOCKERS)) {
if (options.get(Constants.Option.POSSIBLE_BLOCKERS) instanceof List) {
possibleBlockers.addAll((List) options.get(Constants.Option.POSSIBLE_BLOCKERS));
}
}
for (PlayerView player : game.getPlayers()) {
if (players.containsKey(player.getPlayerId())) {
if (!possibleAttackers.isEmpty()) {
@ -705,6 +712,13 @@ public final class GamePanel extends javax.swing.JPanel {
}
}
}
if (!possibleBlockers.isEmpty()) {
for (UUID permanentId : possibleBlockers) {
if (player.getBattlefield().containsKey(permanentId)) {
player.getBattlefield().get(permanentId).setCanBlock(true);
}
}
}
players.get(player.getPlayerId()).update(player);
if (player.getPlayerId().equals(playerId)) {
skipButtons.updateFromPlayer(player);