Esempio n. 1
0
        public void TestLyricTimeFormattedString(double startTime, double endTime, string format)
        {
            var lyric = new Lyric
            {
                StartTime = startTime,
                Duration  = endTime - startTime
            };

            Assert.AreEqual(LyricUtils.LyricTimeFormattedString(lyric), format);
        }
Esempio n. 2
0
 private Drawable createTimeDrawable(Lyric lyric)
 {
     return(new OsuSpriteText
     {
         Text = LyricUtils.LyricTimeFormattedString(lyric),
         Anchor = Anchor.CentreLeft,
         Origin = Anchor.CentreLeft,
         Margin = new MarginPadding {
             Left = row_inner_spacing
         },
         Font = OsuFont.GetFont(size: 18, fixedWidth: true),
         AllowMultiline = false
     });
 }
Esempio n. 3
0
            public InfoControl(Lyric lyric)
            {
                Lyric = lyric;

                Children = new Drawable[]
                {
                    background = new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = max_height,
                    },
                    new FillFlowContainer
                    {
                        Direction        = FillDirection.Vertical,
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Anchor           = Anchor.TopRight,
                        Origin           = Anchor.TopRight,
                        Spacing          = new Vector2(5),
                        Children         = new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                Height           = 36,
                                Children         = new Drawable[]
                                {
                                    headerBackground = new Box
                                    {
                                        RelativeSizeAxes = Axes.Both
                                    },
                                    timeRange = new OsuSpriteText
                                    {
                                        Anchor = Anchor.CentreLeft,
                                        Origin = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(size: 16, fixedWidth: true),
                                        Margin = new MarginPadding(10),
                                    },
                                    new InvalidInfo(lyric)
                                    {
                                        Anchor = Anchor.CentreRight,
                                        Origin = Anchor.CentreRight,
                                        Margin = new MarginPadding(10),
                                        Scale  = new Vector2(1.3f),
                                        Y      = 1,
                                    },
                                }
                            },
                            new GridContainer
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                ColumnDimensions = new[]
                                {
                                    new Dimension(),
                                    new Dimension(GridSizeMode.Absolute, 28),
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        subInfoContainer = new Container
                                        {
                                            RelativeSizeAxes = Axes.X
                                        },
                                        new FillFlowContainer
                                        {
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y,
                                            Direction        = FillDirection.Vertical,
                                            Spacing          = new Vector2(5),
                                            Children         = new Drawable[]
                                            {
                                                new OrderInfo(lyric),
                                                new LockInfo(lyric),
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                };

                timeRange.Text = LyricUtils.LyricTimeFormattedString(lyric);

                bindableMode.BindValueChanged(e =>
                {
                    CreateBadge(e.NewValue);
                });
            }