* Allow to addd hint texts to stack abilities. Swicthed to html text format for text box of stack abilites.

This commit is contained in:
LevelX2 2020-07-02 00:53:46 +02:00
parent f409f56c05
commit 84370ee5ab
11 changed files with 64 additions and 46 deletions

View file

@ -18,6 +18,7 @@ public abstract class MageBufferedImageOp implements BufferedImageOp {
/**
* Creates compatible image for @param src image.
*/
@Override
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dest) {
if (dest == null) {
dest = src.getColorModel();
@ -25,14 +26,17 @@ public abstract class MageBufferedImageOp implements BufferedImageOp {
return new BufferedImage(dest, dest.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dest.isAlphaPremultiplied(), null);
}
@Override
public RenderingHints getRenderingHints() {
return null;
}
@Override
public Rectangle2D getBounds2D(BufferedImage src) {
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
}
@Override
public Point2D getPoint2D(Point2D srcPt, Point2D destPt) {
if (destPt == null) {
destPt = new Point2D.Double();

View file

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.EnumSet;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.util.SubTypeList;
@ -28,7 +27,7 @@ public class AbilityView extends CardView {
this.power = "";
this.toughness = "";
this.loyalty = "";
this.cardTypes = new ArrayList<CardType>();
this.cardTypes = new ArrayList<>();
this.subTypes = new SubTypeList();
this.superTypes = EnumSet.noneOf(SuperType.class);
this.color = new ObjectColor();

View file

@ -55,7 +55,7 @@ public class GameView implements Serializable {
private final PhaseStep step;
private final UUID activePlayerId;
private String activePlayerName = "";
private String priorityPlayerName;
private final String priorityPlayerName;
private final int turn;
private boolean special = false;
private final boolean isPlayer; // false = watching user
@ -138,7 +138,7 @@ public class GameView implements Serializable {
// can happen if a player times out while ability is on the stack
LOGGER.debug("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule());
}
} else {
} else if (stackObject != null) {
LOGGER.fatal("Unknown type of StackObject: " + stackObject.getName() + ' ' + stackObject.toString() + ' ' + stackObject.getClass().toString());
}
//stackOrder.add(stackObject.getId());

View file

@ -17,6 +17,8 @@ import mage.util.GameLog;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.hint.Hint;
import mage.abilities.hint.HintUtils;
/**
* @author BetaSteward_at_googlemail.com
@ -115,6 +117,18 @@ public class StackAbilityView extends CardView {
this.rules.add("<span color='green'><i>Chosen mode: " + mode.getEffects().getText(mode) + "</i></span>");
}
}
if (HintUtils.ABILITY_HINTS_ENABLE) {
List<String> abilityHints = new ArrayList<>();
for (Hint hint : ability.getHints()) {
abilityHints.add(hint.getText(game, ability));
}
// total hints
if (!abilityHints.isEmpty()) {
rules.add(HintUtils.HINT_START_MARK);
HintUtils.appendHints(rules, abilityHints);
}
}
}
public CardView getSourceCard() {