[Mobile] Add AI Status to Deck ListView

This commit is contained in:
Anthony Calosa
2022-01-31 20:34:25 +08:00
parent c6b4a2b27f
commit 03b338f4f0

View File

@@ -2,6 +2,7 @@ package forge.itemmanager;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Align;
import forge.Forge; import forge.Forge;
@@ -133,6 +134,10 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
x += IMAGE_SIZE + FList.PADDING; x += IMAGE_SIZE + FList.PADDING;
ColorSet deckColor = deck.getColor(); ColorSet deckColor = deck.getColor();
float availableNameWidth = w - CardFaceSymbols.getWidth(deckColor, IMAGE_SIZE) - IMAGE_SIZE - 2 * FList.PADDING; float availableNameWidth = w - CardFaceSymbols.getWidth(deckColor, IMAGE_SIZE) - IMAGE_SIZE - 2 * FList.PADDING;
if (deck.getAI()) {
g.drawOutlinedText("AI", font, Color.GREEN, Color.BLACK, x, y, w, IMAGE_SIZE, true, Align.left, true, false);
x += IMAGE_SIZE + FList.PADDING;
}
String name = deck.getName(); String name = deck.getName();
if (!deck.getPath().isEmpty()) { //render path after name if needed if (!deck.getPath().isEmpty()) { //render path after name if needed
name += " (" + deck.getPath().substring(1) + ")"; name += " (" + deck.getPath().substring(1) + ")";