mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* UI: added cancel button for all target definition abilities;
This commit is contained in:
parent
904660e624
commit
dab481ee17
3 changed files with 24 additions and 8 deletions
|
|
@ -325,11 +325,16 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
if (!getTargets().isEmpty()) {
|
||||
Outcome outcome = getEffects().isEmpty() ? Outcome.Detriment : getEffects().get(0).getOutcome();
|
||||
if (getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game) == false) {
|
||||
if ((variableManaCost != null || announceString != null)) {
|
||||
// can be cancel by user
|
||||
if (getTargets().chooseTargets(outcome, this.controllerId, this, noMana, game, true) == false) {
|
||||
/*
|
||||
if ((variableManaCost != null) || (announceString != null && !announceString.isEmpty())) {
|
||||
// ?debug message?
|
||||
game.informPlayer(controller, (sourceObject != null ? sourceObject.getIdName() : "") + ": no valid targets");
|
||||
}
|
||||
return false; // when activation of ability is canceled during target selection
|
||||
*/
|
||||
// when activation of ability is canceled during target selection
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} // end modes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue