Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Trace hit for hovering over a mover
- function TimerProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
- {
- if ((Other != none) && (Other.IsA('Mover')) && VSize(Other.Location-Owner.Location) < 2000)
- {
- Spawn(class'MoverWallHitEffect',,, HitLocation+HitNormal*9, Rotator(HitNormal));
- Owner.PlaySound(SuccessSound, SLOT_None, Pawn(Owner).SoundDampening*3.0);
- }
- }
- // Creates the overlay in the HUD that shows movers
- // Needs improvement, some movers don't render properly
- simulated function PostRender(canvas Canvas)
- {
- local Mover thisMover;
- local vector X, Y, Z, CamLoc, TargetDir, Dir, XY;
- local rotator CamRot;
- local Actor Camera;
- local float BaseBeaconScale, BeaconScale, Dist, DistScale;
- local float TanFOVx, TanFOVy;
- local float dx, dy, FontY;
- local string BeaconText;
- Canvas.Style = ERenderStyle.STY_Masked;
- if (Canvas.ClipX > 1024)
- Canvas.Font = Font'BeaconNameFontLarge';
- else if (Canvas.ClipX > 640)
- Canvas.Font = Font'BeaconNameFontMedium';
- else
- Canvas.Font = Font'BeaconNameFontSmall';
- Canvas.TextSize("X", dx, FontY);
- Canvas.SetPos(0,0.5 * Canvas.ClipY);
- Canvas.DrawText(" SCANNER INFORMATION", False);
- Canvas.SetPos(0,0.5 * Canvas.ClipY + 16);
- Canvas.DrawText(" Monsters Left: "$ Charge, False);
- Canvas.SetPos(0, 0);
- BaseBeaconScale = 1.5 * FontY / Texture'TeamBeacon2'.VSize;
- Canvas.ViewPort.Actor.PlayerCalcView(Camera, CamLoc, CamRot);
- TanFOVx = Tan(Canvas.ViewPort.Actor.FOVAngle / 114.591559);
- TanFOVy = (Canvas.ClipY / Canvas.ClipX) * TanFOVx;
- GetAxes(CamRot, X, Y, Z);
- Canvas.bNoSmooth = False;
- Canvas.Style = ERenderStyle.STY_Masked;
- //foreach RadiusActors(class 'Mover', thisMover, 7000)
- foreach Owner.RadiusActors(class 'Mover', thisMover, 7000,CamLoc)
- {
- if (thisMover != none && thisMover != Camera)
- {
- TargetDir = thisMover.Location - CamLoc;
- Dist = VSize(TargetDir) * FMin(TanFOVx, 1.0);
- TargetDir = Normal(TargetDir + vect(0,0,1)); // * thisMover.CollisionHeight);
- DistScale = FMin(100.0 * thisMover.CollisionRadius / Dist, 1.0);
- d = Dist;
- if ((DistScale > 0.0 && TargetDir dot X > 0) && (FastTrace(thisMover.Location, CamLoc)
- || FastTrace(thisMover.Location + vect(0,0,0.8) * thisMover.CollisionHeight, CamLoc)))
- {
- BeaconScale = BaseBeaconScale * DistScale;
- Dir = X * (X dot TargetDir);
- XY = TargetDir - Dir;
- dx = Canvas.ClipX * 0.5 * (1.0 + (XY dot Y) / (VSize(Dir) * TanFOVx));
- dy = Canvas.ClipY * 0.5 * (1.0 - (XY dot Z) / (VSize(Dir) * TanFOVy));
- //Canvas.SetPos(dx - 0.5 * BeaconScale * TeamBeaconIcon.USize, dy - 2 * FontY * DistScale);
- Canvas.SetPos(dx - 0.5 * BeaconScale, dy - 2 * FontY * DistScale);
- if (DistScale <= 1.0)
- {
- if (Canvas.ClipX > 600)
- BeaconText = "Mover: " $ d $ "";
- Canvas.DrawIcon(texture'CrossHair6', 1.0);
- Canvas.SetPos(dx + 0.6 * BeaconScale * TeamBeaconIcon.USize + 1, dy - 1.75 * FontY + 1);
- Canvas.DrawTextClipped(BeaconText, False);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement