mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fix a regression which made it impossible to select lands under tapped lands by clicking on any of the lands in stack on mobile Forge.
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
|
|
||||||
|
import forge.GuiBase;
|
||||||
import forge.game.GameActionUtil;
|
import forge.game.GameActionUtil;
|
||||||
import forge.game.spellability.SpellAbilityView;
|
import forge.game.spellability.SpellAbilityView;
|
||||||
import forge.util.TextUtil;
|
import forge.util.TextUtil;
|
||||||
@@ -71,21 +72,40 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean onCardSelected(final Card card, final List<Card> otherCardsToSelect, final ITriggerEvent triggerEvent) {
|
protected boolean onCardSelected(final Card card, final List<Card> otherCardsToSelect, final ITriggerEvent triggerEvent) {
|
||||||
if (card.getManaAbilities().size() == 1) {
|
if (GuiBase.getInterface().isLibgdxPort()) {
|
||||||
activateManaAbility(card, card.getManaAbilities().get(0));
|
// Mobile Forge allows to tap cards underneath the current card even if the current one is tapped
|
||||||
|
if (otherCardsToSelect != null) {
|
||||||
|
for (Card c : otherCardsToSelect) {
|
||||||
|
for (SpellAbility sa : c.getManaAbilities()) {
|
||||||
|
if (sa.canPlay()) {
|
||||||
|
delaySelectCards.add(c);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!card.getManaAbilities().isEmpty() && activateManaAbility(card)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return activateDelayedCard();
|
||||||
} else {
|
} else {
|
||||||
SpellAbilityView spellAbilityView;
|
// Desktop Forge floating menu functionality
|
||||||
HashMap<SpellAbilityView, SpellAbility> spellAbilityViewMap = new HashMap<>();
|
if (card.getManaAbilities().size() == 1) {
|
||||||
for (SpellAbility sa : card.getManaAbilities()) {
|
activateManaAbility(card, card.getManaAbilities().get(0));
|
||||||
spellAbilityViewMap.put(sa.getView(), sa);
|
} else {
|
||||||
}
|
SpellAbilityView spellAbilityView;
|
||||||
List<SpellAbilityView> choices = new ArrayList<>(spellAbilityViewMap.keySet());
|
HashMap<SpellAbilityView, SpellAbility> spellAbilityViewMap = new HashMap<>();
|
||||||
spellAbilityView = getController().getGui().getAbilityToPlay(card.getView(), choices, triggerEvent);
|
for (SpellAbility sa : card.getManaAbilities()) {
|
||||||
if (spellAbilityView != null) {
|
spellAbilityViewMap.put(sa.getView(), sa);
|
||||||
activateManaAbility(card, spellAbilityViewMap.get(spellAbilityView));
|
}
|
||||||
|
List<SpellAbilityView> choices = new ArrayList<>(spellAbilityViewMap.keySet());
|
||||||
|
spellAbilityView = getController().getGui().getAbilityToPlay(card.getView(), choices, triggerEvent);
|
||||||
|
if (spellAbilityView != null) {
|
||||||
|
activateManaAbility(card, spellAbilityViewMap.get(spellAbilityView));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user