Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowDialogControl | +--UWindow.UWindowButton | +--UTMenu.NotifyButton | +--UTMenu.SpeechButton
float
FadeFactor
Texture
SelectedTexture
int
Type
bool
bHighlightButton
void
Paint(Canvas C, float X, float Y)
00001 class SpeechButton expands NotifyButton; 00002 00003 var float FadeFactor; 00004 var bool bHighlightButton; 00005 var texture SelectedTexture; 00006 var int Type; 00007 00008 function Paint(Canvas C, float X, float Y) 00009 { 00010 local float Wx, Hy; 00011 local int W, H; 00012 local color HUDColor; 00013 00014 // Set the color to that of the HUD. 00015 HUDColor.R = 255; 00016 HUDColor.G = 255; 00017 HUDColor.B = 255; 00018 if (GetPlayerOwner().MyHUD.IsA('ChallengeHUD')) 00019 { 00020 if (ChallengeHUD(GetPlayerOwner().MyHUD).Style != 3) 00021 C.Style = 2; 00022 else 00023 C.Style = 3; 00024 if (ChallengeHUD(GetPlayerOwner().MyHUD).bUseTeamColor) 00025 { 00026 if (GetPlayerOwner().MyHUD.IsA('ChallengeTeamHUD')) 00027 { 00028 HUDColor = ChallengeTeamHUD(GetPlayerOwner().MyHUD).TeamColor[GetPlayerOwner().PlayerReplicationInfo.Team]; 00029 } else { 00030 HUDColor = ChallengeHUD(GetPlayerOwner().MyHUD).FavoriteHUDColor; 00031 } 00032 } else { 00033 HUDColor = ChallengeHUD(GetPlayerOwner().MyHUD).FavoriteHUDColor; 00034 } 00035 if (ChallengeHUD(GetPlayerOwner().MyHUD).Opacity != 16) 00036 { 00037 HUDColor.R = HUDColor.R * (ChallengeHUD(GetPlayerOwner().MyHUD).Opacity + 0.9); 00038 HUDColor.G = HUDColor.G * (ChallengeHUD(GetPlayerOwner().MyHUD).Opacity + 0.9); 00039 HUDColor.B = HUDColor.B * (ChallengeHUD(GetPlayerOwner().MyHUD).Opacity + 0.9); 00040 } else { 00041 HUDColor.R *= 15.9; 00042 HUDColor.G *= 15.9; 00043 HUDColor.B *= 15.9; 00044 } 00045 } 00046 C.DrawColor = HUDColor; 00047 if (MouseIsOver() && bHighlightButton) 00048 { 00049 C.DrawColor.R = Clamp(C.DrawColor.R + 100, 0, 255); 00050 C.DrawColor.G = Clamp(C.DrawColor.G + 100, 0, 255); 00051 C.DrawColor.B = Clamp(C.DrawColor.B + 100, 0, 255); 00052 TextColor.R = 255; 00053 TextColor.G = 255; 00054 TextColor.B = 0; 00055 } else { 00056 TextColor.R = 255; 00057 TextColor.G = 255; 00058 TextColor.B = 255; 00059 } 00060 00061 Super.Paint(C, X, Y); 00062 00063 W = WinWidth / 4; 00064 H = W; 00065 00066 if(W > 256 || H > 256) 00067 { 00068 W = 256; 00069 H = 256; 00070 } 00071 00072 if (LabelWidth == 0) 00073 LabelWidth = WinWidth; 00074 00075 if (LabelHeight == 0) 00076 LabelHeight = WinHeight; 00077 00078 C.DrawColor = TextColor; 00079 C.DrawColor.R = C.DrawColor.R * FadeFactor; 00080 C.DrawColor.G = C.DrawColor.G * FadeFactor; 00081 C.DrawColor.B = C.DrawColor.B * FadeFactor; 00082 C.Font = MyFont; 00083 TextSize(C, Text, Wx, Hy); 00084 if (bLeftJustify) 00085 ClipText(C, XOffset, 0, Text); 00086 else 00087 ClipText(C, (LabelWidth - Wx)/2, (LabelHeight - Hy)/2, Text); 00088 } 00089 00090 defaultproperties 00091 { 00092 }