< Summary

Class:DCL.Tutorial.TutorialStep_Tooltip_ExploreButton
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Tooltip_ExploreButton.cs
Covered lines:11
Uncovered lines:4
Coverable lines:15
Total lines:51
Line coverage:73.3% (11 of 15)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%110100%
OnStepFinished()0%110100%
SetTooltipPosition()0%5.395075%
ExploreV2IsOpenChanged(...)0%6200%

File(s)

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

#LineLine coverage
 1using DCL.Helpers;
 2
 3namespace DCL.Tutorial
 4{
 5    /// <summary>
 6    /// Class that represents the onboarding tutorial step related to how to open the Explore window from the taskbar.
 7    /// </summary>
 8    public class TutorialStep_Tooltip_ExploreButton : TutorialStep_Tooltip
 9    {
 10        private const string PLAYER_PREFS_START_MENU_SHOWED = "StartMenuFeatureShowed";
 11        private const int TEACHER_CANVAS_SORT_ORDER_START = 5;
 12
 13        public override void OnStepStart()
 14        {
 115            base.OnStepStart();
 16
 117            DataStore.i.exploreV2.isOpen.OnChange += ExploreV2IsOpenChanged;
 18
 119            tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 120        }
 21
 22        public override void OnStepFinished()
 23        {
 124            base.OnStepFinished();
 25
 26            // TODO (Santi): This a TEMPORAL fix. It will be removed when we refactorize the tutorial system in order to
 127            PlayerPrefsUtils.SetInt(PLAYER_PREFS_START_MENU_SHOWED, 1);
 28
 129            DataStore.i.exploreV2.isOpen.OnChange -= ExploreV2IsOpenChanged;
 130        }
 31
 32        protected override void SetTooltipPosition()
 33        {
 134            base.SetTooltipPosition();
 35
 136            if (tutorialController != null &&
 37                tutorialController.hudController != null &&
 38                tutorialController.hudController.profileHud != null &&
 39                tutorialController.hudController.profileHud.tutorialTooltipReference)
 40            {
 041                tooltipTransform.position = tutorialController.hudController.profileHud.tutorialTooltipReference.positio
 42            }
 143        }
 44
 45        internal void ExploreV2IsOpenChanged(bool current, bool previous)
 46        {
 047            if (current)
 048                stepIsFinished = true;
 049        }
 50    }
 51}