Exemplo n.º 1
0
        // UI -----------------------------------------------------------------------------------------------
        #region UI

        private async Task ChangePlayerInfo(EFilter_Game newGame, EFilter_Mode newMode, EFilter_PlayerType newPlayerType, string newPlayerValue)
        {
            if (newGame == game && newMode == mode && newPlayerValue == playerValue)
            {
                return;
            }

            var playerInfoDatum = await playerViewModel.GetPlayerInfo(newGame, newMode, newPlayerType, newPlayerValue);

            playerInfoData = playerInfoDatum?.data;
            if (playerInfoData is null || playerInfoData.basicInfo is null)
            {
                await DisplayAlert("Could not find player profile!", "Invalid SteamID or rank.", "OK");

                return;
            }

            playerType    = newPlayerType;
            playerValue   = newPlayerValue;
            game          = newGame;
            mode          = newMode;
            playerSteamId = playerInfoData.basicInfo.steamID;
            playerRank    = playerInfoData.SurfRank;

            string playerName = playerInfoData.basicInfo.name;

            if (playerName.Length > 18)
            {
                playerName = playerName.Substring(0, 13) + "...";
            }
            Title = playerName + " [" + EFilter_ToString.toString2(game) + ", " + EFilter_ToString.toString(mode) + "]";

            var PlayerSteamDatum = await playerViewModel.GetPlayerSteamProfile(playerSteamId);

            playerSteamProfile = PlayerSteamDatum?.response.players[0];

            wrsType = EFilter_PlayerWRsType.none;
            LayoutPlayerInfo();
            LayoutPlayerProfile();
        }