< Summary

Class:DCL.Tutorial.TutorialStep_Tooltip_BackpackButton
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Tooltip_BackpackButton.cs
Covered lines:0
Uncovered lines:21
Coverable lines:21
Total lines:61
Line coverage:0% (0 of 21)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%20400%
OnStepFinished()0%20400%
SetTooltipPosition()0%6200%
ProfileHud_OnOpen()0%2100%
ExploreV2IsOpenChanged(...)0%6200%

File(s)

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

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL.Tutorial
 4{
 5    /// <summary>
 6    /// Class that represents the onboarding tutorial step related to how to open the Backpack window from the taskbar.
 7    /// </summary>
 8    public class TutorialStep_Tooltip_BackpackButton : TutorialStep_Tooltip
 9    {
 10        public override void OnStepStart()
 11        {
 012            base.OnStepStart();
 13
 014            if (tutorialController != null &&
 15                tutorialController.hudController != null &&
 16                tutorialController.hudController.profileHud != null)
 17            {
 018                tutorialController.hudController.profileHud.OnOpen += ProfileHud_OnOpen;
 19            }
 20
 021            DataStore.i.exploreV2.isOpen.OnChange += ExploreV2IsOpenChanged;
 022        }
 23
 24        public override void OnStepFinished()
 25        {
 026            base.OnStepFinished();
 27
 028            if (tutorialController != null &&
 29                tutorialController.hudController != null &&
 30                tutorialController.hudController.profileHud != null)
 31            {
 032                tutorialController.hudController.profileHud.OnOpen -= ProfileHud_OnOpen;
 33            }
 34
 035            DataStore.i.exploreV2.isOpen.OnChange -= ExploreV2IsOpenChanged;
 036        }
 37
 38        protected override void SetTooltipPosition()
 39        {
 040            base.SetTooltipPosition();
 41
 042            if (DataStore.i.exploreV2.profileCardTooltipReference.Get() != null)
 043                tooltipTransform.position = DataStore.i.exploreV2.profileCardTooltipReference.Get().position;
 044        }
 45
 46        internal void ProfileHud_OnOpen()
 47        {
 048            tutorialController.SetNextSkippedSteps(0);
 049            stepIsFinished = true;
 050        }
 51
 52        internal void ExploreV2IsOpenChanged(bool current, bool previous)
 53        {
 054            if (!current)
 55            {
 056                tutorialController.SetNextSkippedSteps(7);
 057                stepIsFinished = true;
 58            }
 059        }
 60    }
 61}