Add Show Ability Icons Preference

(Overlay Menu on PC, Settings Page on Mobile)
This commit is contained in:
Anthony Calosa
2019-09-25 14:49:41 +08:00
parent c24f4b59ec
commit b6ed045c21
5 changed files with 16 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ public final class CardOverlaysMenu {
menu.add(getMenuItem_CardOverlay("Mana Cost", FPref.UI_OVERLAY_CARD_MANA_COST));
menu.add(getMenuItem_CardOverlay("Power/Toughness", FPref.UI_OVERLAY_CARD_POWER));
menu.add(getMenuItem_CardOverlay("Card Id", FPref.UI_OVERLAY_CARD_ID));
menu.add(getMenuItem_CardOverlay("Ability Icon", FPref.UI_OVERLAY_ABILITY_ICONS));
return menu;
}

View File

@@ -511,7 +511,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
int abiX = cardXOffset + (cardWidth / 2) + (cardWidth / 3);
int abiSpace = (cardWidth / 7);
int abiY = cardWidth < 200 ? cardYOffset + 25 : cardYOffset + 50;
if (ZoneType.Battlefield.equals(card.getZone())){
if (ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons()){
if (card.getCurrentState().hasFlying()) {
CardFaceSymbols.drawAbilitySymbol("flying", g, abiX, abiY, abiScale, abiScale);
abiY += abiSpace;
@@ -982,6 +982,10 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
}
private boolean showAbilityIcons() {
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_ABILITY_ICONS);
}
public void repaintOverlays() {
repaint();
doLayout();

View File

@@ -551,7 +551,7 @@ public class CardRenderer {
float abiSpace = cw / 5.7f;
float abiCount = 0;
if (onbattlefield && onTop) {
if (onbattlefield && onTop && showAbilityIcons(card)) {
if (card.isToken()){
CardFaceSymbols.drawSymbol("token", g, abiX, abiY, abiScale, abiScale);
abiY += abiSpace;
@@ -1026,6 +1026,10 @@ public class CardRenderer {
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
}
private static boolean showAbilityIcons(CardView card) {
return isShowingOverlays(card) && isPreferenceEnabled(FPref.UI_OVERLAY_ABILITY_ICONS);
}
private static boolean showCardIdOverlay(CardView card) {
return card.getId() > 0 && isShowingOverlays(card) && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
}

View File

@@ -331,6 +331,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
localizer.getMessage("lblShowCardIDOverlays"),
localizer.getMessage("nlShowCardIDOverlays")),
5);
lstSettings.addItem(new BooleanSetting(FPref.UI_OVERLAY_ABILITY_ICONS,
"Show Ability Icons",
"Show ability icons for cards, otherwise they're hidden."),
5);
//Vibration Options
lstSettings.addItem(new BooleanSetting(FPref.UI_VIBRATE_ON_LIFE_LOSS,

View File

@@ -78,6 +78,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_OVERLAY_CARD_POWER ("true"),
UI_OVERLAY_CARD_MANA_COST ("true"),
UI_OVERLAY_CARD_ID ("true"),
UI_OVERLAY_ABILITY_ICONS("true"),
UI_ENABLE_ONLINE_IMAGE_FETCHER ("false"),
UI_IMAGE_CACHE_MAXIMUM("400"),
UI_OVERLAY_FOIL_EFFECT ("true"),