mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
DeckEditor: draft mode, removing card for cardpool and no possibility to return card back.
This commit is contained in:
parent
100a0a54e1
commit
e45efd0527
2 changed files with 8 additions and 2 deletions
|
|
@ -125,7 +125,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener
|
|||
resizeArea();
|
||||
}
|
||||
|
||||
private void removeCard(UUID cardId) {
|
||||
public void removeCard(UUID cardId) {
|
||||
for (Component comp: getComponents()) {
|
||||
if (comp instanceof Card) {
|
||||
if (((Card)comp).getCardId().equals(cardId)) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
for (Card card: cardSelector.getCards()) {
|
||||
if (card.getId().equals((UUID)event.getSource())) {
|
||||
deck.getCards().add(createCard(card.getClass()));
|
||||
break;
|
||||
if (System.getProperty("draft") != null) {
|
||||
cardSelector.getCardsList().removeCard(card.getId());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
refreshDeck();
|
||||
|
|
@ -106,6 +109,9 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
new Listener<Event> () {
|
||||
@Override
|
||||
public void event(Event event) {
|
||||
if (System.getProperty("draft") != null) {
|
||||
return;
|
||||
}
|
||||
if (event.getEventName().equals("double-click")) {
|
||||
for (Card card: deck.getCards()) {
|
||||
if (card.getId().equals((UUID)event.getSource())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue