Merge pull request #6545 from kevlahnota/master2

fix room choicelist render
This commit is contained in:
kevlahnota
2024-11-08 10:39:23 +08:00
committed by GitHub
4 changed files with 13 additions and 6 deletions

View File

@@ -169,6 +169,10 @@ public class CardView extends GameEntityView {
return get(TrackableProperty.Modal); return get(TrackableProperty.Modal);
} }
public boolean isRoom() {
return get(TrackableProperty.Room);
}
/* /*
public boolean isTransformed() { public boolean isTransformed() {
return getCurrentState().getState() == CardStateName.Transformed; return getCurrentState().getState() == CardStateName.Transformed;
@@ -977,6 +981,7 @@ public class CardView extends GameEntityView {
set(TrackableProperty.Adventure, c.isAdventureCard()); set(TrackableProperty.Adventure, c.isAdventureCard());
set(TrackableProperty.DoubleFaced, c.isDoubleFaced()); set(TrackableProperty.DoubleFaced, c.isDoubleFaced());
set(TrackableProperty.Modal, c.isModal()); set(TrackableProperty.Modal, c.isModal());
set(TrackableProperty.Room, c.isRoom());
//backside //backside
if (c.getAlternateState() != null) if (c.getAlternateState() != null)

View File

@@ -109,6 +109,7 @@ public enum TrackableProperty {
AlternateState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze), AlternateState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze),
LeftSplitState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze), LeftSplitState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze),
RightSplitState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze), RightSplitState(TrackableTypes.CardStateViewType, FreezeMode.IgnoresFreeze),
Room(TrackableTypes.BooleanType, FreezeMode.IgnoresFreeze),
HiddenId(TrackableTypes.IntegerType), HiddenId(TrackableTypes.IntegerType),
ExertedThisTurn(TrackableTypes.BooleanType), ExertedThisTurn(TrackableTypes.BooleanType),

View File

@@ -869,10 +869,7 @@ public class CardRenderer {
float manaSymbolSize = w / 4.5f; float manaSymbolSize = w / 4.5f;
if (card.isSplitCard() && card.hasAlternateState() && !card.isFaceDown() && card.getZone() != ZoneType.Stack && card.getZone() != ZoneType.Battlefield) { if (card.isSplitCard() && card.hasAlternateState() && !card.isFaceDown() && card.getZone() != ZoneType.Stack && card.getZone() != ZoneType.Battlefield) {
if (isChoiceList) { if (isChoiceList) {
if (card.getRightSplitState().getName().equals(details.getName())) drawManaCost(g, details.getManaCost(), x - padding, y, w + 2 * padding, h, manaSymbolSize);
drawManaCost(g, card.getRightSplitState().getManaCost(), x - padding, y, w + 2 * padding, h, manaSymbolSize);
else
drawManaCost(g, card.getLeftSplitState().getManaCost(), x - padding, y, w + 2 * padding, h, manaSymbolSize);
} else { } else {
ManaCost leftManaCost = card.getLeftSplitState().getManaCost(); ManaCost leftManaCost = card.getLeftSplitState().getManaCost();
ManaCost rightManaCost = card.getRightSplitState().getManaCost(); ManaCost rightManaCost = card.getRightSplitState().getManaCost();

View File

@@ -447,8 +447,12 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
//special case if aftermath cards can be cast from graveyard like yawgmoths will, you will have choices //special case if aftermath cards can be cast from graveyard like yawgmoths will, you will have choices
if (cardView.getAlternateState().getOracleText().contains("Aftermath")) if (cardView.getAlternateState().getOracleText().contains("Aftermath"))
showAlt = cardView.getAlternateState().getOracleText().contains(value); showAlt = cardView.getAlternateState().getOracleText().contains(value);
else else {
showAlt = value.equals(cardView.getAlternateState().getAbilityText()); if (cardView.isRoom()) // special case for room cards
showAlt = cardView.getAlternateState().getName().equalsIgnoreCase(value);
else
showAlt = value.equals(cardView.getAlternateState().getAbilityText());
}
} }
} }
return showAlt; return showAlt;