diff options
Diffstat (limited to 'Lua/src/screens')
-rw-r--r-- | Lua/src/screens/UScreenPartyScore.pas | 7 | ||||
-rw-r--r-- | Lua/src/screens/UScreenPartyWin.pas | 57 |
2 files changed, 30 insertions, 34 deletions
diff --git a/Lua/src/screens/UScreenPartyScore.pas b/Lua/src/screens/UScreenPartyScore.pas index b249a55a..7fc79ee7 100644 --- a/Lua/src/screens/UScreenPartyScore.pas +++ b/Lua/src/screens/UScreenPartyScore.pas @@ -185,6 +185,10 @@ var begin inherited; + // indicate that round is finished + Party.RoundPlayed; + + // get rankings for current round Ranking := Party.Rounds[Party.CurrentRound].Ranking; @@ -198,9 +202,6 @@ begin if Static[StaticTeam2].Texture.ScaleW > 99 then Static[StaticTeam2].Texture.ScaleW := 99; if Static[StaticTeam3].Texture.ScaleW > 99 then Static[StaticTeam3].Texture.ScaleW := 99; } - //End Last Round // to-do : Party - //PartySession.EndRound; - //Set Winnertext Text[TextWinner].Text := Format(Language.Translate('PARTY_SCORE_WINS'), [Party.GetWinnerString(Party.CurrentRound)]); diff --git a/Lua/src/screens/UScreenPartyWin.pas b/Lua/src/screens/UScreenPartyWin.pas index 6b4a55c0..280a9b28 100644 --- a/Lua/src/screens/UScreenPartyWin.pas +++ b/Lua/src/screens/UScreenPartyWin.pas @@ -83,13 +83,8 @@ begin // check special keys case PressedKey of SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - AudioPlayback.PlaySound(SoundLib.Start); - FadeTo(@ScreenMain); - end; - - SDLK_RETURN: + SDLK_BACKSPACE, + SDLK_RETURN : begin AudioPlayback.PlaySound(SoundLib.Start); FadeTo(@ScreenMain); @@ -127,11 +122,11 @@ begin end; procedure TScreenPartyWin.onShow; -//var -// I: Integer; // Auto Removed, Unused Variable -// Placing: Integer; // Auto Removed, Unused Variable +var + I, J: Integer; + Ranking: AParty_TeamRanking; - Function GetTeamColor(Team: Byte): Cardinal; + Function GetTeamColor(Team: Integer): Cardinal; var NameString: String; begin @@ -143,16 +138,16 @@ procedure TScreenPartyWin.onShow; begin inherited; - // to-do : Party - //Get Team Placing - //Placing := PartySession.GetTeamOrder; + // get team ranking + // Ranking is sorted by score + Ranking := Party.GetTeamRanking; //Set Winnertext - //Text[TextWinner].Text := Format(Language.Translate('PARTY_SCORE_WINS'), [PartySession.Teams.Teaminfo[Placing[0]].Name]); - {if (PartySession.Teams.NumTeams >= 1) then + Text[TextWinner].Text := Format(Language.Translate('PARTY_SCORE_WINS'), [Party.GetWinnerString(-1)]); + if (Length(Party.Teams) >= 1) then begin - Text[TextScoreTeam1].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[0]].Score); - Text[TextNameTeam1].Text := String(PartySession.Teams.TeamInfo[Placing[0]].Name); + Text[TextScoreTeam1].Text := IntToStr(Party.Teams[Ranking[0].Team].Score); + Text[TextNameTeam1].Text := Party.Teams[Ranking[0].Team].Name; Text[TextScoreTeam1].Visible := True; Text[TextNameTeam1].Visible := True; @@ -163,7 +158,7 @@ begin //Set Static Color to Team Color If (Theme.PartyWin.StaticTeam1BG.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[0]); + I := GetTeamColor(Ranking[0].Team); if (I <> -1) then begin Static[StaticTeam1BG].Texture.ColR := Color[I].RGB.R; @@ -174,7 +169,7 @@ begin If (Theme.PartyWin.StaticTeam1.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[0]); + I := GetTeamColor(Ranking[0].Team); if (I <> -1) then begin Static[StaticTeam1].Texture.ColR := Color[I].RGB.R; @@ -192,10 +187,10 @@ begin Static[StaticTeam1Deco].Visible := False; end; - if (PartySession.Teams.NumTeams >= 2) then + if (Length(Party.Teams) >= 2) then begin - Text[TextScoreTeam2].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[1]].Score); - Text[TextNameTeam2].Text := String(PartySession.Teams.TeamInfo[Placing[1]].Name); + Text[TextScoreTeam2].Text := IntToStr(Party.Teams[Ranking[1].Team].Score); + Text[TextNameTeam2].Text := Party.Teams[Ranking[1].Team].Name; Text[TextScoreTeam2].Visible := True; Text[TextNameTeam2].Visible := True; @@ -206,7 +201,7 @@ begin //Set Static Color to Team Color If (Theme.PartyWin.StaticTeam2BG.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[1]); + I := GetTeamColor(Ranking[1].Team); if (I <> -1) then begin Static[StaticTeam2BG].Texture.ColR := Color[I].RGB.R; @@ -217,7 +212,7 @@ begin If (Theme.PartyWin.StaticTeam2.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[1]); + I := GetTeamColor(Ranking[1].Team); if (I <> -1) then begin Static[StaticTeam2].Texture.ColR := Color[I].RGB.R; @@ -235,10 +230,10 @@ begin Static[StaticTeam2Deco].Visible := False; end; - if (PartySession.Teams.NumTeams >= 3) then + if (Length(Party.Teams) >= 3) then begin - Text[TextScoreTeam3].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[2]].Score); - Text[TextNameTeam3].Text := String(PartySession.Teams.TeamInfo[Placing[2]].Name); + Text[TextScoreTeam3].Text := IntToStr(Party.Teams[Ranking[2].Team].Score); + Text[TextNameTeam3].Text := Party.Teams[Ranking[2].Team].Name; Text[TextScoreTeam3].Visible := True; Text[TextNameTeam3].Visible := True; @@ -249,7 +244,7 @@ begin //Set Static Color to Team Color If (Theme.PartyWin.StaticTeam3BG.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[2]); + I := GetTeamColor(Ranking[2].Team); if (I <> -1) then begin Static[StaticTeam3BG].Texture.ColR := Color[I].RGB.R; @@ -260,7 +255,7 @@ begin If (Theme.PartyWin.StaticTeam3.Color = 'TeamColor') then begin - I := GetTeamColor(Placing[2]); + I := GetTeamColor(Ranking[2].Team); if (I <> -1) then begin Static[StaticTeam3].Texture.ColR := Color[I].RGB.R; @@ -276,7 +271,7 @@ begin Static[StaticTeam3].Visible := False; Static[StaticTeam3BG].Visible := False; Static[StaticTeam3Deco].Visible := False; - end; } + end; end; procedure TScreenPartyWin.SetAnimationProgress(Progress: real); |