mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
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:
parent
577bdaea84
commit
9927123cb3
2 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue