예제 #1
0
        public LyricEditor()
        {
            Child = new SkinProvidingContainer(skin = new KaraokeLyricEditorSkin())
            {
                RelativeSizeAxes = Axes.Both,
                Child            = container = new DrawableLyricEditList
                {
                    RelativeSizeAxes = Axes.Both,
                }
            };

            container.Items.BindTo(BindableLyrics);
            if (lyricManager != null)
            {
                container.OnOrderChanged += lyricManager.ChangeLyricOrder;
            }

            MoveCaret(MovingCaretAction.First);

            BindableMode.BindValueChanged(e =>
            {
                // display add new lyric only with edit mode.
                container.DisplayBottomDrawable = e.NewValue == Mode.EditMode;
            }, true);
        }
예제 #2
0
        public LyricEditor()
        {
            Child = gridContainer = new GridContainer
            {
                RelativeSizeAxes = Axes.Both,
                Content          = new[]
                {
                    new Drawable[]
                    {
                        leftSideExtendArea = new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        new Box(),
                        new SkinProvidingContainer(skin = new KaraokeLyricEditorSkin())
                        {
                            RelativeSizeAxes = Axes.Both,
                            Child            = container = new DrawableLyricEditList
                            {
                                RelativeSizeAxes = Axes.Both,
                            }
                        },
                        new Box(),
                        rightSideExtendArea = new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                    }
                }
            };

            container.Items.BindTo(BindableLyrics);
            if (lyricManager != null)
            {
                container.OnOrderChanged += lyricManager.ChangeLyricOrder;
            }

            MoveCaret(MovingCaretAction.First);

            BindableMode.BindValueChanged(e =>
            {
                initialCaretPositionAlgorithm();

                // display add new lyric only with edit mode.
                container.DisplayBottomDrawable = e.NewValue == LyricEditorMode.Manage;

                // should wait until beatmap has been loaded.
                Schedule(() => ResetPosition(e.NewValue));

                // should control grid container spacing and place some component.
                initializeExtendArea();
            }, true);

            BindableRecordingMovingCaretMode.BindValueChanged(e =>
            {
                initialCaretPositionAlgorithm();

                ResetPosition(Mode);
            });
        }