mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Standardizing home screen appearance: Sanctioned submenu (all)
This commit is contained in:
@@ -28,7 +28,6 @@ import forge.gui.deckeditor.CDeckEditorUI;
|
||||
import forge.gui.deckeditor.controllers.ACEditorBase;
|
||||
import forge.gui.deckeditor.controllers.CEditorLimited;
|
||||
import forge.gui.framework.ICDoc;
|
||||
import forge.gui.toolbox.FSkin;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.ItemPool;
|
||||
import forge.properties.ForgeProps;
|
||||
@@ -85,14 +84,6 @@ public enum CSubmenuSealed implements ICDoc {
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
VSubmenuSealed.SINGLETON_INSTANCE.showDirections();
|
||||
}
|
||||
@Override
|
||||
public void mouseEntered(final MouseEvent e) {
|
||||
VSubmenuSealed.SINGLETON_INSTANCE.getBtnDirections().setForeground(FSkin.getColor(FSkin.Colors.CLR_HOVER));
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(final MouseEvent e) {
|
||||
VSubmenuSealed.SINGLETON_INSTANCE.getBtnDirections().setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.gui.toolbox.FLabel;
|
||||
import forge.gui.toolbox.FList;
|
||||
import forge.gui.toolbox.FRadioButton;
|
||||
import forge.gui.toolbox.FScrollPane;
|
||||
import forge.gui.toolbox.FSkin;
|
||||
|
||||
/**
|
||||
* Assembles Swing components of constructed submenu singleton.
|
||||
@@ -40,6 +41,10 @@ public enum VSubmenuConstructed implements IVSubmenu {
|
||||
private final DragTab tab = new DragTab("Constructed Mode");
|
||||
|
||||
/** */
|
||||
private final FLabel lblTitle = new FLabel.Builder()
|
||||
.text("Sanctioned Format: Constructed").fontAlign(SwingConstants.CENTER)
|
||||
.fontSize(16).opaque(true).build();
|
||||
|
||||
private final JPanel pnlDecksHuman = new JPanel(new MigLayout("insets 0, gap 0, wrap"));
|
||||
private final JPanel pnlDecksAI = new JPanel(new MigLayout("insets 0, gap 0, wrap"));
|
||||
private final JPanel pnlRadiosHuman = new JPanel(new MigLayout("insets 0, gap 0, wrap"));
|
||||
@@ -79,26 +84,26 @@ public enum VSubmenuConstructed implements IVSubmenu {
|
||||
private VSubmenuConstructed() {
|
||||
// Radio button group: Human
|
||||
final ButtonGroup grpRadiosHuman = new ButtonGroup();
|
||||
grpRadiosHuman.add(radColorsHuman);
|
||||
grpRadiosHuman.add(radThemesHuman);
|
||||
grpRadiosHuman.add(radCustomHuman);
|
||||
grpRadiosHuman.add(radQuestsHuman);
|
||||
grpRadiosHuman.add(radColorsHuman);
|
||||
grpRadiosHuman.add(radThemesHuman);
|
||||
|
||||
// Radio button group: AI
|
||||
final ButtonGroup grpRadiosAI = new ButtonGroup();
|
||||
grpRadiosAI.add(radColorsAI);
|
||||
grpRadiosAI.add(radThemesAI);
|
||||
grpRadiosAI.add(radCustomAI);
|
||||
grpRadiosAI.add(radQuestsAI);
|
||||
grpRadiosAI.add(radColorsAI);
|
||||
grpRadiosAI.add(radThemesAI);
|
||||
|
||||
// Add deck scrollers and random buttons: Human and AI
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
|
||||
// Deck scrollers
|
||||
pnlDecksHuman.setOpaque(false);
|
||||
pnlDecksHuman.add(scrHumanDecks, "w 100%!, pushy, growy");
|
||||
pnlDecksHuman.add(btnHumanRandom, "w 100%!, h 30px!, gap 0 0 10px 10px");
|
||||
|
||||
pnlDecksAI.setOpaque(false);
|
||||
pnlDecksAI.add(scrAIDecks, "w 100%!, pushy, growy");
|
||||
pnlDecksAI.add(btnAIRandom, "w 100%!, h 30px!, gap 0 0 10px 0");
|
||||
|
||||
// Radio button panels: Human and AI
|
||||
final String strRadioConstraints = "w 100%!, h 30px!";
|
||||
@@ -107,19 +112,21 @@ public enum VSubmenuConstructed implements IVSubmenu {
|
||||
pnlRadiosHuman.add(new FLabel.Builder().text("Select your deck:")
|
||||
.fontStyle(Font.BOLD).fontSize(16)
|
||||
.fontAlign(SwingConstants.LEFT).build(), strRadioConstraints);
|
||||
pnlRadiosHuman.add(radColorsHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(radThemesHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(radCustomHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(radQuestsHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(radColorsHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(radThemesHuman, strRadioConstraints);
|
||||
pnlRadiosHuman.add(btnHumanRandom, "w 200px!, h 30px!, gap 0 0 10px 0, ax center");
|
||||
|
||||
pnlRadiosAI.setOpaque(false);
|
||||
pnlRadiosAI.add(new FLabel.Builder().text("Select an AI deck:")
|
||||
.fontStyle(Font.BOLD).fontSize(16)
|
||||
.fontAlign(SwingConstants.LEFT).build(), strRadioConstraints);
|
||||
pnlRadiosAI.add(radColorsAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(radThemesAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(radCustomAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(radQuestsAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(radColorsAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(radThemesAI, strRadioConstraints);
|
||||
pnlRadiosAI.add(btnAIRandom, "w 200px!, h 30px!, gap 0 0 10px 0, ax center");
|
||||
|
||||
final String strCheckboxConstraints = "w 200px!, h 30px!, gap 0 20px 0 0";
|
||||
pnlStart.setOpaque(false);
|
||||
@@ -158,15 +165,13 @@ public enum VSubmenuConstructed implements IVSubmenu {
|
||||
*/
|
||||
@Override
|
||||
public void populate() {
|
||||
final String strLeftConstraints = "w 200px, pushy, growy, gap 0 20px 25px 25px";
|
||||
final String strRightConstraints = "w 30%!, pushy, growy, gap 0 20px 25px 25px";
|
||||
|
||||
parentCell.getBody().setLayout(new MigLayout("insets 0, gap 0, wrap 2, align center"));
|
||||
parentCell.getBody().add(pnlRadiosAI, strLeftConstraints);
|
||||
parentCell.getBody().add(pnlDecksAI, strRightConstraints);
|
||||
parentCell.getBody().add(pnlRadiosHuman, strLeftConstraints);
|
||||
parentCell.getBody().add(pnlDecksHuman, strRightConstraints);
|
||||
parentCell.getBody().add(pnlStart, "w 220px + 30%, span 2 1, gap 0 0 0 50px");
|
||||
parentCell.getBody().setLayout(new MigLayout("insets 0, gap 0, wrap 2"));
|
||||
parentCell.getBody().add(lblTitle, "w 98%!, h 30px!, gap 1% 0 15px 15px, span 2");
|
||||
parentCell.getBody().add(pnlRadiosAI, "w 45%!, gap 1% 8% 20px 20px");
|
||||
parentCell.getBody().add(pnlRadiosHuman, "w 45%!, gap 0 0 20px 20px");
|
||||
parentCell.getBody().add(pnlDecksAI, "w 45%!, gap 1% 8% 0 0, growy, pushy");
|
||||
parentCell.getBody().add(pnlDecksHuman, "w 45%!, growy, pushy");
|
||||
parentCell.getBody().add(pnlStart, "span 2, gap 1% 0 50px 50px, ax center");
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JList} */
|
||||
|
||||
@@ -47,25 +47,26 @@ public enum VSubmenuDraft implements IVSubmenu {
|
||||
private final DragTab tab = new DragTab("Draft Mode");
|
||||
|
||||
/** */
|
||||
private final FLabel lblTitle = new FLabel.Builder()
|
||||
.text("Sanctioned Format: Draft").fontAlign(SwingConstants.CENTER)
|
||||
.fontSize(16).opaque(true).build();
|
||||
|
||||
private final StartButton btnStart = new StartButton();
|
||||
private final JButton btnPlayThisOpponent = new JButton("Play this opponent");
|
||||
|
||||
private final DeckLister lstHumanDecks = new DeckLister(GameType.Draft);
|
||||
private final JList lstAI = new FList();
|
||||
private final JList lstAI = new FList();
|
||||
|
||||
private final JLabel lblAI = new FLabel.Builder()
|
||||
.text("Who will you play?").fontSize(16)
|
||||
.fontAlign(SwingConstants.CENTER).build();
|
||||
.text("Who will you play?").fontSize(16).fontAlign(SwingConstants.CENTER).build();
|
||||
|
||||
private final JLabel lblHuman = new FLabel.Builder()
|
||||
.text("Select your deck:").fontSize(16)
|
||||
.fontAlign(SwingConstants.CENTER).build();
|
||||
|
||||
private final JLabel btnBuildDeck = new FLabel.Builder()
|
||||
.fontSize(16)
|
||||
.opaque(true).hoverable(true).text("Start A New Draft").build();
|
||||
.text("Select your deck:").fontSize(16).fontAlign(SwingConstants.CENTER).build();
|
||||
private final JLabel btnPlayThisOpponent = new FLabel.Builder()
|
||||
.fontSize(16).opaque(true).hoverable(true).text("Play this opponent").build();
|
||||
private final JLabel btnBuildDeck = new FLabel.Builder()
|
||||
.fontSize(16).opaque(true).hoverable(true).text("Start A New Draft").build();
|
||||
private final JLabel btnDirections = new FLabel.Builder()
|
||||
.fontSize(16)
|
||||
.text("Click For Directions").fontAlign(SwingConstants.CENTER).build();
|
||||
.fontSize(16).opaque(true).hoverable(true).text("How To Play").build();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -73,6 +74,8 @@ public enum VSubmenuDraft implements IVSubmenu {
|
||||
private VSubmenuDraft() {
|
||||
lstAI.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
btnStart.setEnabled(false);
|
||||
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -115,7 +118,7 @@ public enum VSubmenuDraft implements IVSubmenu {
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JButton} */
|
||||
public JButton getBtnPlayThisOpponent() {
|
||||
public JLabel getBtnPlayThisOpponent() {
|
||||
return this.btnPlayThisOpponent;
|
||||
}
|
||||
|
||||
@@ -193,16 +196,19 @@ public enum VSubmenuDraft implements IVSubmenu {
|
||||
@Override
|
||||
public void populate() {
|
||||
parentCell.getBody().setLayout(new MigLayout("insets 0, gap 0, wrap 2, hidemode 2"));
|
||||
parentCell.getBody().add(lblHuman, "w 60%!, gap 5% 5% 2% 2%");
|
||||
parentCell.getBody().add(lblAI, "w 25%!, gap 0 0 2% 2%");
|
||||
parentCell.getBody().add(lblTitle, "w 98%!, h 30px!, gap 1% 0 15px 15px, span 2");
|
||||
|
||||
parentCell.getBody().add(new FScrollPane(lstHumanDecks), "w 60%!, h 30%!, gap 5% 5% 2% 2%");
|
||||
parentCell.getBody().add(new FScrollPane(lstAI), "w 25%!, h 37%!, gap 0 0 2% 0, span 1 2, wrap");
|
||||
parentCell.getBody().add(lblHuman, "w 60%!, gap 1% 8% 0 15px");
|
||||
parentCell.getBody().add(lblAI, "w 30%!, gap 0 0 0 15px");
|
||||
|
||||
parentCell.getBody().add(btnBuildDeck, "w 60%!, h 5%!, gap 5% 5% 0 0, wrap");
|
||||
parentCell.getBody().add(btnDirections, "alignx center, span 2 1, gap 5% 5% 5% 2%, wrap");
|
||||
parentCell.getBody().add(btnStart, "gap 5% 5% 0 0, ax center, span 2 1");
|
||||
parentCell.getBody().add((btnPlayThisOpponent), "cell 1 3, ax center, wrap");
|
||||
parentCell.getBody().add(new FScrollPane(lstHumanDecks), "w 60%!, gap 1% 8% 0 0, pushy, growy");
|
||||
parentCell.getBody().add(new FScrollPane(lstAI), "w 30%!, pushy, growy");
|
||||
|
||||
parentCell.getBody().add(btnBuildDeck, "w 60%!, h 30px!, gap 1% 5% 10px 0");
|
||||
parentCell.getBody().add(btnPlayThisOpponent, "w 30%!, h 30px!, gap 0 0 10px 0");
|
||||
|
||||
parentCell.getBody().add(btnDirections, "w 200px!, h 30px!, gap 1% 0 20px 0, span 2, ax center");
|
||||
parentCell.getBody().add(btnStart, "w 98%!, gap 1% 0 50px 50px, ax center, span 2");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -44,26 +44,32 @@ public enum VSubmenuSealed implements IVSubmenu {
|
||||
private final DragTab tab = new DragTab("Sealed Mode");
|
||||
|
||||
/** */
|
||||
private final FLabel lblTitle = new FLabel.Builder()
|
||||
.text("Sanctioned Format: Sealed").fontAlign(SwingConstants.CENTER)
|
||||
.fontSize(16).opaque(true).build();
|
||||
|
||||
private final StartButton btnStart = new StartButton();
|
||||
private final DeckLister lstDecks = new DeckLister(GameType.Sealed);
|
||||
|
||||
private final JLabel lblTitle = new FLabel.Builder()
|
||||
.text("Select a deck for yourself, or build a new one: ")
|
||||
private final JLabel lblInfo = new FLabel.Builder()
|
||||
.text("Select a game, or build a new one.")
|
||||
.fontSize(16).fontAlign(SwingConstants.CENTER).build();
|
||||
|
||||
private final JLabel btnBuildDeck = new FLabel.Builder()
|
||||
.fontSize(16)
|
||||
.opaque(true).hoverable(true).text("Build a Sealed Deck Game").build();
|
||||
.fontSize(16).opaque(true).hoverable(true)
|
||||
.text("Build a Sealed Deck Game").build();
|
||||
|
||||
private final JLabel btnDirections = new FLabel.Builder()
|
||||
.fontSize(16)
|
||||
.text("Click For Directions").fontAlign(SwingConstants.CENTER).build();
|
||||
.fontSize(16).opaque(true).hoverable(true)
|
||||
.text("How To Play").fontAlign(SwingConstants.CENTER).build();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
private VSubmenuSealed() {
|
||||
btnStart.setEnabled(false);
|
||||
|
||||
lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -73,10 +79,12 @@ public enum VSubmenuSealed implements IVSubmenu {
|
||||
public void populate() {
|
||||
parentCell.getBody().setLayout(new MigLayout("insets 0, gap 0, hidemode 2, wrap"));
|
||||
|
||||
parentCell.getBody().add(lblTitle, "w 100%!, gap 0 0 2% 2%");
|
||||
parentCell.getBody().add(new FScrollPane(lstDecks), "w 90%!, h 35%!, gap 5% 0 2% 2%");
|
||||
parentCell.getBody().add(btnBuildDeck, "w 50%!, h 5%!, gap 25% 0 0 0");
|
||||
parentCell.getBody().add(btnStart, "ax center, gaptop 5%");
|
||||
parentCell.getBody().add(lblTitle, "w 98%!, h 30px!, gap 1% 0 15px 15px");
|
||||
parentCell.getBody().add(lblInfo, "w 100%!, gap 0 0 30px 15px");
|
||||
parentCell.getBody().add(new FScrollPane(lstDecks), "w 98%!, growy, pushy, gap 1% 0 0 0");
|
||||
parentCell.getBody().add(btnBuildDeck, "w 300px!, h 30px!, gap 0 0 15px 15px, ax center");
|
||||
parentCell.getBody().add(btnDirections, "w 200px!, h 30px!, ax center");
|
||||
parentCell.getBody().add(btnStart, "w 98%!, gap 1% 0 50px 50px, span 2");
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
Reference in New Issue
Block a user