Support selecting cards further back in stack if tapped card not selectable

This commit is contained in:
drdev
2014-05-17 21:38:41 +00:00
parent 1baf8009b0
commit 91d0c89b8a
16 changed files with 132 additions and 85 deletions

View File

@@ -173,12 +173,28 @@ public abstract class VCardDisplayArea extends VDisplayArea {
ThreadUtil.invokeInGameThread(new Runnable() { //must invoke in game thread in case a dialog needs to be shown
@Override
public void run() {
FControl.getInputProxy().selectCard(getCard(), null);
if (!selectCard()) {
//if no cards in stack can be selected, just show zoom/details for card
CardZoom.show(getCard());
}
}
});
return true;
}
public boolean selectCard() {
if (FControl.getInputProxy().selectCard(getCard(), null)) {
return true;
}
//if panel can't do anything with card selection, try selecting an attached panel
for (CardAreaPanel panel : attachedPanels) {
if (panel.selectCard()) {
return true;
}
}
return false;
}
@Override
public boolean longPress(float x, float y) {
CardZoom.show(getCard());