mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Make {X} appear before generic on card overlays
This commit is contained in:
@@ -149,21 +149,36 @@ public class CardFaceSymbols {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xpos = x;
|
||||||
|
final int offset = 14;
|
||||||
final int genericManaCost = manaCost.getGenericCost();
|
final int genericManaCost = manaCost.getGenericCost();
|
||||||
final boolean hasGeneric = (genericManaCost > 0) || manaCost.isPureGeneric();
|
final boolean hasGeneric = (genericManaCost > 0) || manaCost.isPureGeneric();
|
||||||
final List<ManaCostShard> shards = manaCost.getShards();
|
final List<ManaCostShard> shards = manaCost.getShards();
|
||||||
|
|
||||||
int xpos = x;
|
|
||||||
final int offset = 14;
|
|
||||||
if (hasGeneric) {
|
if (hasGeneric) {
|
||||||
|
for (final ManaCostShard s : shards) { //render X shards before generic
|
||||||
|
if (s == ManaCostShard.X) {
|
||||||
|
CardFaceSymbols.drawSymbol(s.getImageKey(), skin, g, xpos, y);
|
||||||
|
xpos += offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final String sGeneric = Integer.toString(genericManaCost);
|
final String sGeneric = Integer.toString(genericManaCost);
|
||||||
CardFaceSymbols.drawSymbol(sGeneric, skin, g, xpos, y);
|
CardFaceSymbols.drawSymbol(sGeneric, skin, g, xpos, y);
|
||||||
xpos += offset;
|
xpos += offset;
|
||||||
}
|
|
||||||
|
|
||||||
for (final ManaCostShard s : shards) {
|
for (final ManaCostShard s : shards) { //render non-X shards after generic
|
||||||
CardFaceSymbols.drawSymbol(s.getImageKey(), skin, g, xpos, y);
|
if (s != ManaCostShard.X) {
|
||||||
xpos += offset;
|
CardFaceSymbols.drawSymbol(s.getImageKey(), skin, g, xpos, y);
|
||||||
|
xpos += offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { //if no generic, just render shards in order
|
||||||
|
for (final ManaCostShard s : shards) {
|
||||||
|
CardFaceSymbols.drawSymbol(s.getImageKey(), skin, g, xpos, y);
|
||||||
|
xpos += offset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user