Пример #1
0
        public Host()
        {
            InitializeComponent();

            TimeLimit.SelectedItem = Program.Config.chtTimeLimit;
            BanList.SelectedItem   = Program.Config.chtBanList;
            Mode.SelectedItem      = Program.Config.chtMode;
            GameName = LauncherHelper.GenerateString().Substring(0, 5);
            CardRules.SelectedItem = Program.Config.chtCardRules;
            Priority.Checked       = Program.Config.chtEnablePrority;
            ShuffleDeck.Checked    = Program.Config.chtDisableShuffleDeck;
            CheckDeck.Checked      = Program.Config.chtDisableCheckDeck;
            BanList.Items.AddRange(LauncherHelper.GetBanListArray());
            if (BanList.Items.Count > 0)
            {
                if (BanList.Items.Contains(Program.Config.chtBanList))
                {
                    BanList.SelectedItem = Program.Config.chtBanList;
                }
            }

            Mode.SelectedIndexChanged += DuelModeChanged;

            ApplyTranslation();
        }
Пример #2
0
        public HubGameList_frm()
        {
            InitializeComponent();
            TopLevel = false;
            Dock     = DockStyle.Fill;
            Visible  = true;

            Format.SelectedIndex    = 0;
            GameType.SelectedIndex  = 0;
            BanList.SelectedIndex   = 0;
            TimeLimit.SelectedIndex = 0;

            BanList.Items.AddRange(LauncherHelper.GetBanListArray());

            Program.ChatServer.AddRooms          += OnRoomsList;
            Program.ChatServer.CreateRoom        += OnRoomCreate;
            Program.ChatServer.RemoveRoom        += OnRoomRemoved;
            Program.ChatServer.UpdateRoomStatus  += OnRoomStarted;
            Program.ChatServer.UpdateRoomPlayers += OnRoomPlayersUpdate;
            Program.ChatServer.AddGameServer     += AddServer;
            Program.ChatServer.RemoveGameServer  += RemoveServer;
            RankedList.DrawItem      += GameListBox_DrawItem;
            UnrankedList.DrawItem    += GameListBox_DrawItem;
            UnrankedList.DoubleClick += LoadRoom;
            RankedList.DoubleClick   += LoadRoom;

            SearchReset.Tick         += ResetSearch;
            GameListUpdateTimer.Tick += UpdateGameListTimer;

            RefreshDeckList();
            LauncherHelper.DeckEditClosed   += RefreshDeckList;
            DeckSelect.SelectedIndexChanged += DeckSelect_SelectedValueChanged;

            ApplyTranslation();
        }
Пример #3
0
        public Host(bool options, bool isranked)
        {
            InitializeComponent();
            if (options)
            {
                TimeLimit.SelectedItem = Program.Config.TimeLimit;
                BanList.SelectedItem   = Program.Config.BanList;
                Mode.SelectedItem      = Program.Config.Mode;
                GameName = LauncherHelper.GenerateString().Substring(0, 5);
                CardRules.SelectedItem = Program.Config.CardRules;
                Priority.Checked       = Program.Config.EnablePrority;
                ShuffleDeck.Checked    = Program.Config.DisableShuffleDeck;
                CheckDeck.Checked      = Program.Config.DisableCheckDeck;
// ReSharper disable CoVariantArrayConversion
                BanList.Items.AddRange(LauncherHelper.GetBanListArray());
// ReSharper restore CoVariantArrayConversion
                BanList.SelectedItem = Program.Config.BanList;
                if (BanList.SelectedItem == null && BanList.Items.Count > 0)
                {
                    BanList.SelectedIndex = 0;
                }
            }
            else
            {
                TimeLimit.SelectedIndex = 0;
                CardRules.SelectedIndex = 0;
                Mode.SelectedIndex      = 0;
                GameName = LauncherHelper.GenerateString().Substring(0, 5);
// ReSharper disable CoVariantArrayConversion
                BanList.Items.AddRange(LauncherHelper.GetBanListArray());
// ReSharper restore CoVariantArrayConversion
                if (BanList.Items.Count > 0)
                {
                    BanList.SelectedIndex = 0;
                }
            }
            Mode.SelectedIndexChanged += DuelModeChanged;
            if (!isranked)
            {
                CardRules.SelectedIndexChanged += CardRulesChanged;
            }
            ApplyTranslation();
        }
Пример #4
0
        public Host(bool isranked)
        {
            InitializeComponent();
            ApplyTranslation();

            TimeLimit.SelectedItem = Program.Config.TimeLimit;
            BanList.SelectedItem   = Program.Config.BanList;
            Mode.SelectedItem      = Program.Config.Mode;
            GameName = LauncherHelper.GenerateString().Substring(0, 5);
            CardRules.SelectedItem = Program.Config.CardRules;
            Prerelease.Checked     = Program.Config.EnablePrerelease;
            Priority.Checked       = Program.Config.EnablePrority;
            ShuffleDeck.Checked    = Program.Config.DisableShuffleDeck;
            CheckDeck.Checked      = Program.Config.DisableCheckDeck;
            BanList.Items.AddRange(LauncherHelper.GetBanListArray());
            BanList.SelectedItem = Program.Config.BanList;
            if (BanList.SelectedItem == null && BanList.Items.Count > 0)
            {
                BanList.SelectedIndex = 0;
            }

            Mode.SelectedIndexChanged += DuelModeChanged;

            LifePoints.Text = (Mode.SelectedItem.ToString() == "Tag") ? "16000" : "8000";
            if (isranked)
            {
                Prerelease.Enabled    = false;
                BanList.Enabled       = false;
                Priority.Enabled      = false;
                ShuffleDeck.Enabled   = false;
                CheckDeck.Enabled     = false;
                LifePoints.Enabled    = false;
                TimeLimit.Enabled     = false;
                PasswordInput.Enabled = false;
            }
            //CardRules.SelectedIndexChanged += CardRulesChanged;
        }