diff options
Diffstat (limited to 'Game/Code')
-rw-r--r-- | Game/Code/Classes/UDraw.pas | 21 | ||||
-rw-r--r-- | Game/Code/Classes/UFiles.pas | 26 | ||||
-rw-r--r-- | Game/Code/Classes/UIni.pas | 32 | ||||
-rw-r--r-- | Game/Code/Classes/USongs.pas | 57 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenEditSub.pas | 173 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenName.pas | 241 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSing.pas | 19 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSingModi.pas | 2 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSongJumpto.pas | 3 |
9 files changed, 354 insertions, 220 deletions
diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index e4735a39..8b7fd8b4 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -64,7 +64,7 @@ var TickOld: cardinal;
TickOld2:cardinal;
//end Singbar Mod
- ShowNotes: integer; //0=show all; 1=don't show notes+rating; 2=don't show notes, rating, score+score bar
+ ShowNotes: integer; //0=show all; 1=don't show notes+rating; 2=don't show notes, rating, score+score bar; 3=also lyrics
@@ -724,19 +724,26 @@ begin ScreenSing.LyricMain[0].SetAlpha(Alpha[0]);
ScreenSing.LyricSub[0].SetAlpha(Alpha[2]);
- ScreenSing.LyricMain[0].Draw;
- ScreenSing.LyricSub[0].Draw;
- SingDrawLyricHelper(0, NR);
+ if (ShowNotes<3) then
+ begin
+ ScreenSing.LyricMain[0].Draw;
+ ScreenSing.LyricSub[0].Draw;
+
+ SingDrawLyricHelper(0, NR);
+ end;
if (AktSong.isDuet) then
begin
ScreenSing.LyricMain[1].SetAlpha(Alpha[1]);
ScreenSing.LyricSub[1].SetAlpha(Alpha[3]);
- ScreenSing.LyricMain[1].Draw;
- ScreenSing.LyricSub[1].Draw;
- SingDrawLyricHelper(1, NR);
+ if (ShowNotes<3) then
+ begin
+ ScreenSing.LyricMain[1].Draw;
+ ScreenSing.LyricSub[1].Draw;
+ SingDrawLyricHelper(1, NR);
+ end;
end;
// oscilloscope
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index 93e745e5..d6ec4254 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -45,7 +45,7 @@ var //Absolute Paths
GamePath: string;
SoundPath: string;
- SongPath: string;
+ SongPaths: array of string;
LogPath: string;
ThemePath: string;
ScreenshotsPath: string;
@@ -82,7 +82,9 @@ begin GamePath := ExtractFilePath(ParamStr(0));
SoundPath := GamePath + 'Sounds\';
- SongPath := GamePath + 'Songs\';
+
+ SetLength(SongPaths, 1);
+ SongPaths[0] := GamePath + 'Songs\';
LogPath := GamePath;
ThemePath := GamePath + 'Themes\';
ScreenshotsPath := GamePath + 'Screenshots\';
@@ -100,8 +102,8 @@ begin If not DirectoryExists(SoundPath) then
Writeable := ForceDirectories(SoundPath);
- If Writeable And (not DirectoryExists(SongPath)) then
- Writeable := ForceDirectories(SongPath);
+ If Writeable And (not DirectoryExists(SongPaths[0])) then
+ Writeable := ForceDirectories(SongPaths[0]);
If Writeable And (not DirectoryExists(ThemePath)) then
Writeable := ForceDirectories(ThemePath);
@@ -745,6 +747,7 @@ var foundMedleyStart: boolean;
foundMedleyEnd: boolean;
medley: boolean;
+ singer: string;
begin
Result := true;
@@ -761,6 +764,11 @@ begin for p := 0 to Length(Czesci) - 1 do
begin
+ if AktSong.isDuet then
+ singer := ' (P' + IntToStr(p+1) + ')'
+ else
+ singer := '';
+
bt := low(integer);
numLines := Length(Czesci[p].Czesc);
@@ -793,7 +801,7 @@ begin if(bt>Czesci[p].Czesc[line].Start) then
begin
Log.LogError('Beat error in sentence ' + IntToStr(line+1) + ', on beat ' + IntToStr(Czesci[p].Czesc[line].Start) +
- ' in song ' + AktSong.Path + AktSong.Filename);
+ singer + ' in song ' + AktSong.Path + AktSong.Filename);
if (Ini.LoadFaultySongs=0) and (Ini.LoadFaultySongs_temp=0) then
Result := false;
end;
@@ -804,7 +812,7 @@ begin if(bt>Czesci[p].Czesc[line].Nuta[note].Start) then
begin
Log.LogError('Beat error in sentence ' + IntToStr(line+1) + ', on beat ' + IntToStr(Czesci[p].Czesc[line].Nuta[note].Start) +
- ' in song ' + AktSong.Path + AktSong.Filename);
+ singer + ' in song ' + AktSong.Path + AktSong.Filename);
if (Ini.LoadFaultySongs=0) and (Ini.LoadFaultySongs_temp=0) then
Result := false;
end;
@@ -813,7 +821,7 @@ begin if (Czesci[p].Czesc[line].Nuta[note].Dlugosc<0) then
begin
Log.LogError('Note length <0 in sentence ' + IntToStr(line+1) + ', on beat ' + IntToStr(Czesci[p].Czesc[line].Nuta[note].Start) +
- ' in song ' + AktSong.Path + AktSong.Filename);
+ singer + ' in song ' + AktSong.Path + AktSong.Filename);
if (Ini.LoadFaultySongs=0) and (Ini.LoadFaultySongs_temp=0) then
Result := false;
end;
@@ -821,7 +829,7 @@ begin if (Czesci[p].Czesc[line].Nuta[note].Dlugosc=0) and not Czesci[p].Czesc[line].Nuta[note].FreeStyle then
begin
Log.LogError('Note length =0 in sentence ' + IntToStr(line+1) + ', on beat ' + IntToStr(Czesci[p].Czesc[line].Nuta[note].Start) +
- ' in song ' + AktSong.Path + AktSong.Filename);
+ singer + ' in song ' + AktSong.Path + AktSong.Filename);
if (Ini.LoadFaultySongs=0) and (Ini.LoadFaultySongs_temp=0) then
Result := false;
end;
@@ -836,7 +844,7 @@ begin if (bt+Czesci[p].Czesc[line].Nuta[note].Dlugosc>nextBeat) then
begin
Log.LogError('Note length error in sentence ' + IntToStr(line+1) + ', on beat ' + IntToStr(Czesci[p].Czesc[line].Nuta[note].Start) +
- ' in song ' + AktSong.Path + AktSong.Filename);
+ singer + ' in song ' + AktSong.Path + AktSong.Filename);
if (Ini.LoadFaultySongs=0) and (Ini.LoadFaultySongs_temp=0) then
Result := false;
end;
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index d3f912d9..56306ba2 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -214,6 +214,8 @@ var Modes: PPSDL_Rect;
SR: TSearchRec; //Skin List Patch
found: boolean;
+ txt: string;
+ num: integer;
function GetFileName (S: String):String;
begin
@@ -668,9 +670,29 @@ begin // SongPath
if (Params.SongPath <> '') then
- SongPath := IncludeTrailingPathDelimiter(Params.SongPath)
+ SongPaths[0] := IncludeTrailingPathDelimiter(Params.SongPath)
else
- SongPath := IncludeTrailingPathDelimiter(IniFile.ReadString('Path', 'Songs', SongPath));
+ begin
+ txt := IniFile.ReadString('Path', 'Songs', ' ');
+ if (DirectoryExists(txt)) then
+ begin
+ num := Length(SongPaths);
+ SetLength(SongPaths, num+1);
+ SongPaths[num] := IncludeTrailingPathDelimiter(txt);
+ end;
+
+ I := 1;
+ repeat
+ txt := IniFile.ReadString('Directories', 'SongDir'+IntToStr(I), ' ');
+ if (DirectoryExists(txt)) then
+ begin
+ num := Length(SongPaths);
+ SetLength(SongPaths, num+1);
+ SongPaths[num] := IncludeTrailingPathDelimiter(txt);
+ Inc(I);
+ end;
+ until (not DirectoryExists(txt));
+ end;
Filename := IniFile.FileName;
IniFile.Free;
@@ -928,6 +950,12 @@ begin Tekst := ILogSession[Ini.LogSession];
IniFile.WriteString('Advanced', 'LogSession', Tekst);
+ // Directories (add a template if section is missing, from 1.1)
+ if (not IniFile.SectionExists('Path')) then
+ IniFile.WriteString('Path', 'Songs', ' ');
+ if (not IniFile.SectionExists('Directories')) then
+ IniFile.WriteString('Directories', 'SongDir1', ' ');
+
IniFile.Free;
end;
end;
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 61473535..330b8a9e 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -99,7 +99,7 @@ type function FindSongFile(Dir, Mask: string): string;
procedure LoadSongList; // load all songs
- procedure BrowseDir(Dir: string); // should return number of songs in the future
+ procedure BrowseDir(Dir: string; Index: integer); // should return number of songs in the future
procedure Sort(Order: integer);
end;
@@ -217,6 +217,8 @@ begin end;
procedure TSongs.LoadSongList;
+var
+ I: integer;
begin
Log.LogStatus('Initializing', 'LoadSongList');
@@ -226,13 +228,14 @@ begin BrowsePos := 0;
// browse directories
- BrowseDir(SongPath);
+ for I := 0 to Length(SongPaths) - 1 do
+ BrowseDir(SongPaths[I], I);
//Set Correct SongArray Length
SetLength(Song, BrowsePos);
end;
-procedure TSongs.BrowseDir(Dir: string);
+procedure TSongs.BrowseDir(Dir: string; Index: integer);
var
SR: TSearchRec; // for parsing Songs Directory
SLen: integer;
@@ -240,10 +243,11 @@ var Name: string;
begin
- if FindFirst(Dir + '*', faDirectory, SR) = 0 then begin
+ if FindFirst(Dir + '*', faDirectory, SR) = 0 then
+ begin
repeat
if (SR.Name <> '.') and (SR.Name <> '..') then
- BrowseDir(Dir + SR.Name + '\');
+ BrowseDir(Dir + SR.Name + '\', Index);
until FindNext(SR) <> 0;
end; // if
FindClose(SR);
@@ -256,7 +260,7 @@ begin SLen := BrowsePos;
Song[SLen].Path := Dir;
- Song[SLen].Folder := Copy(Dir, Length(SongPath)+1, 10000);
+ Song[SLen].Folder := Copy(Dir, Length(SongPaths[Index])+1, 10000);
Song[SLen].Folder := Copy(Song[SLen].Folder, 1, Pos('\', Song[SLen].Folder)-1);
Song[SLen].FileName := SR.Name;
@@ -463,27 +467,50 @@ begin Log.BenchmarkStart(3);
case Ini.Sorting of
- sEdition: begin
+ sEdition:
+ begin
Songs.Sort(sArtist);
Songs.Sort(sEdition);
end;
- sGenre: begin
+ sGenre:
+ begin
Songs.Sort(sArtist);
Songs.Sort(sGenre);
end;
- sLanguage: begin
+ sLanguage:
+ begin
Songs.Sort(sArtist);
Songs.Sort(sLanguage);
end;
- sFolder: begin
+ sFolder:
+ begin
Songs.Sort(sArtist);
Songs.Sort(sFolder);
end;
- sTitle: Songs.Sort(sTitle);
- sArtist: Songs.Sort(sArtist);
- sTitle2: Songs.Sort(sTitle2); // by title2 ???
- sArtist2: Songs.Sort(sArtist2); // by artist2 ???
- sRandom: Songs.Sort(sRandom);
+ sTitle:
+ begin
+ Songs.Sort(sArtist);
+ Songs.Sort(sTitle);
+ end;
+ sArtist:
+ begin
+ Songs.Sort(sTitle);
+ Songs.Sort(sArtist);
+ end;
+ sTitle2:
+ begin
+ Songs.Sort(sArtist);
+ Songs.Sort(sTitle);
+ end;
+ sArtist2:
+ begin
+ Songs.Sort(sTitle);
+ Songs.Sort(sArtist);
+ end;
+ sRandom:
+ begin
+ Songs.Sort(sRandom);
+ end;
end; // case
Log.BenchmarkEnd(3);
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 31cc6505..02817d51 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -113,7 +113,7 @@ type procedure SelectPrevNote;
procedure MakeSingle;
procedure MakeDuet;
- procedure DuetCopyLine;
+ function DuetCopyLine: boolean;
procedure DuetMoveLine;
procedure CopyNote(Pf, Cf, Nf, Pt, Ct, Nt: integer);
procedure CopyLine(Pf, Cf, Pt, Ct: integer);
@@ -597,14 +597,22 @@ begin begin
// Divide lengths by 2
if (SDL_ModState = KMOD_LSHIFT) then
+ begin
CzesciDivide;
+ Text[TextDebug].Text := 'BPM and note lengths halfed';
+ end;
if (SDL_ModState = KMOD_LCTRL or KMOD_LSHIFT) then
begin
if AktSong.isDuet then
- MakeSingle
- else
+ begin
+ MakeSingle;
+ Text[TextDebug].Text := 'Converted duet into normal song';
+ end else
+ begin
MakeDuet;
+ Text[TextDebug].Text := 'Created duet song';
+ end;
end;
end;
@@ -612,7 +620,10 @@ begin begin
// Multiply lengths by 2
if (SDL_ModState = KMOD_LSHIFT) then
+ begin
CzesciMultiply;
+ Text[TextDebug].Text := 'BPM and note lengths doubled';
+ end;
end;
SDLK_C:
@@ -627,11 +638,17 @@ begin // Correct spaces
if SDL_ModState = KMOD_LSHIFT then
+ begin
LyricsCorrectSpaces;
+ Text[TextDebug].Text := 'Corrected lyric spaces';
+ end;
// Copy sentence
if SDL_ModState = KMOD_LCTRL then
+ begin
MarkSrc;
+ Text[TextDebug].Text := 'Line marked'
+ end;
end;
SDLK_R: //reload
@@ -642,6 +659,7 @@ begin acClose;
onShow;
+ Text[TextDebug].Text := 'Song reloaded!';
end;
SDLK_V:
@@ -652,8 +670,10 @@ begin if (Length(Czesci[CopySrcCP].Czesc)>CopySrcLine) then
begin
if Czesci[CP].Czesc[Czesci[CP].Akt].IlNut >= Czesci[CopySrcCP].Czesc[CopySrcLine].IlNut then
- PasteText
- else
+ begin
+ PasteText;
+ Text[TextDebug].Text := 'Text pasted';
+ end else
beep;
end else
beep;
@@ -662,6 +682,7 @@ begin if (SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT) then
begin
CopySentence(CopySrcLine, Czesci[CP].Akt);
+ Text[TextDebug].Text := 'Line pasted';
end;
if SDL_ModState = 0 then
@@ -959,10 +980,14 @@ begin begin
// moves text to right in current sentence
DeleteNote;
+ Text[TextDebug].Text := 'Note deleted';
end;
if SDL_ModState = KMOD_LSHIFT then
+ begin
DeleteSentence;
+ Text[TextDebug].Text := 'Line deleted';
+ end;
end;
SDLK_PERIOD:
@@ -1175,11 +1200,11 @@ begin end;
end;
- {if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL) and (CP=0) then
+ if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL) and (CP=0) then
DuetCopyLine;
if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL or KMOD_LALT) and (CP=0) then
- DuetMoveLine;}
+ DuetMoveLine;
end;
SDLK_UP:
@@ -1222,11 +1247,11 @@ begin end;
end;
- {if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL) and (CP=1) then
+ if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL) and (CP=1) then
DuetCopyLine;
if AktSong.isDuet and (SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL or KMOD_LALT) and (CP=1) then
- DuetMoveLine;}
+ DuetMoveLine;
end;
// Golden Note Patch
@@ -1824,13 +1849,6 @@ begin Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
EditorLyric[CP].Selected := AktNuta[CP];
-
- {
- if AktSong.isDuet then
- begin
- Czesci[(CP+1) mod 2].Akt := Czesci[CP].Akt;
- EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[(CP+1) mod 2].Akt);
- end; }
end;
procedure TScreenEditSub.JoinSentence;
@@ -2252,62 +2270,14 @@ end; procedure TScreenEditSub.SelectNextNote();
begin
- {if AktSong.isDuet then
- begin
- Czesci[(CP+1) mod 2].Akt := Czesci[CP].Akt;
- while (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) do
- begin
- Czesci[(CP+1) mod 2].Akt := Czesci[CP].Akt;
- if (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)=0) then
- inc(Czesci[CP].Akt)
- else
- CP := (CP+1) mod 2;
-
- if Czesci[CP].Akt > Czesci[CP].High then
- Czesci[CP].Akt := 0;
- end;
-
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
-
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
- EditorLyric[1].AddCzesc(1, Czesci[1].Akt);
- EditorLyric[0].Selected := 0;
- EditorLyric[1].Selected := 0;
- end else
- begin }
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
- EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
- EditorLyric[CP].Selected := 0;
- //end;
+ EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
+ EditorLyric[CP].Selected := 0;
end;
procedure TScreenEditSub.SelectPrevNote();
begin
- {if AktSong.isDuet then
- begin
- //beat := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start;
- Czesci[(CP+1) mod 2].Akt := Czesci[CP].Akt;
- while (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) do
- begin
- Czesci[(CP+1) mod 2].Akt := Czesci[CP].Akt;
- if (Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)=0) then
- dec(Czesci[CP].Akt)
- else
- CP := (CP+1) mod 2;
-
- if Czesci[CP].Akt < 0 then
- Czesci[CP].Akt := Czesci[CP].High;
- end;
-
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
-
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
- EditorLyric[1].AddCzesc(1, Czesci[1].Akt);
- EditorLyric[0].Selected := 0;
- EditorLyric[1].Selected := 0;
- end else
- begin }
Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
@@ -2315,15 +2285,7 @@ begin end;
procedure TScreenEditSub.MakeSingle;
-var
- C: integer;
-
begin
- {for C := 0 to Length(Czesci[0].Czesc) - 1 do
- begin
- if (Length(Czesci[0].Czesc[C].Nuta)=0) then
- Czesci[0].Czesc[C] := Czesci[1].Czesc[C];
- end;}
SetLength(Czesci, 1);
AktSong.isDuet := false;
CP := 0;
@@ -2386,17 +2348,69 @@ begin AktSong.Medley.Source := msNone;
end;
-procedure TScreenEditSub.DuetCopyLine;
+function TScreenEditSub.DuetCopyLine: boolean;
var
LSrc, LDst: integer;
CSrc, CDst: integer;
+ SrcStart: integer;
+ SrcEnd: integer;
+
+ DstStart: integer;
+ DstEnd: integer;
+
+ SrcNumN: integer;
+ DstNumN: integer;
+
+ I, C: integer;
+
+ CLen: integer;
begin
+ Result := false;
+
CSrc := CP;
CDst := (CP+1) mod 2;
LSrc := Czesci[CSrc].Akt;
- LDst := Czesci[CDst].Akt;
+ LDst := -1;
+
+ SrcStart := Czesci[CSrc].Czesc[LSrc].Nuta[0].Start;
+ SrcNumN := Length(Czesci[CSrc].Czesc[LSrc].Nuta);
+ SrcEnd := Czesci[CSrc].Czesc[LSrc].Nuta[SrcNumN-1].Start + Czesci[CSrc].Czesc[LSrc].Nuta[SrcNumN-1].Dlugosc;
+
+ for I := 0 to Length(Czesci[CDst].Czesc)-1 do
+ begin
+ DstStart := Czesci[CDst].Czesc[I].Nuta[0].Start;
+ DstNumN := Length(Czesci[CDst].Czesc[I].Nuta);
+ DstEnd := Czesci[CDst].Czesc[I].Nuta[DstNumN-1].Start + Czesci[CDst].Czesc[I].Nuta[DstNumN-1].Dlugosc;
+ if (DstStart<=SrcStart) and (SrcEnd<=DstEnd) then
+ begin
+ LDst := I;
+ break;
+ end;
+
+ if (LDst = -1) and (I<Length(Czesci[CDst].Czesc)-1) then
+ begin
+ DstStart := DstEnd;
+ DstEnd := Czesci[CDst].Czesc[I+1].Nuta[0].Start;
+ if (DstStart<SrcStart) and (SrcEnd<DstEnd) then
+ begin
+ CLen := Length(Czesci[CDst].Czesc);
+ SetLength(Czesci[CDst].Czesc, CLen + 1);
+ Inc(Czesci[CDst].Ilosc);
+ Inc(Czesci[CDst].High);
+
+ for C := CLen-1 downto I do
+ CopyLine(CDst, C, CDst, C+1);
+
+ SetLength(Czesci[CDst].Czesc[I+1].Nuta, 0);
+ LDst := I+1;
+ break;
+ end;
+ end;
+ end;
+ if (LDst = -1) then
+ Exit;
CopyLine(CSrc, LSrc, CDst, LDst);
@@ -2405,6 +2419,7 @@ begin EditorLyric[CDst].Selected := 0;
AktNuta[CDst] := 0;
Czesci[CSrc].Czesc[LSrc].Nuta[AktNuta[CSrc]].Color := 2;
+ Result := true;
end;
procedure TScreenEditSub.CopyLine(Pf, Cf, Pt, Ct: integer);
@@ -2439,8 +2454,8 @@ end; procedure TScreenEditSub.DuetMoveLine;
begin
- DuetCopyLine;
- DeleteSentence;
+ if DuetCopyLine then
+ DeleteSentence;
{Czesci[CP].Czesc[Czesci[CP].Akt].Lyric := '';
Czesci[CP].Czesc[Czesci[CP].Akt].LyricWidth := 0;
Czesci[CP].Czesc[Czesci[CP].Akt].HighNut := -1;
diff --git a/Game/Code/Screens/UScreenName.pas b/Game/Code/Screens/UScreenName.pas index ee81901f..a00f8831 100644 --- a/Game/Code/Screens/UScreenName.pas +++ b/Game/Code/Screens/UScreenName.pas @@ -12,6 +12,7 @@ type constructor Create; override;
function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
procedure onShow; override;
+ procedure Refresh;
procedure SetAnimationProgress(Progress: real); override;
end;
@@ -49,113 +50,101 @@ begin // Templates for Names Mod
SDLK_F1:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[0] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[0];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[0] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[0];
+ end;
SDLK_F2:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[1] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[1];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[1] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[1];
+ end;
SDLK_F3:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[2] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[2];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[2] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[2];
+ end;
SDLK_F4:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[3] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[3];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[3] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[3];
+ end;
SDLK_F5:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[4] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[4];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[4] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[4];
+ end;
SDLK_F6:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[5] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[5];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[5] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[5];
+ end;
SDLK_F7:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[6] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[6];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[6] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[6];
+ end;
SDLK_F8:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[7] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[7];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[7] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[7];
+ end;
SDLK_F9:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[8] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[8];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[8] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[8];
+ end;
SDLK_F10:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[9] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[9];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[9] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[9];
+ end;
SDLK_F11:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[10] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[10];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[10] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[10];
+ end;
SDLK_F12:
- if (SDL_ModState = KMOD_LALT) then
- begin
- Ini.NameTemplate[11] := Button[Interaction].Text[0].Text;
- end
- else
- begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[11];
- end;
+ if (SDL_ModState = KMOD_LALT) then
+ begin
+ Ini.NameTemplate[11] := Button[Interaction].Text[0].Text;
+ end else
+ begin
+ Button[Interaction].Text[0].Text := Ini.NameTemplate[11];
+ end;
SDLK_BACKSPACE:
@@ -191,10 +180,44 @@ begin // Up and Down could be done at the same time,
// but I don't want to declare variables inside
// functions like this one, called so many times
- SDLK_DOWN: InteractNext;
- SDLK_UP: InteractPrev;
- SDLK_RIGHT: InteractNext;
- SDLK_LEFT: InteractPrev;
+ SDLK_DOWN:
+ begin
+ if (SDL_ModState = KMOD_LSHIFT) then
+ begin
+ if (Ini.Players>0) then
+ Dec(Ini.Players);
+
+ if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1;
+ if (Ini.Players = 4) then PlayersPlay := 6;
+
+ Refresh;
+ end else
+ InteractNext;
+ end;
+
+ SDLK_UP:
+ begin
+ if (SDL_ModState = KMOD_LSHIFT) then
+ begin
+ if (Ini.Players<4) then
+ Inc(Ini.Players);
+
+ if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1;
+ if (Ini.Players = 4) then PlayersPlay := 6;
+ Refresh;
+ end else
+ InteractPrev;
+ end;
+
+ SDLK_RIGHT:
+ begin
+ InteractNext;
+ end;
+
+ SDLK_LEFT:
+ begin
+ InteractPrev;
+ end;
end;
end;
@@ -222,17 +245,27 @@ begin for I := 1 to 6 do
Button[I-1].Text[0].Text := Ini.Name[I-1];
- for I := 1 to PlayersPlay do begin
+ Refresh;
+
+ if not Help.SetHelpID(ID) then
+ Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenName)');
+end;
+
+procedure TScreenName.Refresh;
+var
+ I: integer;
+begin
+ for I := 1 to PlayersPlay do
+ begin
Button[I-1].Visible := true;
Button[I-1].Selectable := true;
end;
- for I := PlayersPlay+1 to 6 do begin
+ for I := PlayersPlay+1 to 6 do
+ begin
Button[I-1].Visible := false;
Button[I-1].Selectable := false;
end;
- if not Help.SetHelpID(ID) then
- Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenName)');
end;
procedure TScreenName.SetAnimationProgress(Progress: real);
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index f9d59552..46f7b63c 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -225,7 +225,7 @@ begin Exit;
Inc(ShowNotes);
- if (ShowNotes>2) then
+ if (ShowNotes>3) then
ShowNotes:=0;
end;
@@ -283,7 +283,8 @@ begin SDLK_S:
begin
- Ini.PossibleScore := (Ini.PossibleScore+1) mod 4;
+ if (ScreenSong.Mode = smNormal) then
+ Ini.PossibleScore := (Ini.PossibleScore+1) mod 4;
//Ini.Save;
end;
@@ -2091,10 +2092,22 @@ begin end;
Static[StaticLyricBar].Texture.Alpha := Alpha[1];
+ if (ShowNotes<3) then
+ Static[StaticLyricBar].Visible := true
+ else
+ Static[StaticLyricBar].Visible := false;
if AktSong.isDuet then
+ begin
Static[StaticLyricDuetBar].Texture.Alpha := Alpha[0];
+ if (ShowNotes<3) then
+ Static[StaticLyricDuetBar].Visible := true
+ else
+ Static[StaticLyricDuetBar].Visible := false;
+ end;
+
+
// draw custom items
SingDraw(Alpha); // always draw
@@ -2274,6 +2287,8 @@ begin end else if(ScreenSong.Mode = smNormal) then
begin
singmode := 'Normal';
+ if AktSong.isDuet then
+ singmode := singmode + ' (Duet)';
end;
if not ScreenSong.SungToEnd then
diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas index 8379fdcf..5f2e12a7 100644 --- a/Game/Code/Screens/UScreenSingModi.pas +++ b/Game/Code/Screens/UScreenSingModi.pas @@ -185,7 +185,7 @@ var I: Integer;
begin
PlayersPlay := TeamInfo.NumTeams;
-
+ Ini.PossibleScore := 0;
if DLLMan.Selected.LoadSong then //Start with Song
begin
inherited;
diff --git a/Game/Code/Screens/UScreenSongJumpto.pas b/Game/Code/Screens/UScreenSongJumpto.pas index af08edc9..b210dd7e 100644 --- a/Game/Code/Screens/UScreenSongJumpto.pas +++ b/Game/Code/Screens/UScreenSongJumpto.pas @@ -54,7 +54,8 @@ begin SDLK_SPACE, SDLK_MINUS, SDLK_EXCLAIM,
SDLK_COMMA, SDLK_SLASH, SDLK_ASTERISK,
SDLK_QUESTION, SDLK_QUOTE, SDLK_QUOTEDBL,
- SDLK_LEFTBRACKET, SDLK_SEMICOLON:
+ SDLK_LEFTBRACKET, SDLK_SEMICOLON,
+ SDLK_PERIOD:
begin
if not isDuet then
begin
|