< Summary

Class:DCL.Tutorial.TutorialStep_Tooltip_UsersAround
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Tooltip_UsersAround.cs
Covered lines:13
Uncovered lines:3
Coverable lines:16
Total lines:59
Line coverage:81.2% (13 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%4.254075%
OnStepFinished()0%4.134080%
SetTooltipPosition()0%5.395075%
UsersAroundListHud_OnOpen()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Tooltip_UsersAround.cs

#LineLine coverage
 1using DCL.Helpers;
 2using UnityEngine;
 3
 4namespace DCL.Tutorial
 5{
 6    /// <summary>
 7    /// Class that represents the onboarding tutorial step related to how to view the players in scene and configure voi
 8    /// </summary>
 9    public class TutorialStep_Tooltip_UsersAround : TutorialStep_Tooltip
 10    {
 11        private const string PLAYER_PREFS_VOICE_CHAT_FEATURE_SHOWED = "VoiceChatFeatureShowed";
 12
 13        public override void OnStepStart()
 14        {
 115            base.OnStepStart();
 16
 117            if (tutorialController != null &&
 18                tutorialController.hudController != null &&
 19                tutorialController.hudController.usersAroundListHud != null)
 20            {
 021                tutorialController.hudController.usersAroundListHud.OnOpen += UsersAroundListHud_OnOpen;
 22            }
 123        }
 24
 25        public override void OnStepFinished()
 26        {
 127            base.OnStepFinished();
 28
 29            // TODO (Santi): This a TEMPORAL fix. It will be removed when we refactorize the tutorial system in order to
 130            PlayerPrefsUtils.SetInt(PLAYER_PREFS_VOICE_CHAT_FEATURE_SHOWED, 1);
 31
 132            if (tutorialController != null &&
 33                tutorialController.hudController != null &&
 34                tutorialController.hudController.usersAroundListHud != null)
 35            {
 036                tutorialController.hudController.usersAroundListHud.OnOpen -= UsersAroundListHud_OnOpen;
 37            }
 138        }
 39
 40        protected override void SetTooltipPosition()
 41        {
 142            base.SetTooltipPosition();
 43
 144            if (tutorialController != null &&
 45                tutorialController.hudController != null &&
 46                tutorialController.hudController.minimapHud != null &&
 47                tutorialController.hudController.minimapHud.usersAroundTooltipReference)
 48            {
 049                tooltipTransform.position = tutorialController.hudController.minimapHud.usersAroundTooltipReference.posi
 50            }
 151        }
 52
 53        internal void UsersAroundListHud_OnOpen()
 54        {
 155            stepIsFinished = true;
 156            tutorialController.PlayTeacherAnimation(TutorialTeacher.TeacherAnimation.QuickGoodbye);
 157        }
 58    }
 59}