luvcraft/clim/legend.lisp
--------------------------------------------------------------------- Reading a table.
Return the command a keystroke item stands for, or NIL.
A :function item builds its command from the gesture that reached it -- which
is how one entry serves nine quickbar slots or four walking directions -- so
asking what it means is asking it.
What a legend should call the command name applied to arguments.
Rows are merged by this label, so it decides how coarse the legend is: one line per argument where the argument is the point, one line for the whole family where it is not. Walking forward and sprinting are different lines because they are different things to do; the nine quickbar slots are one line because nobody needs to be told about each of them separately.
Return table's keystrokes as (label . KEYS) rows, one row per label.
Keys are merged rather than listed once each, because a cheatsheet wants to say that the quickbar is 1-9 rather than saying `select block' nine times.
Which tables the legend shows, in the order a player meets them.
Each is read without inheritance, so a command appears under the layer that actually owns it rather than once per table that inherits it.
Return (TITLE . ROWS) for every section that has anything to say.
--------------------------------------------------------------------- The panel.
Where the key column ends; labels begin a gutter to its right.
Wide enough for the longest run of keys one command answers to, which is the whole number row.
Gathered when the frame is made, so the very first paint already has them: a pane realized by ENABLE-FRAME draws before anyone can fill a slot in afterwards.
--------------------------------------------------------------------- The overlay: a panel in the middle of the screen.
Place the panel at its own size in the middle of the viewport.
A legend is a tool rather than a thing in the world: the camera stays put, and the crosshair never targets it.
Stay exactly where the player was standing.
A legend is a tool, not a thing in the world: nothing is framed, nothing is approached, and the view a player looks back at afterwards is the one they were already looking at.
Focusing released mouse look, and closing this panel should not silently take it back: escape has always been how a player gets their cursor, and a legend is what you open when you have lost track of the controls.
--------------------------------------------------------------------- Opening and closing.
Create, attach, and focus session's keymap legend.
Put the legend away.
Show session's keymap legend, or put it away if it is already up.
Escape shows the keys. It keeps its old meaning too: focusing the legend releases mouse look, and the legend refuses to take it back on the way out.
(item gesture)Return the command a keystroke ITEM stands for, or NIL. A :FUNCTION item builds its command from the gesture that reached it -- which is how one entry serves nine quickbar slots or four walking directions -- so asking what it means is asking it.
(name arguments table)What a legend should call the command NAME applied to ARGUMENTS. Rows are merged by this label, so it decides how coarse the legend is: one line per argument where the argument is the point, one line for the whole family where it is not. Walking forward and sprinting are different lines because they are different…
A simple Org table without formulas.
Logical disjunction of tests and raw truth values.
(table)Return TABLE's keystrokes as (LABEL . KEYS) rows, one row per label. Keys are merged rather than listed once each, because a cheatsheet wants to say that the quickbar is 1-9 rather than saying `select block' nine times.
(gesture)Which tables the legend shows, in the order a player meets them. Each is read without inheritance, so a command appears under the layer that actually owns it rather than once per table that inherits it.
Test whether two compatible scalars are equal.
Where the key column ends; labels begin a gutter to its right. Wide enough for the longest run of keys one command answers to, which is the whole number row.
(&optional (sections (luvcraft-legend-sections)))Addition over compatible quantities.
Multiplication and scalar scaling.
(pane row top)Subtraction or unary negation.
Division of two represented quantities.
((pane lobby-hud-pane) region)(frame)An explicitly owned AVFrame.
A direct GPU target for an ordered LUV-GPU-MEDIUM drawing stream. An embedded mirror retains an immutable prepared CPU revision for the game's final pass; a standalone mirror renders into its native canvas drawable.
A direct McCLIM surface mounted in the presentation HUD.
(overlay)Return where OVERLAY draws: :SCENE, :WORLD-PANEL, :VIEWMODEL, :HUD, or :NONE. Scene overlays inhabit world depth; viewmodels are first-person geometry above the world but below held items and the crosshair. World panels retain world projection and depth while drawing analytic application graphics at native…
(overlay)(overlay)(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
The minimum of compatible quantities.
(overlay session pass surface-texture)Encode OVERLAY into SESSION's open scene PASS for SURFACE-TEXTURE.
(focus session)Return a non-negative targeting score when FOCUS can be entered by TAB.
(focus session)Return FOCUS's desired CAMERA-POSE in SESSION, or NIL for an FOV-only cue.
(position)The block-world camera's 70-degree vertical field of view.
(focus session)Notify FOCUS that SESSION has entered its interaction mode.
(focus session canvas event)Handle EVENT while FOCUS owns SESSION's modal player interaction.
A native destination with a lifetime and frame clock.
(overlay session)(session)(session &key (title "luvcraft keys"))A McCLIM frame manager constrained by luv's current native host.
(session overlay)Attach OVERLAY at SESSION's next native frame boundary and return it. ADD consumes a newly offered OVERLAY on both success and terminal rejection. Once SESSION begins stopping, the rejected overlay is released exactly once before APPLICATION-ATTACHMENT-CLOSED is signalled.
(session focus)Enter modal interaction with FOCUS, suspending ordinary player input. This is the common session transition behind using a world terminal or book, mounting a vehicle, and other interactions described by #8JCMA5.
(session)(session overlay &key (release-p t))Detach OVERLAY at a frame boundary and optionally release it there. The no-release path is intentionally preserved for FUSE-LUVCRAFT-OVERLAY: that path may run inside a frame whose command stream still borrows OVERLAY.
(session)(name (&rest lambda-list) documentation &body body)
The keymap legend: what the keys do, read off the tables that decide it.
Nothing here is a written-down list of bindings. The rows are gathered by walking the same command tables dispatch walks, so rebinding a key or adding a command changes what the game says about itself, and a legend can never quietly drift out of date with the thing it describes.
Escape slides it up. Escape again puts it away -- and since taking focus hands the pointer back, escape also does what escape has always done here, which is get the player their cursor.