예제 #1
0
    public void SetMatchDetails(Current details)
    {
        if (details.teams.Count == 2)
        {
            Team t1 = details.teams[0];
            Team t2 = details.teams[1];
            matchDetails       = details;
            team1.text         = t1.name;
            team2.text         = t2.name;
            team1Score.text    = t1.score.ToString();
            team2Score.text    = t2.score.ToString();
            team1Info.text     = $"({t1.rating}) {t1.coach} TV {t1.tv / 1000}k {t1.race}";
            team2Info.text     = $"{t2.race} TV {t2.tv / 1000}k {t2.coach} ({t2.rating})";
            turnIndicator.text = $"h{details.half}t{details.turn}";

            float progress = (float)((((float)details.half - 1) * 8) + (float)details.turn) / 16f;
            progressBar.fillAmount = progress;

            FumbblApi.GetImage(t1.logo, team1Image);
            FumbblApi.GetImage(t2.logo, team2Image);
        }
        else
        {
            Debug.LogError("Invalid number of teams found when parsing match details");
        }
    }
예제 #2
0
    public void SetMatchDetails(Current details, System.Collections.Generic.HashSet <string> friends)
    {
        if (details.teams.Count == 2)
        {
            Team t1 = details.teams[0];
            Team t2 = details.teams[1];
            matchDetails = details;
            team1.text   = t1.name;
            team2.text   = t2.name;

            var coach1 = TextPanelHandler.SanitizeText(t1.coach);
            var coach2 = TextPanelHandler.SanitizeText(t2.coach);

            if (friends.Contains(t1.coach))
            {
                coach1 = $"<#00F324>{coach1}</color>";
            }
            if (friends.Contains(t2.coach))
            {
                coach2 = $"<#00F324>{coach2}</color>";
            }

            team1Score.text    = t1.score.ToString();
            team2Score.text    = t2.score.ToString();
            team1Info.text     = $"({t1.rating}) {coach1} TV {t1.tv / 1000}k {t1.race}";
            team2Info.text     = $"{t2.race} TV {t2.tv / 1000}k {coach2} ({t2.rating})";
            turnIndicator.text = $"h{details.half}t{details.turn}";

            float progress = (float)((((float)details.half - 1) * 8) + (float)details.turn) / 16f;
            progressBar.fillAmount = progress;

            FumbblApi.GetImage(t1.logolarge, team1Image);
            FumbblApi.GetImage(t2.logolarge, team2Image);
        }
        else
        {
            LogManager.Error("Invalid number of teams found when parsing match details");
        }
    }