mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
display locked room, fix nonrotated card panels
This commit is contained in:
@@ -48,6 +48,7 @@ import javax.swing.SwingUtilities;
|
|||||||
import forge.CachedCardImage;
|
import forge.CachedCardImage;
|
||||||
import forge.StaticData;
|
import forge.StaticData;
|
||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
|
import forge.card.CardStateName;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.card.CardView;
|
import forge.game.card.CardView;
|
||||||
@@ -62,9 +63,11 @@ import forge.item.PaperCard;
|
|||||||
import forge.localinstance.properties.ForgeConstants;
|
import forge.localinstance.properties.ForgeConstants;
|
||||||
import forge.localinstance.properties.ForgeConstants.CounterDisplayType;
|
import forge.localinstance.properties.ForgeConstants.CounterDisplayType;
|
||||||
import forge.localinstance.properties.ForgePreferences.FPref;
|
import forge.localinstance.properties.ForgePreferences.FPref;
|
||||||
|
import forge.localinstance.skin.FSkinProp;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.screens.match.CMatchUI;
|
import forge.screens.match.CMatchUI;
|
||||||
import forge.toolbox.CardFaceSymbols;
|
import forge.toolbox.CardFaceSymbols;
|
||||||
|
import forge.toolbox.FSkin;
|
||||||
import forge.toolbox.FSkin.SkinnedPanel;
|
import forge.toolbox.FSkin.SkinnedPanel;
|
||||||
import forge.toolbox.IDisposable;
|
import forge.toolbox.IDisposable;
|
||||||
import forge.util.CardTranslation;
|
import forge.util.CardTranslation;
|
||||||
@@ -365,6 +368,17 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
final boolean canShow = matchUI.mayView(card);
|
final boolean canShow = matchUI.mayView(card);
|
||||||
|
if (canShow && ZoneType.Battlefield.equals(card.getZone())) {
|
||||||
|
CardStateView cardStateView = card.getCurrentState();
|
||||||
|
if (card.isSplitCard() && card.hasAlternateState() && !card.isFaceDown() && !CardStateName.Original.equals(cardStateView.getState())) {
|
||||||
|
if (CardStateName.RightSplit.equals(cardStateView.getState())) {
|
||||||
|
FSkin.drawImage(g, FSkin.getIcon(FSkinProp.ICO_RIGHTLOCK), cardXOffset, cardYOffset, cardWidth, cardHeight);
|
||||||
|
} else if (CardStateName.LeftSplit.equals(cardStateView.getState())) {
|
||||||
|
FSkin.drawImage(g, FSkin.getIcon(FSkinProp.ICO_LEFTLOCK), cardXOffset, cardYOffset, cardWidth, cardHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
displayIconOverlay(g, canShow);
|
displayIconOverlay(g, canShow);
|
||||||
if (canShow) {
|
if (canShow) {
|
||||||
drawFoilEffect(g, card, cardXOffset, cardYOffset,
|
drawFoilEffect(g, card, cardXOffset, cardYOffset,
|
||||||
|
|||||||
@@ -220,6 +220,8 @@ public enum FSkinImage implements FSkinImageInterface {
|
|||||||
UNKNOWN (FSkinProp.ICO_UNKNOWN),
|
UNKNOWN (FSkinProp.ICO_UNKNOWN),
|
||||||
LOGO (FSkinProp.ICO_LOGO),
|
LOGO (FSkinProp.ICO_LOGO),
|
||||||
CARDART (FSkinProp.ICO_CARDART),
|
CARDART (FSkinProp.ICO_CARDART),
|
||||||
|
LEFTLOCK (FSkinProp.ICO_LEFTLOCK),
|
||||||
|
RIGHTLOCK (FSkinProp.ICO_RIGHTLOCK),
|
||||||
|
|
||||||
FLIPCARD (FSkinProp.ICO_FLIPCARD),
|
FLIPCARD (FSkinProp.ICO_FLIPCARD),
|
||||||
HDFLIPCARD (FSkinProp.ICO_HDFLIPCARD),
|
HDFLIPCARD (FSkinProp.ICO_HDFLIPCARD),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import forge.assets.FRotatedImage;
|
|||||||
import forge.assets.FSkin;
|
import forge.assets.FSkin;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinFont;
|
import forge.assets.FSkinFont;
|
||||||
|
import forge.assets.FSkinImage;
|
||||||
import forge.assets.FSkinImageInterface;
|
import forge.assets.FSkinImageInterface;
|
||||||
import forge.assets.FTextureRegionImage;
|
import forge.assets.FTextureRegionImage;
|
||||||
import forge.assets.ImageCache;
|
import forge.assets.ImageCache;
|
||||||
@@ -62,6 +63,7 @@ import forge.toolbox.FList;
|
|||||||
import static forge.assets.FSkin.getDefaultSkinFile;
|
import static forge.assets.FSkin.getDefaultSkinFile;
|
||||||
|
|
||||||
public class CardRenderer {
|
public class CardRenderer {
|
||||||
|
static boolean drawSpiral = false;
|
||||||
public enum CardStackPosition {
|
public enum CardStackPosition {
|
||||||
Top,
|
Top,
|
||||||
BehindHorz,
|
BehindHorz,
|
||||||
@@ -742,6 +744,16 @@ public class CardRenderer {
|
|||||||
return;
|
return;
|
||||||
} //remaining rendering not needed if card is behind another card in a vertical stack
|
} //remaining rendering not needed if card is behind another card in a vertical stack
|
||||||
boolean onTop = (pos == CardStackPosition.Top);
|
boolean onTop = (pos == CardStackPosition.Top);
|
||||||
|
if (canShow && ZoneType.Battlefield.equals(card.getZone())) {
|
||||||
|
//locked room
|
||||||
|
if (card.isSplitCard() && card.hasAlternateState() && !card.isFaceDown() && !CardStateName.Original.equals(details.getState())) {
|
||||||
|
if (CardStateName.RightSplit.equals(details.getState())) {
|
||||||
|
g.drawImage(FSkinImage.RIGHTLOCK, cx, cy, cw, ch);
|
||||||
|
} else if (CardStateName.LeftSplit.equals(details.getState())) {
|
||||||
|
g.drawImage(FSkinImage.LEFTLOCK, cx, cy, cw, ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (canShow && showCardIdOverlay(card)) {
|
if (canShow && showCardIdOverlay(card)) {
|
||||||
FSkinFont idFont = FSkinFont.forHeight(h * 0.11f);
|
FSkinFont idFont = FSkinFont.forHeight(h * 0.11f);
|
||||||
@@ -818,7 +830,9 @@ public class CardRenderer {
|
|||||||
if (unselectable) {
|
if (unselectable) {
|
||||||
g.setAlphaComposite(0.6f);
|
g.setAlphaComposite(0.6f);
|
||||||
}
|
}
|
||||||
|
boolean drawIcons = false;
|
||||||
if (ZoneType.Battlefield.equals(card.getZone()) && onTop) {
|
if (ZoneType.Battlefield.equals(card.getZone()) && onTop) {
|
||||||
|
drawIcons = true;
|
||||||
drawAbilityIcons(g, card, cx, cy, cw, ch, cx + ((cw * 2) / 2.3f), cy, cw / 5.5f, cw / 5.7f, showAbilityIcons(card));
|
drawAbilityIcons(g, card, cx, cy, cw, ch, cx + ((cw * 2) / 2.3f), cy, cw / 5.5f, cw / 5.7f, showAbilityIcons(card));
|
||||||
} else if (canShow && !ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons(card)) {
|
} else if (canShow && !ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons(card)) {
|
||||||
//draw indicator for flash or can be cast at instant speed, enabled if show ability icons is enabled
|
//draw indicator for flash or can be cast at instant speed, enabled if show ability icons is enabled
|
||||||
@@ -870,6 +884,16 @@ public class CardRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//TODO animate rotation inside shader
|
||||||
|
Texture spiral = Forge.getAssets().getTexture(getDefaultSkinFile("spiral.png"), false);
|
||||||
|
if (spiral != null && drawIcons) {
|
||||||
|
drawSpiral = true;
|
||||||
|
float newX = card.isTapped() ? cx + cw / 4.5f : cx;
|
||||||
|
float newY = card.isTapped() ? cy + cw / 4.75f : cy;
|
||||||
|
g.startRotateTransform(newX + cw / 2f, newY + ch / 2, -(Forge.deltaTime * 16f));
|
||||||
|
g.drawImage(spiral, newX, newY, cw, ch);
|
||||||
|
g.endTransform();
|
||||||
|
}
|
||||||
//reset alpha
|
//reset alpha
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
}
|
}
|
||||||
@@ -883,15 +907,7 @@ public class CardRenderer {
|
|||||||
abiCount += 1;
|
abiCount += 1;
|
||||||
}
|
}
|
||||||
if (card.isSick()) {
|
if (card.isSick()) {
|
||||||
Texture spiral = Forge.getAssets().getTexture(getDefaultSkinFile("spiral.png"), false);
|
if (!drawSpiral) {
|
||||||
if (spiral != null) {
|
|
||||||
float newX = card.isTapped() ? cx + cw / 4.5f : cx;
|
|
||||||
float newY = card.isTapped() ? cy + cw / 4.75f : cy;
|
|
||||||
g.startRotateTransform(newX + cw / 2f, newY + ch / 2, -(Forge.deltaTime * 16f));
|
|
||||||
g.drawImage(spiral, newX, newY, cw, ch);
|
|
||||||
g.endTransform();
|
|
||||||
} else {
|
|
||||||
//old indicator
|
|
||||||
CardFaceSymbols.drawSymbol("summonsick", g, abiX, abiY, cw / 4.7f, cw / 4.7f);
|
CardFaceSymbols.drawSymbol("summonsick", g, abiX, abiY, cw / 4.7f, cw / 4.7f);
|
||||||
abiY += abiSpace + 1.7f;
|
abiY += abiSpace + 1.7f;
|
||||||
abiCount += 1;
|
abiCount += 1;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 574 KiB After Width: | Height: | Size: 581 KiB |
@@ -360,6 +360,8 @@ public enum FSkinProp {
|
|||||||
ICO_UNKNOWN (new int[] {0, 720, 80, 80}, PropType.ICON),
|
ICO_UNKNOWN (new int[] {0, 720, 80, 80}, PropType.ICON),
|
||||||
ICO_LOGO (new int[] {480, 0, 200, 200}, PropType.ICON),
|
ICO_LOGO (new int[] {480, 0, 200, 200}, PropType.ICON),
|
||||||
ICO_CARDART (new int[] {0, 1600, 200, 200}, PropType.ICON),
|
ICO_CARDART (new int[] {0, 1600, 200, 200}, PropType.ICON),
|
||||||
|
ICO_LEFTLOCK (new int[] {200, 1600, 143, 200}, PropType.ICON),
|
||||||
|
ICO_RIGHTLOCK (new int[] {343, 1600, 143, 200}, PropType.ICON),
|
||||||
|
|
||||||
ICO_FLIPCARD (new int[] {400, 0, 80, 120}, PropType.ICON),
|
ICO_FLIPCARD (new int[] {400, 0, 80, 120}, PropType.ICON),
|
||||||
ICO_HDFLIPCARD (new int[] {2, 1268, 387, 500}, PropType.BUTTONS),
|
ICO_HDFLIPCARD (new int[] {2, 1268, 387, 500}, PropType.BUTTONS),
|
||||||
|
|||||||
Reference in New Issue
Block a user