private void FillInfo(LeagueTitleUIComponent selectedLeague)
        {
            bool flag = selectedLeague.LeagueEntity.Equals(this.userLeague);

            this.currentLeagueTitle.color = !flag ? Color.clear : Color.white;
            string nameAccusative = string.Empty;
            double d           = 0.0;
            int    leagueIndex = selectedLeague.LeagueEntity.GetComponent <LeagueConfigComponent>().LeagueIndex;
            GetLeagueByIndexEvent eventInstance = new GetLeagueByIndexEvent(leagueIndex + 1);

            base.ScheduleEvent(eventInstance, selectedLeague.LeagueEntity);
            Entity leagueEntity = eventInstance.leagueEntity;

            if (leagueEntity != null)
            {
                nameAccusative = leagueEntity.GetComponent <LeagueNameComponent>().NameAccusative;
                d = this.GetReputationToEnter(leagueEntity);
            }
            if (flag)
            {
                this.leaguePoints.text = !leagueIndex.Equals((int)(this.leaguesCount - 1)) ? string.Format(this.leaguePointsCurrent.Value, "<color=white><b>" + Math.Truncate(this.currentUserReputation), Math.Truncate(d) + "</b></color>", nameAccusative + " " + this.leagueAccusative.Value) : (string.Format(this.leaguePointsCurrentMax.Value, this.ToBoldText(Math.Truncate(this.currentUserReputation).ToString())) + "\n" + string.Format(this.leaguePlaceCurrentMax.Value, this.ToBoldText(this.PlaceInTopLeague.ToString())));
            }
            else
            {
                double a = this.GetReputationToEnter(selectedLeague.LeagueEntity) - this.currentUserReputation;
                this.leaguePoints.text = (a <= 0.0) ? string.Empty : string.Format(this.leaguePointsNotCurrent.Value, "<color=white><b>" + Math.Ceiling(a) + "</b></color>");
            }
        }
 private void LeagueSelected(LeagueTitleUIComponent selectedLeague)
 {
     this.FillInfo(selectedLeague);
     this.FillLeagueChest(selectedLeague);
     this.FillSeasonReward(selectedLeague);
     this.FillTooltip(selectedLeague);
 }
        private void FillLeagueChest(LeagueTitleUIComponent selectedLeague)
        {
            this.leagueChestList.Clear();
            long chestId = selectedLeague.LeagueEntity.GetComponent <ChestBattleRewardComponent>().ChestId;

            this.AddItemToList(chestId, 1, this.leagueChestList);
        }
        private void FillTooltip(LeagueTitleUIComponent selectedLeague)
        {
            string str = string.Format(this.chestTooltipLocalization.Value, this.chestScoreLimit);

            if (this.userLeague.GetComponent <LeagueConfigComponent>().LeagueIndex < 3)
            {
                str = str + this.chestTooltipLowLeagueLocalization.Value;
            }
            this.chestTooltip.TipText = str;
        }
        private LeagueTitleUIComponent GetNewLeagueTitleLayout(Entity entity)
        {
            LeagueTitleUIComponent component = Instantiate <LeagueTitleUIComponent>(this.leagueTitlePrefab);

            component.transform.SetParent(this.scrollContent, false);
            component.gameObject.SetActive(true);
            component.Name = entity.GetComponent <LeagueNameComponent>().Name + " " + this.leagueLocalizedField.Value;
            component.Icon = entity.GetComponent <LeagueIconComponent>().SpriteUid;
            return(component);
        }
        private void FillSeasonReward(LeagueTitleUIComponent selectedLeague)
        {
            this.seasonRewardList.Clear();
            bool flag  = false;
            bool flag2 = false;

            if (!selectedLeague.LeagueEntity.HasComponent <CurrentSeasonRewardForClientComponent>())
            {
                Debug.LogWarning("League doesn't have reward!");
            }
            else
            {
                List <EndSeasonRewardItem> rewards = selectedLeague.LeagueEntity.GetComponent <CurrentSeasonRewardForClientComponent>().Rewards;
                if (rewards.Count <= 0)
                {
                    Debug.LogWarning("End season rewards is empty");
                }
                else
                {
                    if (this.selectedBar > (rewards.Count - 1))
                    {
                        this.selectedBar = 0;
                        this.SetRadioButton(0);
                    }
                    flag2 = rewards.Count > 1;
                    List <DroppedItem> items = rewards[this.selectedBar].Items;
                    if (items != null)
                    {
                        flag = items.Count > 0;
                        foreach (DroppedItem item in items)
                        {
                            this.AddItemToList(item, this.seasonRewardList);
                        }
                    }
                }
                this.seasonRewardsTitleLayout.SetActive(flag);
                this.tabsPanel.SetActive(flag2);
            }
        }