mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
fixed multicolored split cards rendering
This commit is contained in:
parent
783ddb5bdc
commit
db7eb398cc
1 changed files with 2 additions and 20 deletions
|
@ -49,8 +49,8 @@ public class ModernSplitCardRenderer extends ModernCardRenderer {
|
|||
rightHalf.manaCostString = ManaSymbols.getClearManaCost(cardView.getRightSplitCostsStr());
|
||||
leftHalf.manaCostString = ManaSymbols.getClearManaCost(cardView.getLeftSplitCostsStr());
|
||||
|
||||
rightHalf.color = getColorFromManaCostHack(cardView.getRightSplitCostsStr());
|
||||
leftHalf.color = getColorFromManaCostHack(cardView.getLeftSplitCostsStr());
|
||||
rightHalf.color = new ObjectColor(cardView.getRightSplitCostsStr());
|
||||
leftHalf.color = new ObjectColor(cardView.getLeftSplitCostsStr());
|
||||
|
||||
parseRules(view.getRightSplitRules(), rightHalf.keywords, rightHalf.rules);
|
||||
parseRules(view.getLeftSplitRules(), leftHalf.keywords, leftHalf.rules);
|
||||
|
@ -123,24 +123,6 @@ public class ModernSplitCardRenderer extends ModernCardRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
// Ugly hack used here because the card database doesn't actually store color
|
||||
// for each half of split cards separately.
|
||||
private ObjectColor getColorFromManaCostHack(String costs) {
|
||||
ObjectColor c = new ObjectColor();
|
||||
if (costs.contains("W")) {
|
||||
c.setWhite(true);
|
||||
} else if (costs.contains("U")) {
|
||||
c.setBlue(true);
|
||||
} else if (costs.contains("B")) {
|
||||
c.setBlack(true);
|
||||
} else if (costs.contains("R")) {
|
||||
c.setRed(true);
|
||||
} else if (costs.contains("G")) {
|
||||
c.setGreen(true);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(Graphics2D g) {
|
||||
if (cardView.isFaceDown()) {
|
||||
|
|
Loading…
Reference in a new issue