- Added an exception for MPS_AKH when visualizing the card border (these cards do not have an actual black border around the card frame, it seems). The way it's currently handled in Forge, there's only a 2px border added around the card, which is necessarily to properly visualize the card selection box and stuff without making it glitch out. So, this is as close to black-borderless as I think can be without introducing visual artifacts.

This commit is contained in:
Agetian
2017-04-23 09:44:24 +00:00
parent 9a5b346fd5
commit 8c82b1e439
2 changed files with 11 additions and 2 deletions

View File

@@ -1095,7 +1095,14 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
Rectangle bounds = itemInfo.getBounds();
final int itemWidth = bounds.width;
final int selBorderSize = 1;
final int borderSize = Math.round(itemWidth * CardPanel.BLACK_BORDER_SIZE);
// Unusual border exceptions
boolean noExtraBorder = false;
if (itemInfo.item instanceof IPaperCard) {
noExtraBorder = CardView.getCardForUi((IPaperCard)itemInfo.item).getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH");
}
final int borderSize = noExtraBorder? 2 : Math.round(itemWidth * CardPanel.BLACK_BORDER_SIZE);
final int cornerSize = Math.max(4, Math.round(itemWidth * CardPanel.ROUNDED_CORNER_SIZE));
if (itemInfo.selected || itemInfo == hoveredItem) {

View File

@@ -303,7 +303,9 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
@Override
public final void doLayout() {
final int borderSize = Math.round(cardWidth * CardPanel.BLACK_BORDER_SIZE);
boolean noBorder = getCard().getCurrentState().getSetCode().equalsIgnoreCase("MPS_AKH"); // Unusual border exception
final int borderSize = noBorder ? 2 : Math.round(cardWidth * CardPanel.BLACK_BORDER_SIZE);
final Point imgPos = new Point(cardXOffset + borderSize, cardYOffset + borderSize);
final Dimension imgSize = new Dimension(cardWidth - (borderSize * 2), cardHeight - (borderSize * 2));