fix GUI for attached panels with each other

- closes #3661
This commit is contained in:
Anthony Calosa
2023-08-24 22:09:07 +08:00
parent 1ccb76745f
commit 64303f455e
3 changed files with 18 additions and 2 deletions

View File

@@ -697,7 +697,15 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
CardPanel attachedToPanel; CardPanel attachedToPanel;
if (card.getAttachedTo() != null) { if (card.getAttachedTo() != null) {
if (card != card.getAttachedTo().getAttachedTo())
attachedToPanel = getCardPanel(card.getAttachedTo().getId()); attachedToPanel = getCardPanel(card.getAttachedTo().getId());
else {
toPanel.getAttachedPanels().remove(getCardPanel(card.getAttachedTo().getId()));
CardPanel panel = getCardPanel(card.getAttachedTo().getId());
if (panel != null)
panel.setAttachedToPanel(null);
attachedToPanel = null;
}
} else { } else {
attachedToPanel = null; attachedToPanel = null;
} }

View File

@@ -77,6 +77,9 @@ public class TargetingOverlay {
drawArrow(g, endpoints.get(attachedTo.getId()), endpoints.get(c.getId()), ArcConnection.Friends); drawArrow(g, endpoints.get(attachedTo.getId()), endpoints.get(c.getId()), ArcConnection.Friends);
} }
} }
if (null != attachedTo && c == attachedTo.getAttachedTo()) {
drawArrow(g, endpoints.get(attachedTo.getId()), endpoints.get(c.getId()), ArcConnection.Friends);
}
if (null != attachedCards) { if (null != attachedCards) {
for (final CardView enc : attachedCards) { for (final CardView enc : attachedCards) {
if (enc.getController() != null && !enc.getController().equals(c.getController())) { if (enc.getController() != null && !enc.getController().equals(c.getController())) {

View File

@@ -300,7 +300,12 @@ public abstract class VCardDisplayArea extends VDisplayArea implements ActivateH
} }
if (card.getAttachedTo() != null) { if (card.getAttachedTo() != null) {
if (card != card.getAttachedTo().getAttachedTo())
setAttachedToPanel(CardAreaPanel.get(card.getAttachedTo())); setAttachedToPanel(CardAreaPanel.get(card.getAttachedTo()));
else {
attachedPanels.remove(CardAreaPanel.get(card.getAttachedTo()));
setAttachedToPanel(null);
}
} }
else { else {
setAttachedToPanel(null); setAttachedToPanel(null);