public SceneEditingEffects(SceneEditingModel model, SceneItemModel item)
        {
            _model = model;
            _item  = item;

            ToggleHFlip = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    RemoveFilter(present);
                }
                else
                {
                    AddFilter(new SceneItemFilter {
                        Type = SceneItemFilterType.HFlip, Enabled = true
                    });
                }
            };

            RemoveAll = () =>
            {
                var present = GetHflip();
                if (present != null)
                {
                    _item.Model.Filters = new SceneItemFilters {
                        Filters = new[] { present }
                    }
                }
                ;
                else
                {
                    _item.Model.Filters = null;
                }
            };

            BasicSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Basic).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            QuickSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Quick).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();
            CreativeSources = _typeDescriptors.Where(s => s.Category == FilterCategory.Creative).Select(s => new FilterSourceModel {
                Desc = s
            }).ToList();


            AllSources = BasicSources.Concat(QuickSources).Concat(CreativeSources).ToList();

            AllSources.ForEach(s => s.InUse.OnChange = (o, n) => SourceChanged(s));

            AddLut = (f, d) => _ = AddResource(f, d);

            UpdateContent(EditingUpdateType.Content);
        }
Beispiel #2
0
        public EditLayerPage(SceneEditingModel model, SceneItemModel item, IEditingPage sourceEditor)
        {
            Item                 = item;
            _sourceEditor        = sourceEditor;
            SubPageContent.Value = sourceEditor;
            Effects              = new SceneEditingEffects(model, item);

            ShowSettings = () => { SetSubPage(EditingSubPage.Settings); SubPageContent.Value = _sourceEditor; };
            ShowEffects  = () => { SetSubPage(EditingSubPage.Effects); SubPageContent.Value = Effects; };
            ShowZoom     = () => { SetSubPage(EditingSubPage.Zoom); SubPageContent.Value = item.Zoom; };
        }