mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Add Show Ability Icons Preference
(Overlay Menu on PC, Settings Page on Mobile)
This commit is contained in:
@@ -30,6 +30,7 @@ public final class CardOverlaysMenu {
|
|||||||
menu.add(getMenuItem_CardOverlay("Mana Cost", FPref.UI_OVERLAY_CARD_MANA_COST));
|
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("Power/Toughness", FPref.UI_OVERLAY_CARD_POWER));
|
||||||
menu.add(getMenuItem_CardOverlay("Card Id", FPref.UI_OVERLAY_CARD_ID));
|
menu.add(getMenuItem_CardOverlay("Card Id", FPref.UI_OVERLAY_CARD_ID));
|
||||||
|
menu.add(getMenuItem_CardOverlay("Ability Icon", FPref.UI_OVERLAY_ABILITY_ICONS));
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
int abiX = cardXOffset + (cardWidth / 2) + (cardWidth / 3);
|
int abiX = cardXOffset + (cardWidth / 2) + (cardWidth / 3);
|
||||||
int abiSpace = (cardWidth / 7);
|
int abiSpace = (cardWidth / 7);
|
||||||
int abiY = cardWidth < 200 ? cardYOffset + 25 : cardYOffset + 50;
|
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()) {
|
if (card.getCurrentState().hasFlying()) {
|
||||||
CardFaceSymbols.drawAbilitySymbol("flying", g, abiX, abiY, abiScale, abiScale);
|
CardFaceSymbols.drawAbilitySymbol("flying", g, abiX, abiY, abiScale, abiScale);
|
||||||
abiY += abiSpace;
|
abiY += abiSpace;
|
||||||
@@ -982,6 +982,10 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
|
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean showAbilityIcons() {
|
||||||
|
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_ABILITY_ICONS);
|
||||||
|
}
|
||||||
|
|
||||||
public void repaintOverlays() {
|
public void repaintOverlays() {
|
||||||
repaint();
|
repaint();
|
||||||
doLayout();
|
doLayout();
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ public class CardRenderer {
|
|||||||
float abiSpace = cw / 5.7f;
|
float abiSpace = cw / 5.7f;
|
||||||
float abiCount = 0;
|
float abiCount = 0;
|
||||||
|
|
||||||
if (onbattlefield && onTop) {
|
if (onbattlefield && onTop && showAbilityIcons(card)) {
|
||||||
if (card.isToken()){
|
if (card.isToken()){
|
||||||
CardFaceSymbols.drawSymbol("token", g, abiX, abiY, abiScale, abiScale);
|
CardFaceSymbols.drawSymbol("token", g, abiX, abiY, abiScale, abiScale);
|
||||||
abiY += abiSpace;
|
abiY += abiSpace;
|
||||||
@@ -1026,6 +1026,10 @@ public class CardRenderer {
|
|||||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
|
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) {
|
private static boolean showCardIdOverlay(CardView card) {
|
||||||
return card.getId() > 0 && isShowingOverlays(card) && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
|
return card.getId() > 0 && isShowingOverlays(card) && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_ID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,6 +331,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
|||||||
localizer.getMessage("lblShowCardIDOverlays"),
|
localizer.getMessage("lblShowCardIDOverlays"),
|
||||||
localizer.getMessage("nlShowCardIDOverlays")),
|
localizer.getMessage("nlShowCardIDOverlays")),
|
||||||
5);
|
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
|
//Vibration Options
|
||||||
lstSettings.addItem(new BooleanSetting(FPref.UI_VIBRATE_ON_LIFE_LOSS,
|
lstSettings.addItem(new BooleanSetting(FPref.UI_VIBRATE_ON_LIFE_LOSS,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
UI_OVERLAY_CARD_POWER ("true"),
|
UI_OVERLAY_CARD_POWER ("true"),
|
||||||
UI_OVERLAY_CARD_MANA_COST ("true"),
|
UI_OVERLAY_CARD_MANA_COST ("true"),
|
||||||
UI_OVERLAY_CARD_ID ("true"),
|
UI_OVERLAY_CARD_ID ("true"),
|
||||||
|
UI_OVERLAY_ABILITY_ICONS("true"),
|
||||||
UI_ENABLE_ONLINE_IMAGE_FETCHER ("false"),
|
UI_ENABLE_ONLINE_IMAGE_FETCHER ("false"),
|
||||||
UI_IMAGE_CACHE_MAXIMUM("400"),
|
UI_IMAGE_CACHE_MAXIMUM("400"),
|
||||||
UI_OVERLAY_FOIL_EFFECT ("true"),
|
UI_OVERLAY_FOIL_EFFECT ("true"),
|
||||||
|
|||||||
Reference in New Issue
Block a user