mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* GUI: fixed that users can select empty timing option in new tourney dialog;
This commit is contained in:
parent
d3f2b537fb
commit
f334b81de6
3 changed files with 23 additions and 4 deletions
|
|
@ -86,7 +86,10 @@ public class NewTournamentDialog extends MageDialog {
|
|||
cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values()));
|
||||
cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values()));
|
||||
cbDraftCube.setModel(new DefaultComboBoxModel(SessionHandler.getDraftCubes()));
|
||||
cbDraftTiming.setModel(new DefaultComboBoxModel(DraftOptions.TimingOption.values()));
|
||||
cbDraftTiming.setModel(new DefaultComboBoxModel(Arrays.stream(TimingOption.values())
|
||||
.filter(o -> !o.equals(TimingOption.NONE))
|
||||
.toArray())
|
||||
);
|
||||
// update player types
|
||||
int i = 2;
|
||||
for (TournamentPlayerPanel tournamentPlayerPanel : players) {
|
||||
|
|
@ -682,6 +685,13 @@ public class NewTournamentDialog extends MageDialog {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (tournamentType.isDraft() && tOptions.getLimitedOptions() instanceof DraftOptions) {
|
||||
DraftOptions draftOptions = (DraftOptions) tOptions.getLimitedOptions();
|
||||
if (draftOptions.getTiming() == TimingOption.NONE) {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Warning, you must select draft timing option", "Warning", JOptionPane.WARNING_MESSAGE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// save last settings
|
||||
onSaveSettings(0, tOptions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue