Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions forge-game/src/main/java/forge/game/card/CardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ public boolean hasSecondaryState() {
return get(TrackableProperty.Secondary);
}

public boolean hasPreparedSpell() {
return hasAlternateState() && getAlternateState().getState() == CardStateName.PreparedSpell;
}

public boolean isModalCard() {
return get(TrackableProperty.Modal);
}
Expand Down
18 changes: 12 additions & 6 deletions forge-gui-mobile/src/forge/card/CardImageRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,26 @@ private static void drawTypeLine(Graphics g, CardStateView state, boolean canSho
private static final TextRenderer cardTextRenderer = new TextRenderer(true);

private static void drawTextBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean onTop, boolean useCardBGTexture, boolean noText, boolean altstate, boolean isFacedown, boolean canShow, boolean isChoiceList) {
if (card.hasSecondaryState()) {
if (card.hasSecondaryState() || card.hasPreparedSpell()) {
Color[] altcolors = FSkinColor.tintColors(Color.WHITE, fillColorBackground(g, CardDetailUtil.getBorderColors(card.getState(true), canShow) , x, y, w, h), CardRenderer.NAME_BOX_TINT);
if ((isFacedown && !altstate) || card.getZone() == ZoneType.Stack || isChoiceList || altstate) {
if ((isFacedown && !altstate) || card.getZone() == ZoneType.Stack && !card.hasPreparedSpell() || isChoiceList || altstate) {
setTextBox(g, card, state, colors, x, y, w, h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
} else {
float leftX = x, rightX = x + w / 2, width = w - (w / 2);
CardStateView rightState = state, leftState = card.getState(true);
if (card.hasPreparedSpell()) {
leftX = x + w / 2;
rightX = x;
}
//left
//float headerHeight = Math.max(MANA_SYMBOL_SIZE + 2 * HEADER_PADDING, 2 * TYPE_FONT.getCapHeight()) + 2;
float typeBoxHeight = 2 * getCapHeight(TYPE_FONT);
drawHeader(g, card, card.getState(true), altcolors, x, y, w - (w / 2), typeBoxHeight, noText, true);
drawTypeLine(g, card.getState(true), canShow, altcolors, x, y + typeBoxHeight, w - (w / 2), typeBoxHeight, noText, true, true);
drawHeader(g, card, leftState, altcolors, leftX, y, width, typeBoxHeight, noText, true);
drawTypeLine(g, leftState, canShow, altcolors, leftX, y + typeBoxHeight, width, typeBoxHeight, noText, true, true);
float mod = (typeBoxHeight + typeBoxHeight);
setTextBox(g, card, card.getState(true), altcolors, x, y + mod, w - (w / 2), h - mod, onTop, useCardBGTexture, noText, typeBoxHeight, typeBoxHeight, true, altstate, isFacedown);
setTextBox(g, card, leftState, altcolors, leftX, y + mod, width, h - mod, onTop, useCardBGTexture, noText, typeBoxHeight, typeBoxHeight, true, altstate, isFacedown);
//right
setTextBox(g, card, state, colors, x + w / 2, y, w - (w / 2), h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
setTextBox(g, card, rightState, colors, rightX, y, width, h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
}
} else {
setTextBox(g, card, state, colors, x, y, w, h, onTop, useCardBGTexture, noText, 0f, 0f, false, altstate, isFacedown);
Expand Down
Loading