* GUI: fixed that abilities and triggers on the stack were not highlighted as valid target;

This commit is contained in:
Oleg Agafonov 2020-12-24 21:43:17 +04:00
parent 6f34d514f9
commit b8b2dd2c9b
3 changed files with 12 additions and 0 deletions

View file

@ -168,8 +168,13 @@
}
}
if (card instanceof StackAbilityView) {
// replace ability by original card
CardView tmp = ((StackAbilityView) card).getSourceCard();
tmp.overrideRules(card.getRules());
tmp.setChoosable(card.isChoosable());
tmp.setPlayable(card.isPlayable());
tmp.setPlayableAmount(card.getPlayableAmount());
tmp.setSelected(card.isSelected());
tmp.setIsAbility(true);
tmp.overrideTargets(card.getTargets());
tmp.overrideId(card.getId());

View file

@ -112,8 +112,13 @@ public class StackDialog extends IDialogPanel {
for (CardView card : cards.values()) {
if (card instanceof StackAbilityView) {
// replace ability by original card
CardView tmp = ((StackAbilityView) card).getSourceCard();
tmp.overrideRules(card.getRules());
tmp.setChoosable(card.isChoosable());
tmp.setPlayable(card.isPlayable());
tmp.setPlayableAmount(card.getPlayableAmount());
tmp.setSelected(card.isSelected());
tmp.setIsAbility(true);
tmp.overrideTargets(card.getTargets());
tmp.overrideId(card.getId());

View file

@ -27,6 +27,8 @@ public class StackAbilityView extends CardView {
private static final long serialVersionUID = 1L;
// in GUI: that's view will be replaced by sourceCard, so don't forget to sync settings like
// selectable, chooseable, etc. Search by getSourceCard
private final CardView sourceCard;
public StackAbilityView(Game game, StackAbility ability, String sourceName, CardView sourceCard) {