Example #1
0
    void DrawRightPane(bool bLayoutUpdate, bool bRepaintUpdate)
    {
        Rect AreaRect = new Rect(Screen.width / 2 + 20, 130, Screen.width / 2 - 40, Screen.height - 150 - 50);

        GUILayout.BeginArea(AreaRect);
        ParsedScrollPos = GUILayout.BeginScrollView(ParsedScrollPos);
        //ParseTeamsText = GUILayout.TextArea(ParseTeamsText);
        GUILayout.BeginVertical();
        for (int PoolIndex = 0; PoolIndex < AllPools.Count; ++PoolIndex)
        {
            GUILayout.BeginVertical();
            PoolData PData = AllPools[PoolIndex].Data;
            GUILayout.Label("Pool " + PData.PoolName + ":");
            for (int TeamIndex = 0; TeamIndex < PData.Teams.Count; ++TeamIndex)
            {
                TeamData TData      = PData.Teams[TeamIndex].Data;
                GUIStyle LabelStyle = new GUIStyle();
                if (AllPools[PoolIndex].Data.Teams[TeamIndex].bClickedOn)
                {
                    LabelStyle.normal.textColor = Color.grey;
                }
                else
                {
                    LabelStyle.normal.textColor = Color.white;
                }

                if (DivisionCombo.IsPicking || RoundCombo.IsPicking)
                {
                }
                else
                {
                    string TeamStr = (TeamIndex + 1) + ". " + TData.PlayerNames + " : " +
                                     (TData.ContainsJudgeScores() ? TData.RoutineScores.GetTotalPoints() : TData.TotalRankPoints);
                    bool bTeamClicked = GUILayout.RepeatButton(TeamStr, LabelStyle);
                    AllPools[PoolIndex].Data.Teams[TeamIndex].bClickedOn |= !bLayoutUpdate ? bTeamClicked : AllPools[PoolIndex].Data.Teams[TeamIndex].bClickedOn;
                    if (bTeamClicked)
                    {
                        MovingTeam = PData.Teams[TeamIndex];
                    }
                }
            }
            GUILayout.EndVertical();

            if (bRepaintUpdate)
            {
                AllPools[PoolIndex].DisplayRect    = GUILayoutUtility.GetLastRect();
                AllPools[PoolIndex].DisplayRect.x += AreaRect.x;
                AllPools[PoolIndex].DisplayRect.y += AreaRect.y;
            }
        }

        GUILayout.EndVertical();
        GUILayout.EndScrollView();
        GUILayout.EndArea();
    }