// Token: 0x060025AA RID: 9642 RVA: 0x000A3E44 File Offset: 0x000A2044
 public static void RemoveTooltip(MPEventSystem eventSystem, TooltipProvider tooltipProvider)
 {
     if (eventSystem.currentTooltipProvider == tooltipProvider)
     {
         TooltipController.SetTooltip(eventSystem, null, Vector3.zero);
     }
 }
Пример #2
0
        // Token: 0x060021A8 RID: 8616 RVA: 0x0009E640 File Offset: 0x0009C840
        public void SetDisplayData(GameEndReportPanelController.DisplayData newDisplayData)
        {
            if (this.displayData.Equals(newDisplayData))
            {
                return;
            }
            this.displayData = newDisplayData;
            if (this.resultLabel)
            {
                GameResultType gameResultType = GameResultType.Unknown;
                if (this.displayData.runReport != null)
                {
                    gameResultType = this.displayData.runReport.gameResultType;
                }
                string token;
                if (gameResultType != GameResultType.Lost)
                {
                    if (gameResultType != GameResultType.Won)
                    {
                        token = "GAME_RESULT_UNKNOWN";
                    }
                    else
                    {
                        token = "GAME_RESULT_WON";
                    }
                }
                else
                {
                    token = "GAME_RESULT_LOST";
                }
                this.resultLabel.text = Language.GetString(token);
            }
            RunReport runReport = this.displayData.runReport;

            RunReport.PlayerInfo playerInfo = (runReport != null) ? runReport.GetPlayerInfoSafe(this.displayData.playerIndex) : null;
            this.SetPlayerInfo(playerInfo);
            RunReport runReport2 = this.displayData.runReport;
            int       num        = (runReport2 != null) ? runReport2.playerInfoCount : 0;

            this.playerNavigationController.gameObject.SetActive(num > 1);
            this.playerNavigationController.SetDisplayData(new CarouselNavigationController.DisplayData(num, this.displayData.playerIndex));
            ReadOnlyCollection <MPButton> elements = this.playerNavigationController.buttonAllocator.elements;

            for (int i = 0; i < elements.Count; i++)
            {
                MPButton             mpbutton                = elements[i];
                RunReport.PlayerInfo playerInfo2             = this.displayData.runReport.GetPlayerInfo(i);
                CharacterBody        bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(playerInfo2.bodyIndex);
                Texture texture = bodyPrefabBodyComponent ? bodyPrefabBodyComponent.portraitIcon : null;
                mpbutton.GetComponentInChildren <RawImage>().texture = texture;
                mpbutton.GetComponent <TooltipProvider>().SetContent(TooltipProvider.GetPlayerNameTooltipContent(playerInfo2.name));
            }
            this.selectedPlayerEffectRoot.transform.SetParent(this.playerNavigationController.buttonAllocator.elements[this.displayData.playerIndex].transform);
            this.selectedPlayerEffectRoot.gameObject.SetActive(false);
            this.selectedPlayerEffectRoot.gameObject.SetActive(true);
            this.selectedPlayerEffectRoot.offsetMin  = Vector2.zero;
            this.selectedPlayerEffectRoot.offsetMax  = Vector2.zero;
            this.selectedPlayerEffectRoot.localScale = Vector3.one;
        }
 // Token: 0x060025A4 RID: 9636 RVA: 0x000A3CD0 File Offset: 0x000A1ED0
 private void SetTooltipProvider(TooltipProvider provider)
 {
     this.titleLabel.text           = provider.titleText;
     this.titleLabel.richText       = !provider.disableTitleRichText;
     this.bodyLabel.text            = provider.bodyText;
     this.bodyLabel.richText        = !provider.disableBodyRichText;
     this.colorHighlightImage.color = provider.titleColor;
 }
 // Token: 0x060025A9 RID: 9641 RVA: 0x000A3DF0 File Offset: 0x000A1FF0
 public static void RemoveTooltip(TooltipProvider tooltipProvider)
 {
     if (tooltipProvider.userCount > 0)
     {
         foreach (MPEventSystem eventSystem in MPEventSystem.readOnlyInstancesList)
         {
             TooltipController.RemoveTooltip(eventSystem, tooltipProvider);
         }
     }
 }
 // Token: 0x060025AB RID: 9643 RVA: 0x000A3E68 File Offset: 0x000A2068
 public static void SetTooltip(MPEventSystem eventSystem, TooltipProvider newTooltipProvider, Vector2 tooltipPosition)
 {
     if (eventSystem.currentTooltipProvider != newTooltipProvider)
     {
         if (eventSystem.currentTooltip)
         {
             UnityEngine.Object.Destroy(eventSystem.currentTooltip.gameObject);
             eventSystem.currentTooltip = null;
         }
         if (eventSystem.currentTooltipProvider)
         {
             eventSystem.currentTooltipProvider.userCount--;
         }
         eventSystem.currentTooltipProvider = newTooltipProvider;
         if (newTooltipProvider)
         {
             newTooltipProvider.userCount++;
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/Tooltip"));
             eventSystem.currentTooltip          = gameObject.GetComponent <TooltipController>();
             eventSystem.currentTooltip.owner    = eventSystem;
             eventSystem.currentTooltip.uiCamera = TooltipController.FindUICamera(eventSystem);
             eventSystem.currentTooltip.SetTooltipProvider(eventSystem.currentTooltipProvider);
             Canvas   component = gameObject.GetComponent <Canvas>();
             UICamera uicamera  = eventSystem.currentTooltip.uiCamera;
             component.worldCamera = ((uicamera != null) ? uicamera.camera : null);
         }
     }
     if (eventSystem.currentTooltip)
     {
         Vector2  zero      = Vector2.zero;
         UICamera uicamera2 = eventSystem.currentTooltip.uiCamera;
         Camera   camera    = Camera.main;
         if (uicamera2)
         {
             camera = uicamera2.camera;
         }
         if (camera)
         {
             Vector3 vector = camera.ScreenToViewportPoint(new Vector3(tooltipPosition.x, tooltipPosition.y, 0f));
             zero = new Vector2(vector.x, vector.y);
         }
         Vector2 vector2 = new Vector2(0f, 0f);
         vector2.x = ((zero.x > 0.5f) ? 1f : 0f);
         vector2.y = ((zero.y > 0.5f) ? 1f : 0f);
         eventSystem.currentTooltip.tooltipFlipTransform.anchorMin = vector2;
         eventSystem.currentTooltip.tooltipFlipTransform.anchorMax = vector2;
         eventSystem.currentTooltip.tooltipFlipTransform.pivot     = vector2;
     }
 }
