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>");
            }
        }
 public void GetLeagueByIndex(GetLeagueByIndexEvent e, Node any, [JoinAll] ICollection <LeagueNode> leagues)
 {
     foreach (LeagueNode node in SortedLeagues(leagues))
     {
         if (node.leagueConfig.LeagueIndex == e.index)
         {
             e.leagueEntity = node.Entity;
             break;
         }
     }
 }
예제 #3
0
 private void SetTooltip()
 {
     this.animator.SetBool("CurrentLeagueIsMax", this.topLeague);
     this.tooltip.IsMaxLeague = this.topLeague;
     if (this.topLeague)
     {
         this.tooltip.TipText = string.Format((string)this.youLeaguePointsText, Math.Truncate(this.points));
     }
     else
     {
         GetLeagueByIndexEvent eventInstance = new GetLeagueByIndexEvent(this.currentLeague.GetComponent <LeagueConfigComponent>().LeagueIndex + 1);
         base.ScheduleEvent(eventInstance, this.currentLeague);
         Entity leagueEntity = eventInstance.leagueEntity;
         this.tooltip.SetNextLeagueTooltipData(this.GetReputationToEnter(leagueEntity) - Math.Truncate(this.points), leagueEntity.GetComponent <LeagueIconComponent>().SpriteUid, leagueEntity.GetComponent <LeagueNameComponent>().Name, (int)this.delta, this.unfairMM);
     }
 }