forked from External/mage
Chnaged permanent row handling so creatures are always shown towards the opponent side.
This commit is contained in:
parent
e9993f980a
commit
7cfdd80c57
12 changed files with 89 additions and 60 deletions
|
|
@ -1,6 +1,6 @@
|
|||
package mage.client.util.layout;
|
||||
|
||||
import javax.swing.JLayeredPane;
|
||||
import mage.client.game.BattlefieldPanel;
|
||||
|
||||
/**
|
||||
* Interface for operations that modify cards' layout
|
||||
|
|
@ -11,7 +11,7 @@ public interface CardLayoutStrategy {
|
|||
|
||||
int getDefaultZOrder();
|
||||
|
||||
void onAdd(JLayeredPane jLayeredPane);
|
||||
void onAdd(BattlefieldPanel jLayeredPane);
|
||||
|
||||
void doLayout(JLayeredPane jLayeredPane, int battlefieldWidth);
|
||||
void doLayout(BattlefieldPanel jLayeredPane, int battlefieldWidth);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,16 +31,16 @@ public class OldCardLayoutStrategy implements CardLayoutStrategy {
|
|||
private static final int ATTACHMENT_MIN_DY_OFFSET = 12;
|
||||
|
||||
@Override
|
||||
public void doLayout(JLayeredPane jLayeredPane, int width) {
|
||||
Map<UUID, MagePermanent> permanents = ((BattlefieldPanel) jLayeredPane).getPermanents();
|
||||
JLayeredPane jPanel = ((BattlefieldPanel) jLayeredPane).getMainPanel();
|
||||
public void doLayout(BattlefieldPanel battlefieldPanel, int width) {
|
||||
Map<UUID, MagePermanent> permanents = battlefieldPanel.getPermanents();
|
||||
JLayeredPane jPanel = battlefieldPanel.getMainPanel();
|
||||
|
||||
int height = Plugins.getInstance().sortPermanents(((BattlefieldPanel) jLayeredPane).getUiComponentsList(), permanents.values());
|
||||
int height = Plugins.getInstance().sortPermanents(battlefieldPanel.getUiComponentsList(), permanents.values(), battlefieldPanel.isTopPanelBattlefield());
|
||||
jPanel.setPreferredSize(new Dimension(width - 30, height));
|
||||
|
||||
for (PermanentView permanent : ((BattlefieldPanel) jLayeredPane).getBattlefield().values()) {
|
||||
for (PermanentView permanent : battlefieldPanel.getBattlefield().values()) {
|
||||
if (permanent.getAttachments() != null) {
|
||||
groupAttachments(jLayeredPane, jPanel, permanents, permanent);
|
||||
groupAttachments(battlefieldPanel, jPanel, permanents, permanent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ public class OldCardLayoutStrategy implements CardLayoutStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onAdd(JLayeredPane jLayeredPane) {
|
||||
public void onAdd(BattlefieldPanel jLayeredPane) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue