From 5f75598d87a18881891b1bc892e094429b6e65cd Mon Sep 17 00:00:00 2001 From: Sol Date: Fri, 30 Nov 2012 03:46:19 +0000 Subject: [PATCH] - After a draft finishes, properly reset buttons used in the Deck Editor --- .../controllers/CEditorDraftingProcess.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorDraftingProcess.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorDraftingProcess.java index 887940fc145..3fe5659a151 100644 --- a/src/main/java/forge/gui/deckeditor/controllers/CEditorDraftingProcess.java +++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorDraftingProcess.java @@ -54,7 +54,7 @@ import forge.view.FView; public class CEditorDraftingProcess extends ACEditorBase { private IBoosterDraft boosterDraft; - private String ccAddLabel = new String(); + private String ccAddLabel = "Add card"; private DragCell filtersParent = null; private DragCell allDecksParent = null; private DragCell deckGenParent = null; @@ -267,10 +267,7 @@ public class CEditorDraftingProcess extends ACEditorBase this.getTableDeck().setDeck((Iterable) null); //Remove buttons - VCardCatalog.SINGLETON_INSTANCE.getPnlAddButtons().remove(VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4()); - - VCurrentDeck.SINGLETON_INSTANCE.getPnlRemButtons().remove(VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove()); - VCurrentDeck.SINGLETON_INSTANCE.getPnlRemButtons().remove(VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4()); + VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4().setVisible(false); VCurrentDeck.SINGLETON_INSTANCE.getPnlHeader().setVisible(false); @@ -327,16 +324,15 @@ public class CEditorDraftingProcess extends ACEditorBase public boolean exit() { CSubmenuDraft.SINGLETON_INSTANCE.update(); - //Re-add buttons - VCardCatalog.SINGLETON_INSTANCE.getPnlAddButtons().add(VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4()); - - VCurrentDeck.SINGLETON_INSTANCE.getPnlRemButtons().add(VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove()); - VCurrentDeck.SINGLETON_INSTANCE.getPnlRemButtons().add(VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4()); - - VCurrentDeck.SINGLETON_INSTANCE.getPnlHeader().setVisible(true); - //Re-rename buttons VCardCatalog.SINGLETON_INSTANCE.getBtnAdd().setText(ccAddLabel); + + //Re-add buttons + VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4().setVisible(true); + VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove().setVisible(true); + VCurrentDeck.SINGLETON_INSTANCE.getBtnRemove4().setVisible(true); + + VCurrentDeck.SINGLETON_INSTANCE.getPnlHeader().setVisible(true); //Re-add tabs if (filtersParent != null) {