예제 #1
0
        public DopesheetPanelViewModel(Editor editor)
        {
            _editor = editor;
            _rowsPerPropertyAnimationIdIndex = new Dictionary <ulong, DopesheetRow>();
            Rows         = new ObservableCollection <DopesheetRow>();
            IsNotPlaying = true;
            _keyIndex    = new TwowayIndex <ulong, TimelineKey>();

            MessageBus.Default.Subscribe <PropertyAnimationAdded>(OnPropertyAnimationAdded);
            MessageBus.Default.Subscribe <PropertyAnimationRemoved>(OnPropertyAnimationRemoved);
            MessageBus.Default.Subscribe <CurrentAnimationChanged>(OnCurrentAnimationChanged);
            MessageBus.Default.Subscribe <EditorModeChanged>(OnEditorModeChanged);
            MessageBus.Default.Subscribe <AnimationKeyAdded>(OnAnimationKeyAdded);
            MessageBus.Default.Subscribe <AnimationKeyRemoved>(OnAnimationKeyRemoved);
            MessageBus.Default.Subscribe <AnimationCurrentFrameChanged>(OnCurrentAnimationFrameChanged);
            MessageBus.Default.Subscribe <AnimationBeginFrameChanged>(OnAnimationBeginFrameChanged);
            MessageBus.Default.Subscribe <AnimationEndFrameChanged>(OnAnimationEndFrameChanged);
            MessageBus.Default.Subscribe <KeySelected>(OnKeySelected);
            MessageBus.Default.Subscribe <KeyDeselected>(OnKeyDeselected);
            MessageBus.Default.Subscribe <AutoKeyToggled>(OnAutoKeyToggled);
            MessageBus.Default.Subscribe <AnimationIsLoopChanged>(OnAnimationIsLoopChanged);
            MessageBus.Default.Subscribe <NodeSelected>(m => UpdateRowHighlighting());
            MessageBus.Default.Subscribe <NodeDeselected>(m => UpdateRowHighlighting());

            ConfigureButtonBrushes();
        }
예제 #2
0
        public HierarchyPanelViewModel(Editor editor)
        {
            _editor   = editor;
            _index    = new TwowayIndex <ulong, HierarchyNodeViewModel>();
            RootNodes = new ObservableCollection <HierarchyNodeViewModel>();

            DropHandler = new HierarchyDropHandler(editor);

            RegisterMessageHandlers();

            Clear();
        }
예제 #3
0
        public DrawOrderPanelViewModel(Editor editor)
        {
            _editor    = editor;
            Items      = new ObservableCollection <DrawOrderItemViewModel>();
            DropTarget = new DrawOrderDropHandler(editor);
            _index     = new TwowayIndex <ulong, DrawOrderItemViewModel>();

            MessageBus.Default.Subscribe <DocumentLoaded>(OnDocumentLoaded);
            MessageBus.Default.Subscribe <SpriteNodeAdded>(OnSpriteNodeAdded);
            MessageBus.Default.Subscribe <NodeRemoved>(OnNodeRemoved);
            MessageBus.Default.Subscribe <NodeSelected>(msg => OnNodeSelected(msg.NodeId));
            MessageBus.Default.Subscribe <NodeDeselected>(msg => OnNodeDeselected(msg.NodeId));
            MessageBus.Default.Subscribe <DrawOrderChanged>(DrawOrderChanged);
            MessageBus.Default.Subscribe <NodeRenamed>(OnNodeRenamed);
            MessageBus.Default.Subscribe <NodePropertyValueChanged>(OnNodePropertyValueChanged);
        }