Improve pool distribution dialog for new quests

This commit is contained in:
Krazy
2017-06-07 19:05:52 +00:00
parent a590edad78
commit 614caa837b
2 changed files with 250 additions and 212 deletions

View File

@@ -28,7 +28,7 @@ public class DialogChooseColors {
private final FCheckBox cbxArtifacts = new FCheckBox("Include Artifacts"); private final FCheckBox cbxArtifacts = new FCheckBox("Include Artifacts");
private final FRadioButton radBalanced = new FRadioButton("Balanced"); private final FRadioButton radBalanced = new FRadioButton("Balanced");
private final FRadioButton radRandom = new FRadioButton("Random"); private final FRadioButton radRandom = new FRadioButton("True Random");
private final FRadioButton radSurpriseMe = new FRadioButton("Surprise Me"); private final FRadioButton radSurpriseMe = new FRadioButton("Surprise Me");
private final FRadioButton radBoosters = new FRadioButton("Boosters"); private final FRadioButton radBoosters = new FRadioButton("Boosters");
@@ -96,12 +96,11 @@ public class DialogChooseColors {
mainPanel.setOpaque(false); mainPanel.setOpaque(false);
mainPanel.setBackgroundTexture(FSkin.getIcon(FSkinProp.BG_TEXTURE)); mainPanel.setBackgroundTexture(FSkin.getIcon(FSkinProp.BG_TEXTURE));
final String contentPanelConstraints = "w 200px!, h 290px!, left, gap 5, insets 10 25 10 25, wrap 1"; final String contentPanelConstraints = "w 200px!, h 340px!, left, gap 5, insets 10 25 10 25, wrap 1";
//Right side //Right side
final FPanel right = new FPanel(new MigLayout(contentPanelConstraints)); final FPanel right = new FPanel(new MigLayout(contentPanelConstraints));
right.setOpaque(false); right.setOpaque(false);
right.add(new FLabel.Builder().text("Colors").fontSize(18).build(), "gaptop 10");
final FLabel clearColors = new FLabel.Builder().text("Clear All").fontSize(12).opaque(true).hoverable(true).build(); final FLabel clearColors = new FLabel.Builder().text("Clear All").fontSize(12).opaque(true).hoverable(true).build();
clearColors.setCommand(new UiCommand() { clearColors.setCommand(new UiCommand() {
@@ -116,6 +115,19 @@ public class DialogChooseColors {
} }
}); });
final FLabel boosterPackLabel = new FLabel.Builder().text("Number of Boosters:").fontSize(14).build();
final FLabel colorsLabel = new FLabel.Builder().text("Colors").fontSize(18).build();
final FTextPane noSettingsText = new FTextPane("No settings are available for this selection.");
if (radBoosters.isSelected()) {
right.add(boosterPackLabel, "gaptop 10");
right.add(numberOfBoostersField, "w 100px!, gaptop 5");
} else if (radSurpriseMe.isSelected()) {
right.add(noSettingsText, "gaptop 10");
} else if (radRandom.isSelected()) {
right.add(cbxArtifacts, "gaptop 10");
} else {
right.add(colorsLabel, "gaptop 10");
right.add(clearColors, "w 75px!, h 20px!, gaptop 10"); right.add(clearColors, "w 75px!, h 20px!, gaptop 10");
right.add(cbxBlack, "gaptop 10"); right.add(cbxBlack, "gaptop 10");
right.add(cbxBlue); right.add(cbxBlue);
@@ -123,6 +135,8 @@ public class DialogChooseColors {
right.add(cbxRed); right.add(cbxRed);
right.add(cbxWhite); right.add(cbxWhite);
right.add(cbxColorless); right.add(cbxColorless);
right.add(cbxArtifacts, "gaptop 25");
}
//Left Side //Left Side
final FPanel left = new FPanel(new MigLayout(contentPanelConstraints)); final FPanel left = new FPanel(new MigLayout(contentPanelConstraints));
@@ -139,27 +153,53 @@ public class DialogChooseColors {
ActionListener radioButtonListener = new ActionListener() { ActionListener radioButtonListener = new ActionListener() {
@Override @Override
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
clearColors.setEnabled(radBalanced.isSelected());
cbxBlack.setEnabled(radBalanced.isSelected()); right.removeAll();
cbxBlue.setEnabled(radBalanced.isSelected());
cbxGreen.setEnabled(radBalanced.isSelected()); if (radBoosters.isSelected()) {
cbxRed.setEnabled(radBalanced.isSelected()); right.add(boosterPackLabel, "gaptop 10");
cbxWhite.setEnabled(radBalanced.isSelected()); right.add(numberOfBoostersField, "w 100px!, gaptop 5");
cbxColorless.setEnabled(radBalanced.isSelected()); } else if (radSurpriseMe.isSelected()) {
cbxArtifacts.setEnabled(!radSurpriseMe.isSelected() && !radBoosters.isSelected()); right.add(noSettingsText, "gaptop 10");
numberOfBoostersField.setEnabled(radBoosters.isSelected()); } else if (radRandom.isSelected()) {
right.add(cbxArtifacts, "gaptop 10");
} else {
right.add(colorsLabel, "gaptop 10");
right.add(clearColors, "w 75px!, h 20px!, gaptop 10");
right.add(cbxBlack, "gaptop 10");
right.add(cbxBlue);
right.add(cbxGreen);
right.add(cbxRed);
right.add(cbxWhite);
right.add(cbxColorless);
right.add(cbxArtifacts, "gaptop 25");
}
clearColors.setVisible(radBalanced.isSelected());
cbxBlack.setVisible(radBalanced.isSelected());
cbxBlue.setVisible(radBalanced.isSelected());
cbxGreen.setVisible(radBalanced.isSelected());
cbxRed.setVisible(radBalanced.isSelected());
cbxWhite.setVisible(radBalanced.isSelected());
cbxColorless.setVisible(radBalanced.isSelected());
cbxArtifacts.setVisible(!radSurpriseMe.isSelected() && !radBoosters.isSelected());
numberOfBoostersField.setVisible(radBoosters.isSelected());
right.validate();
right.repaint();
} }
}; };
clearColors.setEnabled(radBalanced.isSelected()); clearColors.setVisible(radBalanced.isSelected());
cbxBlack.setEnabled(radBalanced.isSelected()); cbxBlack.setVisible(radBalanced.isSelected());
cbxBlue.setEnabled(radBalanced.isSelected()); cbxBlue.setVisible(radBalanced.isSelected());
cbxGreen.setEnabled(radBalanced.isSelected()); cbxGreen.setVisible(radBalanced.isSelected());
cbxRed.setEnabled(radBalanced.isSelected()); cbxRed.setVisible(radBalanced.isSelected());
cbxWhite.setEnabled(radBalanced.isSelected()); cbxWhite.setVisible(radBalanced.isSelected());
cbxColorless.setEnabled(radBalanced.isSelected()); cbxColorless.setVisible(radBalanced.isSelected());
cbxArtifacts.setEnabled(!radSurpriseMe.isSelected() && !radBoosters.isSelected()); cbxArtifacts.setVisible(!radSurpriseMe.isSelected() && !radBoosters.isSelected());
numberOfBoostersField.setEnabled(radBoosters.isSelected()); numberOfBoostersField.setVisible(radBoosters.isSelected());
radBalanced.setToolTipText("A balanced distribution will provide a roughly equal number of cards in each selected color."); radBalanced.setToolTipText("A balanced distribution will provide a roughly equal number of cards in each selected color.");
radRandom.setToolTipText("A random distribution will be almost entirely randomly selected. This ignores any color selections."); radRandom.setToolTipText("A random distribution will be almost entirely randomly selected. This ignores any color selections.");
@@ -173,8 +213,6 @@ public class DialogChooseColors {
radBoosters.addActionListener(radioButtonListener); radBoosters.addActionListener(radioButtonListener);
left.add(poolTypePanel, "gaptop 15"); left.add(poolTypePanel, "gaptop 15");
left.add(cbxArtifacts, "gaptop 25");
left.add(numberOfBoostersField, "w 100px!, gaptop 15");
//Add Bottom and Panels //Add Bottom and Panels
mainPanel.add(left); mainPanel.add(left);

View File

@@ -86,8 +86,8 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
private final FCheckBox boxCompleteSet = new FCheckBox("Start with all cards in selected sets"); private final FCheckBox boxCompleteSet = new FCheckBox("Start with all cards in selected sets");
private final FCheckBox boxAllowDuplicates = new FCheckBox("Allow duplicate cards"); private final FCheckBox boxAllowDuplicates = new FCheckBox("Allow duplicate cards");
private final FLabel lblPreferredColor = new FLabel.Builder().text("Starting pool colors:").build(); private final FLabel lblPreferredColor = new FLabel.Builder().text("Starting pool distribution:").build();
private final FLabel btnPreferredColors = new FLabel.Builder().opaque(true).hoverable(true).text("Choose Colors").build(); private final FLabel btnPreferredColors = new FLabel.Builder().opaque(true).hoverable(true).text("Choose Distribution").build();
private final FLabel btnPrizeDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build(); private final FLabel btnPrizeDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build();