Ejemplo n.º 1
0
        internal static async void UpdateLeaderboardData()
        {
            if (_config.isLeaderboardActivated)
            {
                if (InBgMenu())
                {
                    if (!String.IsNullOrEmpty(_config.leaderboardName))
                    {
                        switch (Core.Game.CurrentRegion)
                        {
                        case Region.ASIA:
                        {
                            _overlay.tbLeaderboard.Content = "AS-Leaderboard:";
                            (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("AP", _config.leaderboardName);

                            break;
                        }

                        case (Region.US):
                        {
                            _overlay.tbLeaderboard.Content = "NA-Leaderboard:";
                            (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("US", _config.leaderboardName);

                            break;
                        }

                        case (Region.EU):
                        {
                            _overlay.tbLeaderboard.Content = "EU-Leaderboard:";
                            (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("EU", _config.leaderboardName);

                            break;
                        }
                        }
                        if (!String.IsNullOrEmpty(_rating.ToString()) && _rating == 0)
                        {
                            var neededMMRForLeaderboard = _leaderboardRatingNextRank - _ratingStart;
                            _overlay.tbLeaderboardRatingDifference.Content = neededMMRForLeaderboard;
                        }
                        _overlay.tbLeaderboardRank.Content = _leaderBoardRank;
                    }
                }
                if (InGameplayMode() && InBgMode())
                {
                    switch (Core.Game.CurrentRegion)
                    {
                    case Region.ASIA:
                    {
                        _overlay.tbLeaderboard.Content = "AS-Leaderboard:";
                        (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("AP", _config.leaderboardName);

                        break;
                    }

                    case (Region.US):
                    {
                        _overlay.tbLeaderboard.Content = "NA-Leaderboard:";
                        (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("US", _config.leaderboardName);

                        break;
                    }

                    case (Region.EU):
                    {
                        _overlay.tbLeaderboard.Content = "EU-Leaderboard:";
                        (_leaderBoardRank, _leaderboardRatingNextRank) = await Leaderboard.GetLeaderboard("EU", _config.leaderboardName);

                        break;
                    }
                    }

                    if (!String.IsNullOrEmpty(_rating.ToString()) && _rating > 0)
                    {
                        var neededMMRForLeaderboard = _leaderboardRatingNextRank - _rating;
                        _overlay.tbLeaderboardRatingDifference.Content = neededMMRForLeaderboard;
                    }
                }
            }
        }