diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-06-20 18:14:10 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-06-20 18:14:10 +0000 |
commit | 077d1c500e6a90870dfa979303cd5003feffc359 (patch) | |
tree | daf703a7beee5a6aecff3eb31e636010814ff4c5 /Game/Code/Screens | |
parent | 92a343ee6465a52d16a48d4f1d674b2feae4b583 (diff) | |
download | usdx-077d1c500e6a90870dfa979303cd5003feffc359.tar.gz usdx-077d1c500e6a90870dfa979303cd5003feffc359.tar.xz usdx-077d1c500e6a90870dfa979303cd5003feffc359.zip |
Enabled Deco Texurechanging depending on TeamPlaylings in PartyScore Screen
Changed Theme to fit the Changes
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@266 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Screens/UScreenPartyScore.pas | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/Game/Code/Screens/UScreenPartyScore.pas b/Game/Code/Screens/UScreenPartyScore.pas index 324656c0..5c632356 100644 --- a/Game/Code/Screens/UScreenPartyScore.pas +++ b/Game/Code/Screens/UScreenPartyScore.pas @@ -25,6 +25,11 @@ type StaticTeam3Deco: Cardinal;
TextWinner: Cardinal;
+ DecoTex: Array[0..5] of Integer;
+ DecoColor: Array[0..5] of Record
+ R, G, B: Real;
+ end;
+
MaxScore: Word;
constructor Create; override;
@@ -35,7 +40,7 @@ type implementation
-uses UGraphic, UMain, UParty, UScreenSingModi, ULanguage;
+uses UGraphic, UMain, UParty, UScreenSingModi, ULanguage, UTexture, USkins;
function TScreenPartyScore.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
begin
@@ -75,6 +80,9 @@ end; constructor TScreenPartyScore.Create;
var
I: integer;
+ Tex: TTexture;
+ R, G, B: Real;
+ Color: Integer;
begin
inherited Create;
@@ -97,12 +105,50 @@ begin TextWinner := AddText (Theme.PartyScore.TextWinner);
+ //Load Deco Textures
+ if Theme.PartyScore.DecoTextures.ChangeTextures then
+ begin
+ //Get Color
+ LoadColor(R, G, B, Theme.PartyScore.DecoTextures.FirstColor);
+ Color := $10000 * Round(R*255) + $100 * Round(G*255) + Round(B*255);
+ DecoColor[0].R := R;
+ DecoColor[0].G := G;
+ DecoColor[0].B := B;
+
+ //Load Texture
+ Tex := Texture.LoadTexture(pchar(Skin.GetTextureFileName(Theme.PartyScore.DecoTextures.FirstTexture)), 'JPG', PChar(Theme.PartyScore.DecoTextures.FirstTyp), Color);
+ DecoTex[0] := Tex.TexNum;
+
+ //Get Second Color
+ LoadColor(R, G, B, Theme.PartyScore.DecoTextures.SecondColor);
+ Color := $10000 * Round(R*255) + $100 * Round(G*255) + Round(B*255);
+ DecoColor[1].R := R;
+ DecoColor[1].G := G;
+ DecoColor[1].B := B;
+
+ //Load Second Texture
+ Tex := Texture.LoadTexture(pchar(Skin.GetTextureFileName(Theme.PartyScore.DecoTextures.SecondTexture)), 'JPG', PChar(Theme.PartyScore.DecoTextures.SecondTyp), Color);
+ DecoTex[1] := Tex.TexNum;
+
+ //Get Third Color
+ LoadColor(R, G, B, Theme.PartyScore.DecoTextures.ThirdColor);
+ Color := $10000 * Round(R*255) + $100 * Round(G*255) + Round(B*255);
+ DecoColor[2].R := R;
+ DecoColor[2].G := G;
+ DecoColor[2].B := B;
+
+ //Load Third Texture
+ Tex := Texture.LoadTexture(pchar(Skin.GetTextureFileName(Theme.PartyScore.DecoTextures.ThirdTexture)), 'JPG', PChar(Theme.PartyScore.DecoTextures.ThirdTyp), Color);
+ DecoTex[2] := Tex.TexNum;
+ end;
+
LoadFromTheme(Theme.PartyScore);
end;
procedure TScreenPartyScore.onShow;
var
- I: Integer;
+ I, J: Integer;
+ Placings: Array [0..5] of Byte;
begin
//Get Maxscore
MaxScore := 0;
@@ -112,6 +158,16 @@ begin MaxScore := ScreenSingModi.PlayerInfo.Playerinfo[I].Score;
end;
+ //Get Placings
+ for I := 0 to ScreenSingModi.PlayerInfo.NumPlayers - 1 do
+ begin
+ Placings[I] := 0;
+ for J := 0 to ScreenSingModi.PlayerInfo.NumPlayers - 1 do
+ If (ScreenSingModi.PlayerInfo.Playerinfo[J].Score > ScreenSingModi.PlayerInfo.Playerinfo[I].Score) then
+ Inc(Placings[I]);
+ end;
+
+
//Set Static Length
Static[StaticTeam1].Texture.ScaleW := ScreenSingModi.PlayerInfo.Playerinfo[0].Percentage / 100;
Static[StaticTeam2].Texture.ScaleW := ScreenSingModi.PlayerInfo.Playerinfo[1].Percentage / 100;
@@ -133,6 +189,15 @@ begin Text[TextScoreTeam1].Text := InttoStr(ScreenSingModi.PlayerInfo.Playerinfo[0].Score);
Text[TextNameTeam1].Text := String(ScreenSingModi.TeamInfo.Teaminfo[0].Name);
+ //Set Deco Texture
+ if Theme.PartyScore.DecoTextures.ChangeTextures then
+ begin
+ Static[StaticTeam1Deco].Texture.TexNum := DecoTex[Placings[0]];
+ Static[StaticTeam1Deco].Texture.ColR := DecoColor[Placings[0]].R;
+ Static[StaticTeam1Deco].Texture.ColG := DecoColor[Placings[0]].G;
+ Static[StaticTeam1Deco].Texture.ColB := DecoColor[Placings[0]].B;
+ end;
+
Text[TextScoreTeam1].Visible := True;
Text[TextNameTeam1].Visible := True;
Static[StaticTeam1].Visible := True;
@@ -153,6 +218,15 @@ begin Text[TextScoreTeam2].Text := InttoStr(ScreenSingModi.PlayerInfo.Playerinfo[1].Score);
Text[TextNameTeam2].Text := String(ScreenSingModi.TeamInfo.Teaminfo[1].Name);
+ //Set Deco Texture
+ if Theme.PartyScore.DecoTextures.ChangeTextures then
+ begin
+ Static[StaticTeam2Deco].Texture.TexNum := DecoTex[Placings[1]];
+ Static[StaticTeam2Deco].Texture.ColR := DecoColor[Placings[1]].R;
+ Static[StaticTeam2Deco].Texture.ColG := DecoColor[Placings[1]].G;
+ Static[StaticTeam2Deco].Texture.ColB := DecoColor[Placings[1]].B;
+ end;
+
Text[TextScoreTeam2].Visible := True;
Text[TextNameTeam2].Visible := True;
Static[StaticTeam2].Visible := True;
@@ -173,6 +247,15 @@ begin Text[TextScoreTeam3].Text := InttoStr(ScreenSingModi.PlayerInfo.Playerinfo[2].Score);
Text[TextNameTeam3].Text := String(ScreenSingModi.TeamInfo.Teaminfo[2].Name);
+ //Set Deco Texture
+ if Theme.PartyScore.DecoTextures.ChangeTextures then
+ begin
+ Static[StaticTeam3Deco].Texture.TexNum := DecoTex[Placings[2]];
+ Static[StaticTeam3Deco].Texture.ColR := DecoColor[Placings[2]].R;
+ Static[StaticTeam3Deco].Texture.ColG := DecoColor[Placings[2]].G;
+ Static[StaticTeam3Deco].Texture.ColB := DecoColor[Placings[2]].B;
+ end;
+
Text[TextScoreTeam3].Visible := True;
Text[TextNameTeam3].Visible := True;
Static[StaticTeam3].Visible := True;
|