From 9bbedc30d451861ccbd2348c00d7d8ae5a828c60 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 3 Jan 2016 22:49:06 +0000 Subject: end of first pass. many more smaller changes and preparations for later additions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3189 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyNewRound.pas | 92 +++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 18 deletions(-) (limited to 'src/screens/UScreenPartyNewRound.pas') diff --git a/src/screens/UScreenPartyNewRound.pas b/src/screens/UScreenPartyNewRound.pas index 8024108c..d5bc6ac5 100644 --- a/src/screens/UScreenPartyNewRound.pas +++ b/src/screens/UScreenPartyNewRound.pas @@ -44,6 +44,9 @@ uses type TScreenPartyNewRound = class(TMenu) + private + VisibleRound: integer; + public //Texts: TextRound: array [0..6] of cardinal; @@ -84,6 +87,7 @@ type function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; procedure OnShow; override; procedure SetAnimationProgress(Progress: real); override; + procedure Refresh; end; implementation @@ -127,6 +131,70 @@ begin AudioPlayback.PlaySound(SoundLib.Start); Party.CallBeforeSongSelect; end; + + SDLK_UP: + begin + if VisibleRound > 0 then + begin + Dec(VisibleRound); + Refresh; + end; + end; + + SDLK_DOWN: + begin + if VisibleRound < (Length(Party.Rounds) - 7) then + begin + Inc(VisibleRound); + Refresh; + end; + end; + end; + end; +end; + +procedure TScreenPartyNewRound.Refresh; +var + N, R, I: Integer; + NumRounds: Integer; +begin + R := Party.CurrentRound; + + //Set Visibility of Round Infos + NumRounds := Length(Party.Rounds); + + N := VisibleRound; + + if ((NumRounds-7) < N) then + begin + N := NumRounds - 7; + VisibleRound := N; + end; + + if (N < 0) then + begin + N := 0; + VisibleRound := 0; + end; + + //Set Visibility of Round Infos + for I := 0 to 6 do + begin + if (I <= High(Party.Rounds)) then + begin + Statics[StaticRound[I]].Visible := True; + Text[TextRound[I]].Visible := True; + Text[TextWinner[I]].Visible := True; + + // update texts: + Text[TextRound[I]].Text := IntToStr(I + 1 + N)+') ' + Language.Translate('MODE_' + uppercase(Party.Modes[Party.Rounds[I + N].Mode].Name) + '_NAME'); + Text[TextWinner[I]].Text := Party.GetWinnerString(I + N); + end + else + begin + Statics[StaticRound[I]].Visible := False; + Text[TextRound[I]].Visible := False; + Text[TextWinner[I]].Visible := False; end; end; end; @@ -210,27 +278,15 @@ var begin inherited; - //Set Visibility of Round Infos - for I := 0 to 6 do + if (Party.CurrentRound > 0) then begin - if (I <= High(Party.Rounds)) then - begin - Statics[StaticRound[I]].Visible := True; - Text[TextRound[I]].Visible := True; - Text[TextWinner[I]].Visible := True; - - // update texts: - Text[TextRound[I]].Text := Language.Translate('MODE_' + uppercase(Party.Modes[Party.Rounds[I].Mode].Name) + '_NAME'); - Text[TextWinner[I]].Text := Party.GetWinnerString(I); - end + if (Party.CurrentRound > 1) then + VisibleRound := Party.CurrentRound - 2 else - begin - Statics[StaticRound[I]].Visible := False; - Text[TextRound[I]].Visible := False; - Text[TextWinner[I]].Visible := False; - end; + VisibleRound := Party.CurrentRound - 1; end; + Refresh; //Display Scores if (Length(Party.Teams) >= 1) then @@ -294,7 +350,7 @@ begin Text[TextTeam3Players].Visible := false; Statics[StaticTeam3].Visible := false; Statics[StaticNextPlayer3].Visible := false; - end; + end; //nextRound Texts Text[TextNextRound].Text := Language.Translate('MODE_' + uppercase(Party.Modes[Party.Rounds[Party.CurrentRound].Mode].Name) + '_DESC'); -- cgit v1.2.3