diff options
author | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-10 14:48:56 +0000 |
---|---|---|
committer | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-10 14:48:56 +0000 |
commit | 0cf452b6cb8efaf90f8bdda6636bdabbb71d52b6 (patch) | |
tree | a869201883cc1cd4f39918daf67b979c3f51677a /Game/Code | |
parent | 44f53ae73531b0570aef1ac1adf47a146c114a49 (diff) | |
download | usdx-0cf452b6cb8efaf90f8bdda6636bdabbb71d52b6.tar.gz usdx-0cf452b6cb8efaf90f8bdda6636bdabbb71d52b6.tar.xz usdx-0cf452b6cb8efaf90f8bdda6636bdabbb71d52b6.zip |
- fixed saving duets
- rewrite of DivideSentence and JoinSentence for duet mode
- rewrite of DivideNote for duet mode
- fixed score calculation for P2
- added more functions to the menu
- update of language files
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2473 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code')
-rw-r--r-- | Game/Code/Classes/UFiles.pas | 29 | ||||
-rw-r--r-- | Game/Code/Classes/UMain.pas | 4 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenEditSub.pas | 280 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSing.pas | 3 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSong.pas | 190 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSongJumpto.pas | 47 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSongMenu.pas | 226 |
7 files changed, 555 insertions, 224 deletions
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index 1896829f..f9c281b1 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -998,6 +998,7 @@ var RelativeSubTime: integer;
NoteState: String;
CP: integer;
+ P: integer;
procedure WriteCustomTags; //from 1.1 (modified)
var
@@ -1132,17 +1133,17 @@ begin end; // C
end else
begin
- CP := -1;
+ P := -1;
for C := 0 to Czesc[0].High do //go through all lines
begin
if isIdenticalLine(C) then
begin
//not end?
- if (C < Czesc[0].High) and (CP <> 3) then
+ if (C < Czesc[0].High) and (P <> 3) then
begin
//P1+P2 ==> P3
S := 'P3';
- CP := 3;
+ P := 3;
WriteLn(SongFile, S);
end;
WriteLine(0, C);
@@ -1151,10 +1152,10 @@ begin //singer 1 P1
if (Length(Czesc[0].Czesc[C].Nuta)>0) then
begin
- if (C < Czesc[0].High) and (CP <> 1) then
+ if (C < Czesc[0].High) and (P <> 1) then
begin
S := 'P1';
- CP := 1;
+ P := 1;
WriteLn(SongFile, S);
end;
WriteLine(0, C);
@@ -1163,25 +1164,29 @@ begin //singer 2 P2
if (Length(Czesc[1].Czesc[C].Nuta)>0) then
begin
- if (C < Czesc[0].High) and (CP <> 2) then
+ if (C < Czesc[0].High) and (P <> 2) then
begin
S := 'P2';
- CP := 2;
+ P := 2;
WriteLn(SongFile, S);
end;
WriteLine(1, C);
end;
end;
- if C < Czesc[0].High then
+ CP := P-1;
+ if CP=2 then
+ CP := 0;
+
+ if C < Czesc[CP].High then
begin // don't write end of last sentence
if not Relative then
- S := '- ' + IntToStr(Czesc[0].Czesc[C+1].Start)
+ S := '- ' + IntToStr(Czesc[CP].Czesc[C+1].Start)
else
begin
- S := '- ' + IntToStr(Czesc[0].Czesc[C+1].Start - RelativeSubTime) +
- ' ' + IntToStr(Czesc[0].Czesc[C+1].Start - RelativeSubTime);
- RelativeSubTime := Czesc[0].Czesc[C+1].Start;
+ S := '- ' + IntToStr(Czesc[CP].Czesc[C+1].Start - RelativeSubTime) +
+ ' ' + IntToStr(Czesc[CP].Czesc[C+1].Start - RelativeSubTime);
+ RelativeSubTime := Czesc[CP].Czesc[C+1].Start;
end;
WriteLn(SongFile, S);
end;
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index 9a7caae7..04c19a47 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -515,7 +515,7 @@ begin Music.PlayClick;
// debug system on LPT
- if ((Czas.AktBeatC + Czesci[CP].Resolution + Czesci[CP].NotesGAP) mod Czesci[CP].Resolution = 0) then
+ {if ((Czas.AktBeatC + Czesci[CP].Resolution + Czesci[CP].NotesGAP) mod Czesci[CP].Resolution = 0) then
begin
//LPT_1 := 0;
// Light.LightOne(0, 150);
@@ -525,7 +525,7 @@ begin Light.LightOne(0, 150)
else
Light.LightOne(1, 150)}
- end;
+ //end;
if (Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta)=0) then
Exit;
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 55748a0e..2b961040 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -32,7 +32,7 @@ type TextSentence: integer;
TextTitle: integer;
TextArtist: integer;
- TextMp3: integer;
+ //TextMp3: integer;
TextBPM: integer;
TextGAP: integer;
TextDebug: integer;
@@ -113,6 +113,8 @@ type procedure MakeDuet;
procedure DuetCopyLine;
procedure DuetMoveLine;
+ procedure CopyNote(Pf, Cf, Nf, Pt, Ct, Nt: integer);
+ procedure CopyLine(Pf, Cf, Pt, Ct: integer);
procedure Refresh;
public
Tex_Background: TTexture;
@@ -285,21 +287,13 @@ begin begin
if SDL_ModState = 0 then
begin
- if AktSong.isDuet then
- Exit;
// Insert start of sentece
if AktNuta[CP] > 0 then
- begin
DivideSentence;
- FixTimings;
- EditorLyric[CP].Selected := AktNuta[CP];
- end;
end;
if SDL_ModState = KMOD_LSHIFT then
begin
- if AktSong.isDuet then
- Exit;
// Join next sentence with current
if Czesci[CP].Akt < Czesci[CP].High then
JoinSentence;
@@ -1602,6 +1596,7 @@ end; procedure TScreenEditSub.DivideSentence;
var
+ P: integer;
C: integer;
CStart: integer;
CNew: integer;
@@ -1610,100 +1605,152 @@ var NStart: integer;
NHigh: integer;
NNewL: integer;
+
+ BStart: integer; //start beat
+
begin
- // increase sentence length by 1
- CLen := Length(Czesci[0].Czesc);
- SetLength(Czesci[0].Czesc, CLen + 1);
- Inc(Czesci[0].Ilosc);
- Inc(Czesci[0].High);
-
- // move needed sentences to one forward. newly has the copy of divided sentence
- CStart := Czesci[0].Akt;
- for C := CLen-1 downto CStart do
- Czesci[0].Czesc[C+1] := Czesci[0].Czesc[C];
-
- // clear and set new sentence
+ CStart := Czesci[CP].Akt;
+ BStart := Czesci[CP].Czesc[CStart].Nuta[AktNuta[CP]].Start;
+
CNew := CStart + 1;
- NStart := AktNuta[CP];
- Czesci[0].Czesc[CNew].Start := Czesci[0].Czesc[CStart].Nuta[NStart].Start;
- Czesci[0].Czesc[CNew].StartNote := Czesci[0].Czesc[CStart].Nuta[NStart].Start;
- Czesci[0].Czesc[CNew].Lyric := '';
- Czesci[0].Czesc[CNew].LyricWidth := 0;
- Czesci[0].Czesc[CNew].Koniec := 0;
- Czesci[0].Czesc[CNew].BaseNote := 0; // 0.5.0: we modify it later in this procedure
- Czesci[0].Czesc[CNew].IlNut := 0;
- Czesci[0].Czesc[CNew].HighNut := -1;
- SetLength(Czesci[0].Czesc[CNew].Nuta, 0);
-
- // move right notes to new sentences
- NHigh := Czesci[0].Czesc[CStart].HighNut;
- for N := NStart to NHigh do begin
- NNewL := Czesci[0].Czesc[CNew].IlNut;
- SetLength(Czesci[0].Czesc[CNew].Nuta, NNewL + 1);
- Czesci[0].Czesc[CNew].Nuta[NNewL] := Czesci[0].Czesc[CStart].Nuta[N];
-
- // increase sentence counters
- Inc(Czesci[0].Czesc[CNew].IlNut);
- Inc(Czesci[0].Czesc[CNew].HighNut);
- Czesci[0].Czesc[CNew].Koniec := Czesci[0].Czesc[CNew].Nuta[NNewL].Start +
- Czesci[0].Czesc[CNew].Nuta[NNewL].Dlugosc;
+
+ for P := 0 to Length(Czesci) - 1 do
+ begin
+ // increase sentence length by 1
+ CLen := Length(Czesci[P].Czesc);
+ SetLength(Czesci[P].Czesc, CLen + 1);
+ Inc(Czesci[P].Ilosc);
+ Inc(Czesci[P].High);
+
+ // move needed sentences to one forward. newly has the copy of divided sentence
+ for C := CLen-1 downto CStart do
+ CopyLine(P, C, P, C+1);
+ //Czesci[P].Czesc[C+1] := Czesci[P].Czesc[C];
+
+ // clear and set new sentence
+ NStart := -1;
+ if (Length(Czesci[P].Czesc[CStart].Nuta)>0) then
+ begin
+ for N := 0 to Length(Czesci[P].Czesc[CStart].Nuta) - 1 do
+ begin
+ if Czesci[P].Czesc[CStart].Nuta[N].Start>=BStart then
+ begin
+ NStart := N;
+ break;
+ end;
+ end;
+
+ if (NStart > -1) then
+ begin
+ Czesci[P].Czesc[CNew].Start := Czesci[P].Czesc[CStart].Nuta[NStart].Start;
+ Czesci[P].Czesc[CNew].StartNote := Czesci[P].Czesc[CStart].Nuta[NStart].Start;
+ end;
+ end;
+
+ Czesci[P].Czesc[CNew].Lyric := '';
+ Czesci[P].Czesc[CNew].LyricWidth := 0;
+ Czesci[P].Czesc[CNew].Koniec := 0;
+ Czesci[P].Czesc[CNew].BaseNote := 0; // 0.5.0: we modify it later in this procedure
+ Czesci[P].Czesc[CNew].IlNut := 0;
+ Czesci[P].Czesc[CNew].HighNut := -1;
+ SetLength(Czesci[P].Czesc[CNew].Nuta, 0);
+
+ // move right notes to new sentences
+ if (NStart > -1) then
+ begin
+ NHigh := Czesci[P].Czesc[CStart].HighNut;
+ for N := NStart to NHigh do
+ begin
+ NNewL := Czesci[P].Czesc[CNew].IlNut;
+ SetLength(Czesci[P].Czesc[CNew].Nuta, NNewL + 1);
+ CopyNote(P, CStart, N, P, CNew, NNewL);
+ //Czesci[P].Czesc[CNew].Nuta[NNewL] := Czesci[P].Czesc[CStart].Nuta[N];
+
+ // increase sentence counters
+ Inc(Czesci[P].Czesc[CNew].IlNut);
+ Inc(Czesci[P].Czesc[CNew].HighNut);
+ Czesci[P].Czesc[CNew].Koniec := Czesci[P].Czesc[CNew].Nuta[NNewL].Start +
+ Czesci[P].Czesc[CNew].Nuta[NNewL].Dlugosc;
+ end;
+
+ // clear old notes and set sentence counters
+ Czesci[P].Czesc[CStart].HighNut := NStart - 1;
+ Czesci[P].Czesc[CStart].IlNut := Czesci[P].Czesc[CStart].HighNut + 1;
+ if (NStart>0) then
+ Czesci[P].Czesc[CStart].Koniec := Czesci[P].Czesc[CStart].Nuta[NStart-1].Start +
+ Czesci[P].Czesc[CStart].Nuta[NStart-1].Dlugosc;
+
+ SetLength(Czesci[P].Czesc[CStart].Nuta, Czesci[P].Czesc[CStart].IlNut);
+ end;
+ Czesci[P].Akt := Czesci[P].Akt + 1;
+ AktNuta[P] := 0;
end;
- // clear old notes and set sentence counters
- Czesci[0].Czesc[CStart].HighNut := NStart - 1;
- Czesci[0].Czesc[CStart].IlNut := Czesci[0].Czesc[CStart].HighNut + 1;
- Czesci[0].Czesc[CStart].Koniec := Czesci[0].Czesc[CStart].Nuta[NStart-1].Start +
- Czesci[0].Czesc[CStart].Nuta[NStart-1].Dlugosc;
- SetLength(Czesci[0].Czesc[CStart].Nuta, Czesci[0].Czesc[CStart].IlNut);
-
- // 0.5.0: modify BaseNote
- Czesci[0].Czesc[CNew].BaseNote := 120;
- for N := 0 to Czesci[0].Czesc[CNew].IlNut do
- if Czesci[0].Czesc[CNew].Nuta[N].Ton < Czesci[0].Czesc[CNew].BaseNote then
- Czesci[0].Czesc[CNew].BaseNote := Czesci[0].Czesc[CNew].Nuta[N].Ton;
-
- Czesci[0].Akt := Czesci[0].Akt + 1;
- AktNuta[0] := 0;
- Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 2;
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
+ Refresh;
+ 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;
var
+ P: integer;
C: integer;
N: integer;
NStart: integer;
NDst: integer;
begin
- C := Czesci[CP].Akt;
-
- // set new sentence
- NStart := Czesci[0].Czesc[C].IlNut;
- Czesci[0].Czesc[C].IlNut := Czesci[0].Czesc[C].IlNut + Czesci[0].Czesc[C+1].IlNut;
- Czesci[0].Czesc[C].HighNut := Czesci[0].Czesc[C].HighNut + Czesci[0].Czesc[C+1].IlNut;
- SetLength(Czesci[0].Czesc[C].Nuta, Czesci[0].Czesc[C].IlNut);
-
- // move right notes to new sentences
- for N := 0 to Czesci[0].Czesc[C+1].HighNut do
+ for P := 0 to Length(Czesci) - 1 do
begin
- NDst := NStart + N;
- Czesci[0].Czesc[C].Nuta[NDst] := Czesci[0].Czesc[C+1].Nuta[N];
- end;
+ C := Czesci[CP].Akt;
+ // set new sentence
+ NStart := Czesci[P].Czesc[C].IlNut;
+ Czesci[P].Czesc[C].IlNut := Czesci[P].Czesc[C].IlNut + Czesci[P].Czesc[C+1].IlNut;
+ Czesci[P].Czesc[C].HighNut := Czesci[P].Czesc[C].HighNut + Czesci[P].Czesc[C+1].IlNut;
+ SetLength(Czesci[P].Czesc[C].Nuta, Czesci[P].Czesc[C].IlNut);
+
+ // move right notes to new sentences
+ if (Length(Czesci[P].Czesc[C+1].Nuta)>0) then
+ begin
+ for N := 0 to Czesci[P].Czesc[C+1].HighNut do
+ begin
+ NDst := NStart + N;
+ CopyNote(P, C+1, N, P, C, NDst);
+ //Czesci[P].Czesc[C].Nuta[NDst] := Czesci[P].Czesc[C+1].Nuta[N];
+ end;
- // increase sentence counters
- NDst := Czesci[0].Czesc[C].HighNut;
- Czesci[0].Czesc[C].Koniec := Czesci[0].Czesc[C].Nuta[NDst].Start +
- Czesci[0].Czesc[C].Nuta[NDst].Dlugosc;
+ // increase sentence counters
+ NDst := Czesci[P].Czesc[C].HighNut;
+ Czesci[P].Czesc[C].Koniec := Czesci[P].Czesc[C].Nuta[NDst].Start +
+ Czesci[P].Czesc[C].Nuta[NDst].Dlugosc;
+ end;
+ // move needed sentences to one backward.
+ for C := Czesci[P].Akt + 1 to Czesci[P].High - 1 do
+ //Czesci[P].Czesc[C] := Czesci[P].Czesc[C+1];
+ CopyLine(P, C+1, P, C);
+
+ // decrease sentence length by 1
+ SetLength(Czesci[P].Czesc, Length(Czesci[P].Czesc) - 1);
+ Dec(Czesci[P].Ilosc);
+ Dec(Czesci[P].High);
+ end;
- // move needed sentences to one backward.
- for C := Czesci[0].Akt + 1 to Czesci[0].High - 1 do
- Czesci[0].Czesc[C] := Czesci[0].Czesc[C+1];
+ Refresh;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
+ EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
+ EditorLyric[CP].Selected := AktNuta[CP];
- // increase sentence length by 1
- SetLength(Czesci[0].Czesc, Length(Czesci[0].Czesc) - 1);
- Dec(Czesci[0].Ilosc);
- Dec(Czesci[0].High);
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
+ 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.DivideNote;
@@ -2159,31 +2206,13 @@ procedure TScreenEditSub.DuetCopyLine; var
L: integer;
Src, Dst: integer;
- N: integer;
begin
L := Czesci[CP].Akt;
Src := CP;
Dst := (CP+1) mod 2;
- SetLength(Czesci[Dst].Czesc[L].Nuta, Czesci[Src].Czesc[L].IlNut);
- Czesci[Dst].Czesc[L].IlNut := Czesci[Src].Czesc[L].IlNut;
- Czesci[Dst].Czesc[L].HighNut := Czesci[Src].Czesc[L].HighNut;
- Czesci[Dst].Czesc[L].Koniec := Czesci[Src].Czesc[L].Koniec;
- Czesci[Dst].Czesc[L].Start := Czesci[Src].Czesc[L].Start;
- Czesci[Dst].Czesc[L].BaseNote := Czesci[Src].Czesc[L].BaseNote;
- Czesci[Dst].Czesc[L].StartNote := Czesci[Src].Czesc[L].StartNote;
-
- for N := 0 to Czesci[Src].Czesc[L].HighNut do
- begin
- Czesci[Dst].Czesc[L].Nuta[N].Tekst := Czesci[Src].Czesc[L].Nuta[N].Tekst;
- Czesci[Dst].Czesc[L].Nuta[N].Dlugosc := Czesci[Src].Czesc[L].Nuta[N].Dlugosc;
- Czesci[Dst].Czesc[L].Nuta[N].Ton := Czesci[Src].Czesc[L].Nuta[N].Ton;
- Czesci[Dst].Czesc[L].Nuta[N].Start := Czesci[Src].Czesc[L].Nuta[N].Start;
- Czesci[Dst].Czesc[L].Nuta[N].TonGamy := Czesci[Src].Czesc[L].Nuta[N].TonGamy;
- Czesci[Dst].Czesc[L].Nuta[N].FreeStyle := Czesci[Src].Czesc[L].Nuta[N].FreeStyle;
- Czesci[Dst].Czesc[L].Nuta[N].Wartosc := Czesci[Src].Czesc[L].Nuta[N].Wartosc;
- end;
+ CopyLine(Src, L, Dst, L);
Refresh;
EditorLyric[Dst].AddCzesc(Dst, Czesci[Src].Akt);
@@ -2192,6 +2221,36 @@ begin Czesci[Src].Czesc[L].Nuta[AktNuta[Src]].Color := 2;
end;
+procedure TScreenEditSub.CopyLine(Pf, Cf, Pt, Ct: integer);
+var
+ N: integer;
+begin
+ Czesci[Pt].Czesc[Ct].IlNut := Czesci[Pf].Czesc[Cf].IlNut;
+ Czesci[Pt].Czesc[Ct].HighNut := Czesci[Pf].Czesc[Cf].HighNut;
+ Czesci[Pt].Czesc[Ct].Koniec := Czesci[Pf].Czesc[Cf].Koniec;
+ Czesci[Pt].Czesc[Ct].Start := Czesci[Pf].Czesc[Cf].Start;
+ Czesci[Pt].Czesc[Ct].BaseNote := Czesci[Pf].Czesc[Cf].BaseNote;
+ Czesci[Pt].Czesc[Ct].StartNote := Czesci[Pf].Czesc[Cf].StartNote;
+
+ SetLength(Czesci[Pt].Czesc[Ct].Nuta, Czesci[Pf].Czesc[Cf].IlNut);
+ for N := 0 to Czesci[Pf].Czesc[Cf].HighNut do
+ CopyNote(Pf, Cf, N, Pt, Ct, N);
+end;
+
+procedure TScreenEditSub.CopyNote(Pf, Cf, Nf, Pt, Ct, Nt: integer);
+begin
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Color := 0;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Start := Czesci[Pf].Czesc[Cf].Nuta[Nf].Start;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Dlugosc := Czesci[Pf].Czesc[Cf].Nuta[Nf].Dlugosc;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Ton := Czesci[Pf].Czesc[Cf].Nuta[Nf].Ton;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].TonGamy := Czesci[Pf].Czesc[Cf].Nuta[Nf].TonGamy;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Tekst := Czesci[Pf].Czesc[Cf].Nuta[Nf].Tekst;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].FreeStyle := Czesci[Pf].Czesc[Cf].Nuta[Nf].FreeStyle;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].Wartosc := Czesci[Pf].Czesc[Cf].Nuta[Nf].Wartosc;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].IsMedley := Czesci[Pf].Czesc[Cf].Nuta[Nf].IsMedley;
+ Czesci[Pt].Czesc[Ct].Nuta[Nt].IsStartPreview := Czesci[Pf].Czesc[Cf].Nuta[Nf].IsStartPreview;
+end;
+
procedure TScreenEditSub.DuetMoveLine;
begin
DuetCopyLine;
@@ -2230,6 +2289,7 @@ begin IlNut := Length(Nuta);
HighNut := IlNut-1;
TotalNotes := 0;
+ BaseNote := 120;
if (Length(Nuta)>0) then
begin
@@ -2239,8 +2299,12 @@ begin Nuta[N].Color := 0;
Czesci[P].Wartosc := Czesci[P].Wartosc + Nuta[N].Dlugosc * Nuta[N].Wartosc;
TotalNotes := TotalNotes + Nuta[N].Dlugosc * Nuta[N].Wartosc;
+
+ if (Nuta[N].Ton < BaseNote) then
+ BaseNote := Nuta[N].Ton;
end;
- end;
+ end else
+ BaseNote := 0;
end;
end;
end;
@@ -2382,6 +2446,7 @@ var Blend: real;
begin
DrawStatics;
+ end_ := false;
glClearColor(1,1,1,1);
@@ -2650,7 +2715,8 @@ begin Text[TextNStart].Text := IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Start);
Text[TextNDlugosc].Text := IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Dlugosc);
Text[TextNTon].Text := IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Ton) +
- ' ( ' + GetNoteName(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Ton) + ' )';
+ ' ( ' + GetNoteName(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Ton) + ' ) ' +
+ IntToStr(Czesci[CP].Czesc[Czesci[CP].Akt].BaseNote);
Text[TextNText].Text := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst;
//F and G and Medley Mod:
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index fb242285..06cb048c 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -1695,7 +1695,8 @@ begin //PhrasenBonus give Points
Player[I].ScoreLine := Player[I].ScoreLine +
- (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[I mod 2]) * A / 8);
+ (1000 / (Length(Czesci[CP].Czesc) - NumEmptySentences[CP]) * A / 8);
+
Player[I].ScoreLineI := Round(Player[I].ScoreLine / 10) * 10;
//Update Total Score
Player[I].ScoreTotalI := Player[I].ScoreI + Player[I].ScoreGoldenI + Player[I].ScoreLineI;
diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 8f3b227d..4c394ceb 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -150,6 +150,7 @@ type constructor Create; override;
+ procedure ChangeSorting(tabs: boolean; sorting: integer);
procedure SetScroll;
procedure SetScroll1;
procedure SetScroll2;
@@ -365,10 +366,6 @@ var Letter: Char;
VisArr: array of integer;
- Artist: string;
- Title: string;
- jump: boolean;
-
begin
Result := true;
@@ -812,7 +809,8 @@ begin begin
WaitHandler.changed := false;
CatSongs.Selected := Interaction;
- if not CatSongs.Song[Interaction].Main then begin // clicked on Song
+ if not CatSongs.Song[Interaction].Main then
+ begin // clicked on Song
if CatSongs.CatNumShow = -3 then
ScreenSongMenu.MenuShow(SM_Playlist)
else
@@ -1117,91 +1115,17 @@ begin begin
//Change Sorting
if (Ini.Sorting<Length(ISorting)-1) then
- Inc(Ini.Sorting)
+ ChangeSorting(Ini.Tabs=1, Ini.Sorting+1)
else
- Ini.Sorting := 0;
-
- InfoHandler.txt := 'Sorting: ' + ISorting[Ini.Sorting];
+ ChangeSorting(Ini.Tabs=1, 0);
end else
begin
//Change Tabs (on/off)
if (Ini.Tabs=1) then
- begin
- Ini.Tabs := 0;
- InfoHandler.txt := 'Tabs: off';
- end else
- begin
- Ini.Tabs := 1;
- InfoHandler.txt := 'Tabs: on';
- end;
- end;
-
- if not CatSongs.Song[Interaction].Main then
- begin
- Artist := CatSongs.Song[Interaction].Artist;
- Title := CatSongs.Song[Interaction].Title;
- jump := true;
- end else
- jump := false;
-
- Refresh(false);
- PlaylistMan.LoadPlayLists;
-
- if jump then
- I2 := PlaylistMan.FindSong(Artist, Title)
- else
- begin
- //Find Category
- I := Interaction;
- while not catsongs.Song[I].Main do
- begin
- Dec (I);
- if (I < low(CatSongs.Song)) then
- break;
- end;
- if (I<= 1) then
- Interaction := high(catsongs.Song)
+ ChangeSorting(false, Ini.Sorting)
else
- Interaction := I - 1;
-
- CatSongs.ShowCategoryList;
-
- //Show Cat in Top Left Mod
- HideCatTL;
-
- //Show Wrong Song when Tabs on Fix
- SelectNext;
- FixSelected;
+ ChangeSorting(true, Ini.Sorting);
end;
-
- if (Ini.Tabs=1) and not (CatSongs.CatNumShow = -3) and jump then
- begin
- //Search Cat
- for I := I2 downto low(CatSongs.Song) do
- begin
- if CatSongs.Song[I].Main then
- break;
- end;
-
- //Choose Cat
- CatSongs.ShowCategoryList;
- ShowCatTL(I);
- CatSongs.ClickCategoryButton(I);
- end else
- HideCatTL;
-
- //Choose Song
- if jump then
- begin
- SkipTo2(I2);
- SongCurrent := SongTarget;
- ChangeMusic;
- end;
-
- Ini.Save;
-
- InfoHandler.changed := true;
- InfoHandler.change_time := 0;
end;
SDLK_1:
@@ -1429,6 +1353,106 @@ begin MP3Volume := Ini.PreviewVolume * 10;
end;
+procedure TScreenSong.ChangeSorting(tabs: boolean; sorting: integer);
+var
+ changed: boolean;
+ Artist: string;
+ Title: string;
+ jump: boolean;
+ I, I2: integer;
+
+begin
+ changed := false;
+
+ if (tabs and (Ini.Tabs=0)) or (not tabs and (Ini.Tabs=1)) then
+ changed := true;
+
+ if (sorting <> Ini.Sorting) then
+ changed := true;
+
+ if not changed then
+ Exit;
+
+ Ini.Sorting := sorting;
+
+ if tabs then
+ begin
+ Ini.Tabs := 1;
+ InfoHandler.txt := 'Tabs: on ' + 'Sorting: ' + ISorting[Ini.Sorting];
+ end else
+ begin
+ Ini.Tabs := 0;
+ InfoHandler.txt := 'Tabs: off ' + 'Sorting: ' + ISorting[Ini.Sorting];
+ end;
+
+ if not CatSongs.Song[Interaction].Main then
+ begin
+ Artist := CatSongs.Song[Interaction].Artist;
+ Title := CatSongs.Song[Interaction].Title;
+ jump := true;
+ end else
+ jump := false;
+
+ Refresh(false);
+ PlaylistMan.LoadPlayLists;
+
+ if jump then
+ I2 := PlaylistMan.FindSong(Artist, Title)
+ else
+ begin
+ //Find Category
+ I := Interaction;
+ while not CatSongs.Song[I].Main do
+ begin
+ Dec (I);
+ if (I < low(CatSongs.Song)) then
+ break;
+ end;
+ if (I<= 1) then
+ Interaction := high(catsongs.Song)
+ else
+ Interaction := I - 1;
+
+ //Show Cat in Top Left Mod
+ HideCatTL;
+
+ //Show Wrong Song when Tabs on Fix
+ SelectNext;
+ FixSelected;
+ ChangeMusic;
+ end;
+
+ if (Ini.Tabs=1) and not (CatSongs.CatNumShow = -3) and jump then
+ begin
+ //Search Cat
+ for I := I2 downto low(CatSongs.Song) do
+ begin
+ if CatSongs.Song[I].Main then
+ break;
+ end;
+
+ //Choose Cat
+ CatSongs.ShowCategoryList;
+ ShowCatTL(I);
+ CatSongs.ClickCategoryButton(I);
+ end;
+
+ //Choose Song
+ if jump then
+ begin
+ SkipTo2(I2);
+ SongCurrent := SongTarget;
+ ChangeMusic;
+ end;
+
+ Ini.Save;
+
+ InfoHandler.changed := true;
+ InfoHandler.change_time := 0;
+end;
+
+
+
procedure TScreenSong.SetScroll;
var
VS, B, I: Integer;
diff --git a/Game/Code/Screens/UScreenSongJumpto.pas b/Game/Code/Screens/UScreenSongJumpto.pas index c79fff65..f4d0d796 100644 --- a/Game/Code/Screens/UScreenSongJumpto.pas +++ b/Game/Code/Screens/UScreenSongJumpto.pas @@ -27,6 +27,10 @@ type function Draw: boolean; override;
procedure SetTextFound(const Count: Cardinal);
+ procedure ToggleDuetFilter();
+ procedure SetDuetFilter();
+ procedure ResetDuetFilter();
+ procedure RefreshDuetFilter();
end;
var
@@ -106,18 +110,7 @@ begin SDLK_F1:
begin
- if not isDuet then
- begin
- //show/hide duet songs
- isDuet := true;
- Button[0].Text[0].Text := 'Duet Songs';
- SetTextFound(CatSongs.SetFilter('', 3));
- end else
- begin
- isDuet := false;
- Button[0].Text[0].Text := '';
- SetTextFound(CatSongs.SetFilter(Button[0].Text[0].Text, SelectType));
- end;
+ ToggleDuetFilter;
end;
SDLK_RETURN,
@@ -269,4 +262,34 @@ begin end;
end;
+procedure TScreenSongJumpto.ToggleDuetFilter;
+begin
+ if not isDuet then
+ SetDuetFilter
+ else
+ ResetDuetFilter;
+end;
+
+procedure TScreenSongJumpto.SetDuetFilter;
+begin
+ isDuet := true;
+ Button[0].Text[0].Text := 'Duet Songs';
+ SetTextFound(CatSongs.SetFilter('', 3));
+end;
+
+procedure TScreenSongJumpto.ResetDuetFilter;
+begin
+ isDuet := false;
+ Button[0].Text[0].Text := '';
+ SetTextFound(CatSongs.SetFilter(Button[0].Text[0].Text, SelectType));
+end;
+
+procedure TScreenSongJumpto.RefreshDuetFilter;
+begin
+ if isDuet then
+ SetDuetFilter
+ else
+ ResetDuetFilter;
+end;
+
end.
diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index ccd9d07c..4cbad5e7 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -24,6 +24,12 @@ type const
SM_Main = 1;
+
+ SM_Song = 8 or 1;
+
+ SM_Medley = 16 or 1;
+
+ SM_Sort = 32 or 1;
SM_PlayList = 64 or 1;
SM_Playlist_Add = 64 or 2;
@@ -110,17 +116,34 @@ begin begin
if UVideo.VideoOpened then
begin
- if ScreenSong.VidVis=full then
- ScreenSong.VidVis:=windowed
- else begin
- ScreenSong.VidVis:=full;
- UVideo.SetAspectCorrection(TAspectCorrection(
+ if ScreenSong.TargetVidVis=full then
+ begin
+ ScreenSong.TargetVidVis:=windowed;
+ ScreenSong.TargetAspect := acoCrop;
+ if not ScreenSong.VidVisHandler.changed then
+ begin
+ ScreenSong.VidVisHandler.changed := true;
+ ScreenSong.VidVisHandler.change_time := 0;
+ end;
+ end else
+ begin
+ ScreenSong.TargetVidVis:=full;
+ if not ScreenSong.VidVisHandler.changed then
+ begin
+ ScreenSong.VidVisHandler.changed := true;
+ ScreenSong.VidVisHandler.change_time := 0;
+ end;
+ //UVideo.SetAspectCorrection(TAspectCorrection(
+ // DataBase.GetAspect(CatSongs.Song[Interaction].Artist,
+ // CatSongs.Song[Interaction].Title, Ini.AspectCorrect)));
+ ScreenSong.TargetAspect := TAspectCorrection(
DataBase.GetAspect(CatSongs.Song[Interaction].Artist,
- CatSongs.Song[Interaction].Title, Ini.AspectCorrect)));
+ CatSongs.Song[Interaction].Title, Ini.AspectCorrect));
+
ScreenSong.AspectHandler.changed := true;
ScreenSong.AspectHandler.change_time := Czas.Teraz;
end;
- Visible := False;
+
end;
end;
@@ -154,11 +177,17 @@ begin begin
if (Interaction=3) then
InteractInc;
+
+ if (CurMenu = SM_Sort) then
+ Button[3].Visible := (Ini.Sorting <> SelectValue);
end;
SDLK_LEFT:
begin
if (Interaction=3) then
InteractDec;
+
+ if (CurMenu = SM_Sort) then
+ Button[3].Visible := (Ini.Sorting <> SelectValue);
end;
SDLK_1:
@@ -245,6 +274,9 @@ begin end;
procedure TScreenSongMenu.MenuShow(sMenu: Byte);
+var
+ I: integer;
+
begin
Interaction := 0; //Reset Interaction
Visible := True; //Set Visible
@@ -256,6 +288,29 @@ begin Text[0].Text := Language.Translate('SONG_MENU_NAME_MAIN');
Button[0].Visible := True;
+ Button[1].Visible := (CatSongs.Song[ScreenSong.Interaction].Medley.Source>msNone);
+ Button[2].Visible := True;
+ Button[3].Visible := True;
+ SelectsS[0].Visible := False;
+
+ Button[0].Text[0].Text := Language.Translate('SONG_MENU_SONG');
+ Button[1].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY');
+ Button[2].Text[0].Text := Language.Translate('SONG_MENU_SORT');
+ Button[3].Text[0].Text := Language.Translate('SONG_MENU_HELP');
+
+ {Button[0].Text[0].Text := Language.Translate('SONG_MENU_PLAY');
+ Button[1].Text[0].Text := Language.Translate('SONG_MENU_CHANGEPLAYERS');
+ Button[2].Text[0].Text := Language.Translate('SONG_MENU_PLAYLIST_ADD');
+ Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT');}
+ end;
+
+ SM_Song:
+ begin
+ ID := 'ID_032';
+ CurMenu := sMenu;
+ Text[0].Text := Language.Translate('SONG_MENU_SONG');
+
+ Button[0].Visible := True;
Button[1].Visible := True;
Button[2].Visible := True;
Button[3].Visible := True;
@@ -267,6 +322,47 @@ begin Button[3].Text[0].Text := Language.Translate('SONG_MENU_EDIT');
end;
+ SM_Medley:
+ begin
+ ID := 'ID_034';
+ CurMenu := sMenu;
+ Text[0].Text := Language.Translate('SONG_MENU_MEDLEY');
+
+ Button[0].Visible := True;
+ Button[1].Visible := (Length(PlaylistMedley.Song)>0);
+ Button[2].Visible := (Length(PlaylistMedley.Song)>0) or
+ (CatSongs.Song[ScreenSong.Interaction].Medley.Source > msNone);
+ Button[3].Visible := not ScreenSong.MakeMedley;
+ SelectsS[0].Visible := False;
+
+ Button[0].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY_ADD');
+ Button[1].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY_DELETE');
+ Button[2].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY_START');
+ Button[3].Text[0].Text := Language.Translate('SONG_MENU_MEDLEY_START5');
+ end;
+ SM_Sort:
+ begin
+ ID := 'ID_034';
+ CurMenu := sMenu;
+ Text[0].Text := Language.Translate('SONG_MENU_SORT');
+
+ Button[0].Visible := True;
+ Button[1].Visible := (Length(PlaylistMedley.Song)=0);
+ Button[2].Visible := False;
+ SelectsS[0].Visible := True;
+
+ Button[0].Text[0].Text := Language.Translate('SONG_MENU_SORT_TABS');
+ Button[1].Text[0].Text := Language.Translate('SONG_MENU_SORT_DUETS');
+ Button[3].Text[0].Text := Language.Translate('SONG_MENU_SORT_CONFIRM');
+
+ SetLength(ISelections, Length(UIni.ISorting));
+ For I := 0 to Length(UIni.ISorting)-1 do
+ ISelections[I] := UIni.ISorting[I];
+
+ UpdateSelectSlideOptions(Theme.SongMenu.SelectSlide3, 0, ISelections, SelectValue);
+ Button[3].Visible := (Ini.Sorting <> SelectValue);
+ end;
+
SM_PlayList:
begin
ID := 'ID_032';
@@ -464,6 +560,38 @@ begin Case Interaction of
0: //Button 1
begin
+ MenuShow(SM_Song);
+ end;
+
+ 1: //Button 2
+ begin
+ MenuShow(SM_Medley);
+ end;
+
+ 2: //Button 3
+ begin
+ MenuShow(SM_Sort);
+ end;
+
+ 3: //SelectSlide 3
+ begin
+ //Dummy
+ end;
+
+ 4: //Button 4
+ begin
+ Help.SetHelpID(ScreenSong.ID);
+ ScreenPopupHelp.ShowPopup();
+ Visible := False;
+ end;
+ end;
+ end;
+
+ SM_Song:
+ begin
+ Case Interaction of
+ 0: //Button 1
+ begin
ScreenSong.StartSong;
Visible := False;
end;
@@ -494,6 +622,90 @@ begin end;
end;
+ SM_Medley:
+ begin
+ Case Interaction of
+ 0: //Button 1
+ begin
+ ScreenSong.MakeMedley := true;
+ ScreenSong.StartMedley(99, msCalculated);
+
+ Visible := False;
+ end;
+
+ 1: //Button 2
+ begin
+ SetLength(PlaylistMedley.Song, Length(PlaylistMedley.Song)-1);
+ PlaylistMedley.NumMedleySongs := Length(PlaylistMedley.Song);
+
+ if Length(PlaylistMedley.Song)=0 then
+ ScreenSong.MakeMedley := false;
+
+ Visible := False;
+ end;
+
+ 2: //Button 3
+ begin
+ if ScreenSong.MakeMedley then
+ begin
+ ScreenSong.Mode := smMedley;
+ Music.Stop;
+ //Do the Action that is specified in Ini
+ case Ini.OnSongClick of
+ 0: FadeTo(@ScreenSing);
+ 1: ScreenSong.SelectPlayers;
+ 2: FadeTo(@ScreenSing);
+ end;
+ end else
+ ScreenSong.StartMedley(0, msCalculated);
+
+ Visible := False;
+ end;
+
+ 3: //SelectSlide 3
+ begin
+ //Dummy
+ end;
+
+ 4: //Button 4
+ begin
+ ScreenSong.StartMedley(5, msCalculated);
+ end;
+ end;
+ end;
+
+ SM_Sort:
+ begin
+ Case Interaction of
+ 0: //Button 1
+ begin
+ //Change Tabs (on/off)
+ if (Ini.Tabs=1) then
+ ScreenSong.ChangeSorting(false, Ini.Sorting)
+ else
+ ScreenSong.ChangeSorting(true, Ini.Sorting);
+ end;
+
+ 1: //Button 2
+ begin
+ ScreenSongJumpto.ToggleDuetFilter;
+ Visible := false;
+ end;
+
+ 3: //Slide
+ begin
+ //dummy
+ end;
+
+ 4: //Button 4
+ begin
+ //Change Sorting
+ ScreenSong.ChangeSorting(Ini.Tabs=1, SelectValue);
+ Visible := false;
+ end;
+ end;
+ end;
+
SM_PlayList:
begin
Visible := False;
|