Beispiel #1
0
 // Token: 0x06005574 RID: 21876 RVA: 0x001D7AD0 File Offset: 0x001D5ED0
 public void DeactivateLabel(string id)
 {
     TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(id);
     if (activeLabel != null)
     {
         this.DeactivateLabel(activeLabel);
     }
 }
Beispiel #2
0
 // Token: 0x06005572 RID: 21874 RVA: 0x001D7A50 File Offset: 0x001D5E50
 public bool IsLabelActiveOnTransform(Transform targetObject)
 {
     if (targetObject == null)
     {
         targetObject = this.FloatingLabelTransform;
     }
     TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(targetObject.GetInstanceID());
     return(activeLabel != null && activeLabel.Label.IsActive);
 }
Beispiel #3
0
    // Token: 0x06005579 RID: 21881 RVA: 0x001D7F30 File Offset: 0x001D6330
    private void DeactivateLabel(TutorialManager.ActiveLabel label)
    {
        label.TimeToLive = -1f;
        label.Label.Deactivate();
        ControllerUI controllerUI = VRCTrackingManager.GetControllerUI(label.Hand);

        if (controllerUI != null)
        {
            controllerUI.EnableHighlight(label.ControllerPart, false);
        }
        this.RefreshControllerUiVisibility(label.Hand);
    }
Beispiel #4
0
 // Token: 0x06005573 RID: 21875 RVA: 0x001D7A94 File Offset: 0x001D5E94
 public void DeactivateObjectLabel(Transform targetObject)
 {
     if (targetObject == null)
     {
         targetObject = this.FloatingLabelTransform;
     }
     TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(targetObject.GetInstanceID());
     if (activeLabel != null)
     {
         this.DeactivateLabel(activeLabel);
     }
 }
Beispiel #5
0
    // Token: 0x06005577 RID: 21879 RVA: 0x001D7BF8 File Offset: 0x001D5FF8
    private bool ActivateLabel(Transform targetObj, string id, TutorialLabelType type, ControllerHand hand, ControllerInputUI controllerPart, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, Vector3?tetherPos, Vector3?labelPos, AttachMode attachMode, bool showOffscreen, float scale)
    {
        if (!this.AreLabelsEnabled)
        {
            return(false);
        }
        if (this.TutorialLabelPrefab == null)
        {
            return(false);
        }
        bool flag = targetObj == null || type == TutorialLabelType.Popup || type == TutorialLabelType.PopupAttached;

        if (targetObj == null)
        {
            targetObj = this.FloatingLabelTransform;
        }
        TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(targetObj.GetInstanceID());
        if (activeLabel == null)
        {
            if (flag)
            {
                Vector3 value = TutorialLabel.CalculateFloatingLabelPosition();
                tetherPos = new Vector3?(value);
                labelPos  = new Vector3?(value);
            }
            else if (tetherPos == null || labelPos == null)
            {
                Vector3 value2;
                Vector3 value3;
                TutorialLabel.FindLabelAttachPoints(targetObj, out value2, out value3);
                if (tetherPos == null)
                {
                    tetherPos = new Vector3?(value2);
                }
                if (labelPos == null)
                {
                    labelPos = new Vector3?(value3);
                }
            }
            if (!showOffscreen && !VRCTrackingManager.IsPointWithinHMDView(labelPos.Value))
            {
                return(false);
            }
            activeLabel = new TutorialManager.ActiveLabel();
            activeLabel.TargetObject = targetObj;
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.TutorialLabelPrefab);
            activeLabel.Label = gameObject.GetComponent <TutorialLabel>();
            activeLabel.Label.Init();
            this._activeLabels.Add(activeLabel.TargetObject.GetInstanceID(), activeLabel);
            activeLabel.Label.SetTargetObject(targetObj, attachMode, tetherPos.Value, labelPos.Value, flag);
        }
        else if (activeLabel.Label.IsActive && activeLabel.Priority > priority)
        {
            VRC.Core.Logger.LogOnceEvery(10f, this, string.Concat(new object[]
            {
                "TutorialManager: Existing label (",
                activeLabel.ID,
                ", ",
                activeLabel.TargetObject.name,
                ") \"",
                activeLabel.Label.TextString,
                "\" has higher priority ",
                activeLabel.Priority,
                " > ",
                priority,
                ", discarding new one"
            }));
            return(false);
        }
        activeLabel.ID   = id;
        activeLabel.Type = type;
        activeLabel.SetController(hand, controllerPart);
        activeLabel.ShowOffscreen = showOffscreen;
        activeLabel.Priority      = priority;
        activeLabel.Label.SetText(text, textSecondary);
        activeLabel.Label.SetIcon(action, actionSecondary);
        activeLabel.Label.SetTextScaleOverride(scale);
        bool invertLabelAlignment = type == TutorialLabelType.Controller && hand == ControllerHand.Right && VRCInputManager.LastInputMethod == VRCInputManager.InputMethod.Oculus;

        activeLabel.Label.IsFloatingLabel      = flag;
        activeLabel.Label.InvertLabelAlignment = invertLabelAlignment;
        activeLabel.Label.IsAttachedToView     = (type == TutorialLabelType.PopupAttached);
        activeLabel.Label.RefreshComponentPositions();
        activeLabel.TimeToLive = duration;
        activeLabel.Label.Activate();
        return(true);
    }
Beispiel #6
0
 // Token: 0x06005571 RID: 21873 RVA: 0x001D7A24 File Offset: 0x001D5E24
 public bool IsLabelActive(string id)
 {
     TutorialManager.ActiveLabel activeLabel = this.FindActiveLabel(id);
     return(activeLabel != null && activeLabel.Label.IsActive);
 }