mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Support double-click and Shift+left click to tap all lands in the same stack
This commit is contained in:
@@ -177,15 +177,15 @@ public class CardDetailPanel extends SkinnedPanel {
|
||||
setInfoLabel.setOpaque(false);
|
||||
setInfoLabel.setBorder(null);
|
||||
cdArea.setText("");
|
||||
if (card == null) {
|
||||
|
||||
final CardStateView state = card.getState(isInAltState);
|
||||
if (card == null || state == null) {
|
||||
updateBorder(null, false);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean canShow = MatchUtil.canCardBeShown(card);
|
||||
|
||||
final CardStateView state = card.getState(isInAltState);
|
||||
|
||||
if (state.getManaCost().isNoCost() || !canShow) {
|
||||
nameCostLabel.setText(CardDetailUtil.formatCardName(card, canShow, isInAltState));
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
if (selectOtherCardsInStack) {
|
||||
if (stack != null) {
|
||||
for (CardPanel p : stack) {
|
||||
if (p != panel && p.getCard() != null) {
|
||||
if (p != panel && p.getCard() != null && p.getStack() == stack) {
|
||||
if (otherCardViewsToSelect == null) {
|
||||
otherCardViewsToSelect = new ArrayList<CardView>();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package forge.match.input;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import forge.game.Game;
|
||||
@@ -131,7 +132,34 @@ public class InputPassPriority extends InputSyncronizedBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
return selectAbility(player.getController().getAbilityToPlay(abilities, triggerEvent));
|
||||
final SpellAbility ability = player.getController().getAbilityToPlay(abilities, triggerEvent);
|
||||
if (selectAbility(ability)) {
|
||||
if (otherCardsToSelect != null && ability.isManaAbility()) {
|
||||
//if mana ability activated, activate same ability on other cards to select if possible
|
||||
String abStr = ability.toUnsuppressedString();
|
||||
final List<SpellAbility> otherAbilitiesToPlay = new ArrayList<SpellAbility>();
|
||||
for (Card c : otherCardsToSelect) {
|
||||
for (SpellAbility ab : c.getAllPossibleAbilities(player, true)) {
|
||||
if (ab.toUnsuppressedString().equals(abStr)) {
|
||||
otherAbilitiesToPlay.add(ab);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (otherAbilitiesToPlay.size() > 0) {
|
||||
ThreadUtil.invokeInGameThread(new Runnable() { //must execute other abilities on game thread
|
||||
@Override
|
||||
public void run() {
|
||||
for (SpellAbility ab : otherAbilitiesToPlay) {
|
||||
player.getController().playChosenSpellAbility(ab);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user