Beispiel #1
0
        private void InitView()
        {
            if (this.player.PlayerID == Service.CurrentPlayer.PlayerId)
            {
                this.nameLabel.Text = Service.Lang.Get("LEADERBOARD_YOUR_NAME", new object[]
                {
                    this.player.PlayerName
                });
                this.arrowSprite.Visible = false;
                base.ToggleHighlight(true);
            }
            else
            {
                this.nameLabel.Text = Service.Lang.Get("LEADERBOARD_PLAYER_NAME", new object[]
                {
                    this.player.PlayerName
                });
                base.ToggleHighlight(false);
            }
            this.typeLabel.Text = this.player.SquadName;
            this.squadSymbolSprite.SpriteName = this.player.Symbol;
            this.rankLabel.Text                  = this.player.Rank.ToString();
            this.memberNumberLabel.Visible       = false;
            this.activeMemberNumberLabel.Visible = false;
            this.squadLevelGroup.Visible         = false;
            LeaderboardBattleHistory leaderboardBattleHistory = null;

            this.InitButtons(this.id);
            this.InitPlanetStats(this.id);
            this.InitBattleStats(this.id, out leaderboardBattleHistory);
            int rating = (leaderboardBattleHistory == null) ? 0 : GameUtils.CalculateBattleHistoryVictoryRating(leaderboardBattleHistory);

            this.InitIcons(this.id, this.player.Faction, rating);
            this.InitFacebookData();
        }
Beispiel #2
0
        private void InitBattleStats(string id, out LeaderboardBattleHistory battleHistory)
        {
            battleHistory = null;
            bool flag = this.tab == SocialTabs.Tournament;

            this.medalGroup.Visible           = !flag;
            this.tournamentMedalGroup.Visible = flag;
            if (flag)
            {
                if (!string.IsNullOrEmpty(this.planetUid))
                {
                    this.tournamentMedalLabel.Text        = Service.Lang.ThousandsSeparated(this.player.BattleScore);
                    this.tournamentMedalSprite.SpriteName = GameUtils.GetTournamentPointIconName(this.planetUid);
                }
                else
                {
                    this.tournamentMedalGroup.Visible = false;
                }
                if (this.player.TournamentBattleHistory != null && !string.IsNullOrEmpty(this.planetUid))
                {
                    TournamentVO activeTournamentOnPlanet = TournamentController.GetActiveTournamentOnPlanet(this.planetUid);
                    if (activeTournamentOnPlanet != null)
                    {
                        this.player.TournamentBattleHistory.TryGetValue(activeTournamentOnPlanet.Uid, out battleHistory);
                    }
                }
            }
            else
            {
                this.medalLabel.Text = Service.Lang.ThousandsSeparated(this.player.BattleScore);
                battleHistory        = this.player.BattleHistory;
            }
            int num  = (battleHistory == null) ? 0 : battleHistory.AttacksWon;
            int num2 = (battleHistory == null) ? 0 : battleHistory.DefensesWon;

            this.attacksLabel.Text = Service.Lang.Get("ATTACKS_WON", new object[]
            {
                num
            });
            this.defensesLabel.Text = Service.Lang.Get("DEFENSES_WON", new object[]
            {
                num2
            });
        }