UK
games/rob-revisited / src / Revisited / Ui / HudData.php · commit f9a1307
<?phpnamespace App\Revisited\Ui;/** What the dashboard shows besides the game state itself, kept by the scene (reused every frame). */final class HudData{    /** @var list<array{0: string, 1: float}> recent messages: text, seconds since it came */    public array $feed = [];    public ?string $prompt = null;    /** several things within reach: which one the prompt is about (1-based) and how many (Game::thingsAhead()) */    public int $focusIndex = 0;    public int $focusCount = 0;    /** the key shown before the prompt: "Espace", "A", "ACTION" */    public string $actKey = 'E';    /** 0..1: how much of the big centre hint to show (Hints), else the small marker under the crosshair */    public float $hint = 1.0;    /** desktop: the mouse turns the view (captured) */    public bool $captured = false;    /** desktop: say that a click captures the mouse */    public bool $captureHint = false;    public bool $crouchToggle = false;    public bool $hasScanner = false;    /** @var list<array{id: string, label: string, severity: float}> */    public array $conditions = [];    public ?string $feeling = null;    /** @var array{0: float, 1: float, 2: string}|null the objective: x, z, label */    public ?array $target = null;    /** @var array<int, ?string> quick slots 1..4 (item ids) */    public array $slots = [1 => null, 2 => null, 3 => null, 4 => null];    public bool $touch = false;    /** phones: the left hand's button (TORCHE, MAIN G.), null: none shown */    public ?string $leftButton = null;    public bool $runToggle = false;    public float $time = 0.0;    public float $flash = 0.0;    public string $quest = '';    public string $objective = '';    /** the explanation of the gauge or badge under the pointer (VitalMenu::tooltip), null: none */    public ?string $tooltip = null;    /** @var array{0: float, 1: float, 2: string}|null a place a gauge's menu pointed at (a fire, water...): x, z, label */    public ?array $pointer = null;    public float $fps = 0.0;    public float $ms = 0.0;    /** the combat mode's target (Land\Combat::info()): name, hp, intent, wind, dist; null: no fight */    public ?array $combat = null;    /** the precision cursor's place on its bar 0..1 (null: no blow aimed) and the width of its critical zone */    public ?float $aim = null;    public float $sweet = 0.16;    /** @var list<array{0: string, 1: float, 2: array}> the fight's popups: text, age, colour */    public array $popups = [];    /** 1 → 0: a blow just landed (the hit marker round the crosshair) */    public float $hitMark = 0.0;    /** the keys said under the target when a blow is coming: dodge, counter */    public string $dodgeKey = 'Espace';    public string $attackKey = 'F';    /** the key that holds the shield up (V, LT), null: no shield on the left arm */    public ?string $shieldKey = null;}