diff options
author | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-11-10 17:23:37 +0000 |
---|---|---|
committer | brunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-11-10 17:23:37 +0000 |
commit | 4f10526633c463675defb42b4d8e27e21105ec21 (patch) | |
tree | 486ac9d7129014b43864b6b01ab183f61db5c1ff /Game/Code/Screens | |
parent | e48e5d9ecd902ecf6a774680959df5ae243737f7 (diff) | |
download | usdx-4f10526633c463675defb42b4d8e27e21105ec21.tar.gz usdx-4f10526633c463675defb42b4d8e27e21105ec21.tar.xz usdx-4f10526633c463675defb42b4d8e27e21105ec21.zip |
- added polish language (thx to Pit33)
- added polish fonts
- added lipsync option
- fixed drawing webcam on 2 screens
- added copy&paste for duets in editor
- some bugfixes in editor
- change language without restart
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2730 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens')
-rw-r--r-- | Game/Code/Screens/UScreenEditSub.pas | 561 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenOptionsGame.pas | 42 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenOptionsRecord.pas | 2 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenOptionsThemes.pas | 1 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSing.pas | 14 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSingModi.pas | 2 | ||||
-rw-r--r-- | Game/Code/Screens/UScreenSong.pas | 6 |
7 files changed, 347 insertions, 281 deletions
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index fea240a3..31cc6505 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -55,7 +55,8 @@ type PlayStopTime: real;
LastClick: integer;
Click: boolean;
- CopySrc: integer;
+ CopySrcLine: integer;
+ CopySrcCP: integer;
MidiOut: TMidiOutput;
MidiStart: real;
@@ -325,7 +326,10 @@ begin AktSong.Medley.Source := msNone;
end
else if (MedleyNotes.isStart and MedleyNotes.isEnd) and
- (MedleyNotes.start.line < MedleyNotes.end_.line) then
+ (MedleyNotes.start.line < MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc)> MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.end_.line].Nuta)>MedleyNotes.end_.note) and
+ (Length(Czesci[0].Czesc[MedleyNotes.start.line].Nuta)>MedleyNotes.start.note) then
begin
AktSong.Medley.Source := msTag;
AktSong.Medley.StartBeat:=Czesci[0].Czesc[MedleyNotes.start.line].Nuta[MedleyNotes.start.note].Start;
@@ -397,7 +401,9 @@ begin end else
begin
Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].IsMedley := true;
- Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].IsMedley := false;
+ if (Length(Czesci[0].Czesc)> MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.end_.line].Nuta)>MedleyNotes.end_.note) then
+ Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].IsMedley := false;
MedleyNotes.end_.line := Czesci[0].Akt;
MedleyNotes.end_.note := AktNuta[0];
end;
@@ -419,7 +425,9 @@ begin end else
begin
Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].IsMedley := true;
- Czesci[0].Czesc[MedleyNotes.start.line].Nuta[MedleyNotes.start.note].IsMedley := false;
+ if (Length(Czesci[0].Czesc)> MedleyNotes.start.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.start.line].Nuta)>MedleyNotes.start.note) then
+ Czesci[0].Czesc[MedleyNotes.start.line].Nuta[MedleyNotes.start.note].IsMedley := false;
MedleyNotes.start.line := Czesci[0].Akt;
MedleyNotes.start.note := AktNuta[0];
end;
@@ -457,58 +465,74 @@ begin MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[MidiLastNote].Ton + 60, 127);
PlaySentenceMidi := false;
PlayOneNoteMidi := false;
-
- Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 0;
- Czesci[0].Akt := MedleyNotes.end_.line;
- AktNuta[0] := MedleyNotes.end_.note;
- Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 2;
-
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
- EditorLyric[0].Selected := AktNuta[0];
Music.Stop;
PlaySentence := false;
PlayOneNote := false;
+
+ if (Length(Czesci[0].Czesc)> MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.end_.line].Nuta)>MedleyNotes.end_.note) then
+ begin
+ Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 0;
+ Czesci[0].Akt := MedleyNotes.end_.line;
+ AktNuta[0] := MedleyNotes.end_.note;
+ Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 2;
+
+ EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
+ EditorLyric[0].Selected := AktNuta[0];
+ end;
end else if MedleyNotes.IsStart then
begin
MidiOut.PutShort($81, Czesci[0].Czesc[Czesci[0].Akt].Nuta[MidiLastNote].Ton + 60, 127);
PlaySentenceMidi := false;
PlayOneNoteMidi := false;
-
- Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 0;
- Czesci[0].Akt := MedleyNotes.start.line;
- AktNuta[0] := MedleyNotes.start.note;
- Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 2;
-
- EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
- EditorLyric[0].Selected := AktNuta[0];
Music.Stop;
PlaySentence := false;
PlayOneNote := false;
+
+ if (Length(Czesci[0].Czesc)> MedleyNotes.start.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.start.line].Nuta)>MedleyNotes.start.note) then
+ begin
+ Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 0;
+ Czesci[0].Akt := MedleyNotes.start.line;
+ AktNuta[0] := MedleyNotes.start.note;
+ Czesci[0].Czesc[Czesci[0].Akt].Nuta[AktNuta[0]].Color := 2;
+
+ EditorLyric[0].AddCzesc(0, Czesci[0].Akt);
+ EditorLyric[0].Selected := AktNuta[0];
+ end;
end;
if (SDL_ModState = KMOD_LALT) then
begin
PlaySentenceMidi := false;
PlayOneNoteMidi := false;
+ PlayOneNote := false;
Music.Stop;
LineChanged[0]:=false;
LineChanged[1]:=false;
- R := GetTimeFromBeat(Czesci[0].Czesc[MedleyNotes.start.line].Nuta[MedleyNotes.start.note].Start);
- if R <= Music.Length then
- begin
- Music.MoveTo(R);
-
- noteStart := AktNuta[0];
- lineStart := Czesci[0].Akt;
- cpStart := 0;
- PlayStopTime := GetTimeFromBeat(
- Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].Start +
- Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].Dlugosc);
- PlaySentence := true;
- PlayOneNote := false;
- Music.Play;
- LastClick := -100;
+ if (MedleyNotes.isStart and MedleyNotes.isEnd) and
+ (MedleyNotes.start.line < MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc)> MedleyNotes.end_.line) and
+ (Length(Czesci[0].Czesc[MedleyNotes.end_.line].Nuta)>MedleyNotes.end_.note) and
+ (Length(Czesci[0].Czesc[MedleyNotes.start.line].Nuta)>MedleyNotes.start.note) then
+ begin
+ R := GetTimeFromBeat(Czesci[0].Czesc[MedleyNotes.start.line].Nuta[MedleyNotes.start.note].Start);
+ if R <= Music.Length then
+ begin
+ Music.MoveTo(R);
+
+ noteStart := AktNuta[0];
+ lineStart := Czesci[0].Akt;
+ cpStart := 0;
+
+ PlayStopTime := GetTimeFromBeat(
+ Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].Start +
+ Czesci[0].Czesc[MedleyNotes.end_.line].Nuta[MedleyNotes.end_.note].Dlugosc);
+ PlaySentence := true;
+ Music.Play;
+ LastClick := -100;
+ end;
end;
end;
@@ -605,9 +629,6 @@ begin if SDL_ModState = KMOD_LSHIFT then
LyricsCorrectSpaces;
- if AktSong.isDuet then
- Exit;
-
// Copy sentence
if SDL_ModState = KMOD_LCTRL then
MarkSrc;
@@ -626,15 +647,21 @@ begin SDLK_V:
begin
// Paste text
- if SDL_ModState = KMOD_LCTRL then begin //TODO !!!
- if Czesci[CP].Czesc[Czesci[CP].Akt].IlNut >= Czesci[CP].Czesc[CopySrc].IlNut then
- PasteText
- else
+ if SDL_ModState = KMOD_LCTRL then
+ 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
+ beep;
+ end else
beep;
end;
- if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then begin //TODO !!!
- CopySentence(CopySrc, Czesci[CP].Akt);
+ if (SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT) then
+ begin
+ CopySentence(CopySrcLine, Czesci[CP].Akt);
end;
if SDL_ModState = 0 then
@@ -654,14 +681,15 @@ begin if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then
begin
- CopySentence(CopySrc, Czesci[0].Akt);
- CopySentence(CopySrc+1, Czesci[0].Akt+1);
- CopySentence(CopySrc+2, Czesci[0].Akt+2);
- CopySentence(CopySrc+3, Czesci[0].Akt+3);
+ CopySentence(CopySrcLine, Czesci[0].Akt);
+ CopySentence(CopySrcLine+1, Czesci[0].Akt+1);
+ CopySentence(CopySrcLine+2, Czesci[0].Akt+2);
+ CopySentence(CopySrcLine+3, Czesci[0].Akt+3);
end;
- if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then begin
- CopySentences(CopySrc, Czesci[0].Akt, 4);
+ if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then
+ begin
+ CopySentences(CopySrcLine, Czesci[0].Akt, 4);
end;
end;
SDLK_5:
@@ -671,16 +699,16 @@ begin if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT then
begin
- CopySentence(CopySrc, Czesci[0].Akt);
- CopySentence(CopySrc+1, Czesci[0].Akt+1);
- CopySentence(CopySrc+2, Czesci[0].Akt+2);
- CopySentence(CopySrc+3, Czesci[0].Akt+3);
- CopySentence(CopySrc+4, Czesci[0].Akt+4);
+ CopySentence(CopySrcLine, Czesci[0].Akt);
+ CopySentence(CopySrcLine+1, Czesci[0].Akt+1);
+ CopySentence(CopySrcLine+2, Czesci[0].Akt+2);
+ CopySentence(CopySrcLine+3, Czesci[0].Akt+3);
+ CopySentence(CopySrcLine+4, Czesci[0].Akt+4);
end;
if SDL_ModState = KMOD_LCTRL + KMOD_LSHIFT + KMOD_LALT then
begin
- CopySentences(CopySrc, Czesci[0].Akt, 5);
+ CopySentences(CopySrcLine, Czesci[0].Akt, 5);
end;
end;
@@ -1814,51 +1842,45 @@ var NDst: integer;
begin
P := CP;
- {for P := 0 to Length(Czesci) - 1 do
- begin}
- 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
+ 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
- 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[P].Czesc[C].HighNut;
- Czesci[P].Czesc[C].Koniec := Czesci[P].Czesc[C].Nuta[NDst].Start +
- Czesci[P].Czesc[C].Nuta[NDst].Dlugosc;
+ NDst := NStart + N;
+ CopyNote(P, C+1, N, P, C, NDst);
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;
+
+ //add space before first note of 2. sentence
+ if (Copy(Czesci[P].Czesc[C].Nuta[NStart].Tekst, 1, 1) <> ' ') then
+ Czesci[P].Czesc[C].Nuta[NStart].Tekst := ' ' + Czesci[P].Czesc[C].Nuta[NStart].Tekst;
+
+ // 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
+ 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);
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.DivideNote;
@@ -2089,7 +2111,8 @@ end; procedure TScreenEditSub.MarkSrc;
begin
- CopySrc := Czesci[CP].Akt;
+ CopySrcLine := Czesci[CP].Akt;
+ CopySrcCP := CP;
end;
procedure TScreenEditSub.PasteText;
@@ -2099,8 +2122,11 @@ var begin
C := Czesci[CP].Akt;
- for N := 0 to Czesci[CP].Czesc[CopySrc].HighNut do
- Czesci[CP].Czesc[C].Nuta[N].Tekst := Czesci[CP].Czesc[CopySrc].Nuta[N].Tekst;
+ for N := 0 to Czesci[CopySrcCP].Czesc[CopySrcLine].HighNut do
+ Czesci[CP].Czesc[C].Nuta[N].Tekst := Czesci[CopySrcCP].Czesc[CopySrcLine].Nuta[N].Tekst;
+
+ Refresh;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
end;
@@ -2111,21 +2137,28 @@ var Time2: integer;
TD: integer;
begin
- Time1 := Czesci[0].Czesc[Src].Nuta[0].Start;
- Time2 := Czesci[0].Czesc[Dst].Nuta[0].Start;
+ Time1 := Czesci[CopySrcCP].Czesc[Src].Nuta[0].Start;
+ Time2 := Czesci[CP].Czesc[Dst].Nuta[0].Start;
TD := Time2-Time1;
- SetLength(Czesci[0].Czesc[Dst].Nuta, Czesci[0].Czesc[Src].IlNut);
- Czesci[0].Czesc[Dst].IlNut := Czesci[0].Czesc[Src].IlNut;
- Czesci[0].Czesc[Dst].HighNut := Czesci[0].Czesc[Src].HighNut;
- for N := 0 to Czesci[0].Czesc[Src].HighNut do begin
- Czesci[0].Czesc[Dst].Nuta[N].Tekst := Czesci[0].Czesc[Src].Nuta[N].Tekst;
- Czesci[0].Czesc[Dst].Nuta[N].Dlugosc := Czesci[0].Czesc[Src].Nuta[N].Dlugosc;
- Czesci[0].Czesc[Dst].Nuta[N].Ton := Czesci[0].Czesc[Src].Nuta[N].Ton;
- Czesci[0].Czesc[Dst].Nuta[N].Start := Czesci[0].Czesc[Src].Nuta[N].Start + TD;
+ SetLength(Czesci[CP].Czesc[Dst].Nuta, Czesci[CopySrcCP].Czesc[Src].IlNut);
+ Czesci[CP].Czesc[Dst].IlNut := Czesci[CopySrcCP].Czesc[Src].IlNut;
+ Czesci[CP].Czesc[Dst].HighNut := Czesci[CopySrcCP].Czesc[Src].HighNut;
+ for N := 0 to Czesci[CopySrcCP].Czesc[Src].HighNut do
+ begin
+ Czesci[CP].Czesc[Dst].Nuta[N].Tekst := Czesci[CopySrcCP].Czesc[Src].Nuta[N].Tekst;
+ Czesci[CP].Czesc[Dst].Nuta[N].Dlugosc := Czesci[CopySrcCP].Czesc[Src].Nuta[N].Dlugosc;
+ Czesci[CP].Czesc[Dst].Nuta[N].Ton := Czesci[CopySrcCP].Czesc[Src].Nuta[N].Ton;
+ Czesci[CP].Czesc[Dst].Nuta[N].FreeStyle := Czesci[CopySrcCP].Czesc[Src].Nuta[N].FreeStyle;
+ Czesci[CP].Czesc[Dst].Nuta[N].Wartosc := Czesci[CopySrcCP].Czesc[Src].Nuta[N].Wartosc;
+ Czesci[CP].Czesc[Dst].Nuta[N].Start := Czesci[CopySrcCP].Czesc[Src].Nuta[N].Start + TD;
end;
- N := Czesci[0].Czesc[Src].HighNut;
- Czesci[0].Czesc[Dst].Koniec := Czesci[0].Czesc[Dst].Nuta[N].Start + Czesci[0].Czesc[Dst].Nuta[N].Dlugosc;
+ N := Czesci[CopySrcCP].Czesc[Src].HighNut;
+ Czesci[CP].Czesc[Dst].Koniec := Czesci[CP].Czesc[Dst].Nuta[N].Start + Czesci[CP].Czesc[Dst].Nuta[N].Dlugosc;
+
+ Refresh;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
+ EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
end;
procedure TScreenEditSub.CopySentences(Src, Dst, Num: integer);
@@ -2304,7 +2337,7 @@ end; procedure TScreenEditSub.MakeDuet;
var
- L: integer;
+ L, I: integer;
begin
SetLength(Czesci, 2);
@@ -2318,29 +2351,34 @@ begin SetLength(Czesci[1].Czesc, Length(Czesci[0].Czesc));
for L := 0 to Length(Czesci[0].Czesc) - 1 do
- begin
- {Czesci[1].Czesc[L].Start := Czesci[0].Czesc[L].Start;
- Czesci[1].Czesc[L].StartNote := Czesci[0].Czesc[L].StartNote;
- Czesci[1].Czesc[L].Lyric := '';
- Czesci[1].Czesc[L].LyricWidth := 0;
- Czesci[1].Czesc[L].Koniec := Czesci[0].Czesc[L].Koniec;
- Czesci[1].Czesc[L].BaseNote := Czesci[0].Czesc[L].BaseNote;
- Czesci[1].Czesc[L].HighNut := -1;
- Czesci[1].Czesc[L].IlNut := 0;
- Czesci[1].Czesc[L].TotalNotes := 0;
- SetLength(Czesci[1].Czesc[L].Nuta, 0);}
CopyLine(0, L, 1, L);
- end;
AktSong.isDuet := true;
-
- EditorLyric[0].Y := offset[0];
- EditorLyric[1].Y := offset[1];
- EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[CP].Akt);
- EditorLyric[(CP+1) mod 2].Selected := 0;
- EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
- AktNuta[(CP+1) mod 2] := 0;
+ AktNuta[1] := 0;
+ Czesci[1].Akt := 0;
+
+ for I := 0 to Length(Czesci)-1 do
+ begin
+ EditorLyric[I].Clear;
+ EditorLyric[I].X := 400;
+ if not AktSong.isDuet and (I=0) then
+ EditorLyric[I].Y := offset[I]+300
+ else
+ EditorLyric[I].Y := offset[I];
+
+ EditorLyric[I].Align := 1;
+ EditorLyric[I].Size := 13;
+ EditorLyric[I].ColR := 0;
+ EditorLyric[I].ColG := 0;
+ EditorLyric[I].ColB := 0;
+ EditorLyric[I].ColSR := Skin_FontHighlightR;
+ EditorLyric[I].ColSG := Skin_FontHighlightG;
+ EditorLyric[I].ColSB := Skin_FontHighlightB;
+ EditorLyric[I].Style := 0;
+ EditorLyric[I].AddCzesc(I, Czesci[I].Akt);
+ EditorLyric[I].Selected := 0;
+ end;
//delete medley
MedleyNotes.isStart := false;
@@ -2630,171 +2668,170 @@ begin begin
for beat := LastClick+1 to AktBeat do
begin
-
- PlayClick := false;
- for line := 0 to Length(Czesci[CP].Czesc) - 1 do
- begin
- for note := 0 to Length(Czesci[CP].Czesc[line].Nuta) - 1 do
+ PlayClick := false;
+ for line := 0 to Length(Czesci[CP].Czesc) - 1 do
begin
- //line change
- if (Czesci[CP].Czesc[line].Start = beat) and (line <> Czesci[CP].Akt) and
- not end_ and not PlayOneSentence then
+ for note := 0 to Length(Czesci[CP].Czesc[line].Nuta) - 1 do
begin
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
- AktNuta[CP] := 0;
- Czesci[CP].Akt := line;
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 1;
- EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
- EditorLyric[CP].Selected := AktNuta[CP];
- LineChanged[CP] := true;
- end;
+ //line change
+ if (Czesci[CP].Czesc[line].Start = beat) and (line <> Czesci[CP].Akt) and
+ not end_ and not PlayOneSentence then
+ begin
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
+ AktNuta[CP] := 0;
+ Czesci[CP].Akt := line;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 1;
+ EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
+ EditorLyric[CP].Selected := AktNuta[CP];
+ LineChanged[CP] := true;
+ end;
- if (Czesci[CP].Czesc[line].Nuta[note].Start = beat) then
- begin
- LastClick := beat;
- PlayClick := true;
+ if (Czesci[CP].Czesc[line].Nuta[note].Start = beat) then
+ begin
+ if not PlayOneSentence or (line=Czesci[CP].Akt) then
+ begin
+ LastClick := beat;
+ PlayClick := true;
+ end;
+ end;
end;
end;
- end;
- if AktSong.isDuet and not PlayOneSentence then
- begin
- for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do
+ if AktSong.isDuet and not PlayOneSentence then
begin
- for note := 0 to Length(Czesci[(CP+1) mod 2].Czesc[line].Nuta) - 1 do
+ for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do
begin
- //line change
- if (Czesci[(CP+1) mod 2].Czesc[line].Start = beat) and (line <> Czesci[(CP+1) mod 2].Akt) and not end_ then
+ for note := 0 to Length(Czesci[(CP+1) mod 2].Czesc[line].Nuta) - 1 do
begin
- if(Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)>0) then
- Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 0;
- AktNuta[(CP+1) mod 2] := 0;
- Czesci[(CP+1) mod 2].Akt := line;
- Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 1;
- EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[(CP+1) mod 2].Akt);
- EditorLyric[(CP+1) mod 2].Selected := AktNuta[(CP+1) mod 2];
- LineChanged[(CP+1) mod 2] := true;
+ //line change
+ if (Czesci[(CP+1) mod 2].Czesc[line].Start = beat) and (line <> Czesci[(CP+1) mod 2].Akt) and not end_ then
+ begin
+ if(Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)>0) then
+ Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 0;
+ AktNuta[(CP+1) mod 2] := 0;
+ Czesci[(CP+1) mod 2].Akt := line;
+ Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 1;
+ EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[(CP+1) mod 2].Akt);
+ EditorLyric[(CP+1) mod 2].Selected := AktNuta[(CP+1) mod 2];
+ LineChanged[(CP+1) mod 2] := true;
+ end;
end;
end;
end;
- end;
- // midi music
- if PlaySentenceMidi then
- begin
- // stop the music
- if end_ then
- begin
- MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[MidiLastNote].Ton + 60, 127);
- PlaySentenceMidi := false;
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
- if (Czesci[CP].Akt = lineStart) then
- AktNuta[CP] := noteStart;
-
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
- EditorLyric[CP].Selected := AktNuta[CP];
- end;
-
- // click
- Text[TextDebug].Text := IntToStr(AktBeat);
-
- if PlayClick then
- begin
- for Pet := 0 to Czesci[CP].Czesc[Czesci[CP].Akt].HighNut do
- if (Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Start = beat) then
+ // midi music
+ if PlaySentenceMidi then
begin
- if Pet > 0 then
- MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet-1].Ton + 60, 127);
- MidiOut.PutShort($91, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Ton + 60, 127);
- MidiLastNote := Pet;
- end;
- end;
- end; // if PlaySentenceMidi
+ // stop the music
+ if end_ then
+ begin
+ MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[MidiLastNote].Ton + 60, 127);
+ PlaySentenceMidi := false;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
+ if (Czesci[CP].Akt = lineStart) then
+ AktNuta[CP] := noteStart;
- // mp3 music
- if PlaySentence then
- begin
- // stop the music
- if end_ then
- begin
- Music.Stop;
- PlaySentence := false;
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
- if (Czesci[CP].Akt = lineStart) then
- AktNuta[CP] := noteStart;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
+ EditorLyric[CP].Selected := AktNuta[CP];
+ end;
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
- EditorLyric[CP].Selected := AktNuta[CP];
- end;
+ // click
+ Text[TextDebug].Text := IntToStr(AktBeat);
- if (Click) and (PlaySentence) then
- begin
- Text[TextDebug].Text := IntToStr(AktBeat);
- if PlayClick then
- Music.PlayClick;
- end; // click
- end;
+ if PlayClick then
+ begin
+ for Pet := 0 to Czesci[CP].Czesc[Czesci[CP].Akt].HighNut do
+ if (Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Start = beat) then
+ begin
+ if Pet > 0 then
+ MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet-1].Ton + 60, 127);
+ MidiOut.PutShort($91, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[Pet].Ton + 60, 127);
+ MidiLastNote := Pet;
+ end;
+ end;
+ end; // if PlaySentenceMidi
- // move "cursor"
- if (PlaySentence or PlaySentenceMidi) then
- begin
- for line := 0 to Length(Czesci[CP].Czesc) - 1 do
- begin
- for note := 0 to Length(Czesci[CP].Czesc[line].Nuta) - 1 do
- begin
- //note change
- if (Czesci[CP].Czesc[line].Nuta[note].Start = beat) and
- (((note <> AktNuta[CP]) or LineChanged[CP]) and
- (not PlayOneSentence or (line = Czesci[CP].Akt))) then
+ // mp3 music
+ if PlaySentence then
begin
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
- if not LineChanged[CP] then
+ // stop the music
+ if end_ then
begin
- AktNuta[CP] := note;
- Czesci[CP].Akt := line;
- end else
- LineChanged[CP] := false;
+ Music.Stop;
+ PlaySentence := false;
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
+ if (Czesci[CP].Akt = lineStart) then
+ AktNuta[CP] := noteStart;
- Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
- EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
EditorLyric[CP].Selected := AktNuta[CP];
+ end;
+
+ if (Click) and (PlaySentence) then
+ begin
+ Text[TextDebug].Text := IntToStr(AktBeat);
+ if PlayClick then
+ Music.PlayClick;
+ end; // click
end;
- end;
- end;
- if AktSong.isDuet and not PlayOneSentence then
- begin
- for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do
- begin
- for note := 0 to Length(Czesci[(CP+1) mod 2].Czesc[line].Nuta) - 1 do
+ // move "cursor"
+ if (PlaySentence or PlaySentenceMidi) then
begin
- //note change
- if (Czesci[(CP+1) mod 2].Czesc[line].Nuta[note].Start = beat) and
- ((note <> AktNuta[(CP+1) mod 2]) or LineChanged[(CP+1) mod 2]) then
+ for line := 0 to Length(Czesci[CP].Czesc) - 1 do
begin
- if(Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)>0) then
- Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 0;
- if not LineChanged[(CP+1) mod 2] then
+ for note := 0 to Length(Czesci[CP].Czesc[line].Nuta) - 1 do
begin
- AktNuta[(CP+1) mod 2] := note;
- Czesci[(CP+1) mod 2].Akt := line;
- end else
- LineChanged[(CP+1) mod 2] := false;
-
- Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 2;
- EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[(CP+1) mod 2].Akt);
- EditorLyric[(CP+1) mod 2].Selected := AktNuta[(CP+1) mod 2];
+ //note change
+ if (Czesci[CP].Czesc[line].Nuta[note].Start = beat) and
+ (((note <> AktNuta[CP]) or LineChanged[CP]) and
+ (not PlayOneSentence or (line = Czesci[CP].Akt))) then
+ begin
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 0;
+ if not LineChanged[CP] then
+ begin
+ AktNuta[CP] := note;
+ Czesci[CP].Akt := line;
+ end else
+ LineChanged[CP] := false;
+
+ Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Color := 2;
+ EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt);
+ EditorLyric[CP].Selected := AktNuta[CP];
+ end;
+ end;
end;
- end;
- end;
- end;
-
- end;
-
+ if AktSong.isDuet and not PlayOneSentence then
+ begin
+ for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do
+ begin
+ for note := 0 to Length(Czesci[(CP+1) mod 2].Czesc[line].Nuta) - 1 do
+ begin
+ //note change
+ if (Czesci[(CP+1) mod 2].Czesc[line].Nuta[note].Start = beat) and
+ ((note <> AktNuta[(CP+1) mod 2]) or LineChanged[(CP+1) mod 2]) then
+ begin
+ if(Length(Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta)>0) then
+ Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 0;
+ if not LineChanged[(CP+1) mod 2] then
+ begin
+ AktNuta[(CP+1) mod 2] := note;
+ Czesci[(CP+1) mod 2].Akt := line;
+ end else
+ LineChanged[(CP+1) mod 2] := false;
+
+ Czesci[(CP+1) mod 2].Czesc[Czesci[(CP+1) mod 2].Akt].Nuta[AktNuta[(CP+1) mod 2]].Color := 2;
+ EditorLyric[(CP+1) mod 2].AddCzesc((CP+1) mod 2, Czesci[(CP+1) mod 2].Akt);
+ EditorLyric[(CP+1) mod 2].Selected := AktNuta[(CP+1) mod 2];
+ end;
+ end;
+ end;
+ end;
+ end; //move "cursor"
end; //for beat
- end;
+ end; //AktBeat <> last
end else
begin
LineChanged[0]:=false;
diff --git a/Game/Code/Screens/UScreenOptionsGame.pas b/Game/Code/Screens/UScreenOptionsGame.pas index c698b046..bce3b1f1 100644 --- a/Game/Code/Screens/UScreenOptionsGame.pas +++ b/Game/Code/Screens/UScreenOptionsGame.pas @@ -9,10 +9,11 @@ type TScreenOptionsGame = class(TMenu)
private
old_Tabs, old_Sorting: integer;
+ old_Language: integer;
procedure Leave;
procedure RefreshSongs;
-
+ procedure RefreshLanguage;
public
constructor Create; override;
function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
@@ -24,7 +25,7 @@ const implementation
-uses UGraphic, UHelp, ULog, UPlaylist;
+uses UGraphic, UHelp, ULog, UPlaylist, ULanguage, TextGL, UTexture;
function TScreenOptionsGame.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
begin
@@ -59,14 +60,16 @@ begin InteractPrev;
SDLK_RIGHT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 6) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 6) then
+ begin
Music.PlayOption;
InteractInc;
end;
end;
SDLK_LEFT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 6) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 6) then
+ begin
Music.PlayOption;
InteractDec;
end;
@@ -99,13 +102,36 @@ end; //Refresh Songs Patch
procedure TScreenOptionsGame.RefreshSongs;
begin
- if (ini.Sorting <> old_Sorting) or (ini.Tabs <> old_Tabs) then
+ if (Ini.Sorting <> old_Sorting) or (Ini.Tabs <> old_Tabs) then
begin
ScreenSong.Refresh(false);
PlaylistMan.LoadPlayLists;
end;
end;
+procedure TScreenOptionsGame.RefreshLanguage;
+begin
+ if (Ini.Language = old_Language) then
+ Exit;
+
+ UGraphic.UnLoadScreens();
+ KillFont;
+
+ BuildFont;
+ Language.ChangeLanguage(ILanguage[Ini.Language]);
+ Help.ChangeLanguage(ILanguage[Ini.Language]);
+
+ Theme.LoadTheme('Themes\' + ITheme[Ini.Theme] + '.ini', Ini.Color);
+ UGraphic.LoadScreens( true );
+ ScreenSong.Refresh(true);
+ PlaylistMan.LoadPlayLists;
+
+ old_language := Ini.Language;
+ old_Sorting := Ini.Sorting;
+ old_Tabs := Ini.Tabs;
+ ScreenMain.ShowNumErrors := false;
+end;
+
procedure TScreenOptionsGame.onShow;
begin
// Interaction := 0;
@@ -115,14 +141,16 @@ begin //Refresh Songs Patch
old_Sorting := Ini.Sorting;
old_Tabs := Ini.Tabs;
+ old_Language := Ini.Language;
end;
procedure TScreenOptionsGame.Leave;
begin
-
+ Ini.Save;
+ RefreshLanguage;
+ RefreshSongs;
Music.PlayBack;
- RefreshSongs;
FadeTo(@ScreenOptions);
end;
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas index 28bdd59e..ea79fbe3 100644 --- a/Game/Code/Screens/UScreenOptionsRecord.pas +++ b/Game/Code/Screens/UScreenOptionsRecord.pas @@ -218,7 +218,7 @@ begin if WebCamPreviewOn then
begin
try
- wDraw(true);
+ wDraw(true, ScreenAct);
except
WebCamPreviewOn := false;
end;
diff --git a/Game/Code/Screens/UScreenOptionsThemes.pas b/Game/Code/Screens/UScreenOptionsThemes.pas index 41383a54..acd7ebcb 100644 --- a/Game/Code/Screens/UScreenOptionsThemes.pas +++ b/Game/Code/Screens/UScreenOptionsThemes.pas @@ -181,6 +181,7 @@ begin UGraphic.LoadScreens( true );
ScreenSong.Refresh(true);
PlaylistMan.LoadPlayLists;
+ ScreenMain.ShowNumErrors := false;
end;
end;
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 6e3da366..f9d59552 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -327,7 +327,7 @@ begin else //Pause ausschalten
begin
Czas.Teraz := PauseTime; //Position of Notes
- Music.MoveTo (PauseTime);//Position of Music
+ Music.MoveTo (PauseTime + Ini.LipSync*0.01);//Position of Music
Music.Play; //Play Music
if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video
acTogglePause;
@@ -1643,7 +1643,7 @@ begin SetFontPos (400 - glTextWidth ('Activating Webcam ...')/2, 250); //Position
glColor4f(1,1,1,1);
glPrint('Activating Webcam ...');
- SwapBuffers;
+ SwapBuffers;
wStartWebCam();
end;
@@ -1978,7 +1978,7 @@ begin if ShowFinish and AktSong.VideoLoaded then
begin
try
- acGetFrame(Music.Position);
+ acGetFrame(Music.Position + Ini.LipSync*0.01);
acDrawGL(ScreenAct, not WebCam); // this only draws
except
//If an Error occurs drawing: prevent Video from being Drawn again and Close Video
@@ -1993,7 +1993,7 @@ begin end;
end;
- wDraw(WebCam);
+ wDraw(WebCam, ScreenAct);
// draw static menu (FG)
DrawFG;
@@ -2006,7 +2006,7 @@ begin if ShowFinish then
begin
if (not Music.Finished) and (not medley_end or (ScreenSong.Mode <> smMedley))
- and ((AktSong.Finish = 0) or (CurTime*1000 <= AktSong.Finish)) then
+ and ((AktSong.Finish = 0) or (Music.Position + Ini.LipSync*0.01 <= AktSong.Finish)) then
begin
//Pause Mod:
if not Paused then
@@ -2170,8 +2170,8 @@ begin SetFontPos (5, 184);
glPrint(PChar('lt: ' + FormatFloat('#0.00', Czas.Teraz) +
- ' mt: ' + FormatFloat('#0.00', Music.Position) +
- ' dt: ' + FormatFloat('#0.000', Czas.Teraz-Music.Position)));
+ ' mt: ' + FormatFloat('#0.00', Music.Position + Ini.LipSync*0.01) +
+ ' dt: ' + FormatFloat('#0.000', Czas.Teraz-(Music.Position+Ini.LipSync*0.01))));
end;
PerfLog.AddComment('ScreenSing: End Draw');
end;
diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas index 1c1d8ade..8379fdcf 100644 --- a/Game/Code/Screens/UScreenSingModi.pas +++ b/Game/Code/Screens/UScreenSingModi.pas @@ -601,7 +601,7 @@ end; acDrawGL(ScreenAct, not WebCam); // this only draws
end;
- wDraw(WebCam);
+ wDraw(WebCam, ScreenAct);
// draw static menu (FG)
DrawFG;
diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index e2576a90..e69cfcfb 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -2380,7 +2380,7 @@ begin //prepare Video
if UVideo.VideoOpened then
begin
- Czas.Teraz := Czas.Teraz + TimeSkip;
+ Czas.Teraz := Music.Position+Ini.LipSync*0.01;
try
acGetFrame(Czas.Teraz);
@@ -2916,8 +2916,8 @@ begin begin
acOpenFile(PAnsiChar(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Video));
- acSkip2(CatSongs.Song[Interaction].VideoGAP, Music.Position);
- Czas.Teraz := Music.Position;
+ acSkip2(CatSongs.Song[Interaction].VideoGAP, Music.Position+Ini.LipSync*0.01);
+ Czas.Teraz := Music.Position+Ini.LipSync*0.01;
Czas.Razem := Music.Length;
StartTry := false;
try
|