From 873f177f08dc7c4fe2d7e50bbe7709df98e238d3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 14:58:32 +0000 Subject: rename Screen part2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1306 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 267 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 src/screens/UScreenPartyWin.pas (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas new file mode 100644 index 00000000..002c6f75 --- /dev/null +++ b/src/screens/UScreenPartyWin.pas @@ -0,0 +1,267 @@ +unit UScreenPartyWin; + +interface + +{$I switches.inc} + +uses + UMenu, SDL, UDisplay, UMusic, SysUtils, UThemes; + +type + TScreenPartyWin = class(TMenu) + public + TextScoreTeam1: Cardinal; + TextScoreTeam2: Cardinal; + TextScoreTeam3: Cardinal; + TextNameTeam1: Cardinal; + TextNameTeam2: Cardinal; + TextNameTeam3: Cardinal; + StaticTeam1: Cardinal; + StaticTeam1BG: Cardinal; + StaticTeam1Deco: Cardinal; + StaticTeam2: Cardinal; + StaticTeam2BG: Cardinal; + StaticTeam2Deco: Cardinal; + StaticTeam3: Cardinal; + StaticTeam3BG: Cardinal; + StaticTeam3Deco: Cardinal; + TextWinner: Cardinal; + + constructor Create; override; + function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; + procedure onShow; override; + procedure SetAnimationProgress(Progress: real); override; + end; + +implementation + +uses UGraphic, UMain, UParty, UScreenSingModi, ULanguage; + +function TScreenPartyWin.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + // check normal keys + case WideCharUpperCase(CharCode)[1] of + 'Q': + begin + Result := false; + Exit; + end; + end; + + // check special keys + case PressedKey of + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + AudioPlayback.PlaySound(SoundLib.Start); + FadeTo(@ScreenMain); + end; + + SDLK_RETURN: + begin + AudioPlayback.PlaySound(SoundLib.Start); + FadeTo(@ScreenMain); + end; + end; + end; +end; + +constructor TScreenPartyWin.Create; +//var +// I: integer; // Auto Removed, Unused Variable +begin + inherited Create; + + TextScoreTeam1 := AddText (Theme.PartyWin.TextScoreTeam1); + TextScoreTeam2 := AddText (Theme.PartyWin.TextScoreTeam2); + TextScoreTeam3 := AddText (Theme.PartyWin.TextScoreTeam3); + TextNameTeam1 := AddText (Theme.PartyWin.TextNameTeam1); + TextNameTeam2 := AddText (Theme.PartyWin.TextNameTeam2); + TextNameTeam3 := AddText (Theme.PartyWin.TextNameTeam3); + + StaticTeam1 := AddStatic (Theme.PartyWin.StaticTeam1); + StaticTeam1BG := AddStatic (Theme.PartyWin.StaticTeam1BG); + StaticTeam1Deco := AddStatic (Theme.PartyWin.StaticTeam1Deco); + StaticTeam2 := AddStatic (Theme.PartyWin.StaticTeam2); + StaticTeam2BG := AddStatic (Theme.PartyWin.StaticTeam2BG); + StaticTeam2Deco := AddStatic (Theme.PartyWin.StaticTeam2Deco); + StaticTeam3 := AddStatic (Theme.PartyWin.StaticTeam3); + StaticTeam3BG := AddStatic (Theme.PartyWin.StaticTeam3BG); + StaticTeam3Deco := AddStatic (Theme.PartyWin.StaticTeam3Deco); + + TextWinner := AddText (Theme.PartyWin.TextWinner); + + LoadFromTheme(Theme.PartyWin); +end; + +procedure TScreenPartyWin.onShow; +//var +// I: Integer; // Auto Removed, Unused Variable +// Placing: Integer; // Auto Removed, Unused Variable + + Function GetTeamColor(Team: Byte): Cardinal; + var + NameString: String; + begin + NameString := 'P' + InttoStr(Team+1) + 'Dark'; + + Result := ColorExists(NameString); + end; + +begin + inherited; + + // to-do : Party + //Get Team Placing + //Placing := PartySession.GetTeamOrder; + + //Set Winnertext + //Text[TextWinner].Text := Format(Language.Translate('PARTY_SCORE_WINS'), [PartySession.Teams.Teaminfo[Placing[0]].Name]); + {if (PartySession.Teams.NumTeams >= 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].Visible := True; + Text[TextNameTeam1].Visible := True; + Static[StaticTeam1].Visible := True; + Static[StaticTeam1BG].Visible := True; + Static[StaticTeam1Deco].Visible := True; + + //Set Static Color to Team Color + If (Theme.PartyWin.StaticTeam1BG.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[0]); + if (I <> -1) then + begin + Static[StaticTeam1BG].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam1BG].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam1BG].Texture.ColB := Color[I].RGB.B; + end; + end; + + If (Theme.PartyWin.StaticTeam1.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[0]); + if (I <> -1) then + begin + Static[StaticTeam1].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam1].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam1].Texture.ColB := Color[I].RGB.B; + end; + end; + end + else + begin + Text[TextScoreTeam1].Visible := False; + Text[TextNameTeam1].Visible := False; + Static[StaticTeam1].Visible := False; + Static[StaticTeam1BG].Visible := False; + Static[StaticTeam1Deco].Visible := False; + end; + + if (PartySession.Teams.NumTeams >= 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].Visible := True; + Text[TextNameTeam2].Visible := True; + Static[StaticTeam2].Visible := True; + Static[StaticTeam2BG].Visible := True; + Static[StaticTeam2Deco].Visible := True; + + //Set Static Color to Team Color + If (Theme.PartyWin.StaticTeam2BG.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[1]); + if (I <> -1) then + begin + Static[StaticTeam2BG].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam2BG].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam2BG].Texture.ColB := Color[I].RGB.B; + end; + end; + + If (Theme.PartyWin.StaticTeam2.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[1]); + if (I <> -1) then + begin + Static[StaticTeam2].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam2].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam2].Texture.ColB := Color[I].RGB.B; + end; + end; + end + else + begin + Text[TextScoreTeam2].Visible := False; + Text[TextNameTeam2].Visible := False; + Static[StaticTeam2].Visible := False; + Static[StaticTeam2BG].Visible := False; + Static[StaticTeam2Deco].Visible := False; + end; + + if (PartySession.Teams.NumTeams >= 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].Visible := True; + Text[TextNameTeam3].Visible := True; + Static[StaticTeam3].Visible := True; + Static[StaticTeam3BG].Visible := True; + Static[StaticTeam3Deco].Visible := True; + + //Set Static Color to Team Color + If (Theme.PartyWin.StaticTeam3BG.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[2]); + if (I <> -1) then + begin + Static[StaticTeam3BG].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam3BG].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam3BG].Texture.ColB := Color[I].RGB.B; + end; + end; + + If (Theme.PartyWin.StaticTeam3.Color = 'TeamColor') then + begin + I := GetTeamColor(Placing[2]); + if (I <> -1) then + begin + Static[StaticTeam3].Texture.ColR := Color[I].RGB.R; + Static[StaticTeam3].Texture.ColG := Color[I].RGB.G; + Static[StaticTeam3].Texture.ColB := Color[I].RGB.B; + end; + end; + end + else + begin + Text[TextScoreTeam3].Visible := False; + Text[TextNameTeam3].Visible := False; + Static[StaticTeam3].Visible := False; + Static[StaticTeam3BG].Visible := False; + Static[StaticTeam3Deco].Visible := False; + end; } + + +// LCD.WriteText(1, ' Choose mode: '); +// UpdateLCD; +end; + +procedure TScreenPartyWin.SetAnimationProgress(Progress: real); +begin + {if (ScreenSingModi.PlayerInfo.NumPlayers >= 1) then + Static[StaticTeam1].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[0].Score / maxScore; + if (ScreenSingModi.PlayerInfo.NumPlayers >= 2) then + Static[StaticTeam2].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[1].Score / maxScore; + if (ScreenSingModi.PlayerInfo.NumPlayers >= 3) then + Static[StaticTeam3].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[2].Score / maxScore;} +end; + +end. -- cgit v1.2.3 From 1ef212ba89e50965b6b3b2d756be2c17e110b3ee Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 6 Sep 2008 09:53:53 +0000 Subject: Delphi-mode set for FPC git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1348 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 002c6f75..3c7f4ea4 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -2,6 +2,10 @@ unit UScreenPartyWin; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} uses -- cgit v1.2.3 From f16756422a5dbb24ce1b751bb9e2bb1de4f19713 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 23 Sep 2008 21:17:50 +0000 Subject: added file headers git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1404 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 3c7f4ea4..fb8341c9 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -1,3 +1,28 @@ +{* UltraStar Deluxe - Karaoke Game + * + * UltraStar Deluxe is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + *} + unit UScreenPartyWin; interface -- cgit v1.2.3 From 90226eb8cd49293af7c893e379a071ba7f9583f5 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 5 Oct 2008 16:15:09 +0000 Subject: removed some commented relicts from outdated LCD and Light support. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1434 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index fb8341c9..6b4a55c0 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -277,10 +277,6 @@ begin Static[StaticTeam3BG].Visible := False; Static[StaticTeam3Deco].Visible := False; end; } - - -// LCD.WriteText(1, ' Choose mode: '); -// UpdateLCD; end; procedure TScreenPartyWin.SetAnimationProgress(Progress: real); -- cgit v1.2.3 From 31b5e9286f721b7cc81f620a28d8de5d0087c63c Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 21 Mar 2009 19:11:54 +0000 Subject: New plugin mode reverted (will be moved to a branch afterwards). Party mode might work again (untested). This might break linux compatibility. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1641 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 6b4a55c0..64a50737 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -127,9 +127,9 @@ begin end; procedure TScreenPartyWin.onShow; -//var -// I: Integer; // Auto Removed, Unused Variable -// Placing: Integer; // Auto Removed, Unused Variable +var + I: Integer; + Placing: TeamOrderArray; Function GetTeamColor(Team: Byte): Cardinal; var @@ -143,13 +143,12 @@ procedure TScreenPartyWin.onShow; begin inherited; - // to-do : Party //Get Team Placing - //Placing := PartySession.GetTeamOrder; + Placing := PartySession.GetTeamOrder; //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'), [PartySession.Teams.Teaminfo[Placing[0]].Name]); + if (PartySession.Teams.NumTeams >= 1) then begin Text[TextScoreTeam1].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[0]].Score); Text[TextNameTeam1].Text := String(PartySession.Teams.TeamInfo[Placing[0]].Name); @@ -276,7 +275,7 @@ begin Static[StaticTeam3].Visible := False; Static[StaticTeam3BG].Visible := False; Static[StaticTeam3Deco].Visible := False; - end; } + end; end; procedure TScreenPartyWin.SetAnimationProgress(Progress: real); -- cgit v1.2.3 From c7f5d683c1eae49e30ee42a76557661f57311b9e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 25 Apr 2009 10:09:59 +0000 Subject: Cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1694 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 135 +++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 63 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 64a50737..3c105c7d 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -34,42 +34,51 @@ interface {$I switches.inc} uses - UMenu, SDL, UDisplay, UMusic, SysUtils, UThemes; + UMenu, + SDL, UDisplay, + UMusic, + SysUtils, + UThemes; type TScreenPartyWin = class(TMenu) public - TextScoreTeam1: Cardinal; - TextScoreTeam2: Cardinal; - TextScoreTeam3: Cardinal; - TextNameTeam1: Cardinal; - TextNameTeam2: Cardinal; - TextNameTeam3: Cardinal; - StaticTeam1: Cardinal; - StaticTeam1BG: Cardinal; - StaticTeam1Deco: Cardinal; - StaticTeam2: Cardinal; - StaticTeam2BG: Cardinal; - StaticTeam2Deco: Cardinal; - StaticTeam3: Cardinal; - StaticTeam3BG: Cardinal; - StaticTeam3Deco: Cardinal; - TextWinner: Cardinal; + TextScoreTeam1: cardinal; + TextScoreTeam2: cardinal; + TextScoreTeam3: cardinal; + TextNameTeam1: cardinal; + TextNameTeam2: cardinal; + TextNameTeam3: cardinal; + StaticTeam1: cardinal; + StaticTeam1BG: cardinal; + StaticTeam1Deco: cardinal; + StaticTeam2: cardinal; + StaticTeam2BG: cardinal; + StaticTeam2Deco: cardinal; + StaticTeam3: cardinal; + StaticTeam3BG: cardinal; + StaticTeam3Deco: cardinal; + TextWinner: 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, UParty, UScreenSingModi, ULanguage; +uses + UGraphic, + UMain, + UParty, + UScreenSingModi, + ULanguage; -function TScreenPartyWin.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +function TScreenPartyWin.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 @@ -128,12 +137,12 @@ end; procedure TScreenPartyWin.onShow; var - I: Integer; + I: integer; Placing: TeamOrderArray; - Function GetTeamColor(Team: Byte): Cardinal; + Function GetTeamColor(Team: byte): cardinal; var - NameString: String; + NameString: string; begin NameString := 'P' + InttoStr(Team+1) + 'Dark'; @@ -151,16 +160,16 @@ begin if (PartySession.Teams.NumTeams >= 1) then begin Text[TextScoreTeam1].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[0]].Score); - Text[TextNameTeam1].Text := String(PartySession.Teams.TeamInfo[Placing[0]].Name); + Text[TextNameTeam1].Text := string(PartySession.Teams.TeamInfo[Placing[0]].Name); - Text[TextScoreTeam1].Visible := True; - Text[TextNameTeam1].Visible := True; - Static[StaticTeam1].Visible := True; - Static[StaticTeam1BG].Visible := True; - Static[StaticTeam1Deco].Visible := True; + Text[TextScoreTeam1].Visible := true; + Text[TextNameTeam1].Visible := true; + Static[StaticTeam1].Visible := true; + Static[StaticTeam1BG].Visible := true; + Static[StaticTeam1Deco].Visible := true; //Set Static Color to Team Color - If (Theme.PartyWin.StaticTeam1BG.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam1BG.Color = 'TeamColor') then begin I := GetTeamColor(Placing[0]); if (I <> -1) then @@ -171,7 +180,7 @@ begin end; end; - If (Theme.PartyWin.StaticTeam1.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam1.Color = 'TeamColor') then begin I := GetTeamColor(Placing[0]); if (I <> -1) then @@ -184,26 +193,26 @@ begin end else begin - Text[TextScoreTeam1].Visible := False; - Text[TextNameTeam1].Visible := False; - Static[StaticTeam1].Visible := False; - Static[StaticTeam1BG].Visible := False; - Static[StaticTeam1Deco].Visible := False; + Text[TextScoreTeam1].Visible := false; + Text[TextNameTeam1].Visible := false; + Static[StaticTeam1].Visible := false; + Static[StaticTeam1BG].Visible := false; + Static[StaticTeam1Deco].Visible := false; end; if (PartySession.Teams.NumTeams >= 2) then begin Text[TextScoreTeam2].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[1]].Score); - Text[TextNameTeam2].Text := String(PartySession.Teams.TeamInfo[Placing[1]].Name); + Text[TextNameTeam2].Text := string(PartySession.Teams.TeamInfo[Placing[1]].Name); - Text[TextScoreTeam2].Visible := True; - Text[TextNameTeam2].Visible := True; - Static[StaticTeam2].Visible := True; - Static[StaticTeam2BG].Visible := True; - Static[StaticTeam2Deco].Visible := True; + Text[TextScoreTeam2].Visible := true; + Text[TextNameTeam2].Visible := true; + Static[StaticTeam2].Visible := true; + Static[StaticTeam2BG].Visible := true; + Static[StaticTeam2Deco].Visible := true; //Set Static Color to Team Color - If (Theme.PartyWin.StaticTeam2BG.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam2BG.Color = 'TeamColor') then begin I := GetTeamColor(Placing[1]); if (I <> -1) then @@ -214,7 +223,7 @@ begin end; end; - If (Theme.PartyWin.StaticTeam2.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam2.Color = 'TeamColor') then begin I := GetTeamColor(Placing[1]); if (I <> -1) then @@ -227,26 +236,26 @@ begin end else begin - Text[TextScoreTeam2].Visible := False; - Text[TextNameTeam2].Visible := False; - Static[StaticTeam2].Visible := False; - Static[StaticTeam2BG].Visible := False; - Static[StaticTeam2Deco].Visible := False; + Text[TextScoreTeam2].Visible := false; + Text[TextNameTeam2].Visible := false; + Static[StaticTeam2].Visible := false; + Static[StaticTeam2BG].Visible := false; + Static[StaticTeam2Deco].Visible := false; end; if (PartySession.Teams.NumTeams >= 3) then begin Text[TextScoreTeam3].Text := InttoStr(PartySession.Teams.TeamInfo[Placing[2]].Score); - Text[TextNameTeam3].Text := String(PartySession.Teams.TeamInfo[Placing[2]].Name); + Text[TextNameTeam3].Text := string(PartySession.Teams.TeamInfo[Placing[2]].Name); - Text[TextScoreTeam3].Visible := True; - Text[TextNameTeam3].Visible := True; - Static[StaticTeam3].Visible := True; - Static[StaticTeam3BG].Visible := True; - Static[StaticTeam3Deco].Visible := True; + Text[TextScoreTeam3].Visible := true; + Text[TextNameTeam3].Visible := true; + Static[StaticTeam3].Visible := true; + Static[StaticTeam3BG].Visible := true; + Static[StaticTeam3Deco].Visible := true; //Set Static Color to Team Color - If (Theme.PartyWin.StaticTeam3BG.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam3BG.Color = 'TeamColor') then begin I := GetTeamColor(Placing[2]); if (I <> -1) then @@ -257,7 +266,7 @@ begin end; end; - If (Theme.PartyWin.StaticTeam3.Color = 'TeamColor') then + if (Theme.PartyWin.StaticTeam3.Color = 'TeamColor') then begin I := GetTeamColor(Placing[2]); if (I <> -1) then @@ -270,11 +279,11 @@ begin end else begin - Text[TextScoreTeam3].Visible := False; - Text[TextNameTeam3].Visible := False; - Static[StaticTeam3].Visible := False; - Static[StaticTeam3BG].Visible := False; - Static[StaticTeam3Deco].Visible := False; + Text[TextScoreTeam3].Visible := false; + Text[TextNameTeam3].Visible := false; + Static[StaticTeam3].Visible := false; + Static[StaticTeam3BG].Visible := false; + Static[StaticTeam3Deco].Visible := false; end; end; -- cgit v1.2.3 From 917901e8e33438c425aef50a0a7417f32d77b760 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Mon, 9 Nov 2009 00:27:55 +0000 Subject: merged unicode branch (r1931) into trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1939 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 3c105c7d..afa5ce83 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -34,10 +34,11 @@ interface {$I switches.inc} uses + SDL, + SysUtils, UMenu, - SDL, UDisplay, + UDisplay, UMusic, - SysUtils, UThemes; type @@ -61,28 +62,29 @@ type TextWinner: cardinal; constructor Create; override; - function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override; - procedure onShow; override; + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; + procedure OnShow; override; procedure SetAnimationProgress(Progress: real); override; end; implementation -uses +uses UGraphic, UMain, UParty, UScreenSingModi, - ULanguage; + ULanguage, + UUnicodeUtils; -function TScreenPartyWin.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; +function TScreenPartyWin.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; begin Result := true; if (PressedDown) then begin // Key Down // check normal keys - case WideCharUpperCase(CharCode)[1] of - 'Q': + case UCS4UpperCase(CharCode) of + Ord('Q'): begin Result := false; Exit; @@ -135,7 +137,7 @@ begin LoadFromTheme(Theme.PartyWin); end; -procedure TScreenPartyWin.onShow; +procedure TScreenPartyWin.OnShow; var I: integer; Placing: TeamOrderArray; -- cgit v1.2.3 From 4711217f127aa0c10fa52755fd567c570277a1a1 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Tue, 12 Jan 2010 17:42:41 +0000 Subject: merged lua into trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2071 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 52 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 28 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index afa5ce83..18a6e69e 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -94,13 +94,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); @@ -139,10 +134,10 @@ end; procedure TScreenPartyWin.OnShow; var - I: integer; - Placing: TeamOrderArray; + I, J: integer; + Ranking: AParty_TeamRanking; - Function GetTeamColor(Team: byte): cardinal; + Function GetTeamColor(Team: integer): cardinal; var NameString: string; begin @@ -154,15 +149,16 @@ var begin inherited; - //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; @@ -173,7 +169,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; @@ -184,7 +180,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; @@ -202,10 +198,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; @@ -216,7 +212,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; @@ -227,7 +223,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; @@ -245,10 +241,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; @@ -259,7 +255,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; @@ -270,7 +266,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; -- cgit v1.2.3 From d94d936982cc25905ffa5e961955f502077696f6 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 12 Jan 2010 19:57:53 +0000 Subject: forgotten updates from last commit git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2081 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 1 - 1 file changed, 1 deletion(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 18a6e69e..3d7092bc 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -73,7 +73,6 @@ uses UGraphic, UMain, UParty, - UScreenSingModi, ULanguage, UUnicodeUtils; -- cgit v1.2.3 From 54f567282784181b99a3012fd9db03dae60f361e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 22 Feb 2010 18:27:15 +0000 Subject: screens code cleanup git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2146 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index 3d7092bc..d9fd26d4 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -104,8 +104,6 @@ begin end; constructor TScreenPartyWin.Create; -//var -// I: integer; // Auto Removed, Unused Variable begin inherited Create; @@ -133,7 +131,7 @@ end; procedure TScreenPartyWin.OnShow; var - I, J: integer; + I: integer; Ranking: AParty_TeamRanking; Function GetTeamColor(Team: integer): cardinal; -- cgit v1.2.3 From f761eb20ce8d3b5ef718be4a305b78712641248d Mon Sep 17 00:00:00 2001 From: tobigun Date: Sun, 18 Apr 2010 13:43:36 +0000 Subject: change variable names "static" to "statics" - "static" is a reserved name and should not be used - code-completion in lazarus does not work as it is not able to cope with variables that are named "static" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2246 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenPartyWin.pas | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'src/screens/UScreenPartyWin.pas') diff --git a/src/screens/UScreenPartyWin.pas b/src/screens/UScreenPartyWin.pas index d9fd26d4..ed8d017c 100644 --- a/src/screens/UScreenPartyWin.pas +++ b/src/screens/UScreenPartyWin.pas @@ -159,9 +159,9 @@ begin Text[TextScoreTeam1].Visible := true; Text[TextNameTeam1].Visible := true; - Static[StaticTeam1].Visible := true; - Static[StaticTeam1BG].Visible := true; - Static[StaticTeam1Deco].Visible := true; + Statics[StaticTeam1].Visible := true; + Statics[StaticTeam1BG].Visible := true; + Statics[StaticTeam1Deco].Visible := true; //Set Static Color to Team Color if (Theme.PartyWin.StaticTeam1BG.Color = 'TeamColor') then @@ -169,9 +169,9 @@ begin I := GetTeamColor(Ranking[0].Team); if (I <> -1) then begin - Static[StaticTeam1BG].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam1BG].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam1BG].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam1BG].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam1BG].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam1BG].Texture.ColB := Color[I].RGB.B; end; end; @@ -180,9 +180,9 @@ begin I := GetTeamColor(Ranking[0].Team); if (I <> -1) then begin - Static[StaticTeam1].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam1].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam1].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam1].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam1].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam1].Texture.ColB := Color[I].RGB.B; end; end; end @@ -190,9 +190,9 @@ begin begin Text[TextScoreTeam1].Visible := false; Text[TextNameTeam1].Visible := false; - Static[StaticTeam1].Visible := false; - Static[StaticTeam1BG].Visible := false; - Static[StaticTeam1Deco].Visible := false; + Statics[StaticTeam1].Visible := false; + Statics[StaticTeam1BG].Visible := false; + Statics[StaticTeam1Deco].Visible := false; end; if (Length(Party.Teams) >= 2) then @@ -202,9 +202,9 @@ begin Text[TextScoreTeam2].Visible := true; Text[TextNameTeam2].Visible := true; - Static[StaticTeam2].Visible := true; - Static[StaticTeam2BG].Visible := true; - Static[StaticTeam2Deco].Visible := true; + Statics[StaticTeam2].Visible := true; + Statics[StaticTeam2BG].Visible := true; + Statics[StaticTeam2Deco].Visible := true; //Set Static Color to Team Color if (Theme.PartyWin.StaticTeam2BG.Color = 'TeamColor') then @@ -212,9 +212,9 @@ begin I := GetTeamColor(Ranking[1].Team); if (I <> -1) then begin - Static[StaticTeam2BG].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam2BG].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam2BG].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam2BG].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam2BG].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam2BG].Texture.ColB := Color[I].RGB.B; end; end; @@ -223,9 +223,9 @@ begin I := GetTeamColor(Ranking[1].Team); if (I <> -1) then begin - Static[StaticTeam2].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam2].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam2].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam2].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam2].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam2].Texture.ColB := Color[I].RGB.B; end; end; end @@ -233,9 +233,9 @@ begin begin Text[TextScoreTeam2].Visible := false; Text[TextNameTeam2].Visible := false; - Static[StaticTeam2].Visible := false; - Static[StaticTeam2BG].Visible := false; - Static[StaticTeam2Deco].Visible := false; + Statics[StaticTeam2].Visible := false; + Statics[StaticTeam2BG].Visible := false; + Statics[StaticTeam2Deco].Visible := false; end; if (Length(Party.Teams) >= 3) then @@ -245,9 +245,9 @@ begin Text[TextScoreTeam3].Visible := true; Text[TextNameTeam3].Visible := true; - Static[StaticTeam3].Visible := true; - Static[StaticTeam3BG].Visible := true; - Static[StaticTeam3Deco].Visible := true; + Statics[StaticTeam3].Visible := true; + Statics[StaticTeam3BG].Visible := true; + Statics[StaticTeam3Deco].Visible := true; //Set Static Color to Team Color if (Theme.PartyWin.StaticTeam3BG.Color = 'TeamColor') then @@ -255,9 +255,9 @@ begin I := GetTeamColor(Ranking[2].Team); if (I <> -1) then begin - Static[StaticTeam3BG].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam3BG].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam3BG].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam3BG].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam3BG].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam3BG].Texture.ColB := Color[I].RGB.B; end; end; @@ -266,9 +266,9 @@ begin I := GetTeamColor(Ranking[2].Team); if (I <> -1) then begin - Static[StaticTeam3].Texture.ColR := Color[I].RGB.R; - Static[StaticTeam3].Texture.ColG := Color[I].RGB.G; - Static[StaticTeam3].Texture.ColB := Color[I].RGB.B; + Statics[StaticTeam3].Texture.ColR := Color[I].RGB.R; + Statics[StaticTeam3].Texture.ColG := Color[I].RGB.G; + Statics[StaticTeam3].Texture.ColB := Color[I].RGB.B; end; end; end @@ -276,20 +276,20 @@ begin begin Text[TextScoreTeam3].Visible := false; Text[TextNameTeam3].Visible := false; - Static[StaticTeam3].Visible := false; - Static[StaticTeam3BG].Visible := false; - Static[StaticTeam3Deco].Visible := false; + Statics[StaticTeam3].Visible := false; + Statics[StaticTeam3BG].Visible := false; + Statics[StaticTeam3Deco].Visible := false; end; end; procedure TScreenPartyWin.SetAnimationProgress(Progress: real); begin {if (ScreenSingModi.PlayerInfo.NumPlayers >= 1) then - Static[StaticTeam1].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[0].Score / maxScore; + Statics[StaticTeam1].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[0].Score / maxScore; if (ScreenSingModi.PlayerInfo.NumPlayers >= 2) then - Static[StaticTeam2].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[1].Score / maxScore; + Statics[StaticTeam2].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[1].Score / maxScore; if (ScreenSingModi.PlayerInfo.NumPlayers >= 3) then - Static[StaticTeam3].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[2].Score / maxScore;} + Statics[StaticTeam3].Texture.ScaleW := Progress * ScreenSingModi.PlayerInfo.Playerinfo[2].Score / maxScore;} end; end. -- cgit v1.2.3