Merge branch 'unstable-basic-lands' into 'master'

- Render Unstable basic lands borderless.

See merge request core-developers/forge!160
This commit is contained in:
Michael Kamensky
2018-01-30 16:22:08 +00:00
2 changed files with 12 additions and 3 deletions

View File

@@ -1103,9 +1103,14 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
final int selBorderSize = 1;
// Determine whether to render border from properties
boolean noBorder = !isPreferenceEnabled(ForgePreferences.FPref.UI_RENDER_BLACK_BORDERS) ||
(itemInfo.item instanceof IPaperCard && CardView.getCardForUi((IPaperCard)itemInfo.item).
getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH"));
boolean noBorder = !isPreferenceEnabled(ForgePreferences.FPref.UI_RENDER_BLACK_BORDERS);
if (itemInfo.item instanceof IPaperCard) {
CardView cv = CardView.getCardForUi((IPaperCard) itemInfo.item);
// Amonkhet Invocations
noBorder |= cv.getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH");
// Unstable basic lands
noBorder |= cv.getCurrentState().isBasicLand() && cv.getCurrentState().getSetCode().equalsIgnoreCase("UST");
}
final int borderSize = noBorder? 0 : Math.round(itemWidth * CardPanel.BLACK_BORDER_SIZE);
final int cornerSize = Math.max(4, Math.round(itemWidth * CardPanel.ROUNDED_CORNER_SIZE));

View File

@@ -364,7 +364,11 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
boolean noBorderPref = !isPreferenceEnabled(FPref.UI_RENDER_BLACK_BORDERS);
// Borderless cards should be accounted for here
// Amonkhet Invocations
boolean noBorderOnCard = getCard().getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH");
// Unstable basic lands
noBorderOnCard |= getCard().getCurrentState().isBasicLand() && getCard().getCurrentState().getSetCode().equalsIgnoreCase("UST");
boolean cardImgHasAlpha = imagePanel != null && imagePanel.getSrcImage() != null && imagePanel.getSrcImage().getColorModel().hasAlpha();
if (!noBorderPref && !(noBorderOnCard && cardImgHasAlpha)) {