forked from External/mage
Fixed some display problems with emblems and there abilities on the stack.
This commit is contained in:
parent
3b8a75588b
commit
f540e78045
4 changed files with 13 additions and 13 deletions
|
|
@ -194,11 +194,6 @@ public class MageActionCallback implements ActionCallback {
|
|||
}
|
||||
|
||||
private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {
|
||||
// skip popup for not implemented cards (they have Rarity.NA)
|
||||
if (data.card.getRarity().equals(Rarity.NA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.component != null) {
|
||||
String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true");
|
||||
if (showTooltips.equals("false")) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,9 @@ public class CardView extends SimpleCardView {
|
|||
this.name = emblem.getName();
|
||||
this.displayName = name;
|
||||
this.rules = emblem.getRules();
|
||||
this.expansionSetCode = emblem.getExpansionSetCode();
|
||||
// emblem images are always with common (black) symbol
|
||||
this.expansionSetCode = emblem.getExpansionSetCode();
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public CardView(boolean empty) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import mage.game.ExileZone;
|
|||
import mage.game.Game;
|
||||
import mage.game.GameState;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.command.CommandObject;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
|
|
@ -85,6 +84,7 @@ public class GameView implements Serializable {
|
|||
}
|
||||
for (StackObject stackObject: state.getStack()) {
|
||||
if (stackObject instanceof StackAbility) {
|
||||
// Stack Ability
|
||||
MageObject object = game.getObject(stackObject.getSourceId());
|
||||
Card card = game.getCard(stackObject.getSourceId());
|
||||
if (card != null) {
|
||||
|
|
@ -100,7 +100,7 @@ public class GameView implements Serializable {
|
|||
} else if (object != null) {
|
||||
if (object instanceof PermanentToken) {
|
||||
PermanentToken token = (PermanentToken)object;
|
||||
stack.put(stackObject.getId(), new CardView(token));
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility)stackObject, token.getName(), new CardView(token)));
|
||||
checkPaid(stackObject.getId(), (StackAbility)stackObject);
|
||||
} else if (object instanceof Emblem) {
|
||||
Card sourceCard = game.getCard(((Emblem)object).getSourceId());
|
||||
|
|
@ -110,7 +110,8 @@ public class GameView implements Serializable {
|
|||
} else {
|
||||
throw new IllegalArgumentException("Source card for emblem not found.");
|
||||
}
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility)stackObject, object.getName(), new CardView(((StackAbility)stackObject))));
|
||||
stack.put(stackObject.getId(),
|
||||
new StackAbilityView(game, (StackAbility)stackObject, object.getName(), new CardView(new EmblemView(((Emblem)object),sourceCard))));
|
||||
checkPaid(stackObject.getId(), ((StackAbility)stackObject));
|
||||
} else {
|
||||
StackAbility stackAbility = ((StackAbility)object);
|
||||
|
|
@ -118,9 +119,12 @@ public class GameView implements Serializable {
|
|||
stack.put(stackObject.getId(), new CardView(((StackAbility)stackObject)));
|
||||
checkPaid(stackObject.getId(), ((StackAbility)stackObject));
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Spell
|
||||
stack.put(stackObject.getId(), new CardView((Spell)stackObject));
|
||||
checkPaid(stackObject.getId(), (Spell)stackObject);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,12 +47,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public class Emblem implements CommandObject {
|
||||
|
||||
private String name;
|
||||
private static List emptyList = new ArrayList();
|
||||
private static ObjectColor emptyColor = new ObjectColor();
|
||||
private static ManaCosts emptyCost = new ManaCostsImpl();
|
||||
|
||||
|
||||
private String name;
|
||||
private UUID id;
|
||||
private UUID controllerId;
|
||||
private UUID sourceId;
|
||||
|
|
@ -62,7 +61,7 @@ public class Emblem implements CommandObject {
|
|||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
public Emblem(Emblem emblem) {
|
||||
public Emblem(final Emblem emblem) {
|
||||
this.id = emblem.id;
|
||||
this.controllerId = emblem.controllerId;
|
||||
this.sourceId = emblem.sourceId;
|
||||
|
|
@ -100,7 +99,7 @@ public class Emblem implements CommandObject {
|
|||
|
||||
@Override
|
||||
public String getImageName() {
|
||||
return "";
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue