Search in sources :

Example 6 with TournamentPlayerPanel

use of mage.client.table.TournamentPlayerPanel in project mage by magefree.

the class NewTournamentDialog method showDialog.

public void showDialog(UUID roomId) {
    this.roomId = roomId;
    if (!lastSessionId.equals(SessionHandler.getSessionId())) {
        lastSessionId = SessionHandler.getSessionId();
        this.player1Panel.setPlayerName(SessionHandler.getUserName());
        // no computer
        this.player1Panel.showLevel(false);
        cbTournamentType.setModel(new DefaultComboBoxModel(SessionHandler.getTournamentTypes().toArray()));
        cbGameType.setModel(new DefaultComboBoxModel(SessionHandler.getTournamentGameTypes().toArray()));
        cbDeckType.setModel(new DefaultComboBoxModel(SessionHandler.getDeckTypes()));
        cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values()));
        cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values()));
        cbDraftCube.setModel(new DefaultComboBoxModel(SessionHandler.getDraftCubes()));
        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) {
            tournamentPlayerPanel.init(i++);
        }
        cbAllowSpectators.setSelected(true);
        cbPlaneChase.setSelected(false);
        this.setModal(true);
        this.setLocation(150, 100);
    }
    onLoadSettings(0);
    this.setVisible(true);
}
Also used : java.util(java.util) MageFrame(mage.client.MageFrame) TableView(mage.view.TableView) RangeOfInfluence(mage.constants.RangeOfInfluence) MultiplayerAttackOption(mage.constants.MultiplayerAttackOption) Logger(org.apache.log4j.Logger) IgnoreList(mage.client.util.IgnoreList) MulliganType(mage.game.mulligan.MulliganType) TournamentPlayerPanel(mage.client.table.TournamentPlayerPanel) FastSearchUtil(mage.client.util.gui.FastSearchUtil) GameTypeView(mage.view.GameTypeView) SessionHandler(mage.client.SessionHandler) LimitedOptions(mage.game.tournament.LimitedOptions) SkillLevel(mage.constants.SkillLevel) TournamentTypeView(mage.view.TournamentTypeView) DeckFileFilter(mage.cards.decks.DeckFileFilter) Files(java.nio.file.Files) DeckImporter(mage.cards.decks.importer.DeckImporter) Deck(mage.cards.decks.Deck) ExpansionInfo(mage.cards.repository.ExpansionInfo) IOException(java.io.IOException) PlayerType(mage.players.PlayerType) Collectors(java.util.stream.Collectors) File(java.io.File) java.awt(java.awt) DraftOptions(mage.game.draft.DraftOptions) Paths(java.nio.file.Paths) TimingOption(mage.game.draft.DraftOptions.TimingOption) TournamentOptions(mage.game.tournament.TournamentOptions) GameException(mage.game.GameException) javax.swing(javax.swing) ExpansionRepository(mage.cards.repository.ExpansionRepository) MatchTimeLimit(mage.constants.MatchTimeLimit) TournamentPlayerPanel(mage.client.table.TournamentPlayerPanel)

Aggregations

TournamentPlayerPanel (mage.client.table.TournamentPlayerPanel)6 DraftOptions (mage.game.draft.DraftOptions)3 TournamentOptions (mage.game.tournament.TournamentOptions)3 TournamentTypeView (mage.view.TournamentTypeView)3 IOException (java.io.IOException)2 Deck (mage.cards.decks.Deck)2 ExpansionInfo (mage.cards.repository.ExpansionInfo)2 IgnoreList (mage.client.util.IgnoreList)2 GameException (mage.game.GameException)2 LimitedOptions (mage.game.tournament.LimitedOptions)2 java.awt (java.awt)1 File (java.io.File)1 Files (java.nio.file.Files)1 Paths (java.nio.file.Paths)1 java.util (java.util)1 Collectors (java.util.stream.Collectors)1 javax.swing (javax.swing)1 DeckFileFilter (mage.cards.decks.DeckFileFilter)1 DeckImporter (mage.cards.decks.importer.DeckImporter)1 ExpansionRepository (mage.cards.repository.ExpansionRepository)1