Skip to content

Commit

Permalink
Merge pull request #950 from UltraStar-Deluxe/allow-single-sentence
Browse files Browse the repository at this point in the history
Allow songs that only have a single sentence
  • Loading branch information
barbeque-squared authored Jan 26, 2025
2 parents 28feced + 77f6099 commit 37710ed
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/base/USong.pas
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ function TSong.LoadOpenedSong(SongFile: TTextFileStream; FileNamePath: IPath; Du
begin
if ((Both) or (TrackIndex = 0)) then
begin
if (Length(Tracks[TrackIndex].Lines) < 2) then
if (Length(Tracks[TrackIndex].Lines) < 1) then
begin
LastError := 'ERROR_CORRUPT_SONG_NO_BREAKS';
Log.LogError('Error loading file: Can''t find any linebreaks in "' + FileNamePath.ToNative + '"');
Expand Down
2 changes: 1 addition & 1 deletion src/screens/UScreenEditSub.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4091,7 +4091,7 @@ procedure TScreenEditSub.DrawInfoBar(X, Y, W, H: Integer; ColR, ColG, ColB, Alph
else
EditDrawBorderedBox(X, Y, W, H, ColR, ColG, ColB, Alpha);

if(numLines = 1) then
if(numLines < 1) then
Exit;

SongStart := FindStartBeat;
Expand Down
2 changes: 0 additions & 2 deletions src/screens/views/UScreenSingView.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1281,8 +1281,6 @@ procedure TScreenSingView.DrawInfoLyricBar();
for CurrentTrack := 0 to High(Tracks) do //for P1 of duet or solo lyrics, P2 of duet,..
begin
numLines := Length(Tracks[CurrentTrack].Lines); //Lyric lines
if (numLines < 2) then //catch cases which could cause endless loop
Exit;
//set color to player.color
if (CurrentTrack = 0) then
glColor4f(GetLyricColor(Ini.SingColor[0]).R, GetLyricColor(Ini.SingColor[0]).G, GetLyricColor(Ini.SingColor[0]).B, 0.6)
Expand Down

0 comments on commit 37710ed

Please sign in to comment.