Hello, i'm scripting for ut2k3 and I have a problem: I can't find the part of the code which tells to the game which color applying for the name of the weapons (when I play with hidden weapons), like "assault rifle" in pink, "rocket launcher" in red, "bio rifle" in blue...
Can someone help me, please?
Name of weapons in color
I do not know this for sure, but it looks like it. In the base weapon class (like AssaultRifle.uc in this example, in defaultproperties:
Hope this helps.
Code: Select all
HudColor=(r=255,g=128,b=192,a=255)
The HUDColor Is used by the base hud to change the weapon name:
So changing the weapon's hudcolor should work...if its not post the code and we can try to see if we can help more.
Code: Select all
simulated function DrawWeaponName(Canvas C)
{
local string CurWeaponName;
local float XL,YL, Fade;
if (bHideWeaponName)
return;
if (WeaponDrawTimer>Level.TimeSeconds)
{
C.Font = GetMediumFontFor(C);
C.DrawColor = WeaponDrawColor;
Fade = WeaponDrawTimer - Level.TimeSeconds;
if (Fade<=1)
C.DrawColor.A = 255 * Fade;
C.Strlen(LastWeaponName,XL,YL);
C.SetPos( (C.ClipX/2) - (XL/2), C.ClipY*0.8-YL);
C.DrawText(LastWeaponName);
}
if ( PawnOwner==None || PawnOwner.PendingWeapon==None )
return;
CurWeaponName = PawnOwner.PendingWeapon.GetHumanReadableName();
if (CurWeaponName!=LastWeaponName)
{
WeaponDrawTimer = Level.TimeSeconds+1.5;
WeaponDrawColor = PawnOwner.PendingWeapon.HudColor;
}
LastWeaponName = CurWeaponName;
}
Jb