From 4f10526633c463675defb42b4d8e27e21105ec21 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 10 Nov 2010 17:23:37 +0000 Subject: - 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 --- Game/Code/Classes/TextGL.pas | 33 +- Game/Code/Classes/UDraw.pas | 2 +- Game/Code/Classes/UGraphic.pas | 4 +- Game/Code/Classes/UIni.pas | 13 + Game/Code/Classes/UMain.pas | 4 +- Game/Code/Classes/UTexture.pas | 2 - Game/Code/Classes/UWebCam.pas | 14 +- Game/Code/Screens/UScreenEditSub.pas | 561 +++++++++++++++-------------- Game/Code/Screens/UScreenOptionsGame.pas | 42 ++- Game/Code/Screens/UScreenOptionsRecord.pas | 2 +- Game/Code/Screens/UScreenOptionsThemes.pas | 1 + Game/Code/Screens/UScreenSing.pas | 14 +- Game/Code/Screens/UScreenSingModi.pas | 2 +- Game/Code/Screens/UScreenSong.pas | 6 +- Game/Code/UltraStar.dpr | 2 +- 15 files changed, 399 insertions(+), 303 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas index 7bb9699d..bc7e24e7 100644 --- a/Game/Code/Classes/TextGL.pas +++ b/Game/Code/Classes/TextGL.pas @@ -71,7 +71,7 @@ var implementation -uses UMain, Windows, SysUtils, UGraphic, UFiles; +uses UMain, Windows, SysUtils, UGraphic, UFiles, UIni; procedure BuildFont; // Build Our Bitmap Font var @@ -290,10 +290,20 @@ var begin ActFont := 0; SetLength(FontFiles, 5); - FontFiles[0] := 'Normal.fnt'; - FontFiles[1] := 'Bold.fnt'; - FontFiles[2] := 'FontO.fnt'; - FontFiles[3] := 'FontO2.fnt'; + if (Uppercase(ILanguage[Ini.Language]) <> 'POLISH') then + begin + FontFiles[0] := 'Normal.fnt'; + FontFiles[1] := 'Bold.fnt'; + FontFiles[2] := 'FontO.fnt'; + FontFiles[3] := 'FontO2.fnt'; + end else + begin + FontFiles[0] := 'Normal_p.fnt'; + FontFiles[1] := 'Bold_p.fnt'; + FontFiles[2] := 'FontO_p.fnt'; + FontFiles[3] := 'FontO2_p.fnt'; + end; + FontFiles[4] := 'HighResNumbersO.fnt'; SetLength(Fonts, 5); @@ -307,9 +317,18 @@ begin end; end; -procedure KillFont; // Delete The Font +procedure KillFont; +var + F, Tex: integer; + begin -// glDeleteLists(base, 256); // Delete All 96 Characters + for F := 0 to Length(Fonts) - 1 do + begin + for Tex := 0 to Length(Fonts[F].Tex) - 1 do + Texture.UnloadTexture(Fonts[F].Tex[Tex].Name, false); + end; + + SetLength(Fonts, 0); end; function glTextWidth(text: pchar): real; diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index bfc51916..e4735a39 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -519,7 +519,7 @@ begin end;} end; - glColor4f(1, 1, 1, (sqrt((1+sin(Music.Position * 3))/4)/ 2 + 0.5)*Alpha); + glColor4f(1, 1, 1, (sqrt((1+sin((Music.Position+Ini.LipSync*0.01) * 3))/4)/ 2 + 0.5)*Alpha); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas index 99ffe3a1..bd276b6f 100644 --- a/Game/Code/Classes/UGraphic.pas +++ b/Game/Code/Classes/UGraphic.pas @@ -583,7 +583,7 @@ begin freeandnil( ScreenOptionsGraphics ); freeandnil( ScreenOptionsSound ); freeandnil( ScreenOptionsLyrics ); -// freeandnil( ScreenOptionsThemes ); + freeandnil( ScreenOptionsThemes ); freeandnil( ScreenOptionsRecord ); freeandnil( ScreenOptionsAdvanced ); freeandnil( ScreenEditSub ); @@ -605,8 +605,6 @@ begin //Party M2 Screens freeandnil( ScreenPartyNewRoundM2 ); - //freeandnil( ScreenPartyScoreM2 ); - //freeandnil( ScreenPartyWinM2 ); freeandnil( ScreenPartyOptionsM2 ); freeandnil( ScreenPartyPlayerM2 ); end; diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index 46137de8..d3f912d9 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -52,6 +52,7 @@ type SavePlayback: integer; Threshold: integer; Delay: integer; + LipSync: integer; //Song Preview PreviewVolume: integer; @@ -170,6 +171,7 @@ const ISavePlayback: array[0..1] of string = ('Off', 'On'); IThreshold: array[0..3] of string = ('5%', '10%', '15%', '20%'); IDelay: array[0..9] of string = ('0ms', '10ms', '20ms', '30ms', '40ms', '50ms', '60ms', '70ms', '80ms', '90ms'); + ILipSync: array[0..20] of string = ('0ms', '10ms', '20ms', '30ms', '40ms', '50ms', '60ms', '70ms', '80ms', '90ms', '100ms', '110ms', '120ms', '130ms', '140ms', '150ms', '160ms', '170ms', '180ms', '190ms', '200ms'); //Song Preview IPreviewVolume: array[0..10] of string = ('Off', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'); @@ -442,6 +444,12 @@ begin for Pet := 0 to High(IDelay) do if Tekst = IDelay[Pet] then Ini.Delay := Pet; + // LipSync + Tekst := IniFile.ReadString('Sound', 'LipSync', ILipSync[0]); + for Pet := 0 to High(ILipSync) do + if Tekst = ILipSync[Pet] then Ini.LipSync := Pet; + + //Song Preview Tekst := IniFile.ReadString('Sound', 'PreviewVolume', IPreviewVolume[7]); for Pet := 0 to High(IPreviewVolume) do @@ -803,6 +811,11 @@ begin Tekst := IDelay[Ini.Delay]; IniFile.WriteString('Sound', 'Delay', Tekst); + // LipSync + Tekst := ILipSync[Ini.LipSync]; + IniFile.WriteString('Sound', 'LipSync', Tekst); + + // Song Preview Tekst := IPreviewVolume[Ini.PreviewVolume]; IniFile.WriteString('Sound', 'PreviewVolume', Tekst); diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas index 4e0ffef4..e1205cd8 100644 --- a/Game/Code/Classes/UMain.pas +++ b/Game/Code/Classes/UMain.pas @@ -349,7 +349,7 @@ var N: integer; begin //Czas.Teraz := Czas.Teraz + TimeSkip; - Czas.Teraz := Music.Position; + Czas.Teraz := Music.Position+Ini.LipSync*0.01; Czas.OldBeat := Czas.AktBeat; Czas.MidBeat := GetMidBeat(Czas.Teraz - (AktSong.Gap{ + 90 I've forgotten for what it is}) / 1000); // new system with variable BPM in function @@ -360,7 +360,7 @@ begin Czas.AktBeatC := Floor(Czas.MidBeatC); Czas.OldBeatD := Czas.AktBeatD; - Czas.MidBeatD := -0.5+GetMidBeat(Czas.Teraz - (AktSong.Gap + 120 + Ini.Delay*10) / 1000); // MidBeat with addition GAP + Czas.MidBeatD := -0.5+GetMidBeat(Czas.Teraz - Ini.LipSync*0.01 - (AktSong.Gap + 120 + Ini.Delay*10) / 1000); // MidBeat with addition GAP Czas.AktBeatD := Floor(Czas.MidBeatD); Czas.FracBeatD := Frac(Czas.MidBeatD); diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index cd39dd2f..e40b5a92 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -869,14 +869,12 @@ begin if TexNum >= 0 then begin glDeleteTextures(1, @TexNum); TextureDatabase.Texture[T].Texture.TexNum := -1; -// Log.LogError('Unload texture no '+IntToStr(TexNum)); end; end else begin TexNum := TextureDatabase.Texture[T].TextureCache.TexNum; if TexNum >= 0 then begin glDeleteTextures(1, @TexNum); TextureDatabase.Texture[T].TextureCache.TexNum := -1; -// Log.LogError('Unload texture cache no '+IntToStr(TexNum)); end; end; end; diff --git a/Game/Code/Classes/UWebCam.pas b/Game/Code/Classes/UWebCam.pas index a0ba38f0..5abb7622 100644 --- a/Game/Code/Classes/UWebCam.pas +++ b/Game/Code/Classes/UWebCam.pas @@ -18,7 +18,7 @@ procedure wStopWebCam; procedure wInit; procedure wClose; -procedure wDraw(DoDraw: boolean); +procedure wDraw(DoDraw: boolean; Screen: integer); var @@ -159,7 +159,7 @@ begin end; -procedure wDraw(DoDraw: boolean); +procedure wDraw(DoDraw: boolean; Screen: integer); var SRect: record left, right, upper, lower: double; @@ -203,10 +203,12 @@ begin SRect.lower := (RenderH - ScaledVideoHeight) / 2; SRect.upper := SRect.lower + ScaledVideoHeight; - // have a nice black background to draw on (even if there were errors opening the vid) - glClearColor(0,0,0,1); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - + if (Screen=1) then + begin + glClearColor(0,0,0,1); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + end; + glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); 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 diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr index 05a7dfc2..260bba40 100644 --- a/Game/Code/UltraStar.dpr +++ b/Game/Code/UltraStar.dpr @@ -122,7 +122,7 @@ uses UVideo in 'Classes\UVideo.pas'; const - Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC6.4'; + Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC7.2'; var WndTitle: string; -- cgit v1.2.3