Пример #6
0
        // Token: 0x0600245A RID: 9306 RVA: 0x000AA828 File Offset: 0x000A8A28
        public void UpdateElements()
        {
            int num = 0;

            if (this.voteController)
            {
                num = this.voteController.GetVoteCount();
            }
            this.AllocateIndicators(num);
            for (int i = 0; i < num; i++)
            {
                VoteController.UserVote vote = this.voteController.GetVote(i);
                this.indicators[i].image.sprite = (vote.receivedVote ? this.hasVotedSprite : this.hasNotVotedSprite);
                string userName;
                if (vote.networkUserObject)
                {
                    NetworkUser component = vote.networkUserObject.GetComponent <NetworkUser>();
                    if (component)
                    {
                        userName = component.GetNetworkPlayerName().GetResolvedName();
                    }
                    else
                    {
                        userName = Language.GetString("PLAYER_NAME_UNAVAILABLE");
                    }
                }
                else
                {
                    userName = Language.GetString("PLAYER_NAME_DISCONNECTED");
                }
                this.indicators[i].tooltipProvider.SetContent(TooltipProvider.GetPlayerNameTooltipContent(userName));
            }
            bool flag = this.voteController && this.voteController.timerStartCondition != VoteController.TimerStartCondition.Never;

            this.timerPanelObject.SetActive(flag);
            if (flag)
            {
                float num2 = this.voteController.timer;
                if (num2 < 0f)
                {
                    num2 = 0f;
                }
                int num3 = Mathf.FloorToInt(num2 * 0.016666668f);
                int num4 = (int)num2 - num3 * 60;
                this.timerLabel.text = string.Format("{0}:{1:00}", num3, num4);
            }
        }