Example #1
0
        private void _BuildPlayerTable()
        {
            _PlayerTableScrollArea = new SRectF {
                X = _Texts[_TextPosition].X, Y = _Texts[_TextPosition].Y, W = _Texts[_TextGamePoints].X - _Texts[_TextPosition].X
            };

            _PlayerTable = new List <STableRow>();
            float delta = _Texts[_TextPosition].Rect.H * 1.2f;

            float h = 0;

            for (int i = 0; i < 10; i++)
            {
                var row = new STableRow
                {
                    Pos        = GetNewText(_Texts[_TextPosition]),
                    Name       = GetNewText(_Texts[_TextPlayerName]),
                    Rounds     = GetNewText(_Texts[_TextNumPlayed]),
                    Won        = GetNewText(_Texts[_TextWon]),
                    SingPoints = GetNewText(_Texts[_TextSingPoints]),
                    GamePoints = GetNewText(_Texts[_TextGamePoints])
                };

                row.Pos.Y        += delta * (i + 1);
                row.Name.Y       += delta * (i + 1);
                row.Rounds.Y     += delta * (i + 1);
                row.Won.Y        += delta * (i + 1);
                row.SingPoints.Y += delta * (i + 1);
                row.GamePoints.Y += delta * (i + 1);

                row.Pos.Text = (i + 1) + ".";

                row.Pos.Visible        = false;
                row.Name.Visible       = false;
                row.Rounds.Visible     = false;
                row.Won.Visible        = false;
                row.SingPoints.Visible = false;
                row.GamePoints.Visible = false;

                _AddText(row.Pos);
                _AddText(row.Name);
                _AddText(row.Rounds);
                _AddText(row.Won);
                _AddText(row.SingPoints);
                _AddText(row.GamePoints);

                _PlayerTable.Add(row);

                h = delta * (i + 1);
            }
            _PlayerTableScrollArea.H = h + delta;
        }
Example #2
0
        private void _UpdatePlayerTable()
        {
            for (int i = 0; i < _PlayerTable.Count; i++)
            {
                STableRow row = _PlayerTable[i];

                if (i + _PlayerTableOffset < _PartyMode.GameData.ResultTable.Count)
                {
                    row.Pos.Visible        = true;
                    row.Name.Visible       = true;
                    row.Rounds.Visible     = true;
                    row.Won.Visible        = true;
                    row.SingPoints.Visible = true;
                    row.GamePoints.Visible = true;

                    row.Pos.Text        = _PartyMode.GameData.ResultTable[i + _PlayerTableOffset].Position + ".";
                    row.Name.Text       = CBase.Profiles.GetPlayerName(_PartyMode.GameData.ResultTable[i + _PlayerTableOffset].PlayerID);
                    row.Rounds.Text     = _PartyMode.GameData.ResultTable[i + _PlayerTableOffset].NumPlayed.ToString();
                    row.Won.Text        = _PartyMode.GameData.ResultTable[i + _PlayerTableOffset].NumWon.ToString();
                    row.SingPoints.Text = _PartyMode.GameData.ResultTable[i + _PlayerTableOffset].NumSingPoints.ToString();
                    row.GamePoints.Text = _PartyMode.GameData.ResultTable[i + _PlayerTableOffset].NumGamePoints.ToString();
                }
                else
                {
                    row.Pos.Visible        = false;
                    row.Name.Visible       = false;
                    row.Rounds.Visible     = false;
                    row.Won.Visible        = false;
                    row.SingPoints.Visible = false;
                    row.GamePoints.Visible = false;
                }
            }

            _Buttons[_ButtonPlayerScrollUp].Visible   = _PlayerTableOffset > 0;
            _Buttons[_ButtonPlayerScrollDown].Visible = _PartyMode.GameData.ProfileIDs.Count - _NumPlayerVisible - _PlayerTableOffset > 0;
        }