public override void OnEnter(UIController controller, ExpressionUI previousUI)
        {
            _controller = controller;

            _skipIntroToggle.value = Settings.SkipIntroPage;
            _skipIntroToggle.RegisterValueChangedCallback(evt => Settings.SkipIntroPage = evt.newValue);

            _updatesToggle.value = Settings.AllowCheckForUpdates;
            _updatesToggle.RegisterValueChangedCallback(evt => Settings.AllowCheckForUpdates = evt.newValue);

            _connectToVrcToggle.value = Settings.AllowConnectToVrcApi;
            _connectToVrcToggle.RegisterValueChangedCallback(evt =>
            {
                Settings.AllowConnectToVrcApi = evt.newValue;
                controller.AvatarCache.Refresh(true);
            });

            if (previousUI is null && Settings.SkipIntroPage)
            {
                OnClicked();
                return;
            }

            _nextButton.clickable = new Clickable(OnClicked);
        }
 public override void OnExit(ExpressionUI nextUI)
 {
     _controller.AvatarCache.AvatarWasUpdated -= OnAvatarWasUpdated;
     if (nextUI is Setup)
     {
         _controller.ExpressionInfo.Ping();
     }
 }
Exemple #3
0
        public override void OnEnter(UIController controller, ExpressionUI previousUI)
        {
            _controller = controller;
            _messages   = controller.Messages;


            BuildNameSelection(controller);
            BuildExpressionSelection(controller);
            BuildAnimatorSelection(controller);
            BuildAnimationFolderSelection(controller);
            BuildMenuSelection(controller);
            ErrorValidate();
        }
        public override void OnEnter(UIController controller, ExpressionUI previousUI)
        {
            _controller = controller;
            _messages   = controller.Messages;
            if (controller.AvatarCache.AvatarCount == 1 && controller.ExpressionInfo.AvatarDescriptor != null && previousUI is Intro)
            {
                controller.SetFrame <MainMenu>();
                return;
            }

            _buttons.Clear();
            SetupButtons();
            _controller.AvatarCache.AvatarWasUpdated += OnAvatarWasUpdated;
        }
        public override void OnEnter(UIController controller, ExpressionUI previousUI)
        {
            _deletionList.Clear();
            _parameterList.Clear();

            _controller = controller;
            _deletionHolder.Display(false);
            _toDelete               = new Dictionary <IAnimationDefinition, ObjectField>();
            _dataRow                = controller.Assets.AvatarParameterDataRow;
            _messages               = controller.Messages;
            _deleteButton.clicked  += DeleteObjects;
            Undo.undoRedoPerformed -= UndoRedoPerformed;
            Undo.undoRedoPerformed += UndoRedoPerformed;
            BuildLayout(controller.ExpressionInfo);
            ErrorValidate(controller.ExpressionInfo);
        }
        private void NavigateHistory(ExpressionUI instance)
        {
            if (_history.Peek() == instance)
            {
                return;
            }

            while (_breadcrumbs.childCount > 0)
            {
                _breadcrumbs.PopItem();
                ExpressionUI target;
                if ((target = _history.Pop()) == instance)
                {
                    SetFrame(target);
                    return;
                }
            }
        }
        private void SetExpressionInfoBoxActive(ExpressionUI instance, ExpressionInfo expressionInfo)
        {
            var box = _root.Q("expression-info-box");

            if (!(instance is IExpressionDefinition))
            {
                box.style.display = DisplayStyle.None;
                return;
            }

            box.style.display = DisplayStyle.Flex;
            var expMenu       = box.Q <ObjectField>("expression-menu");
            var expAnimator   = box.Q <ObjectField>("expression-animator");
            var expAnimFolder = box.Q <ObjectField>("expression-animation-folder");

            expMenu.objectType       = typeof(VRCExpressionsMenu);
            expAnimator.objectType   = typeof(RuntimeAnimatorController);
            expAnimFolder.objectType = typeof(DefaultAsset);

            var expName = box.Q <Label>("expression-name");

            expName.text = $"New expression \"{expressionInfo.ExpressionName}\"";
            var expDefinitionName = box.Q <Label>("expression-definition-name");

            expDefinitionName.text = $"Parameters for {instance.Name}";

            expMenu.SetValueWithoutNotify(expressionInfo.Menu);
            expAnimator.SetValueWithoutNotify(expressionInfo.Controller);
            expAnimFolder.SetValueWithoutNotify(expressionInfo.AnimationsFolder);

            expMenu.Q(null, "unity-object-field__selector").Display(false);
            expAnimator.Q(null, "unity-object-field__selector").Display(false);
            expAnimFolder.Q(null, "unity-object-field__selector").Display(false);

            expMenu.RegisterValueChangedCallback(e => expMenu.SetValueWithoutNotify(e.previousValue));
            expAnimator.RegisterValueChangedCallback(e => expAnimator.SetValueWithoutNotify(e.previousValue));
            expAnimFolder.RegisterValueChangedCallback(e => expAnimFolder.SetValueWithoutNotify(e.previousValue));
        }
        public void SetFrame(ExpressionUI instance)
        {
            Messages.Clear();
            if (instance != _activeContent)
            {
                _history.Push(instance);
                _breadcrumbs.PushItem(ObjectNames.NicifyVariableName(instance.Name), () => NavigateHistory(instance));
            }
            ContentFrame.Clear();

            instance.Layout.CloneTree(ContentFrame);

            ExpressionUI previousContent = _activeContent;

            _activeContent = instance;
            if (previousContent != null)
            {
                previousContent.OnExit(_activeContent);
            }

            SetExpressionInfoBoxActive(instance, ExpressionInfo);
            _activeContent.BindControls(ContentFrame);
            _activeContent.OnEnter(this, previousContent);
        }
 public override void OnEnter(UIController controller, ExpressionUI previousUI)
 {
     _createExpressionButton.clicked    += controller.SetFrame <Setup>;
     _avatarParameterDataButton.clicked += controller.SetFrame <AvatarParameterData>;
 }
Exemple #10
0
 public virtual void OnExit(ExpressionUI nextUI)
 {
 }
Exemple #11
0
 public virtual void OnEnter(UIController controller, ExpressionUI previousUI)
 {
 }