legacy-Gobi
07-10-2003, 11:36 AM
Strange crosshair problem, if the player dies with zoom enabled the crosshair is hidden until the player picks up the weapon again!
code:
-----------------------------------------------------------------------------------
simulated event RenderOverlays( Canvas Canvas )
{
local PlayerController P;
local float Scale;
P = PlayerController(Instigator.Controller);
LastFOV = PlayerController(Instigator.Controller).DesiredFOV ;
if ( LastFOV > P.DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.Lightnin gZoomIn', SLOT_Misc,,,,,false);
}
else if ( LastFOV < P.DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.Lightnin gZoomOut', SLOT_Misc,,,,,false);
}
if ( P.DesiredFOV == P.DefaultFOV)
{
P.MyHud.bCrosshairShow = True;
Super.RenderOverlays(Canvas);
zoomed = false;
}
else
{
P.MyHud.bCrosshairShow = False;
SetZoomBlendColor(Canvas);
scale = Canvas.ClipX/640 * 1.1;
Canvas.SetPos(0.5 * Canvas.ClipX - 128 * Scale, 0.5 * Canvas.ClipY - 128 * Scale );
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.DrawIcon(Texture'CrapTex.Tex.CrapScope', Scale);
Canvas.SetPos(0.5 * Canvas.ClipX + 64 * Scale, 0.5 * Canvas.ClipY + 96 * Scale);
Canvas.DrawColor.R = 0;
Canvas.DrawColor.G = 155;
Canvas.DrawColor.B = 255;
scale = P.DefaultFOV/P.DesiredFOV;
Canvas.DrawText("X"$int(Scale)$"."$int(10 * scale - 10 * int(Scale)));
zoomed = true;
}
}
-----------------------------------------------------------------------------
code:
-----------------------------------------------------------------------------------
simulated event RenderOverlays( Canvas Canvas )
{
local PlayerController P;
local float Scale;
P = PlayerController(Instigator.Controller);
LastFOV = PlayerController(Instigator.Controller).DesiredFOV ;
if ( LastFOV > P.DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.Lightnin gZoomIn', SLOT_Misc,,,,,false);
}
else if ( LastFOV < P.DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.Lightnin gZoomOut', SLOT_Misc,,,,,false);
}
if ( P.DesiredFOV == P.DefaultFOV)
{
P.MyHud.bCrosshairShow = True;
Super.RenderOverlays(Canvas);
zoomed = false;
}
else
{
P.MyHud.bCrosshairShow = False;
SetZoomBlendColor(Canvas);
scale = Canvas.ClipX/640 * 1.1;
Canvas.SetPos(0.5 * Canvas.ClipX - 128 * Scale, 0.5 * Canvas.ClipY - 128 * Scale );
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.DrawIcon(Texture'CrapTex.Tex.CrapScope', Scale);
Canvas.SetPos(0.5 * Canvas.ClipX + 64 * Scale, 0.5 * Canvas.ClipY + 96 * Scale);
Canvas.DrawColor.R = 0;
Canvas.DrawColor.G = 155;
Canvas.DrawColor.B = 255;
scale = P.DefaultFOV/P.DesiredFOV;
Canvas.DrawText("X"$int(Scale)$"."$int(10 * scale - 10 * int(Scale)));
zoomed = true;
}
}
-----------------------------------------------------------------------------