From 8e0f573b081c9ca3d0c435d23ef431529707916d Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sun, 17 Oct 2010 10:36:06 +0000 Subject: - medley score in screenscore git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2670 b956fd51-792f-4845-bead-9b4dfca2ff2c --- medley_new/src/screens/UScreenScore.pas | 154 +++++++++++++++++++++++++------- medley_new/src/screens/UScreenSing.pas | 4 +- 2 files changed, 126 insertions(+), 32 deletions(-) diff --git a/medley_new/src/screens/UScreenScore.pas b/medley_new/src/screens/UScreenScore.pas index de7675bf..3b08fe86 100644 --- a/medley_new/src/screens/UScreenScore.pas +++ b/medley_new/src/screens/UScreenScore.pas @@ -167,6 +167,11 @@ type TextPhrase_ActualValue: array[1..6] of integer; TextGolden_ActualValue: array[1..6] of integer; + ActualRound: integer; + + procedure RefreshTexts; + procedure ResetScores; + procedure MapPlayersToPosition; procedure FillPlayer(Item, P: integer); @@ -214,6 +219,7 @@ uses ULog, ULanguage, UNote, + USong, UUnicodeUtils; @@ -237,7 +243,11 @@ begin SDLK_BACKSPACE, SDLK_RETURN: begin - FadeTo(@ScreenTop5); + if (ScreenSong.Mode = smMedley) then + FadeTo(@ScreenSong) + else + FadeTo(@ScreenTop5); + Exit; end; @@ -245,6 +255,26 @@ begin begin Display.SaveScreenShot; end; + + SDLK_RIGHT: + begin + if ActualRound0 then + begin + AudioPlayback.PlaySound(SoundLib.Change); + dec(ActualRound); + RefreshTexts; + end; + end; end; end; end; @@ -258,6 +288,48 @@ begin end; end; +procedure TScreenScore.RefreshTexts; +var + P: integer; + +begin + if (ActualRound < Length(PlaylistMedley.Stats)-1) then + begin + Text[TextArtist].Text := IntToStr(ActualRound+1) + '/' + + IntToStr(Length(PlaylistMedley.Stats)-1) + ': ' + + PlaylistMedley.Stats[ActualRound].SongArtist; + Text[TextTitle].Text := PlaylistMedley.Stats[ActualRound].SongTitle; + Text[TextTitle].Visible := true; + Text[TextArtistTitle].Text := IntToStr(ActualRound+1) + '/' + + IntToStr(Length(PlaylistMedley.Stats)-1) + ': ' + + PlaylistMedley.Stats[ActualRound].SongArtist + + ' - ' + PlaylistMedley.Stats[ActualRound].SongTitle; + end else + begin + if (ScreenSong.Mode = smMedley) then + begin + Text[TextArtist].Text := Language.Translate('SING_TOTAL'); + Text[TextTitle].Visible := false; + Text[TextArtistTitle].Text := Language.Translate('SING_TOTAL'); + end else + begin + Text[TextArtist].Text := PlaylistMedley.Stats[ActualRound].SongArtist; + Text[TextTitle].Text := PlaylistMedley.Stats[ActualRound].SongTitle; + Text[TextTitle].Visible := true; + Text[TextArtistTitle].Text := PlaylistMedley.Stats[ActualRound].SongArtist + ' - ' + + PlaylistMedley.Stats[ActualRound].SongTitle; + end; + end; + + if (ScreenSong.Mode = smMedley) then + begin + for P := 0 to PlayersPlay - 1 do + Player[P] := PlaylistMedley.Stats[ActualRound].Player[P]; + end; + + ResetScores; +end; + procedure TScreenScore.LoadSwapTextures; var P, I: integer; @@ -621,23 +693,15 @@ begin inherited; - MapPlayersToPosition; - - for P := 1 to PlayersPlay do + ActualRound := 0; + if (ScreenSong.Mode = smMedley) then begin - // data - aPlayerScoreScreenDatas[P].Bar_Y := Theme.Score.StaticBackLevel[PlayerPositionMap[P-1].Position].Y; - - // ratings - aPlayerScoreScreenRatings[P].RateEaseStep := 1; - aPlayerScoreScreenRatings[P].RateEaseValue := 20; - - // actual values - TextScore_ActualValue[P] := 0; - TextPhrase_ActualValue[P] := 0; - TextGolden_ActualValue[P] := 0; + for P := 0 to PlayersPlay - 1 do + Player[P] := PlaylistMedley.Stats[ActualRound].Player[P]; end; + MapPlayersToPosition; + Text[TextArtist].Text := CurrentSong.Artist; Text[TextTitle].Text := CurrentSong.Title; Text[TextArtistTitle].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title; @@ -672,22 +736,8 @@ begin for P := 1 to 6 do begin - Text[TextName[P]].Visible := V[P]; - Text[TextScore[P]].Visible := V[P]; - - // We set alpha to 0 , so we can nicely blend them in when we need them - Text[TextScore[P]].Alpha := 0; - Text[TextNotesScore[P]].Alpha := 0; - Text[TextNotes[P]].Alpha := 0; - Text[TextLineBonus[P]].Alpha := 0; - Text[TextLineBonusScore[P]].Alpha := 0; - Text[TextGoldenNotes[P]].Alpha := 0; - Text[TextGoldenNotesScore[P]].Alpha := 0; - Text[TextTotal[P]].Alpha := 0; - Text[TextTotalScore[P]].Alpha := 0; - Statics[StaticBoxLightest[P]].Texture.Alpha := 0; - Statics[StaticBoxLight[P]].Texture.Alpha := 0; - Statics[StaticBoxDark[P]].Texture.Alpha := 0; + Text[TextName[P]].Visible := V[P]; + Text[TextScore[P]].Visible := V[P]; Text[TextNotes[P]].Visible := V[P]; Text[TextNotesScore[P]].Visible := V[P]; @@ -717,9 +767,51 @@ begin Statics[StaticLevelRound[P]].Visible := false; end; + RefreshTexts; +end; + +procedure TScreenScore.ResetScores; +var + P: integer; + +begin + for P := 1 to PlayersPlay do + begin + // data + aPlayerScoreScreenDatas[P].Bar_Y := Theme.Score.StaticBackLevel[PlayerPositionMap[P-1].Position].Y; + + // ratings + aPlayerScoreScreenRatings[P].RateEaseStep := 1; + aPlayerScoreScreenRatings[P].RateEaseValue := 20; + + // actual values + TextScore_ActualValue[P] := 0; + TextPhrase_ActualValue[P] := 0; + TextGolden_ActualValue[P] := 0; + end; + + for P := 1 to 6 do + begin + // We set alpha to 0 , so we can nicely blend them in when we need them + Text[TextScore[P]].Alpha := 0; + Text[TextNotesScore[P]].Alpha := 0; + Text[TextNotes[P]].Alpha := 0; + Text[TextLineBonus[P]].Alpha := 0; + Text[TextLineBonusScore[P]].Alpha := 0; + Text[TextGoldenNotes[P]].Alpha := 0; + Text[TextGoldenNotesScore[P]].Alpha := 0; + Text[TextTotal[P]].Alpha := 0; + Text[TextTotalScore[P]].Alpha := 0; + Statics[StaticBoxLightest[P]].Texture.Alpha := 0; + Statics[StaticBoxLight[P]].Texture.Alpha := 0; + Statics[StaticBoxDark[P]].Texture.Alpha := 0; + end; + BarScore_EaseOut_Step := 1; BarPhrase_EaseOut_Step := 1; BarGolden_EaseOut_Step := 1; + + BarTime := SDL_GetTicks(); end; procedure TScreenScore.onShowFinish; diff --git a/medley_new/src/screens/UScreenSing.pas b/medley_new/src/screens/UScreenSing.pas index 113c44a8..cea1b2c3 100644 --- a/medley_new/src/screens/UScreenSing.pas +++ b/medley_new/src/screens/UScreenSing.pas @@ -243,7 +243,9 @@ begin begin // record sound hack: //Sound[0].BufferLong - + if (ScreenSong.Mode = smMedley) then + PlaylistMedley.NumMedleySongs := PlaylistMedley.CurrentMedleySong; + Finish; FadeOut := true; AudioPlayback.PlaySound(SoundLib.Back); -- cgit v1.2.3