| | 1 | | using DCL.Helpers; |
| | 2 | |
|
| | 3 | | namespace 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 | | { |
| 1 | 15 | | base.OnStepStart(); |
| | 16 | |
|
| 1 | 17 | | DataStore.i.exploreV2.isOpen.OnChange += ExploreV2IsOpenChanged; |
| | 18 | |
|
| 1 | 19 | | tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START); |
| 1 | 20 | | } |
| | 21 | |
|
| | 22 | | public override void OnStepFinished() |
| | 23 | | { |
| 1 | 24 | | base.OnStepFinished(); |
| | 25 | |
|
| | 26 | | // TODO (Santi): This a TEMPORAL fix. It will be removed when we refactorize the tutorial system in order to |
| 1 | 27 | | PlayerPrefsUtils.SetInt(PLAYER_PREFS_START_MENU_SHOWED, 1); |
| | 28 | |
|
| 1 | 29 | | DataStore.i.exploreV2.isOpen.OnChange -= ExploreV2IsOpenChanged; |
| 1 | 30 | | } |
| | 31 | |
|
| | 32 | | protected override void SetTooltipPosition() |
| | 33 | | { |
| 1 | 34 | | base.SetTooltipPosition(); |
| | 35 | |
|
| 1 | 36 | | if (tutorialController != null && |
| | 37 | | tutorialController.hudController != null && |
| | 38 | | tutorialController.hudController.profileHud != null && |
| | 39 | | tutorialController.hudController.profileHud.tutorialTooltipReference) |
| | 40 | | { |
| 0 | 41 | | tooltipTransform.position = tutorialController.hudController.profileHud.tutorialTooltipReference.positio |
| | 42 | | } |
| 1 | 43 | | } |
| | 44 | |
|
| | 45 | | internal void ExploreV2IsOpenChanged(bool current, bool previous) |
| | 46 | | { |
| 0 | 47 | | if (current) |
| 0 | 48 | | stepIsFinished = true; |
| 0 | 49 | | } |
| | 50 | | } |
| | 51 | | } |