Пример #1
0
        public mnuTournamentListing(string name, TournamentListing[] listings, Enums.TournamentListingMode mode)
            : base(name)
        {
            this.listings = listings;
            this.mode = mode;

            base.Size = new Size(315, 360);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location = new Point(10, 40);

            itemPicker = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 63);

            lblJoinTournament = new Label("lblJoinTournament");
            lblJoinTournament.AutoSize = true;
            lblJoinTournament.Font = FontManager.LoadFont("PMDCP", 48);
            if (mode == Enums.TournamentListingMode.Join) {
                lblJoinTournament.Text = "Join A Tournament";
            } else if (mode == Enums.TournamentListingMode.Spectate) {
                lblJoinTournament.Text = "Spectate In A Tournament";
            }
            lblJoinTournament.ForeColor = Color.WhiteSmoke;
            lblJoinTournament.Location = new Point(20, 0);

            lblItemNum = new Label("lblItemNum");
            //lblItemNum.Size = new Size(100, 30);
            lblItemNum.AutoSize = true;
            lblItemNum.Location = new Point(182, 15);
            lblItemNum.Font = FontManager.LoadFont("PMDCP", 32);
            lblItemNum.BackColor = Color.Transparent;
            lblItemNum.ForeColor = Color.WhiteSmoke;
            lblItemNum.Text = "";//"0/" + ((MaxInfo.MaxInv - 1) / 10 + 1);

            lblActiveTournaments = new Label[10];
            for (int i = 0; i < lblActiveTournaments.Length; i++) {
                lblActiveTournaments[i] = new Label("lblActiveTournaments" + i);
                //lblVisibleItems[i].AutoSize = true;
                //lblVisibleItems[i].Size = new Size(200, 32);
                lblActiveTournaments[i].Width = 200;
                lblActiveTournaments[i].Font = FontManager.LoadFont("PMDCP", 32);
                lblActiveTournaments[i].Location = new Point(35, (i * 30) + 48);
                //lblVisibleItems[i].HoverColor = Color.Red;
                lblActiveTournaments[i].ForeColor = Color.WhiteSmoke;
                lblActiveTournaments[i].Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblActiveTournament_Click);
                this.AddWidget(lblActiveTournaments[i]);
            }

            this.AddWidget(itemPicker);
            this.AddWidget(lblJoinTournament);
            this.AddWidget(lblItemNum);

            currentTen = 0;
            DisplayItems(currentTen * 10);
            ChangeSelected(0 % 10);
        }
        public mnuTournamentListingSelected(string name, TournamentListing selectedListing, Enums.TournamentListingMode mode)
            : base(name)
        {
            this.selectedListing = selectedListing;
            this.mode = mode;

            base.Size = new Size(185, 125);

            base.MenuDirection = Enums.MenuDirection.Horizontal;
            base.Location = new Point(335, 40);

            itemPicker = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 23);

            lblJoin = new Label("lblJoin");
            lblJoin.Font = FontManager.LoadFont("PMDCP", 32);
            lblJoin.AutoSize = true;
            if (mode == Enums.TournamentListingMode.Join) {
                lblJoin.Text = "Join";
            } else if (mode == Enums.TournamentListingMode.Spectate) {
                lblJoin.Text = "Spectate";
            }
            lblJoin.Location = new Point(30, 8);
            lblJoin.HoverColor = Color.Red;
            lblJoin.ForeColor = Color.WhiteSmoke;
            lblJoin.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblJoin_Click);

            lblViewRules = new Label("lblViewRules");
            lblViewRules.Font = FontManager.LoadFont("PMDCP", 32);
            lblViewRules.AutoSize = true;
            lblViewRules.Text = "View Rules";
            lblViewRules.Location = new Point(30, 58);
            lblViewRules.HoverColor = Color.Red;
            lblViewRules.ForeColor = Color.WhiteSmoke;
            lblViewRules.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblViewRules_Click);

            this.AddWidget(itemPicker);
            this.AddWidget(lblJoin);
            this.AddWidget(lblViewRules);
        }