public PracticeSettings(IBeatmap beatmap) { var lyrics = beatmap.HitObjects.OfType <LyricLine>().ToList(); Children = new Drawable[] { new OsuSpriteText { Text = "Practice preempt time:" }, preemptTimeSliderBar = new PlayerSliderBar <double>(), new OsuSpriteText { Text = "Lyric:" }, lyricPreview = new LyricPreview(lyrics) { Height = 580 } }; }
public PracticeSettings(IBeatmap beatmap) : base("Practice") { var lyrics = beatmap.HitObjects.OfType <Lyric>().ToList(); Children = new Drawable[] { new OsuSpriteText { Text = "Practice preempt time:" }, preemptTimeSliderBar = new PlayerSliderBar <double>(), new OsuSpriteText { Text = "Lyric:" }, lyricPreview = new LyricPreview(lyrics) { Height = 580, RelativeSizeAxes = Axes.X, Spacing = new Vector2(15), } }; }
public TestSceneLyricRubyRomaji() { beatmap = CreateBeatmap(new KaraokeRuleset().RulesetInfo); Child = new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Relative, 0.4f) }, Content = new[] { new Drawable[] { lyricPreview = new LyricPreview { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(AREA_MARGIN) }, new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { lyricPreviewArea = new LyricPreviewArea { RelativeSizeAxes = Axes.Both, Margin = new MarginPadding(AREA_MARGIN) } }, new Drawable[] { new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] { new Drawable[] { rubyListPreviewArea = new RubyListPreviewArea { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(AREA_MARGIN) }, romajiListPreviewArea = new RomajiListPreviewArea { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(AREA_MARGIN) } } } } } } } } } }; lyricPreview.LyricLines = lyricLines; lyricPreview.BindableLyricLine.BindValueChanged(value => { var newValue = value.NewValue; if (newValue == null) { return; } // Apply new lyric line lyricPreviewArea.LyricLine = newValue; // Apply new tag and max position var maxLyricPosition = newValue.Text.Length - 1; rubyListPreviewArea.Tags = newValue.RubyTags; rubyListPreviewArea.MaxTagPosition = maxLyricPosition; romajiListPreviewArea.Tags = newValue.RomajiTags; romajiListPreviewArea.MaxTagPosition = maxLyricPosition; }, true); rubyListPreviewArea.BindableTag.BindValueChanged(value => { lyricPreviewArea.LyricLine.RubyTags = value.NewValue.ToArray(); }); romajiListPreviewArea.BindableTag.BindValueChanged(value => { lyricPreviewArea.LyricLine.RomajiTags = value.NewValue.ToArray(); }); }