public void Setup() => Schedule(() =>
 {
     Children = new Drawable[]
     {
         new Box
         {
             Colour           = overlayColour.Background5,
             RelativeSizeAxes = Axes.Both,
         },
         new BasicScrollContainer
         {
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding(20),
             Child            = markdownContainer = new OsuMarkdownContainer
             {
                 RelativeSizeAxes = Axes.X,
                 AutoSizeAxes     = Axes.Y
             }
         }
     };
 });
Beispiel #2
0
        private void load(OsuColour colour, ILyricEditorState state)
        {
            Children = new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize)
                    },
                    Content = new[]
                    {
                        buttons = new[]
                        {
                            new EditModeButton(LyricEditorMode.CreateNote)
                            {
                                Text    = "Create",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            },
                            new EditModeButton(LyricEditorMode.CreateNotePosition)
                            {
                                Text    = "Position",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            },
                            new EditModeButton(LyricEditorMode.AdjustNote)
                            {
                                Text    = "Adjust",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            }
                        }
                    }
                },
                description = new OsuMarkdownContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                }
            };

            updateEditMode(state.Mode);

            void updateEditMode(LyricEditorMode mode)
            {
                state.Mode = mode;

                // update button style.
                foreach (var child in buttons)
                {
                    var highLight = child.Mode == mode;
                    child.Alpha = highLight ? 0.8f : 0.4f;

                    switch (child.Mode)
                    {
                    case LyricEditorMode.CreateNote:
                        child.BackgroundColour = highLight ? colour.Blue : colour.BlueDarker;
                        break;

                    case LyricEditorMode.CreateNotePosition:
                        child.BackgroundColour = highLight ? colour.Red : colour.RedDarker;
                        break;

                    case LyricEditorMode.AdjustNote:
                        child.BackgroundColour = highLight ? colour.Yellow : colour.YellowDarker;
                        break;
                    }
                }

                // update description text.
                switch (mode)
                {
                case LyricEditorMode.CreateNote:
                    description.Text = "Using time-tag to create default notes.";
                    break;

                case LyricEditorMode.CreateNotePosition:
                    description.Text = "Using singer voice data to adjust note position.";
                    break;

                case LyricEditorMode.AdjustNote:
                    description.Text = "If you are note satisfied this result, you can adjust this by hands.";
                    break;
                }
            }
        }
Beispiel #3
0
        private void load(OsuColour colour, ILyricEditorState state)
        {
            Children = new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize)
                    },
                    Content = new[]
                    {
                        buttons = new[]
                        {
                            new EditModeButton(LyricEditorMode.CreateTimeTag)
                            {
                                Text    = "Create",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            },
                            new EditModeButton(LyricEditorMode.RecordTimeTag)
                            {
                                Text    = "Recording",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            },
                            new EditModeButton(LyricEditorMode.AdjustTimeTag)
                            {
                                Text    = "Adjust",
                                Action  = updateEditMode,
                                Padding = new MarginPadding {
                                    Horizontal = 5
                                },
                            }
                        }
                    }
                },
                description = new OsuMarkdownContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                }
            };

            updateEditMode(state.Mode);

            void updateEditMode(LyricEditorMode mode)
            {
                state.Mode = mode;

                // update button style.
                foreach (var child in buttons)
                {
                    var highLight = child.Mode == mode;
                    child.Alpha = highLight ? 0.8f : 0.4f;

                    switch (child.Mode)
                    {
                    case LyricEditorMode.CreateTimeTag:
                        child.BackgroundColour = highLight ? colour.Blue : colour.BlueDarker;
                        break;

                    case LyricEditorMode.RecordTimeTag:
                        child.BackgroundColour = highLight ? colour.Red : colour.RedDarker;
                        break;

                    case LyricEditorMode.AdjustTimeTag:
                        child.BackgroundColour = highLight ? colour.Yellow : colour.YellowDarker;
                        break;
                    }
                }

                // update description text.
                switch (mode)
                {
                case LyricEditorMode.CreateTimeTag:
                    description.Text = "Use keyboard to control caret position, press `N` to create new time-tag and press `D` to delete exist time-tag.";
                    break;

                case LyricEditorMode.RecordTimeTag:
                    description.Text = "Press spacing button at the right time to set current time to time-tag.";
                    break;

                case LyricEditorMode.AdjustTimeTag:
                    description.Text = "Drag to adjust time-tag time precisely.";
                    break;
                }
            }
        }