Example #1
0
    // Token: 0x06005576 RID: 21878 RVA: 0x001D7B8C File Offset: 0x001D5F8C
    public Material GetIconMaterialForAction(ControllerActionUI action)
    {
        ControllerIconSet controllerIconSet;

        switch (VRCInputManager.LastInputMethod)
        {
        case VRCInputManager.InputMethod.Keyboard:
        case VRCInputManager.InputMethod.Mouse:
            controllerIconSet = this._mouseKeyboardIcons;
            break;

        case VRCInputManager.InputMethod.Controller:
            controllerIconSet = this._xboxControllerIcons;
            break;

        default:
            controllerIconSet = this._mouseKeyboardIcons;
            break;
        }
        if (controllerIconSet != null)
        {
            return(controllerIconSet.GetIcon(action));
        }
        return(this.ErrorIconMaterial);
    }
Example #2
0
 // Token: 0x06005526 RID: 21798 RVA: 0x001D58AF File Offset: 0x001D3CAF
 public Material GetIcon(ControllerActionUI action)
 {
     if (this.Icons.ContainsKey(action))
     {
         return(this.Icons[action]);
     }
     return(this.DefaultIcon);
 }
Example #3
0
 // Token: 0x06005535 RID: 21813 RVA: 0x001D5B24 File Offset: 0x001D3F24
 public void SetIcon(ControllerActionUI action, ControllerActionUI actionSecondary)
 {
     if (action != ControllerActionUI.None)
     {
         Renderer component = this.Icon.GetComponent <Renderer>();
         component.material = TutorialManager.Instance.GetIconMaterialForAction(action);
         component.enabled  = true;
     }
     else
     {
         this.Icon.GetComponent <Renderer>().enabled = false;
     }
     if (actionSecondary != ControllerActionUI.None)
     {
         Renderer component2 = this.IconSecondary.GetComponent <Renderer>();
         component2.material = TutorialManager.Instance.GetIconMaterialForAction(actionSecondary);
         component2.enabled  = true;
     }
     else
     {
         this.IconSecondary.GetComponent <Renderer>().enabled = false;
     }
 }
Example #4
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);
    }
Example #5
0
    // Token: 0x0600556E RID: 21870 RVA: 0x001D794C File Offset: 0x001D5D4C
    public void ActivateObjectLabel(Transform targetObject, string id, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
    {
        float scale = (type != TutorialLabelType.AreaMarker) ? 1f : 2f;

        this.ActivateLabel(targetObject, id, type, hand, ControllerInputUI.None, text, action, textSecondary, actionSecondary, duration, priority, null, null, attachMode, showOffscreen, scale);
    }
Example #6
0
 // Token: 0x0600556D RID: 21869 RVA: 0x001D7920 File Offset: 0x001D5D20
 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
 {
     this.ActivateObjectLabel(targetObject, "<no id>", type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
 }
Example #7
0
 // Token: 0x06005543 RID: 21827 RVA: 0x001D67D8 File Offset: 0x001D4BD8
 public static void VRC_Tutorial_ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
 {
     if (TutorialManager.Instance != null)
     {
         TutorialManager.Instance.ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
     }
 }
 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
 {
     Tutorial.ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
 }
Example #9
0
 public static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
 {
     ActivateObjectLabel(targetObject, type, hand, text, action, string.Empty, ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
 }