diff --git a/forge-game/src/main/java/forge/game/card/CardView.java b/forge-game/src/main/java/forge/game/card/CardView.java index d8b482d18421..4c162b92d9e4 100644 --- a/forge-game/src/main/java/forge/game/card/CardView.java +++ b/forge-game/src/main/java/forge/game/card/CardView.java @@ -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); } diff --git a/forge-gui-mobile/src/forge/card/CardImageRenderer.java b/forge-gui-mobile/src/forge/card/CardImageRenderer.java index f41aac42c72f..80bbcddb1162 100644 --- a/forge-gui-mobile/src/forge/card/CardImageRenderer.java +++ b/forge-gui-mobile/src/forge/card/CardImageRenderer.java @@ -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);