From dbe444f87b85da27a37f38e80bfd540178b8dde0 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 1 Sep 2010 14:09:58 +0000 Subject: - fix: position of player 3 and 4 in 4-player-mode on one screen in singscreen - fix: scorescreen for 4-player-mode on one screen - add: tag #CALCMEDLEY:Off => disable calculation of medley for that song - add: sorting RANDOM for party-modes - add: ShuffleMode FULL (play whole file) in fullscreen if video available - add: it possible to select the 2 songs left and right of the random selected song in party mode - add: num song in in party options (in the selected folder/playlist) - fix: dont change line in editor while playing only one line - removed option solmization from lyric option screen - add: play last sung song in party score screen - added some plugins (thx to MasterPhW) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2629 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenEditSub.pas | 49 ++++--- Game/Code/Screens/UScreenMain.pas | 9 ++ Game/Code/Screens/UScreenOptionsLyrics.pas | 11 +- Game/Code/Screens/UScreenPartyOptions.pas | 22 ++- Game/Code/Screens/UScreenPartyOptionsM2.pas | 10 +- Game/Code/Screens/UScreenPartyScore.pas | 209 ++++++++++++++++++++++++++-- Game/Code/Screens/UScreenScore.pas | 168 ++++++++++++++-------- Game/Code/Screens/UScreenSing.pas | 3 +- Game/Code/Screens/UScreenSingModi.pas | 3 +- Game/Code/Screens/UScreenSong.pas | 171 +++++++++++++---------- Game/Code/Screens/UScreenSongMenu.pas | 18 +++ 11 files changed, 496 insertions(+), 177 deletions(-) (limited to 'Game/Code/Screens') diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas index 38199ad9..a8c0a20d 100644 --- a/Game/Code/Screens/UScreenEditSub.pas +++ b/Game/Code/Screens/UScreenEditSub.pas @@ -50,6 +50,7 @@ type PlaySentenceMidi: boolean; PlayOneNote: boolean; PlayOneNoteMidi: boolean; + PlayOneSentence: boolean; //for mp3 and midi PlayStopTime: real; LastClick: integer; @@ -148,7 +149,7 @@ var begin Result := true; - + PlayOneSentence := false; Text[TextDebug].Text := ''; if TextEditMode then @@ -726,12 +727,13 @@ begin SDLK_P: begin + // one line, mp3 + clicks if SDL_ModState = 0 then begin - // Play Sentence MidiOut.PutShort($81, Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[MidiLastNote].Ton + 60, 127); PlaySentenceMidi := false; PlayOneNoteMidi := false; + PlayOneSentence := true; Click := true; Music.Stop; R := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].StartNote); @@ -746,10 +748,12 @@ begin end; end; + // one line, midi if SDL_ModState = KMOD_LSHIFT then begin PlaySentenceMidi := true; PlayOneNoteMidi := false; + PlayOneSentence := true; MidiTime := USTime.GetTime; Music.Stop; PlaySentence := false; @@ -760,10 +764,12 @@ begin LastClick := -100; end; + // one line midi + mp3 if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL then begin PlaySentenceMidi := true; PlayOneNoteMidi := false; + PlayOneSentence := true; MidiTime := USTime.GetTime; MidiStart := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].StartNote); MidiStop := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Koniec); @@ -771,7 +777,7 @@ begin PlaySentence := true; PlayOneNote := false; - Click := true; + //Click := true; Music.Stop; Music.MoveTo(GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].StartNote)+0{-0.10}); PlayStopTime := GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].Koniec)+0; @@ -825,7 +831,7 @@ begin PlaySentence := true; PlayOneNote := false; - Click := true; + //Click := true; Music.Stop; Music.MoveTo(GetTimeFromBeat(Czesci[CP].Czesc[Czesci[CP].Akt].StartNote)+0{-0.10}); PlayStopTime := Music.Length; @@ -1252,15 +1258,16 @@ begin if Ini.Debug=1 then Text[TextDebug].Text := 'PressedKey: ' + IntToStr(PressedKey) + ' ScanCode: ' + IntToStr(ScanCode); - + // check normal keys if not (ScanCode in [0..31, 127..159]) then //=isPrintable begin Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst := Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst + chr(ScanCode); - EditorLyric[CP].ChangeCurText(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst); + //EditorLyric[CP].ChangeCurText(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst); EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt); + EditorLyric[CP].Selected := AktNuta[CP]; Exit; end; @@ -1284,8 +1291,9 @@ begin Delete(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst, Length(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst), 1); - EditorLyric[CP].ChangeCurText(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst); + //EditorLyric[CP].ChangeCurText(Czesci[CP].Czesc[Czesci[CP].Akt].Nuta[AktNuta[CP]].Tekst); EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt); + EditorLyric[CP].Selected := AktNuta[CP]; end; SDLK_RIGHT: begin @@ -1868,15 +1876,21 @@ begin Czesci[CP].Czesc[C].Nuta[AktNuta[CP]].Dlugosc; if (Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Dlugosc>0) then - Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Tekst := '~' - else + begin + Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Tekst := '~'; + Czesci[CP].Czesc[C].Nuta[AktNuta[CP]].Color := 2; + Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Color := 0; + end else + begin Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Tekst := ' '; + Czesci[CP].Czesc[C].Nuta[AktNuta[CP]].Color := 0; + Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Color := 2; - Czesci[CP].Czesc[C].Nuta[AktNuta[CP]].Color := 0; - Czesci[CP].Czesc[C].Nuta[AktNuta[CP]+1].Color := 2; + Inc(AktNuta[CP]); + end; - Inc(AktNuta[CP]); EditorLyric[CP].AddCzesc(CP, Czesci[CP].Akt); + EditorLyric[CP].Selected := AktNuta[CP]; end; procedure TScreenEditSub.DeleteNote; @@ -2599,7 +2613,8 @@ begin for note := 0 to Length(Czesci[CP].Czesc[line].Nuta) - 1 do begin //line change - if (Czesci[CP].Czesc[line].Start = AktBeat) and (line <> Czesci[CP].Akt) and not end_ then + if (Czesci[CP].Czesc[line].Start = AktBeat) 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; @@ -2618,7 +2633,7 @@ begin end; end; - if AktSong.isDuet then + if AktSong.isDuet and not PlayOneSentence then begin for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do begin @@ -2645,6 +2660,7 @@ begin LineChanged[0]:=false; LineChanged[1]:=false; PlayVideo := false; + PlayOneSentence := false; end; // midi music @@ -2712,7 +2728,8 @@ begin begin //note change if (Czesci[CP].Czesc[line].Nuta[note].Start = AktBeat) and - ((note <> AktNuta[CP]) or LineChanged[CP]) then + (((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 @@ -2729,7 +2746,7 @@ begin end; end; - if AktSong.isDuet then + if AktSong.isDuet and not PlayOneSentence then begin for line := 0 to Length(Czesci[(CP+1) mod 2].Czesc) - 1 do begin diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas index b92e59a2..fbaa2e37 100644 --- a/Game/Code/Screens/UScreenMain.pas +++ b/Game/Code/Screens/UScreenMain.pas @@ -277,6 +277,15 @@ begin if (Ini.LoadFaultySongs=0) and ShowNumErrors and (Songs.NumFaultySongs>0) then begin ScreenPopupCheck.ShowPopup(Format(Language.Translate('MSG_ERROR_SONGLOADING'), [Songs.NumFaultySongs])); + end else + ShowNumErrors := false; + + if (Ini.tabs_temp <> Ini.tabs) or (Ini.sorting_temp <> Ini.Sorting)then + begin + Ini.Tabs := Ini.tabs_temp; + Ini.Sorting := Ini.sorting_temp; + ScreenSong.Refresh(true); + PlaylistMan.LoadPlayLists; end; end; diff --git a/Game/Code/Screens/UScreenOptionsLyrics.pas b/Game/Code/Screens/UScreenOptionsLyrics.pas index a6ee2464..bfb69c92 100644 --- a/Game/Code/Screens/UScreenOptionsLyrics.pas +++ b/Game/Code/Screens/UScreenOptionsLyrics.pas @@ -44,7 +44,8 @@ begin end; SDLK_RETURN: begin - if SelInteraction = 3 then begin + if SelInteraction = 2 then + begin Ini.Save; Music.PlayBack; FadeTo(@ScreenOptions); @@ -56,14 +57,16 @@ begin InteractPrev; SDLK_RIGHT: begin - if (SelInteraction >= 0) and (SelInteraction <= 2) then begin + if (SelInteraction >= 0) and (SelInteraction <= 1) then + begin Music.PlayOption; InteractInc; end; end; SDLK_LEFT: begin - if (SelInteraction >= 0) and (SelInteraction <= 2) then begin + if (SelInteraction >= 0) and (SelInteraction <= 1) then + begin Music.PlayOption; InteractDec; end; @@ -80,7 +83,7 @@ begin AddSelect(Theme.OptionsLyrics.SelectLyricsFont, Ini.LyricsFont, ILyricsFont); AddSelect(Theme.OptionsLyrics.SelectLyricsEffect, Ini.LyricsEffect, ILyricsEffect); - AddSelect(Theme.OptionsLyrics.SelectSolmization, Ini.Solmization, ISolmization); + //AddSelect(Theme.OptionsLyrics.SelectSolmization, Ini.Solmization, ISolmization); AddButton(Theme.OptionsLyrics.ButtonExit); diff --git a/Game/Code/Screens/UScreenPartyOptions.pas b/Game/Code/Screens/UScreenPartyOptions.pas index deeb8c96..0a58cd79 100644 --- a/Game/Code/Screens/UScreenPartyOptions.pas +++ b/Game/Code/Screens/UScreenPartyOptions.pas @@ -156,6 +156,14 @@ begin SDLK_RETURN: begin + if (Playlist = 0) and ((Ini.Tabs = 1) or (Ini.Sorting <> sRandom)) then + begin + Ini.Tabs := 0; + Ini.Sorting := sRandom; + ScreenSong.Refresh(true); + PlaylistMan.LoadPlayLists; + end; + MenuPluginOpen := false; if not Help.SetHelpID(ID) then Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenPartyOptions)'); @@ -214,7 +222,7 @@ begin J := -1; For I := 0 to high(CatSongs.Song) do begin - if CatSongs.Song[I].Main then + if CatSongs.Song[I].Main and (CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)>0) then Inc(J); if J = Playlist2 then @@ -479,13 +487,15 @@ begin end; procedure TScreenPartyOptions.SetPlaylist2; -var I: Integer; +var + I: Integer; + begin Case Playlist of 0: begin SetLength(IPlaylist2, 1); - IPlaylist2[0] := '---'; + IPlaylist2[0] := '(' + IntToStr(CatSongs.NumSongs()) + ' Songs)'; end; 1: begin @@ -495,7 +505,8 @@ begin If CatSongs.Song[I].Main and (CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)>0) then begin SetLength(IPlaylist2, Length(IPlaylist2) + 1); - IPlaylist2[high(IPlaylist2)] := CatSongs.Song[I].Artist; + IPlaylist2[high(IPlaylist2)] := CatSongs.Song[I].Artist + + ' (' + IntToStr(CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)) + ' Songs)'; end; end; @@ -510,7 +521,7 @@ begin if (Length(PlaylistMan.Playlists) > 0) then begin SetLength(IPlaylist2, Length(PlaylistMan.Playlists)); - PlaylistMan.GetNames(IPlaylist2); + PlaylistMan.GetNamesAndNumSongs(IPlaylist2); end else begin @@ -638,6 +649,7 @@ begin SelectedPlugin := 0; ScreenSong.Mode := smParty; + SetPlaylist2; end; procedure TScreenPartyOptions.SetAnimationProgress(Progress: real); diff --git a/Game/Code/Screens/UScreenPartyOptionsM2.pas b/Game/Code/Screens/UScreenPartyOptionsM2.pas index 057881f9..f27acc01 100644 --- a/Game/Code/Screens/UScreenPartyOptionsM2.pas +++ b/Game/Code/Screens/UScreenPartyOptionsM2.pas @@ -179,7 +179,7 @@ begin J := -1; For I := 0 to high(CatSongs.Song) do begin - if CatSongs.Song[I].Main then + if CatSongs.Song[I].Main and (CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)>0) then Inc(J); if J = Playlist2 then @@ -642,7 +642,7 @@ begin 0: begin SetLength(IPlaylist2, 1); - IPlaylist2[0] := '---'; + IPlaylist2[0] := '(' + IntToStr(CatSongs.NumSongs()) + ' Songs)'; end; 1: begin @@ -652,7 +652,8 @@ begin if CatSongs.Song[I].Main and (CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)>0) then begin SetLength(IPlaylist2, Length(IPlaylist2) + 1); - IPlaylist2[high(IPlaylist2)] := CatSongs.Song[I].Artist; + IPlaylist2[high(IPlaylist2)] := CatSongs.Song[I].Artist + + ' (' + IntToStr(CatSongs.NumCatSongs(CatSongs.Song[I].OrderNum)) + ' Songs)'; end; end; @@ -667,7 +668,7 @@ begin if (Length(PlaylistMan.Playlists) > 0) then begin SetLength(IPlaylist2, Length(PlaylistMan.Playlists)); - PlaylistMan.GetNames(IPlaylist2); + PlaylistMan.GetNamesAndNumSongs(IPlaylist2); end else begin @@ -798,6 +799,7 @@ begin SelectedPlugin := 0; ScreenSong.Mode := smChallenge; + SetPlaylist2; end; function TScreenPartyOptionsM2.Draw: boolean; diff --git a/Game/Code/Screens/UScreenPartyScore.pas b/Game/Code/Screens/UScreenPartyScore.pas index cf08018d..01a4349e 100644 --- a/Game/Code/Screens/UScreenPartyScore.pas +++ b/Game/Code/Screens/UScreenPartyScore.pas @@ -6,6 +6,11 @@ uses UMenu, SDL, UDisplay, UMusic, SysUtils, UThemes; type + THandler = record + changed: boolean; + change_time: real; + end; + TScreenPartyScore = class(TMenu) public TextScoreTeam1: Cardinal; @@ -30,12 +35,21 @@ type R, G, B: Real; end; - MaxScore: Word; + MaxScore: Word; + + ActualRound: integer; + Voice: integer; + Fadeout: boolean; + + MP3VolumeHandler: THandler; constructor Create; override; function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override; procedure onShow; override; + function Draw: boolean; override; procedure SetAnimationProgress(Progress: real); override; + procedure StartPreview; + procedure StartVoice; end; const @@ -43,7 +57,7 @@ const implementation -uses UGraphic, UMain, UParty, UScreenSingModi, ULanguage, UTexture, USkins, UHelp, ULog; +uses UGraphic, UDraw, UTime, UMain, UParty, USongs, UScreenSingModi, ULanguage, UTexture, UIni, USkins, UHelp, ULog; function TScreenPartyScore.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; begin @@ -61,26 +75,81 @@ begin Result := false; end; + //MP3-Volume Up + SDLK_PAGEUP: + begin + if (ScreenSong.MP3Volume<100) then + begin + ScreenSong.MP3Volume := ScreenSong.MP3Volume+5; + Music.SetMusicVolume(ScreenSong.MP3Volume); + end; + MP3VolumeHandler.changed := true; + MP3VolumeHandler.change_time := 0; + end; + + //MP3-Volume Down + SDLK_PAGEDOWN: + begin + if (ScreenSong.MP3Volume>0) then + begin + ScreenSong.MP3Volume := ScreenSong.MP3Volume-5; + Music.SetMusicVolume(ScreenSong.MP3Volume); + end; + MP3VolumeHandler.changed := true; + MP3VolumeHandler.change_time := 0; + end; + SDLK_ESCAPE, - SDLK_BACKSPACE : + SDLK_BACKSPACE, + SDLK_RETURN : begin - Music.PlayStart; - if (PartySession.CurRound < High(PartySession.Rounds)) then - FadeTo(@ScreenPartyNewRound) - else + if (not Fadeout) then begin - PartySession.EndRound; - FadeTo(@ScreenPartyWin); + Music.PlayStart; + + if (Ini.SavePlayback=1) then + Music.VoicesClose; + + ScreenSong.SongIndex := -1; + Music.FadeStop(Ini.PreviewFading); + + if (PartySession.CurRound < High(PartySession.Rounds)) then + FadeTo(@ScreenPartyNewRound) + else + begin + PartySession.EndRound; + FadeTo(@ScreenPartyWin); + end; + Fadeout := true; end; end; - SDLK_RETURN: + SDLK_RIGHT: begin - Music.PlayStart; - if (PartySession.CurRound < High(PartySession.Rounds)) then - FadeTo(@ScreenPartyNewRound) - else - FadeTo(@ScreenPartyWin); + if ActualRound0 then + begin + Music.PlayChange; + dec(ActualRound); + //RefreshTexts; + if not (Ini.SavePlayback=1) then + StartPreview + else + StartVoice; + end; end; end; end; @@ -164,6 +233,9 @@ begin if Music.VocalRemoverActivated() then Music.DisableVocalRemover; + + ActualRound := 0; + Fadeout := false; //Get Maxscore MaxScore := 0; @@ -285,6 +357,113 @@ begin Static[StaticTeam3BG].Visible := False; Static[StaticTeam3Deco].Visible := False; end; + + MP3VolumeHandler.changed := false; + if not (Ini.SavePlayback=1) then + StartPreview + else + begin + Voice := -1; + StartVoice; + end; +end; + +function TScreenPartyScore.Draw: boolean; +begin + inherited Draw; + + if MP3VolumeHandler.changed and (MP3VolumeHandler.change_time+TimeSkip<3) then + begin + MP3VolumeHandler.change_time := MP3VolumeHandler.change_time + TimeSkip; + DrawVolumeBar(10, 530, 780, 12, ScreenSong.MP3Volume); + end else + MP3VolumeHandler.changed := false; +end; + +procedure TScreenPartyScore.StartPreview; +var + select: integer; + changed: boolean; +begin + //When Music Preview is avtivated -> then Change Music + if (Ini.PreviewVolume <> 0) then + begin + changed := false; + if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then + begin + if (ActualRound PlaylistMedley.Song[ActualRound]) then + begin + select := PlaylistMedley.Song[ActualRound]; + changed := true; + ScreenSong.SongIndex := select; + end; + end else + begin + select := ScreenSong.Interaction; + ScreenSong.SongIndex := select; + changed := true; + end; + + if changed then + begin + Music.Close; + if Music.Open(CatSongs.Song[select].Path + CatSongs.Song[select].Mp3) then + begin + if (CatSongs.Song[select].PreviewStart>0) then + Music.MoveTo(CatSongs.Song[select].PreviewStart) + else + Music.MoveTo(Music.Length / 4); + + //If Song Fading is activated then don't Play directly, and Set Volume to Null, else Play normal + if (Ini.PreviewFading = 0) then + begin + Music.SetMusicVolume (ScreenSong.MP3Volume); + Music.Play; + end else + begin + Music.Fade(0, ScreenSong.MP3Volume, Ini.PreviewFading); + Music.Play; + end; + end; + end; + end; +end; + +procedure TScreenPartyScore.StartVoice; +var + changed: boolean; + files: array of string; + I: integer; + +begin + //Music.Close; + //ScreenSong.SongIndex := -1; + changed := false; + if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then + begin + if (ActualRound ActualRound) then + begin + Voice := ActualRound; + changed := true; + SetLength(files, PlaylistMedley.NumPlayer); + for I := 0 to Length(files) - 1 do + files[I] := PlaylistMedley.Stats[Voice].Player[I].VoiceFile; + end; + end else + begin + Voice := 0; + changed := true; + SetLength(files, PlayersPlay); + for I := 0 to Length(files) - 1 do + files[I] := Player[I].VoiceFile; + end; + + if changed then + begin + Music.VoicesClose; + if (Music.VoicesOpen(files)>0) then + Music.VoicesPlay; + end; end; procedure TScreenPartyScore.SetAnimationProgress(Progress: real); diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas index b8a7b61c..7c5c8253 100644 --- a/Game/Code/Screens/UScreenScore.pas +++ b/Game/Code/Screens/UScreenScore.pas @@ -23,30 +23,30 @@ type StaticMedleyNav: integer; TextMedleyNav: integer; - TextName: array[1..6] of integer; - TextScore: array[1..6] of integer; + TextName: array[1..10] of integer; + TextScore: array[1..10] of integer; - TextNotes: array[1..6] of integer; - TextNotesScore: array[1..6] of integer; - TextLineBonus: array[1..6] of integer; - TextLineBonusScore: array[1..6] of integer; - TextGoldenNotes: array[1..6] of integer; - TextGoldenNotesScore: array[1..6] of integer; - TextTotal: array[1..6] of integer; - TextTotalScore: array[1..6] of integer; + TextNotes: array[1..10] of integer; + TextNotesScore: array[1..10] of integer; + TextLineBonus: array[1..10] of integer; + TextLineBonusScore: array[1..10] of integer; + TextGoldenNotes: array[1..10] of integer; + TextGoldenNotesScore: array[1..10] of integer; + TextTotal: array[1..10] of integer; + TextTotalScore: array[1..10] of integer; - PlayerStatic: array[1..6] of array of integer; - PlayerTexts : array[1..6] of array of integer; + PlayerStatic: array[1..10] of array of integer; + PlayerTexts : array[1..10] of array of integer; - StaticBoxLightest: array[1..6] of integer; - StaticBoxLight: array[1..6] of integer; - StaticBoxDark: array[1..6] of integer; + StaticBoxLightest: array[1..10] of integer; + StaticBoxLight: array[1..10] of integer; + StaticBoxDark: array[1..10] of integer; - StaticBackLevel: array[1..6] of integer; - StaticBackLevelRound: array[1..6] of integer; - StaticLevel: array[1..6] of integer; - StaticLevelRound: array[1..6] of integer; + StaticBackLevel: array[1..10] of integer; + StaticBackLevelRound: array[1..10] of integer; + StaticLevel: array[1..10] of integer; + StaticLevelRound: array[1..10] of integer; Animation: real; Fadeout: boolean; @@ -227,7 +227,8 @@ begin StaticMedleyNav := AddStatic(Theme.Score.StaticMedleyNav); TextMedleyNav := AddText(Theme.Score.TextMedleyNav); - for P := 1 to 6 do begin + for P := 1 to 10 do + begin TextName[P] := AddText(Theme.Score.TextName[P]); TextScore[P] := AddText(Theme.Score.TextScore[P]); @@ -268,7 +269,7 @@ procedure TScreenScore.onShow; var P: integer; // player I: integer; - V: array[1..6] of boolean; // visibility array + V: array[1..10] of boolean; // visibility array begin if not Help.SetHelpID(ID) then Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenScore)'); @@ -284,34 +285,78 @@ begin Text[TextArtistTitle].Text := AktSong.Artist + ' - ' + AktSong.Title; // set visibility - case PlayersPlay of - 1: begin + if (not ScreenSing.P4Mode) then + begin + case PlayersPlay of + 1: begin V[1] := true; V[2] := false; V[3] := false; V[4] := false; V[5] := false; V[6] := false; - end; - 2, 4: begin + V[7] := false; + V[8] := false; + V[9] := false; + V[10] := false; + end; + 2, 4: begin V[1] := false; V[2] := true; V[3] := true; V[4] := false; V[5] := false; V[6] := false; - end; - 3, 6: begin + V[7] := false; + V[8] := false; + V[9] := false; + V[10] := false; + end; + 3, 6: begin V[1] := false; V[2] := false; V[3] := false; V[4] := true; V[5] := true; V[6] := true; - end; + V[7] := false; + V[8] := false; + V[9] := false; + V[10] := false; + end; + end; + end else + begin + case PlayersPlay of + 4: begin + V[1] := false; + V[2] := false; + V[3] := false; + V[4] := false; + V[5] := false; + V[6] := false; + V[7] := true; + V[8] := true; + V[9] := true; + V[10] := true; + end; + 6: begin //not finished yet! + V[1] := false; + V[2] := false; + V[3] := false; + V[4] := true; + V[5] := true; + V[6] := true; + V[7] := false; + V[8] := false; + V[9] := false; + V[10] := false; + end; + end; + end; - for P := 1 to 6 do + for P := 1 to 10 do begin Text[TextName[P]].Visible := V[P]; Text[TextScore[P]].Visible := V[P]; @@ -325,6 +370,15 @@ begin Text[TextTotal[P]].Visible := V[P]; Text[TextTotalScore[P]].Visible := V[P]; + //4P-hack: + if (P>7) then + begin + Text[TextNotes[P]].Visible := false; + Text[TextLineBonus[P]].Visible := false; + Text[TextGoldenNotes[P]].Visible := false; + Text[TextTotal[P]].Visible := false; + end; + for I := 0 to high(PlayerStatic[P]) do Static[PlayerStatic[P, I]].Visible := V[P]; @@ -341,21 +395,6 @@ begin Static[StaticLevelRound[P]].Visible := V[P]; end; - { - if PlayersPlay <= 3 then begin // only for 1 screen mode - for P := 0 to PlayersPlay-1 do begin - case PlayersPlay of - 1: PP := 1; - 2: PP := P + 2; - 3: PP := P + 4; - end; - - //Replaced this whole thing with one Procedure call - FillPlayer(PP, P); - - end; // for - end; // if } - if (ScreenSong.Mode = smMedley) or ScreenSong.PartyMedley then begin Static[StaticMedleyNav].Visible := true; @@ -380,19 +419,15 @@ end; function TScreenScore.Draw: boolean; var -{ Min: real; - Max: real; - Wsp: real; - Wsp2: real; - Pet: integer;} - Item: integer; P: integer; begin Item := 0; P := 0; - if PlayersPlay <= 3 then begin // only for 1 screen mode - for P := 0 to PlayersPlay-1 do begin + if PlayersPlay <= 3 then + begin // only for 1 screen mode + for P := 0 to PlayersPlay-1 do + begin case PlayersPlay of 1: Item := 1; 2: Item := P + 2; @@ -406,8 +441,10 @@ begin end; // if // 0.5.0: try also use 4 players screen with nicks - if PlayersPlay = 4 then begin - for Item := 2 to 3 do begin + if (not ScreenSing.P4Mode) and (PlayersPlay = 4) then + begin + for Item := 2 to 3 do + begin if ScreenAct = 1 then P := Item-2; if ScreenAct = 2 then P := Item; @@ -415,10 +452,21 @@ begin end; end; + if (ScreenSing.P4Mode) and (PlayersPlay = 4) then + begin + for Item := 7 to 10 do + begin + P := Item-7; + FillPlayer(Item, P); + end; + end; + // Singstar - let it be...... with 6 statics - if PlayersPlay = 6 then begin - for Item := 4 to 6 do begin + if PlayersPlay = 6 then + begin + for Item := 4 to 6 do + begin if ScreenAct = 1 then P := Item-4; if ScreenAct = 2 then P := Item-1; @@ -501,7 +549,8 @@ begin Static[StaticLevel[Item]].Texture.Y := Static[StaticBackLevel[Item]].Texture.Y + Static[StaticBackLevel[Item]].Texture.H - Static[StaticLevel[Item]].Texture.H; // we modify LevelRound texture by changing it's Y. TexY1 and TexY2 change when the height to draw is lower than 20 - if Lev * MaxH < Static[StaticBackLevelRound[Item]].Texture.H / 2 then begin + if Lev * MaxH < Static[StaticBackLevelRound[Item]].Texture.H / 2 then + begin // when it's lower than 20 => we move TexY1 and TexY2 higher to show only part of this texture Static[StaticLevelRound[Item]].Texture.Y := Static[StaticBackLevel[Item]].Texture.Y + Static[StaticBackLevel[Item]].Texture.H - Static[StaticBackLevelRound[Item]].Texture.H; // - 0.25 when points = 0 @@ -512,7 +561,8 @@ begin Wsp := Lev * MaxH / (Static[StaticBackLevelRound[Item]].Texture.H / 2); Static[StaticLevelRound[Item]].Texture.TexY1 := Static[StaticBackLevelRound[Item]].Texture.TexY1 - 0.25 + 0.25 * Wsp; Static[StaticLevelRound[Item]].Texture.TexY2 := Static[StaticBackLevelRound[Item]].Texture.TexY2 - 0.25 + 0.25 * Wsp; - end else begin + end else + begin // when it's higher or equal 20 => full texture is being shown Static[StaticLevelRound[Item]].Texture.TexY1 := Static[StaticBackLevelRound[Item]].Texture.TexY1; Static[StaticLevelRound[Item]].Texture.TexY2 := Static[StaticBackLevelRound[Item]].Texture.TexY2; @@ -600,7 +650,7 @@ begin end; end; -procedure TScreenSCore.StartVoice; +procedure TScreenScore.StartVoice; var changed: boolean; files: array of string; diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index e8884329..472d11dc 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -240,8 +240,7 @@ begin Result := false; end; - SDLK_ESCAPE, - SDLK_BACKSPACE : + SDLK_ESCAPE: begin //Record Sound Hack: //Sound[0].BufferLong diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas index 0370509e..56ea438a 100644 --- a/Game/Code/Screens/UScreenSingModi.pas +++ b/Game/Code/Screens/UScreenSingModi.pas @@ -76,8 +76,7 @@ begin If (PressedDown) Then begin // Key Down case PressedKey of - SDLK_ESCAPE, - SDLK_BACKSPACE : + SDLK_ESCAPE: begin if ScreenSong.PartyMedley then begin diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 6b5792d2..7c7d04ba 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -41,6 +41,7 @@ type isScrolling: boolean; public + Sel3: integer; //Selection in party mode (0=current, -1=left, 1=right) MP3Volume: integer; MP3VolumeHandler: THandler; TextArtist: integer; @@ -618,87 +619,100 @@ begin SDLK_ESCAPE, SDLK_BACKSPACE : begin - WaitHandler.change_time := 0; - if (Mode = smNormal) or ((Mode = smChallenge) and not PartyMedley and not FoundCAT) then - begin - //On Escape goto Cat-List Hack - if (Ini.Tabs = 1) AND (CatSongs.CatNumShow <> -1) then + if UVideo.VideoOpened then + begin + if TargetVidVis=full then begin - //Find Category - I := Interaction; - while not catsongs.Song[I].Main do + TargetVidVis:=windowed; + TargetAspect := acoCrop; + if not VidVisHandler.changed then begin - Dec (I); - if (I < low(catsongs.Song)) then - break; + VidVisHandler.changed := true; + VidVisHandler.change_time := 0; end; - if (I<= 1) then - Interaction := high(catsongs.Song) - else - Interaction := I - 1; - - //Stop Music - Music.Stop; + Exit; + end; + end; - //Stop Video - acClose; + WaitHandler.change_time := 0; + if (Mode = smNormal) or ((Mode = smChallenge) and not PartyMedley and not FoundCAT) then + begin + //On Escape goto Cat-List Hack + if (Ini.Tabs = 1) AND (CatSongs.CatNumShow <> -1) then + begin + //Find Category + I := Interaction; + while not catsongs.Song[I].Main do + begin + Dec (I); + if (I < low(catsongs.Song)) then + break; + end; - CatSongs.ShowCategoryList; + if (I<= 1) then + Interaction := high(catsongs.Song) + else + Interaction := I - 1; - //Show Cat in Top Left Mod - HideCatTL; + //Stop Music + Music.Stop; + //Stop Video + acClose; - //Show Wrong Song when Tabs on Fix - SelectNext; - FixSelected; - //SelectPrev; - //CatSongs.Song[0].Visible := False; - end - else - begin - //On Escape goto Cat-List Hack End - //Tabs off and in Search or Playlist -> Go back to Song view - if (CatSongs.CatNumShow < -1) then - begin - //Atm: Set Empty Filter - CatSongs.SetFilter('', 0); + CatSongs.ShowCategoryList; //Show Cat in Top Left Mod HideCatTL; - Interaction := 0; + //Show Wrong Song when Tabs on Fix SelectNext; FixSelected; - - ChangeMusic; - end - else if (Mode = smNormal) then + //SelectPrev; + //CatSongs.Song[0].Visible := False; + end else begin - Music.Stop; - Music.PlayBack; - acClose; + //On Escape goto Cat-List Hack End + //Tabs off and in Search or Playlist -> Go back to Song view + if (CatSongs.CatNumShow < -1) then + begin + //Atm: Set Empty Filter + CatSongs.SetFilter('', 0); - FadeTo(@ScreenMain); - end else if (Mode = smChallenge) then - begin - Music.PlayBack; - CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); + //Show Cat in Top Left Mod + HideCatTL; + Interaction := 0; + + //Show Wrong Song when Tabs on Fix + SelectNext; + FixSelected; + + ChangeMusic; + end else if (Mode = smNormal) then + begin + Music.Stop; + Music.PlayBack; + acClose; + + FadeTo(@ScreenMain); + end else if (Mode = smChallenge) then + begin + Music.PlayBack; + CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); + end; end; + end else if (Mode = smChallenge) then + begin + Music.PlayBack; + CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); + end + //When in party Mode then Ask before Close + else if (Mode = smParty) then + begin + Music.PlayBack; + CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); end; - end - else if (Mode = smChallenge) then - begin - Music.PlayBack; - CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); - end - //When in party Mode then Ask before Close - else if (Mode = smParty) then - begin - Music.PlayBack; - CheckFadeTo(@ScreenMain,'MSG_END_PARTY'); - end; end; SDLK_RETURN: begin @@ -955,8 +969,12 @@ begin SDLK_RIGHT: begin if (Length(Songs.Song) > 0) AND - ((Mode = smNormal) or ((Mode = smChallenge) and CatSongs.Song[Interaction].Main)) then + (((Mode = smNormal) or ((Mode = smChallenge) and CatSongs.Song[Interaction].Main)) or + ((Mode = smParty) and (PartySession.Rand3) and (Sel3<=0))) then begin + if (Mode = smParty) then + Inc(Sel3); + Music.PlayChange; SelectNext; ChangeMusic; @@ -967,8 +985,12 @@ begin SDLK_LEFT: begin if (Length(Songs.Song) > 0) AND - ((Mode = smNormal) or ((Mode = smChallenge) and CatSongs.Song[Interaction].Main)) then + (((Mode = smNormal) or ((Mode = smChallenge) and CatSongs.Song[Interaction].Main)) or + ((Mode = smParty) and (PartySession.Rand3) and (Sel3>=0))) then begin + if (Mode = smParty) then + Dec(Sel3); + Music.PlayChange; SelectPrev; ChangeMusic; @@ -2085,6 +2107,8 @@ begin MakeMedley := false; isScrolling := false; + Sel3 := 0; + StartTry := false; AspectHandler.changed := false; InfoHandler.changed := false; @@ -2104,7 +2128,7 @@ begin Text[TextTop[I]].Visible := false; Static[StaticTop].Visible := false; - + HideCatTL; //Cat Mod etc if (Ini.Tabs = 1) AND (CatSongs.CatNumShow = -1) AND (PlaylistMan.Mode=0) then @@ -2659,6 +2683,9 @@ begin WaitHandler.active := true; WaitHandler.lastIndex := Interaction; WaitHandler.lastCat := CatSongs.CatNumShow; + + if (Ini.ShuffleTime=10) and (VidVis<>full) then + VidVis := full; end; if(Ini.Tabs<>1) or (CatSongs.CatNumShow < -1) then @@ -2720,7 +2747,7 @@ begin end; end; - Music.PlayChange; + //Music.PlayChange; ChangeMusic; SetScroll4; end else if (Ini.ShuffleTime>0) then @@ -2912,10 +2939,13 @@ begin begin if Music.Open(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Mp3) then begin - if (CatSongs.Song[Interaction].PreviewStart>0) then - Music.MoveTo(CatSongs.Song[Interaction].PreviewStart) - else - Music.MoveTo(Music.Length / 4); + if not (Ini.ShuffleTime>9) or not WaitHandler.active then + begin + if (CatSongs.Song[Interaction].PreviewStart>0) then + Music.MoveTo(CatSongs.Song[Interaction].PreviewStart) + else + Music.MoveTo(Music.Length / 4); + end; StartVideoPreview; //If Song Fading is activated then don't Play directly, and Set Volume to Null, else Play normal @@ -3679,6 +3709,7 @@ end; //Team No of Team (0-5) procedure TScreenSong.DoJoker (Team: Byte; SDL_ModState: Word); begin + Sel3 := 0; if not PartyMedley and (ChooseableSongs>1) and (Mode = smParty) AND (PartySession.Teams.NumTeams >= Team + 1) AND (PartySession.Teams.Teaminfo[Team].Joker > 0) then begin diff --git a/Game/Code/Screens/UScreenSongMenu.pas b/Game/Code/Screens/UScreenSongMenu.pas index 1a3ee675..72ec1337 100644 --- a/Game/Code/Screens/UScreenSongMenu.pas +++ b/Game/Code/Screens/UScreenSongMenu.pas @@ -179,6 +179,15 @@ begin if (CurMenu = SM_Sort) then Button[3].Visible := (Ini.Sorting <> SelectValue); + + if (ScreenSong.Mode = smParty) and (ScreenSong.Sel3<=0) then + begin + Inc(ScreenSong.Sel3); + Music.PlayChange; + ScreenSong.SelectNext; + ScreenSong.ChangeMusic; + ScreenSong.SetScroll4; + end; end; SDLK_LEFT: begin @@ -187,6 +196,15 @@ begin if (CurMenu = SM_Sort) then Button[3].Visible := (Ini.Sorting <> SelectValue); + + if (ScreenSong.Mode = smParty) and (ScreenSong.Sel3>=0) then + begin + Dec(ScreenSong.Sel3); + Music.PlayChange; + ScreenSong.SelectPrev; + ScreenSong.ChangeMusic; + ScreenSong.SetScroll4; + end; end; SDLK_1: -- cgit v1.2.3