Made deck area orientation dynamic.

* Deck area orientation now changes depending on the context.
* In free building and sideboarding, the sideboard and maindeck are shown side by side.
* In limited deckbuilding, the sideboard (with your limited pool) is shown above the maindeck.
This commit is contained in:
Mark Langen 2016-09-15 00:55:23 -06:00
parent 577bdaea84
commit 9927123cb3
2 changed files with 13 additions and 0 deletions

View file

@ -41,6 +41,8 @@ import mage.client.util.GUISizeHelper;
import mage.client.util.Listener;
import mage.view.CardsView;
import javax.swing.*;
/**
*
* @author BetaSteward_at_googlemail.com
@ -76,6 +78,14 @@ public class DeckArea extends javax.swing.JPanel {
private void setGUISize() {
}
public void setOrientation(boolean limitedBuildingOrientation) {
if (limitedBuildingOrientation) {
deckAreaSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
} else {
deckAreaSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
}
}
public void showSideboard(boolean show) {
this.sideboardList.setVisible(show);
}

View file

@ -154,6 +154,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
switch (mode) {
case LIMITED_BUILDING:
this.deckArea.setOrientation(/*limitedBuildingOrientation = */true);
this.btnAddLand.setVisible(true);
this.txtTimeRemaining.setVisible(true);
case SIDEBOARDING:
@ -162,6 +163,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
this.cardSelector.loadSideboard(new ArrayList<>(deck.getSideboard()), this.bigCard);
}
// TODO: take from preferences
this.deckArea.setOrientation(/*limitedBuildingOrientation = */false);
this.cardSelector.switchToGrid();
this.btnExit.setVisible(false);
this.btnImport.setVisible(false);
@ -182,6 +184,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
}
break;
case FREE_BUILDING:
this.deckArea.setOrientation(/*limitedBuildingOrientation = */false);
this.btnSubmit.setVisible(false);
this.btnAddLand.setVisible(true);
this.cardSelector.loadCards(this.bigCard);