Exemple #1
0
        private void load(AudioManager audio)
        {
            selectSample        = audio.Samples.Get("UI/generic-hover-soft");
            confirmSelectSample = audio.Samples.Get("UI/notification-pop-in");

            selection.BindValueChanged(updateSelection, true);

            AvailableRoms.BindValueChanged(roms =>
            {
                noRomPopup.State.Value = roms.NewValue.Count() > 0 ? Visibility.Hidden : Visibility.Visible;

                selectionContainer.Clear();
                selectionContainer.AddRange(roms.NewValue.Select(rom => new SelectionCard(rom)
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Alpha  = 0,
                }));

                selection.MaxValue = (roms.NewValue.Count() - 1) > 0 ? (roms.NewValue.Count() - 1) : 0;
                selection.TriggerChange();
            }, true);

            selection.BindValueChanged(updateSelectedDrawableCard, true);
        }
        void load(DrawableEditor editor)
        {
            _editor = editor;

            _fontSize = editor.FontSize.GetBoundCopy() as BindableFloat;
            _fontSize.BindValueChanged(s => Scheduler.AddOnce(ResetFlicker));

            _lineNumberWidth = editor.LineNumberWidth.GetBoundCopy() as BindableInt;
            _lineNumberWidth.BindValueChanged(w => Scheduler.AddOnce(ResetFlicker));

            _selectionStart = _selection.Start.GetBoundCopy() as BindableInt;
            _selectionStart.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd = _selection.End.GetBoundCopy() as BindableInt;
            _selectionEnd.BindValueChanged(i => Scheduler.AddOnce(ResetFlicker));

            _selectionEnd.TriggerChange();
        }