Aesthetic update to sealed submenu.

Updated "directions" blurbs in draft submenu.
This commit is contained in:
Doublestrike
2012-10-17 01:04:57 +00:00
parent b1a9e938eb
commit 8c818a64c6
4 changed files with 56 additions and 32 deletions

View File

@@ -52,7 +52,7 @@ public enum CSubmenuDraft implements ICDoc {
public void initialize() {
final VSubmenuDraft view = VSubmenuDraft.SINGLETON_INSTANCE;
view.getLstHumanDecks().setSelectCommand(cmdDeckSelect);
view.getLstDecks().setSelectCommand(cmdDeckSelect);
view.getBtnBuildDeck().setCommand(new Command() { @Override
public void execute() { setupDraft(); } });
@@ -81,7 +81,7 @@ public enum CSubmenuDraft implements ICDoc {
human.add(d.getHumanDeck());
}
VSubmenuDraft.SINGLETON_INSTANCE.getLstHumanDecks().setDecks(human);
VSubmenuDraft.SINGLETON_INSTANCE.getLstDecks().setDecks(human);
if (human.size() > 1) {
VSubmenuDraft.SINGLETON_INSTANCE.getBtnStart().setEnabled(true);
@@ -91,7 +91,7 @@ public enum CSubmenuDraft implements ICDoc {
private void startGame() {
final boolean gauntlet = VSubmenuDraft.SINGLETON_INSTANCE.getRadSingle().isSelected() ? false : true;
final Deck human = VSubmenuDraft.SINGLETON_INSTANCE.getLstHumanDecks().getSelectedDeck();
final Deck human = VSubmenuDraft.SINGLETON_INSTANCE.getLstDecks().getSelectedDeck();
final int aiIndex = (int) Math.floor(Math.random() * 8);
if (human == null) {

View File

@@ -121,9 +121,9 @@ public enum CSubmenuSealed implements ICDoc {
return;
}
int rounds = Singletons.getModel().getDecks().getSealed().get(human.getName()).getAiDecks().size();
int matches = Singletons.getModel().getDecks().getSealed().get(human.getName()).getAiDecks().size();
AllZone.getGauntlet().launch(rounds, human, GameType.Sealed);
AllZone.getGauntlet().launch(matches, human, GameType.Sealed);
}
/** */
@@ -174,7 +174,7 @@ public enum CSubmenuSealed implements ICDoc {
integers[i] = Integer.valueOf(i + 1);
}
Integer rounds = GuiChoose.one("How many rounds?", integers);
Integer rounds = GuiChoose.one("How many matches?", integers);
// System.out.println("You selected " + rounds + " rounds.");

View File

@@ -49,21 +49,29 @@ public enum VSubmenuDraft implements IVSubmenu {
private final JPanel pnlStart = new JPanel();
private final StartButton btnStart = new StartButton();
private final DeckLister lstHumanDecks = new DeckLister(GameType.Draft);
private final DeckLister lstDecks = new DeckLister(GameType.Draft);
private final JList lstAI = new FList();
private final JRadioButton radSingle = new FRadioButton("Play one opponent");
private final JRadioButton radAll = new FRadioButton("Play all 8 opponents");
private final JLabel lblHuman = new FLabel.Builder()
private final JLabel lblInfo = new FLabel.Builder()
.fontAlign(SwingConstants.LEFT).fontSize(16).fontStyle(Font.BOLD)
.text("Build or select a deck").build();
private final FLabel lblDirections = new FLabel.Builder()
.text("In Draft mode, three booster packs are rotated around eight players. Build a deck from the cards you choose.")
private final FLabel lblDir1 = new FLabel.Builder()
.text("In Draft mode, three booster packs are rotated around eight players.")
.fontSize(12).build();
private final ExperimentalLabel btnBuildDeck = new ExperimentalLabel("Start A New Draft");
private final FLabel lblDir2 = new FLabel.Builder()
.text("Build a deck from the cards you choose. The AI will do the same.")
.fontSize(12).build();
private final FLabel lblDir3 = new FLabel.Builder()
.text("Then, play against one or all of the AI opponents.")
.fontSize(12).build();
private final ExperimentalLabel btnBuildDeck = new ExperimentalLabel("New Draft Mode Game");
/**
@@ -127,8 +135,8 @@ public enum VSubmenuDraft implements IVSubmenu {
}
/** @return {@link forge.gui.toolbox.DeckLister} */
public DeckLister getLstHumanDecks() {
return lstHumanDecks;
public DeckLister getLstDecks() {
return lstDecks;
}
//========== Overridden from IVDoc
@@ -142,11 +150,13 @@ public enum VSubmenuDraft implements IVSubmenu {
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap, ax right"));
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 80%!, h 40px!, gap 0 0 15px 15px, ax right");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblHuman, "w 80%!, h 30px!, gap 0 10% 20px 0");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDirections, "gap 0 0 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblInfo, "w 80%!, h 30px!, gap 0 10% 20px 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir1, "gap 0 0 0 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir2, "gap 0 0 0 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir3, "gap 0 0 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnBuildDeck, "w 200px!, h 30px!, ax center, gap 0 10% 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(new FScrollPane(lstHumanDecks), "w 80%!, gap 0 10% 0 0, pushy, growy");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnBuildDeck, "w 250px!, h 30px!, ax center, gap 0 10% 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(new FScrollPane(lstDecks), "w 80%!, gap 0 10% 0 0, pushy, growy");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "gap 0 10% 50px 50px, ax center");

View File

@@ -1,5 +1,6 @@
package forge.gui.home.sanctioned;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -22,9 +23,11 @@ import forge.gui.framework.EDocID;
import forge.gui.framework.ICDoc;
import forge.gui.home.EMenuGroup;
import forge.gui.home.IVSubmenu;
import forge.gui.home.LblHeader;
import forge.gui.home.StartButton;
import forge.gui.home.VHomeUI;
import forge.gui.toolbox.DeckLister;
import forge.gui.toolbox.ExperimentalLabel;
import forge.gui.toolbox.FButton;
import forge.gui.toolbox.FLabel;
import forge.gui.toolbox.FPanel;
@@ -45,20 +48,28 @@ 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 LblHeader lblTitle = new LblHeader("Sanctioned Format: Sealed");
private final StartButton btnStart = new StartButton();
private final DeckLister lstDecks = new DeckLister(GameType.Sealed);
private final JLabel lblInfo = new FLabel.Builder()
.text("Select a game, or build a new one.")
.fontSize(16).fontAlign(SwingConstants.CENTER).build();
.fontAlign(SwingConstants.LEFT).fontSize(16).fontStyle(Font.BOLD)
.text("Select a game, or build a new one").build();
private final JLabel btnBuildDeck = new FLabel.Builder()
.fontSize(16).opaque(true).hoverable(true)
.text("Build a Sealed Deck Game").build();
private final FLabel lblDir1 = new FLabel.Builder()
.text("In Sealed mode, you build a deck from booster packs (maximum 10).")
.fontSize(12).build();
private final FLabel lblDir2 = new FLabel.Builder()
.text("Build a deck from the cards you receive. A number of AI opponents will do the same.")
.fontSize(12).build();
private final FLabel lblDir3 = new FLabel.Builder()
.text("Then, you will play against each of the AI opponents.")
.fontSize(12).build();
private final ExperimentalLabel btnBuildDeck = new ExperimentalLabel("New Sealed Mode Game");
private final JLabel btnDirections = new FLabel.Builder()
.fontSize(16).opaque(true).hoverable(true)
@@ -79,14 +90,17 @@ public enum VSubmenuSealed implements IVSubmenu {
@Override
public void populate() {
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().removeAll();
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, hidemode 2, wrap"));
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap, ax right"));
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 80%!, h 40px!, gap 0 0 15px 15px, ax right");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 98%!, h 30px!, gap 1% 0 15px 15px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblInfo, "w 100%!, gap 0 0 30px 15px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(new FScrollPane(lstDecks), "w 98%!, growy, pushy, gap 1% 0 0 0");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnBuildDeck, "w 300px!, h 30px!, gap 0 0 15px 15px, ax center");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnDirections, "w 200px!, h 30px!, ax center");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnStart, "w 98%!, gap 1% 0 50px 50px, span 2");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblInfo, "w 80%!, h 30px!, gap 0 10% 20px 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir1, "gap 0 0 0 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir2, "gap 0 0 0 5px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblDir3, "gap 0 0 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnBuildDeck, "w 250px!, h 30px!, ax center, gap 0 10% 0 20px");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(new FScrollPane(lstDecks), "w 80%!, gap 0 10% 0 0, pushy, growy");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnStart, "gap 0 10% 50px 50px, ax center");
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().repaintSelf();
VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().revalidate();