Update render mode selection (#13579)

* Update render mode selection

* changes render mode selection to a drop-down
* modes include MTGO, Image, Forced M15, Forced Retro
* debug card test panel updated with additional modes as well

* Update wording on tooltips and update debug panel combobox

* Update CardRenderMode to have id
This commit is contained in:
Jmlundeen 2025-05-28 08:46:27 -05:00 committed by Failure
parent d4d250f720
commit d6851aa31d
8 changed files with 218 additions and 67 deletions

View file

@ -0,0 +1,59 @@
package mage.client.util;
import java.util.ArrayList;
import java.util.List;
public enum CardRenderMode {
MTGO("MTGO", 0),
IMAGE("Image", 1),
FORCED_M15("Forced M15", 2),
FORCED_RETRO("Forced Retro", 3);
private final String text;
private final int id;
CardRenderMode(String text, int id) {
this.text = text;
this.id = id;
}
@Override
public String toString() {
return text;
}
public String getText() {
return text;
}
public int getId() {
return id;
}
public static String[] toList() {
List<String> list = new ArrayList<>();
for (CardRenderMode mode : CardRenderMode.values()) {
list.add(mode.toString());
}
return list.toArray(new String[0]);
}
public static CardRenderMode fromId(int id) {
for (CardRenderMode mode : CardRenderMode.values()) {
if (mode.getId() == id) {
return mode;
}
}
return MTGO;
}
public static CardRenderMode fromString(String text) {
for (CardRenderMode mode : CardRenderMode.values()) {
if (mode.text.equals(text)) {
return mode;
}
}
return MTGO;
}
}