mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Fixed "OK" button not receiving focus during the declare attackers step.
This commit is contained in:
@@ -17,22 +17,13 @@
|
||||
*/
|
||||
package forge.match.input;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import forge.events.UiEventAttackerDeclared;
|
||||
import forge.game.GameEntity;
|
||||
import forge.game.GameEntityView;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.*;
|
||||
import forge.game.card.CardPredicates.Presets;
|
||||
import forge.game.card.CardView;
|
||||
import forge.game.combat.AttackingBand;
|
||||
import forge.game.combat.Combat;
|
||||
import forge.game.combat.CombatUtil;
|
||||
@@ -40,8 +31,12 @@ import forge.game.player.Player;
|
||||
import forge.game.player.PlayerView;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.player.PlayerControllerHuman;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.ITriggerEvent;
|
||||
import forge.util.collect.FCollectionView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -95,12 +90,6 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final boolean allowAwaitNextInput() {
|
||||
//wait for opponent to declare blockers if any attackers
|
||||
return !combat.getAttackers().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void onOk() {
|
||||
// Propaganda costs could have been paid here.
|
||||
@@ -114,7 +103,7 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
//either alpha strike or undeclare all attackers based on whether any attackers have been declared
|
||||
if (canCallBackAttackers()) {
|
||||
//undeclare all attackers
|
||||
List<Card> attackers = new ArrayList<Card>(combat.getAttackers()); //must copy list since it will be modified
|
||||
List<Card> attackers = new ArrayList<>(combat.getAttackers()); //must copy list since it will be modified
|
||||
for (Card c : attackers) {
|
||||
undeclareAttacker(c);
|
||||
}
|
||||
@@ -281,7 +270,7 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
return true;
|
||||
}
|
||||
|
||||
private final void setCurrentDefender(final GameEntity def) {
|
||||
private void setCurrentDefender(final GameEntity def) {
|
||||
currentDefender = def;
|
||||
for (final GameEntity ge : defenders) {
|
||||
if (ge instanceof Card) {
|
||||
@@ -295,7 +284,7 @@ public class InputAttack extends InputSyncronizedBase {
|
||||
updateMessage();
|
||||
}
|
||||
|
||||
private final void activateBand(final AttackingBand band) {
|
||||
private void activateBand(final AttackingBand band) {
|
||||
if (activeBand != null) {
|
||||
for (final Card card : activeBand.getAttackers()) {
|
||||
getController().getGui().setUsedToPay(CardView.get(card), false);
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
*/
|
||||
package forge.match.input;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.events.UiEventBlockerAssigned;
|
||||
import forge.game.card.Card;
|
||||
@@ -34,6 +32,8 @@ import forge.player.PlayerControllerHuman;
|
||||
import forge.util.ITriggerEvent;
|
||||
import forge.util.ThreadUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Input_Block class.
|
||||
@@ -116,8 +116,7 @@ public class InputBlock extends InputSyncronizedBase {
|
||||
boolean isCorrectAction = false;
|
||||
if (triggerEvent != null && triggerEvent.getButton() == 3 && card.getController() == defender) {
|
||||
combat.removeFromCombat(card);
|
||||
card.getGame().fireEvent(new UiEventBlockerAssigned(
|
||||
CardView.get(card), (CardView) null));
|
||||
card.getGame().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
||||
isCorrectAction = true;
|
||||
}
|
||||
else {
|
||||
@@ -132,8 +131,7 @@ public class InputBlock extends InputSyncronizedBase {
|
||||
if (combat.isBlocking(card, currentAttacker)) {
|
||||
//if creature already blocking current attacker, remove blocker from combat
|
||||
combat.removeBlockAssignment(currentAttacker, card);
|
||||
card.getGame().fireEvent(new UiEventBlockerAssigned(
|
||||
CardView.get(card), (CardView) null));
|
||||
card.getGame().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
||||
isCorrectAction = true;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user