diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2016-01-03 22:49:06 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2016-01-03 22:49:06 +0000 |
commit | 9bbedc30d451861ccbd2348c00d7d8ae5a828c60 (patch) | |
tree | 4fd8278dca1cf9d6dcde420685a1fad9bd84e636 /src/screens/UScreenPartyNewRound.pas | |
parent | 7e017d47108ec25fcf3c9bd86cccc79c27cd75f7 (diff) | |
download | usdx-9bbedc30d451861ccbd2348c00d7d8ae5a828c60.tar.gz usdx-9bbedc30d451861ccbd2348c00d7d8ae5a828c60.tar.xz usdx-9bbedc30d451861ccbd2348c00d7d8ae5a828c60.zip |
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
Diffstat (limited to '')
-rw-r--r-- | src/screens/UScreenPartyNewRound.pas | 92 |
1 files changed, 74 insertions, 18 deletions
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'); |