Skip to content
EvilEngine.Api.Crosshair

ICrosshairs interface

public interface ICrosshairs

Every player’s crosshair in a session, as the server holds it: the layers set over it and the events played on it. The host sends each player their part whenever it changes and plays the events on their screen, so nothing here needs the client.

A Plugin reaches it through its context’s Crosshairs, where its layers are named <id>:<name> for it and go when it unloads. The host’s own crosshair_play, crosshair_hold and crosshair_release commands and just map-shot --crosshair-layer and --crosshair-hold drive it too.

crosshairs.Everyone.Set(new CrosshairLayer("ctf:teams") { Locked = [CrosshairKey.Colour] });
crosshairs.Of(sniper)?.Set(new CrosshairLayer("ctf:scope") { Priority = CrosshairLayer.Weapon, Hidden = true });
Assembly
EvilEngine.Api
Commit
4ff877b1

Members

Everyone property

ICrosshair Everyone { get; }

The crosshair every player shares. A layer set here sits under each player’s own of the same priority, and an event played here plays on every screen.

Of method

ICrosshair? Of(PlayerId player)

One player’s own crosshair, or null when that PlayerId isn’t connected. Their layers and events reach only them, and their layers go when they leave.