(Graphics g, IPaperCard pc, float x, float y, float w, float h, CardStackPosition pos)
| 616 | } |
| 617 | |
| 618 | public static void drawCard(Graphics g, IPaperCard pc, float x, float y, float w, float h, CardStackPosition pos) { |
| 619 | Texture image = new RendererCachedCardImage(pc, false).getImage(); |
| 620 | final CardView card = CardView.getCardForUi(pc); |
| 621 | float radius = (h - w) / 8; |
| 622 | float croppedArea = isModernFrame(pc) ? CROP_MULTIPLIER : 0.97f; |
| 623 | float minusxy = isModernFrame(pc) ? 0.0f : 0.13f * radius; |
| 624 | if (pc.getEdition().equals("LEA") || pc.getEdition().equals("LEB")) { |
| 625 | croppedArea = 0.975f; |
| 626 | minusxy = 0.135f * radius; |
| 627 | } |
| 628 | if (pc.isFoil()) { //draw foil effect if needed |
| 629 | if (card.getCurrentState().getFoilIndex() == 0) { //if foil finish not yet established, assign a random one |
| 630 | card.getCurrentState().setFoilIndexOverride(-1); |
| 631 | } |
| 632 | } |
| 633 | if (image != null) { |
| 634 | if (image == ImageCache.getInstance().getDefaultImage() || Forge.enableUIMask.equals("Art")) { |
| 635 | CardImageRenderer.drawCardImage(g, CardView.getCardForUi(pc), false, x, y, w, h, pos, true, true); |
| 636 | } else { |
| 637 | if (Forge.enableUIMask.equals("Full")) { |
| 638 | if (ImageCache.getInstance().isFullBorder(image)) |
| 639 | g.drawCardRoundRect(image, null, x, y, w, h, false, false, CardRendererUtils.drawFoil(card)); |
| 640 | else { |
| 641 | //tint the border |
| 642 | g.drawImage(ImageCache.getInstance().getBorderImage(image.toString()), ImageCache.getInstance().borderColor(image), x, y, w, h); |
| 643 | g.drawImage(ImageCache.getInstance().croppedBorderImage(image), x + radius / 2.4f - minusxy, y + radius / 2 - minusxy, w * croppedArea, h * croppedArea); |
| 644 | if (CardRendererUtils.drawFoil(card)) |
| 645 | g.drawFoil(x, y, w, h, radius); |
| 646 | } |
| 647 | } else if (Forge.enableUIMask.equals("Crop")) { |
| 648 | g.drawImage(ImageCache.getInstance().croppedBorderImage(image), x, y, w, h, CardRendererUtils.drawFoil(card)); |
| 649 | } else |
| 650 | g.drawImage(image, x, y, w, h, CardRendererUtils.drawFoil(card)); |
| 651 | } |
| 652 | } else { |
| 653 | //if card has invalid or no texture due to sudden changes in ImageCache, draw CardImageRenderer instead and wait for it to refresh automatically |
| 654 | CardImageRenderer.drawCardImage(g, card, false, x, y, w, h, pos, true, true); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | public static void drawCard(Graphics g, CardView card, float x, float y, float w, float h, CardStackPosition pos, boolean rotate) { |
| 659 | drawCard(g, card, x, y, w, h, pos, rotate, false, false, false); |
no test coverage detected