< 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:14
Uncovered lines:7
Coverable lines:21
Total lines:61
Line coverage:66.6% (14 of 21)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%4.134080%
OnStepFinished()0%4.134080%
SetTooltipPosition()0%2.062075%
ProfileHud_OnOpen()0%110100%
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        {
 112            base.OnStepStart();
 13
 114            if (tutorialController != null &&
 15                tutorialController.hudController != null &&
 16                tutorialController.hudController.profileHud != null)
 17            {
 018                tutorialController.hudController.profileHud.OnOpen += ProfileHud_OnOpen;
 19            }
 20
 121            DataStore.i.exploreV2.isOpen.OnChange += ExploreV2IsOpenChanged;
 122        }
 23
 24        public override void OnStepFinished()
 25        {
 126            base.OnStepFinished();
 27
 128            if (tutorialController != null &&
 29                tutorialController.hudController != null &&
 30                tutorialController.hudController.profileHud != null)
 31            {
 032                tutorialController.hudController.profileHud.OnOpen -= ProfileHud_OnOpen;
 33            }
 34
 135            DataStore.i.exploreV2.isOpen.OnChange -= ExploreV2IsOpenChanged;
 136        }
 37
 38        protected override void SetTooltipPosition()
 39        {
 140            base.SetTooltipPosition();
 41
 142            if (DataStore.i.exploreV2.profileCardTooltipReference.Get() != null)
 043                tooltipTransform.position = DataStore.i.exploreV2.profileCardTooltipReference.Get().position;
 144        }
 45
 46        internal void ProfileHud_OnOpen()
 47        {
 148            tutorialController.SetNextSkippedSteps(0);
 149            stepIsFinished = true;
 150        }
 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}