mcclim/hotbar.lisp
Give block a restrained top-lit gradient from top to bottom.
A quiet neutral edge for the currently selected material.
The wall modes the hotbar offers, in slot order.
A presentation layer which teaches change-terminal-display-mode a new mode
appends it here and gets a numbered slot; nothing else has to change.
Geometry
One function decides where a slot is, so painting and hit-testing cannot disagree about which one the player clicked.
How wide a named mode slot is, rather than a share of the whole bar.
Nine identical wells want to divide the instrument between them. Two or three named modes do not: a slot stretched to half the bar puts its word alone in a field of empty metal, which reads as a mistake rather than as a button.
Left, top, right, and bottom of slot index of count.
Without width the slots divide the bar between them. With it they are exactly
that wide and the row is centred in the bar instead.
The slot index at horizontal texture fraction U, or NIL between slots.
The instrument the slots sit in: one raised chassis, quietly lit.
Cover the whole sheet first. The chassis is drawn at the bar's declared size, and a sheet that is larger than that -- a frame outliving a resize -- would otherwise show through as bare white.
A single bright hairline along the top edge is what reads as "made of something" without drawing a border around every slot.
One recessed well, lit from inside when it is the chosen one.
The well's own top edge, darker than the chassis, is the whole recess.
The one label the bar carries: what is currently chosen.
One mark per mode. A chooser of three words all the same size makes the player read; a chooser of three shapes lets them recognize.
Kept to marks the game's own font actually carries. A missing glyph draws as nothing at all, which is worse than a plain one: the slot that has a mark and the slot that has none stop looking like the same kind of thing.
Paint the focused terminal's semantic modes into pane.
A mode slot is wide and short, so the mark and the word sit beside each other on one line rather than stacked into each other's space.
The badge is whatever key actually reaches this mode. A wall in shell mode hands every plain key to the PTY, so a bare number here would be an instruction to type one.
The cube is the material: the same procedural faces the world is built from, not a swatch of its average colour.
The tenth slot's key is 0, at the end of the number row.
Nine labels is nine things to read; the chosen one is the only name that answers a question the player is actually asking.
Repaint and publish one complete material palette.
hotbar-slot-at reads the same geometry the painter does, so a click
in the gap between two slots chooses neither rather than guessing.
Create and attach the screen-space McCLIM block palette for session.
(block)(components scale)The minimum of compatible quantities.
Multiplication and scalar scaling.
(block top bottom)(x1 y1 x2 y2 start-color end-color)(top bottom)An explicitly owned AVFrame.
Logical conjunction of tests and raw truth values.
The wall modes the hotbar offers, in slot order. A presentation layer which teaches CHANGE-TERMINAL-DISPLAY-MODE a new mode appends it here and gets a numbered slot; nothing else has to change.
(display session mode)Select DISPLAY's focused wall MODE. The built-in modes are the EQL-specialized symbols :SHELL and :FILM. LUVCRAFT/MCCLIM adds an :AFTER method which supplies the film browser, while the display continues to own focus and movie lifetime.
Logical disjunction of tests and raw truth values.
How wide a named mode slot is, rather than a share of the whole bar. Nine identical wells want to divide the instrument between them. Two or three named modes do not: a slot stretched to half the bar puts its word alone in a field of empty metal, which reads as a mistake rather than as a button.
(count index &key width)Left, top, right, and bottom of slot INDEX of COUNT. Without WIDTH the slots divide the bar between them. With it they are exactly that wide and the row is centred in the bar instead.
Subtraction or unary negation.
Division of two represented quantities.
Convert one scalar float or unsigned value to a 32-bit float.
Addition over compatible quantities.
(count u &key width)Test whether one compatible scalar is at most another.
Test whether one compatible scalar is less than another.
(pane medium)(sheet x1 y1 x2 y2 &rest options
&key (radius 7) (filled t) &allow-other-keys)(pane medium left top right bottom
&key selected-p (accent '(0.95 0.86 0.55)))(pane medium text &key (ink '(0.93 0.93 0.90)))One mark per mode. A chooser of three words all the same size makes the player read; a chooser of three shapes lets them recognize. Kept to marks the game's own font actually carries. A missing glyph draws as nothing at all, which is worse than a plain one: the slot that has a mark and the slot that has none stop…
(pane display)Test whether two compatible scalars are equal.
(thing)Return a short string naming the keystroke that reaches THING, or NIL. A control which draws its own key hint would be inventing one: the keys are decided in the command layer above, so the drawing asks rather than guesses, and a rebound key changes the label on the button.
((pane lobby-hud-pane) region)(inventory)The maximum of compatible quantities.
(stream block x y &optional (size 32))The non-negative remainder of integer division.
(frame)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)(name-and-options &rest method-tail)Define a method whose complete dynamic extent is an ambient trace zone. The inferred name includes the generic function, non-T required specializers, and qualifiers. :ZONE and :VALUE have the same meaning as in ZDEFUN.
(overlay session pass surface-texture)Encode OVERLAY into SESSION's open scene PASS for SURFACE-TEXTURE.
(overlay session)Publish any complete pending render state for OVERLAY at a frame boundary.
(overlay session canvas event)Handle EVENT projected onto OVERLAY, returning true when consumed.
A native destination with a lifetime and frame clock.
(overlay x y)(session number)(focus session canvas event)Offer EVENT to controls which belong to focused FOCUS, returning true when consumed. This is narrower than the ordinary overlay event path: a focused world object may expose a HUD control without allowing an unconsumed click to fall through to block editing or to unrelated overlays.
(focus session)Return a non-negative targeting score when FOCUS can be entered by TAB.
(overlay session)Return left, top, right, and bottom pixel insets obscured by OVERLAY.
The componentwise absolute value of a raw value.
(session &key (title "luvcraft block palette"))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.
(overlay)(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)Attach the player HUD supplied by the loaded presentation system. LUVCRAFT/CORE deliberately has no presentation-system dependency. LUVCRAFT/MCCLIM specializes this at the session boundary and returns its attached overlay.
A real McCLIM hotbar, composited into luvcraft's existing game canvas.