aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenPartyNewRound.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/screens/UScreenPartyNewRound.pas298
1 files changed, 152 insertions, 146 deletions
diff --git a/src/screens/UScreenPartyNewRound.pas b/src/screens/UScreenPartyNewRound.pas
index f95f2ff1..03a72fa9 100644
--- a/src/screens/UScreenPartyNewRound.pas
+++ b/src/screens/UScreenPartyNewRound.pas
@@ -34,87 +34,93 @@ interface
{$I switches.inc}
uses
- UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes;
+ UMenu,
+ SDL,
+ UDisplay,
+ UMusic,
+ UFiles,
+ SysUtils,
+ UThemes;
type
TScreenPartyNewRound = class(TMenu)
public
//Texts:
- TextRound1: Cardinal;
- TextRound2: Cardinal;
- TextRound3: Cardinal;
- TextRound4: Cardinal;
- TextRound5: Cardinal;
- TextRound6: Cardinal;
- TextRound7: Cardinal;
-
- TextWinner1: Cardinal;
- TextWinner2: Cardinal;
- TextWinner3: Cardinal;
- TextWinner4: Cardinal;
- TextWinner5: Cardinal;
- TextWinner6: Cardinal;
- TextWinner7: Cardinal;
-
- TextNextRound: Cardinal;
- TextNextRoundNo: Cardinal;
- TextNextPlayer1: Cardinal;
- TextNextPlayer2: Cardinal;
- TextNextPlayer3: Cardinal;
+ TextRound1: cardinal;
+ TextRound2: cardinal;
+ TextRound3: cardinal;
+ TextRound4: cardinal;
+ TextRound5: cardinal;
+ TextRound6: cardinal;
+ TextRound7: cardinal;
+
+ TextWinner1: cardinal;
+ TextWinner2: cardinal;
+ TextWinner3: cardinal;
+ TextWinner4: cardinal;
+ TextWinner5: cardinal;
+ TextWinner6: cardinal;
+ TextWinner7: cardinal;
+
+ TextNextRound: cardinal;
+ TextNextRoundNo: cardinal;
+ TextNextPlayer1: cardinal;
+ TextNextPlayer2: cardinal;
+ TextNextPlayer3: cardinal;
//Statics
- StaticRound1: Cardinal;
- StaticRound2: Cardinal;
- StaticRound3: Cardinal;
- StaticRound4: Cardinal;
- StaticRound5: Cardinal;
- StaticRound6: Cardinal;
- StaticRound7: Cardinal;
+ StaticRound1: cardinal;
+ StaticRound2: cardinal;
+ StaticRound3: cardinal;
+ StaticRound4: cardinal;
+ StaticRound5: cardinal;
+ StaticRound6: cardinal;
+ StaticRound7: cardinal;
//Scores
- TextScoreTeam1: Cardinal;
- TextScoreTeam2: Cardinal;
- TextScoreTeam3: Cardinal;
- TextNameTeam1: Cardinal;
- TextNameTeam2: Cardinal;
- TextNameTeam3: Cardinal;
+ TextScoreTeam1: cardinal;
+ TextScoreTeam2: cardinal;
+ TextScoreTeam3: cardinal;
+ TextNameTeam1: cardinal;
+ TextNameTeam2: cardinal;
+ TextNameTeam3: cardinal;
- TextTeam1Players: Cardinal;
- TextTeam2Players: Cardinal;
- TextTeam3Players: Cardinal;
-
- StaticTeam1: Cardinal;
- StaticTeam2: Cardinal;
- StaticTeam3: Cardinal;
- StaticNextPlayer1: Cardinal;
- StaticNextPlayer2: Cardinal;
- StaticNextPlayer3: Cardinal;
+ TextTeam1Players: cardinal;
+ TextTeam2Players: cardinal;
+ TextTeam3Players: cardinal;
+ StaticTeam1: cardinal;
+ StaticTeam2: cardinal;
+ StaticTeam3: cardinal;
+ StaticNextPlayer1: cardinal;
+ StaticNextPlayer2: cardinal;
+ StaticNextPlayer3: cardinal;
constructor Create; override;
- function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
procedure onShow; override;
procedure SetAnimationProgress(Progress: real); override;
end;
implementation
-uses UGraphic,
- UMain,
- UIni,
- UTexture,
- UParty,
- UDLLManager,
- ULanguage,
- USong,
- ULog;
-
-function TScreenPartyNewRound.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+uses
+ UGraphic,
+ UMain,
+ UIni,
+ UTexture,
+ UParty,
+ UDLLManager,
+ ULanguage,
+ USong,
+ ULog;
+
+function TScreenPartyNewRound.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
begin
Result := true;
- If (PressedDown) Then
+ if (PressedDown) then
begin // Key Down
// check normal keys
case WideCharUpperCase(CharCode)[1] of
@@ -211,19 +217,19 @@ end;
procedure TScreenPartyNewRound.onShow;
var
- I: Integer;
- function GetTeamPlayers(const Num: Byte): String;
+ I: integer;
+ function GetTeamPlayers(const Num: byte): string;
var
- Players: Array of String;
- J: Byte;
+ Players: array of string;
+ J: byte;
begin
if (Num-1 >= PartySession.Teams.NumTeams) then
exit;
- //Create Players Array
+ //Create Players array
SetLength(Players, PartySession.Teams.TeamInfo[Num-1].NumPlayers);
- For J := 0 to PartySession.Teams.TeamInfo[Num-1].NumPlayers-1 do
- Players[J] := String(PartySession.Teams.TeamInfo[Num-1].PlayerInfo[J].Name);
+ for J := 0 to PartySession.Teams.TeamInfo[Num-1].NumPlayers-1 do
+ Players[J] := string(PartySession.Teams.TeamInfo[Num-1].PlayerInfo[J].Name);
//Implode and Return
Result := Language.Implode(Players);
@@ -237,9 +243,9 @@ begin
I := Length(PartySession.Rounds);
if (I >= 1) then
begin
- Static[StaticRound1].Visible := True;
- Text[TextRound1].Visible := True;
- Text[TextWinner1].Visible := True;
+ Static[StaticRound1].Visible := true;
+ Text[TextRound1].Visible := true;
+ Text[TextWinner1].Visible := true;
//Texts:
Text[TextRound1].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[0].Plugin].Name);
@@ -247,16 +253,16 @@ begin
end
else
begin
- Static[StaticRound1].Visible := False;
- Text[TextRound1].Visible := False;
- Text[TextWinner1].Visible := False;
+ Static[StaticRound1].Visible := false;
+ Text[TextRound1].Visible := false;
+ Text[TextWinner1].Visible := false;
end;
if (I >= 2) then
begin
- Static[StaticRound2].Visible := True;
- Text[TextRound2].Visible := True;
- Text[TextWinner2].Visible := True;
+ Static[StaticRound2].Visible := true;
+ Text[TextRound2].Visible := true;
+ Text[TextWinner2].Visible := true;
//Texts:
Text[TextRound2].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[1].Plugin].Name);
@@ -264,16 +270,16 @@ begin
end
else
begin
- Static[StaticRound2].Visible := False;
- Text[TextRound2].Visible := False;
- Text[TextWinner2].Visible := False;
+ Static[StaticRound2].Visible := false;
+ Text[TextRound2].Visible := false;
+ Text[TextWinner2].Visible := false;
end;
if (I >= 3) then
begin
- Static[StaticRound3].Visible := True;
- Text[TextRound3].Visible := True;
- Text[TextWinner3].Visible := True;
+ Static[StaticRound3].Visible := true;
+ Text[TextRound3].Visible := true;
+ Text[TextWinner3].Visible := true;
//Texts:
Text[TextRound3].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[2].Plugin].Name);
@@ -281,16 +287,16 @@ begin
end
else
begin
- Static[StaticRound3].Visible := False;
- Text[TextRound3].Visible := False;
- Text[TextWinner3].Visible := False;
+ Static[StaticRound3].Visible := false;
+ Text[TextRound3].Visible := false;
+ Text[TextWinner3].Visible := false;
end;
if (I >= 4) then
begin
- Static[StaticRound4].Visible := True;
- Text[TextRound4].Visible := True;
- Text[TextWinner4].Visible := True;
+ Static[StaticRound4].Visible := true;
+ Text[TextRound4].Visible := true;
+ Text[TextWinner4].Visible := true;
//Texts:
Text[TextRound4].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[3].Plugin].Name);
@@ -298,16 +304,16 @@ begin
end
else
begin
- Static[StaticRound4].Visible := False;
- Text[TextRound4].Visible := False;
- Text[TextWinner4].Visible := False;
+ Static[StaticRound4].Visible := false;
+ Text[TextRound4].Visible := false;
+ Text[TextWinner4].Visible := false;
end;
if (I >= 5) then
begin
- Static[StaticRound5].Visible := True;
- Text[TextRound5].Visible := True;
- Text[TextWinner5].Visible := True;
+ Static[StaticRound5].Visible := true;
+ Text[TextRound5].Visible := true;
+ Text[TextWinner5].Visible := true;
//Texts:
Text[TextRound5].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[4].Plugin].Name);
@@ -315,16 +321,16 @@ begin
end
else
begin
- Static[StaticRound5].Visible := False;
- Text[TextRound5].Visible := False;
- Text[TextWinner5].Visible := False;
+ Static[StaticRound5].Visible := false;
+ Text[TextRound5].Visible := false;
+ Text[TextWinner5].Visible := false;
end;
if (I >= 6) then
begin
- Static[StaticRound6].Visible := True;
- Text[TextRound6].Visible := True;
- Text[TextWinner6].Visible := True;
+ Static[StaticRound6].Visible := true;
+ Text[TextRound6].Visible := true;
+ Text[TextWinner6].Visible := true;
//Texts:
Text[TextRound6].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[5].Plugin].Name);
@@ -332,16 +338,16 @@ begin
end
else
begin
- Static[StaticRound6].Visible := False;
- Text[TextRound6].Visible := False;
- Text[TextWinner6].Visible := False;
+ Static[StaticRound6].Visible := false;
+ Text[TextRound6].Visible := false;
+ Text[TextWinner6].Visible := false;
end;
if (I >= 7) then
begin
- Static[StaticRound7].Visible := True;
- Text[TextRound7].Visible := True;
- Text[TextWinner7].Visible := True;
+ Static[StaticRound7].Visible := true;
+ Text[TextRound7].Visible := true;
+ Text[TextWinner7].Visible := true;
//Texts:
Text[TextRound7].Text := Language.Translate(DllMan.Plugins[PartySession.Rounds[6].Plugin].Name);
@@ -349,73 +355,73 @@ begin
end
else
begin
- Static[StaticRound7].Visible := False;
- Text[TextRound7].Visible := False;
- Text[TextWinner7].Visible := False;
+ Static[StaticRound7].Visible := false;
+ Text[TextRound7].Visible := false;
+ Text[TextWinner7].Visible := false;
end;
//Display Scores
if (PartySession.Teams.NumTeams >= 1) then
begin
Text[TextScoreTeam1].Text := InttoStr(PartySession.Teams.TeamInfo[0].Score);
- Text[TextNameTeam1].Text := String(PartySession.Teams.TeamInfo[0].Name);
+ Text[TextNameTeam1].Text := string(PartySession.Teams.TeamInfo[0].Name);
Text[TextTeam1Players].Text := GetTeamPlayers(1);
- Text[TextScoreTeam1].Visible := True;
- Text[TextNameTeam1].Visible := True;
- Text[TextTeam1Players].Visible := True;
- Static[StaticTeam1].Visible := True;
- Static[StaticNextPlayer1].Visible := True;
+ Text[TextScoreTeam1].Visible := true;
+ Text[TextNameTeam1].Visible := true;
+ Text[TextTeam1Players].Visible := true;
+ Static[StaticTeam1].Visible := true;
+ Static[StaticNextPlayer1].Visible := true;
end
else
begin
- Text[TextScoreTeam1].Visible := False;
- Text[TextNameTeam1].Visible := False;
- Text[TextTeam1Players].Visible := False;
- Static[StaticTeam1].Visible := False;
- Static[StaticNextPlayer1].Visible := False;
+ Text[TextScoreTeam1].Visible := false;
+ Text[TextNameTeam1].Visible := false;
+ Text[TextTeam1Players].Visible := false;
+ Static[StaticTeam1].Visible := false;
+ Static[StaticNextPlayer1].Visible := false;
end;
if (PartySession.Teams.NumTeams >= 2) then
begin
Text[TextScoreTeam2].Text := InttoStr(PartySession.Teams.TeamInfo[1].Score);
- Text[TextNameTeam2].Text := String(PartySession.Teams.TeamInfo[1].Name);
+ Text[TextNameTeam2].Text := string(PartySession.Teams.TeamInfo[1].Name);
Text[TextTeam2Players].Text := GetTeamPlayers(2);
- Text[TextScoreTeam2].Visible := True;
- Text[TextNameTeam2].Visible := True;
- Text[TextTeam2Players].Visible := True;
- Static[StaticTeam2].Visible := True;
- Static[StaticNextPlayer2].Visible := True;
+ Text[TextScoreTeam2].Visible := true;
+ Text[TextNameTeam2].Visible := true;
+ Text[TextTeam2Players].Visible := true;
+ Static[StaticTeam2].Visible := true;
+ Static[StaticNextPlayer2].Visible := true;
end
else
begin
- Text[TextScoreTeam2].Visible := False;
- Text[TextNameTeam2].Visible := False;
- Text[TextTeam2Players].Visible := False;
- Static[StaticTeam2].Visible := False;
- Static[StaticNextPlayer2].Visible := False;
+ Text[TextScoreTeam2].Visible := false;
+ Text[TextNameTeam2].Visible := false;
+ Text[TextTeam2Players].Visible := false;
+ Static[StaticTeam2].Visible := false;
+ Static[StaticNextPlayer2].Visible := false;
end;
if (PartySession.Teams.NumTeams >= 3) then
begin
Text[TextScoreTeam3].Text := InttoStr(PartySession.Teams.TeamInfo[2].Score);
- Text[TextNameTeam3].Text := String(PartySession.Teams.TeamInfo[2].Name);
+ Text[TextNameTeam3].Text := string(PartySession.Teams.TeamInfo[2].Name);
Text[TextTeam3Players].Text := GetTeamPlayers(3);
- Text[TextScoreTeam3].Visible := True;
- Text[TextNameTeam3].Visible := True;
- Text[TextTeam3Players].Visible := True;
- Static[StaticTeam3].Visible := True;
- Static[StaticNextPlayer3].Visible := True;
+ Text[TextScoreTeam3].Visible := true;
+ Text[TextNameTeam3].Visible := true;
+ Text[TextTeam3Players].Visible := true;
+ Static[StaticTeam3].Visible := true;
+ Static[StaticNextPlayer3].Visible := true;
end
else
begin
- Text[TextScoreTeam3].Visible := False;
- Text[TextNameTeam3].Visible := False;
- Text[TextTeam3Players].Visible := False;
- Static[StaticTeam3].Visible := False;
- Static[StaticNextPlayer3].Visible := False;
+ Text[TextScoreTeam3].Visible := false;
+ Text[TextNameTeam3].Visible := false;
+ Text[TextTeam3Players].Visible := false;
+ Static[StaticTeam3].Visible := false;
+ Static[StaticNextPlayer3].Visible := false;
end;
//nextRound Texts
@@ -424,26 +430,26 @@ begin
if (PartySession.Teams.NumTeams >= 1) then
begin
Text[TextNextPlayer1].Text := PartySession.Teams.Teaminfo[0].Playerinfo[PartySession.Teams.Teaminfo[0].CurPlayer].Name;
- Text[TextNextPlayer1].Visible := True;
+ Text[TextNextPlayer1].Visible := true;
end
else
- Text[TextNextPlayer1].Visible := False;
+ Text[TextNextPlayer1].Visible := false;
if (PartySession.Teams.NumTeams >= 2) then
begin
Text[TextNextPlayer2].Text := PartySession.Teams.Teaminfo[1].Playerinfo[PartySession.Teams.Teaminfo[1].CurPlayer].Name;
- Text[TextNextPlayer2].Visible := True;
+ Text[TextNextPlayer2].Visible := true;
end
else
- Text[TextNextPlayer2].Visible := False;
+ Text[TextNextPlayer2].Visible := false;
if (PartySession.Teams.NumTeams >= 3) then
begin
Text[TextNextPlayer3].Text := PartySession.Teams.Teaminfo[2].Playerinfo[PartySession.Teams.Teaminfo[2].CurPlayer].Name;
- Text[TextNextPlayer3].Visible := True;
+ Text[TextNextPlayer3].Visible := true;
end
else
- Text[TextNextPlayer3].Visible := False;
+ Text[TextNextPlayer3].Visible := false;
end;
procedure TScreenPartyNewRound.SetAnimationProgress(Progress: real);