Skip to content

Deal with text while combine/separate the notes in the util. #1120

@andy840119

Description

@andy840119

Found while implementing #1116

See the code:

var lyric = new Lyric();

// note that lyrics and notes should be in the selection.
PrepareHitObject(lyric);
PrepareHitObjects(new[]
{
    new Note
    {
        Text = "カラ",
        RubyText = "から",
        StartTime = 1000,
        Duration = 500,
        ParentLyric = lyric,
    },
    new Note
    {
        Text = "オケ",
        RubyText = "おけ",
        StartTime = 1500,
        Duration = 500,
        ParentLyric = lyric,
    }
});

TriggerHandlerChanged(c => c.Combine());

AssertHitObjects(notes =>
{
    var actualNotes = notes.ToArray();
    Assert.AreEqual(1, actualNotes.Length);

    var combinedNote = actualNotes.FirstOrDefault();
    Assert.NotNull(combinedNote);
    Assert.AreEqual("カラ", combinedNote.Text); // todo: maybe should combine the text?
    Assert.AreEqual(null, combinedNote.RubyText);
    Assert.AreEqual(1000, combinedNote.StartTime);
    Assert.AreEqual(1000, combinedNote.Duration);
});

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestutilsAbout utilities.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions