Fix extra end of phrase after the last note#576
Conversation
The UltraStar format specification v1 says that there should not be a trailing end-of-phrase marker after the last sentence.
| foreach (Sentence sentence in sortedSentences.SkipLast(1)) | ||
| { | ||
| AppendSentence(sb, sentence); | ||
| AppendSentence(sb, sentence, true); |
There was a problem hiding this comment.
I would prefer setting the flag based on "is this the last sentence".
Consider to iterate by index, then check if index matches (sentences length - 1).
There was a problem hiding this comment.
Do you mean something like
for all sentences
{
AppendSentence(... , (i == last))
}
There was a problem hiding this comment.
I refactored that loop to check index.
|
Please add a Edit Mode test for this. See |
I sent you an invitation to the repo with WRITE access. You should now be able to edit the wiki pages. |
Now a single loop with index check, as requested in PR review.
|
I added an edit mode test for this fix. |
What does this PR do?
Fixes the issue where the editor saved song files with an additional end-of-phrase marker after the last note, as described in #573.
Closes Issue(s)
#573
Additional Notes
There is a wiki page with an example song file with extra end-of-phrase markers that needs to be updated if this gets merged.
https://github.com/UltraStar-Deluxe/Play/wiki/UltraStar-txt-File-Format