mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Fix a bug that caused the deck subtitle not to be updated when the quest mode deck editor was turned to sideboard mode.
- Fix a bug that allowed the Import button to be used in quest mode deck editor.
This commit is contained in:
@@ -48,6 +48,7 @@ import forge.item.PaperCard;
|
|||||||
import forge.item.InventoryItem;
|
import forge.item.InventoryItem;
|
||||||
import forge.quest.QuestController;
|
import forge.quest.QuestController;
|
||||||
import forge.util.ItemPool;
|
import forge.util.ItemPool;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
//import forge.quest.data.QuestBoosterPack;
|
//import forge.quest.data.QuestBoosterPack;
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ import forge.util.ItemPool;
|
|||||||
public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
||||||
private final QuestController questData;
|
private final QuestController questData;
|
||||||
private final DeckController<Deck> controller;
|
private final DeckController<Deck> controller;
|
||||||
|
private final List<DeckSection> allSections = new ArrayList<DeckSection>();
|
||||||
private DragCell allDecksParent = null;
|
private DragCell allDecksParent = null;
|
||||||
private DragCell deckGenParent = null;
|
private DragCell deckGenParent = null;
|
||||||
private boolean sideboardMode = false;
|
private boolean sideboardMode = false;
|
||||||
@@ -96,6 +98,9 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
|||||||
public CEditorQuest(final QuestController questData0) {
|
public CEditorQuest(final QuestController questData0) {
|
||||||
super(FScreen.DECK_EDITOR_QUEST);
|
super(FScreen.DECK_EDITOR_QUEST);
|
||||||
|
|
||||||
|
allSections.add(DeckSection.Main);
|
||||||
|
allSections.add(DeckSection.Sideboard);
|
||||||
|
|
||||||
this.questData = questData0;
|
this.questData = questData0;
|
||||||
|
|
||||||
final CardManager catalogManager = new CardManager(false);
|
final CardManager catalogManager = new CardManager(false);
|
||||||
@@ -226,6 +231,11 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
|||||||
* Switch between the main deck and the sideboard editor.
|
* Switch between the main deck and the sideboard editor.
|
||||||
*/
|
*/
|
||||||
public void switchEditorMode(boolean isSideboarding) {
|
public void switchEditorMode(boolean isSideboarding) {
|
||||||
|
int curindex = allSections.indexOf(sectionMode);
|
||||||
|
|
||||||
|
curindex = curindex == (allSections.size()-1) ? 0 : curindex+1;
|
||||||
|
sectionMode = allSections.get(curindex);
|
||||||
|
|
||||||
if (isSideboarding) {
|
if (isSideboarding) {
|
||||||
this.getCatalogManager().setPool(this.controller.getModel().getMain());
|
this.getCatalogManager().setPool(this.controller.getModel().getMain());
|
||||||
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
this.getDeckManager().setPool(this.controller.getModel().getOrCreate(DeckSection.Sideboard));
|
||||||
@@ -241,6 +251,8 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
|||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnPrintProxies().setVisible(!isSideboarding);
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnPrintProxies().setVisible(!isSideboarding);
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getTxfTitle().setVisible(!isSideboarding);
|
VCurrentDeck.SINGLETON_INSTANCE.getTxfTitle().setVisible(!isSideboarding);
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getLblTitle().setText(isSideboarding ? "Sideboard" : "Title:");
|
VCurrentDeck.SINGLETON_INSTANCE.getLblTitle().setText(isSideboarding ? "Sideboard" : "Title:");
|
||||||
|
|
||||||
|
this.controller.updateCaptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@@ -277,6 +289,8 @@ public final class CEditorQuest extends ACEditorBase<PaperCard, Deck> {
|
|||||||
SItemManagerUtil.resetUI(this);
|
SItemManagerUtil.resetUI(this);
|
||||||
|
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnSave().setVisible(true);
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnSave().setVisible(true);
|
||||||
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnImport().setVisible(false);
|
||||||
|
|
||||||
this.getBtnCycleSection().setVisible(true);
|
this.getBtnCycleSection().setVisible(true);
|
||||||
this.getBtnCycleSection().setCommand(new Command() {
|
this.getBtnCycleSection().setCommand(new Command() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public final class SItemManagerUtil {
|
|||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnSaveAs().setVisible(true);
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnSaveAs().setVisible(true);
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnNew().setVisible(true);
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnNew().setVisible(true);
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnOpen().setVisible(true);
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnOpen().setVisible(true);
|
||||||
|
VCurrentDeck.SINGLETON_INSTANCE.getBtnImport().setVisible(true);
|
||||||
|
|
||||||
VCurrentDeck.SINGLETON_INSTANCE.getTxfTitle().setEnabled(true);
|
VCurrentDeck.SINGLETON_INSTANCE.getTxfTitle().setEnabled(true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user