aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens/UScreenPartyWin.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-02-19 17:18:42 +0000
commit51ed8fe6f2ea9892e905e81cf5bad3960537eb40 (patch)
treea4dcb099343762dcb7bd7988f73de68c1959d3a5 /Game/Code/Screens/UScreenPartyWin.pas
downloadusdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.gz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.tar.xz
usdx-51ed8fe6f2ea9892e905e81cf5bad3960537eb40.zip
Challenge MOD r7 alpha based on Ultrastar Deluxe v1.0.1a
for changes read Changelog.txt in folder Game git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2107 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens/UScreenPartyWin.pas')
-rw-r--r--Game/Code/Screens/UScreenPartyWin.pas267
1 files changed, 267 insertions, 0 deletions
diff --git a/Game/Code/Screens/UScreenPartyWin.pas b/Game/Code/Screens/UScreenPartyWin.pas
new file mode 100644
index 00000000..e40a48d8
--- /dev/null
+++ b/Game/Code/Screens/UScreenPartyWin.pas
@@ -0,0 +1,267 @@
+unit UScreenPartyWin;
+
+interface
+
+uses
+ UMenu, SDL, UDisplay, UMusic, SysUtils, UThemes;
+
+type
+ TScreenPartyWin = class(TMenu)
+ const
+ ID='ID_018'; //for help system
+
+ 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; ScanCode: byte; PressedDown: Boolean): Boolean; override;
+ procedure onShow; override;
+ procedure SetAnimationProgress(Progress: real); override;
+ end;
+
+implementation
+
+uses UGraphic, UMain, UParty, UScreenSingModi, ULanguage, UHelp, ULog;
+
+function TScreenPartyWin.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
+begin
+ Result := true;
+ If (PressedDown) Then
+ begin // Key Down
+ case PressedKey of
+ SDLK_TAB:
+ begin
+ ScreenPopupHelp.ShowPopup();
+ end;
+
+ SDLK_Q:
+ begin
+ Result := false;
+ end;
+
+ SDLK_ESCAPE,
+ SDLK_BACKSPACE :
+ begin
+ Music.PlayStart;
+ FadeTo(@ScreenMain);
+ end;
+
+ SDLK_RETURN:
+ begin
+ Music.PlayStart;
+ FadeTo(@ScreenMain);
+ end;
+ end;
+ end;
+end;
+
+constructor TScreenPartyWin.Create;
+var
+ I: integer;
+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;
+ Placing: TeamOrderArray;
+ Function GetTeamColor(Team: Byte): Cardinal;
+ var
+ NameString: String;
+ begin
+ NameString := 'P' + InttoStr(Team+1) + 'Dark';
+
+ Result := ColorExists(NameString);
+ end;
+begin
+ if not Help.SetHelpID(ID) then
+ Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenParyWin)');
+
+ //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.