Skip to content

Commit 5d4a14a

Browse files
committed
docs(hud): add the hold-to-peek detail panel to HUD Standard v1
Define the optional on-demand detail panel as a second HUD surface alongside the slot badge: a non-capturing HudRenderCallback on an unbound keybind that reuses the badge's four visibility rules, takes no slot or coordination accessors, pages (never scrolls) its overflow, and never restates a recipe-viewer/tooltip catalog. Covered in HUD-STANDARD.md §8 and the mc-hud skill.
1 parent a32efaf commit 5d4a14a

3 files changed

Lines changed: 119 additions & 17 deletions

File tree

‎.ai/skills/CATALOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the relevant `SKILL.md` directly **before** working in its subject area — use
1818
| [`mc-config`](mc-config/SKILL.md) | Build and maintain a Concord mod's JSON config the suite way — a GSON POJO with versioned schema migration, warn-and-clamp validation, atomic save, a volatile reloadable singleton, a Cloth/ModMenu editor, and a server→client sync with client-fallback precedence | when creating or editing a *Config.java, *ConfigMigrator.java, a compat/modmenu/ModMenuIntegration.java, or any code that reads mod config, syncs config to clients, or adds a config field/section/migration. |
1919
| [`mc-datagen`](mc-datagen/SKILL.md) | Create and maintain Minecraft Fabric data generation providers (models, blockstates, recipes, tags, loot tables, advancements) | when creating or editing *Provider.java, *DataGenerator.java, DataGeneratorEntrypoint, or when the user mentions datagen, data generation, or runDatagen. |
2020
| [`mc-gradle-builds`](mc-gradle-builds/SKILL.md) | Best practices for running Gradle builds, tests, and gametests in Fabric Minecraft mods. Prevents wasted reruns from partial output capture | when running any Gradle command (build, test, runGametest, runDatagen, assemble, check), or when inspecting build output/reports. |
21-
| [`mc-hud`](mc-hud/SKILL.md) | Build a conforming persistent HUD element the suite way (the Concord HUD Standard) — a 20px icon+bar badge registered via HudRenderCallback, anchored with pure testable offset math, hidden by the four standard visibility rules, and stacked under higher-priority sibling mods through reflection-backed coordination accessors rather than hardcoded heights | when creating or editing a *HudOverlay.java, HudMath, a HudRenderCallback registration, the isHudVisible()/getHudHeight() coordination accessors, or when the user mentions a HUD slot, HUD element, on-screen badge, or stacking a HUD against another mod. |
21+
| [`mc-hud`](mc-hud/SKILL.md) | Build a conforming HUD surface the suite way (the Concord HUD Standard) — the persistent 20px icon+bar slot badge (registered via HudRenderCallback, anchored with pure testable offset math, hidden by the four standard visibility rules, and stacked under higher-priority sibling mods through reflection-backed coordination accessors rather than hardcoded heights) and the optional hold-to-peek detail panel that expands it on a keybind | when creating or editing a *HudOverlay.java, a *DetailPanelRenderer.java, HudMath, a HudRenderCallback registration, the isHudVisible()/getHudHeight() coordination accessors, or when the user mentions a HUD slot, HUD element, on-screen badge, a hold-to-peek/detail panel, or stacking a HUD against another mod. |
2222
| [`mc-mixin-craft`](mc-mixin-craft/SKILL.md) | Write, debug, and maintain Mixin injections and access wideners for Fabric Minecraft mods | when creating or editing *Mixin.java, *Accessor.java, *Invoker.java, *.mixins.json, *.accesswidener files, or when discussing injection points, @Inject, @Redirect, @ModifyVariable, or @Overwrite. |
2323
| [`mc-mod-testing`](mc-mod-testing/SKILL.md) | Write and maintain tests for Fabric Minecraft mods across the three-tier test spectrum (pure JUnit, fabric-loader-junit, Fabric Gametest) | when creating or editing *Test.java, *GameTest.java, or when the user asks about testing a Minecraft mod, fabric-loader-junit, or Fabric Gametest. |
2424
| [`mc-networking`](mc-networking/SKILL.md) | Implement client-server networking for Fabric Minecraft mods (custom packets, payload types, stream codecs, sync patterns) | when creating or editing *Payload.java, *Packet.java, *Networking.java, PayloadTypeRegistry, StreamCodec, ServerPlayNetworking, or ClientPlayNetworking. |

‎.ai/skills/mc-hud/SKILL.md‎

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
---
22
name: mc-hud
3-
description: Build a conforming persistent HUD element the suite way (the Concord HUD Standard) — a 20px icon+bar badge registered via HudRenderCallback, anchored with pure testable offset math, hidden by the four standard visibility rules, and stacked under higher-priority sibling mods through reflection-backed coordination accessors rather than hardcoded heights. TRIGGER when creating or editing a *HudOverlay.java, HudMath, a HudRenderCallback registration, the isHudVisible()/getHudHeight() coordination accessors, or when the user mentions a HUD slot, HUD element, on-screen badge, or stacking a HUD against another mod.
3+
description: Build a conforming HUD surface the suite way (the Concord HUD Standard) — the persistent 20px icon+bar slot badge (registered via HudRenderCallback, anchored with pure testable offset math, hidden by the four standard visibility rules, and stacked under higher-priority sibling mods through reflection-backed coordination accessors rather than hardcoded heights) and the optional hold-to-peek detail panel that expands it on a keybind. TRIGGER when creating or editing a *HudOverlay.java, a *DetailPanelRenderer.java, HudMath, a HudRenderCallback registration, the isHudVisible()/getHudHeight() coordination accessors, or when the user mentions a HUD slot, HUD element, on-screen badge, a hold-to-peek/detail panel, or stacking a HUD against another mod.
44
---
55

6-
The user is rendering a persistent on-screen HUD element. The Concord HUD Standard
7-
is summarized in full below — this skill is the normative reference for member
8-
repos, which don't carry a separate standards doc. The hard part is **cross-mod
6+
The user is rendering an on-screen HUD surface — the persistent slot badge, the
7+
optional hold-to-peek detail panel, or both. The Concord HUD Standard is summarized
8+
in full below — this skill is the normative reference for member repos, which don't
9+
carry a separate standards doc. The hard part for the badge is **cross-mod
910
stacking**: each mod renders its own element and must offset past higher-priority
10-
siblings *without* depending on them or hardcoding their size.
11+
siblings *without* depending on them or hardcoding their size. The detail panel is
12+
simpler — transient and unstacked — but has its own rules (see below).
1113

1214
## Whether a mod gets a slot at all
1315

1416
A mod takes a HUD slot **only if it has persistent ambient state the player needs
1517
while walking around** (a level, a standing, a tier that changes as you play).
16-
Everything else belongs in screens, tooltips (Jade/WTHIT — see `mc-tooltips`), or
17-
recipe viewers (`mc-compat`). **Opting out is conformant; future members default
18-
to no slot.** Record a no-slot decision in the mod's `design/DESIGN.md`.
18+
On-demand detail that is too much for the badge — exact figures, a full ladder,
19+
what's physically nearby — goes in the **hold-to-peek detail panel** (below), not a
20+
new slot. Everything else belongs in screens, tooltips (Jade/WTHIT — see
21+
`mc-tooltips`), or recipe viewers (`mc-compat`). **Opting out is conformant; future
22+
members default to no slot.** Record a no-slot decision in the mod's
23+
`design/DESIGN.md`.
1924

2025
## Slot registry
2126

@@ -175,6 +180,46 @@ sibling's HUD. The legacy fixed offset above is only a transitional fallback for
175180
sibling release that predates the accessors. The ~80 lines of offset logic are
176181
deliberately duplicated per mod (convention over dependency).
177182

183+
## Hold-to-peek detail panel
184+
185+
The optional on-demand companion to the badge — the badge says *roughly*, the panel
186+
says *everything*. It is a `HudRenderCallback`, **not** a `Screen`: it never captures
187+
the mouse, pauses the game, or blocks movement (it behaves like vanilla's hold-Tab
188+
player list). Reference: Tribulation's `TierDetailPanelRenderer`, Mercantile's
189+
`ReputationDetailPanelRenderer`. Class convention: `*DetailPanelRenderer`.
190+
191+
- **Keybind.** Register a `KeyMapping` under Controls → `<Mod>`, **unbound by
192+
default**, labelled "Peek `<Domain>` Detail". Draw the panel only while it's held
193+
*and* the badge's visibility predicate passes.
194+
195+
```java
196+
// client init
197+
KeyMapping key = KeyBindingHelper.registerKeyBinding(new KeyMapping(
198+
"key.<mod>.peek_<domain>_detail", InputConstants.UNKNOWN.getValue(), "key.categories.<mod>"));
199+
HudRenderCallback.EVENT.register(new <Mod>DetailPanelRenderer(key));
200+
// in onHudRender:
201+
if (!key.isDown() || !<Mod>HudOverlay.isHudVisible()) return; // reuse the badge predicate
202+
```
203+
204+
- **No slot, no accessors.** Transient, so it takes no slot-registry row and exposes
205+
no `isHudVisible()`/`getHudHeight()` — it is never stacked against siblings. Anchor
206+
it next to the mod's badge with the same `HudMath` helpers.
207+
- **Content.** Framed 9-slice panel in the mod theme, vanilla font only: a header
208+
expanding the badge's headline stat, the relevant progress, and the mod's domain
209+
detail. Every figure derives from the same config/registry the server acts on, so
210+
the panel can't disagree with the badge or the mod's `/`-commands.
211+
- **Proximity element.** A "what's around me now" listing reads a **cached, throttled
212+
scan** (refreshed every N ticks, not per frame) so the render path is a lookup, not
213+
an entity sweep.
214+
- **Overflow pages, never scrolls.** A non-focused HUD layer can't scroll without
215+
capturing input — page the overflow on a frame-timer with an alpha cross-fade and
216+
page dots (keep `pageIndex`/`lastPageChangeMs` as render-thread statics; the fade is
217+
the same `lerp` used for the badge tint).
218+
- **Don't duplicate the catalog.** Possible-loot / possible-reward listings belong in
219+
the recipe viewers (`mc-compat`) and tooltips (`mc-tooltips`); the panel is the live,
220+
contextual view — current state and what's physically nearby — not a static "what
221+
could appear" index.
222+
178223
## Conformance checklist
179224

180225
- [ ] Slot registered in the registry table above (or a no-slot decision recorded
@@ -187,6 +232,10 @@ deliberately duplicated per mod (convention over dependency).
187232
- [ ] `isHudVisible()` / `getHudHeight()` exposed in the `api` package,
188233
reflection-safe from common code.
189234
- [ ] Offset computed from sibling accessors — no hardcoded sibling heights.
235+
- [ ] A hold-to-peek detail panel (if any): unbound keybind under the mod's category,
236+
non-capturing (not a `Screen`), the badge's four visibility rules reused, no
237+
slot/accessors, paged (not scrolled) overflow, figures from the server's own
238+
source, and no recipe-viewer/tooltip duplication.
190239
- [ ] `AGENTS.md` declares "conforms to Concord HUD Standard v1".
191240

192241
## Guardrails
@@ -198,6 +247,11 @@ deliberately duplicated per mod (convention over dependency).
198247
- **Never** use a custom font or a downscaled vanilla item render for the glyph.
199248
- **Never** introduce a shared HUD manager/library — each mod renders and offsets
200249
independently (convention over dependency).
250+
- **Never** open a `Screen` for a peek panel or let it capture the mouse / pause the
251+
game — it's a non-capturing `HudRenderCallback` layer like hold-Tab, gets no slot or
252+
coordination accessors, and pages its overflow rather than scrolling.
253+
- **Never** have a peek panel restate what a recipe viewer or tooltip already catalogs —
254+
it shows live, contextual state, not a static "what could appear" index.
201255
- **Always** reserve sibling height only at the default anchor; moving to another
202256
corner opts out of stacking.
203257
- **Always** resolve sibling accessors once and cache the handles; degrade to 0

‎HUD-STANDARD.md‎

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
# Concord HUD Standard — v1
22

3-
> Normative for every Concord member mod that renders a persistent HUD element.
4-
> Tribulation's `TribulationHudOverlay` is the reference implementation.
3+
> Normative for every Concord member mod that renders an on-screen HUD surface — the
4+
> persistent slot badge (§2–§7) and the optional hold-to-peek detail panel (§8).
5+
> Tribulation's `TribulationHudOverlay` and `TierDetailPanelRenderer` are the reference
6+
> implementations.
57
6-
## 1. Whether a mod gets a slot at all
8+
## 1. Two HUD surfaces
79

8-
A mod takes a HUD slot **only if it has persistent ambient state the player needs while
9-
walking around** (a level, a standing, a tier that changes as you play). Everything else
10-
belongs in screens, tooltips (Jade/WTHIT), or recipe viewers. Opting out is conformant —
11-
Meridian has no slot by design. Future members default to **no slot**.
10+
The standard governs two on-screen surfaces a mod may render, independently of each other:
11+
12+
- **The slot badge** (§2–§7) — a persistent, always-on element in the shared top-left
13+
stack. A mod takes a slot **only if it has persistent ambient state the player needs
14+
while walking around** (a level, a standing, a tier that changes as you play).
15+
- **The hold-to-peek detail panel** (§8) — an on-demand overlay shown only while a keybind
16+
is held, expanding the badge's headline into the full picture. Optional and independent
17+
of the badge: a mod may ship a badge, a panel, both, or neither.
18+
19+
Everything that is neither persistent-ambient nor on-demand-detail belongs in screens,
20+
tooltips (Jade/WTHIT), or recipe viewers. Opting out of both is conformant — Meridian has
21+
no HUD surface by design. Future members default to **no slot**.
1222

1323
## 2. Slot registry
1424

@@ -89,7 +99,42 @@ dependency (`VISION.md` §8.1).
8999
`assets/tribulation/textures/gui/hud_icon.png`, tier tints, progress bar, level-up lerp,
90100
and all four visibility rules.
91101

92-
## 8. Conformance checklist
102+
## 8. Hold-to-peek detail panel
103+
104+
An optional on-demand companion to the slot badge: the badge says *roughly* where the
105+
player stands, the panel says *everything*. It is a HUD surface, not a `Screen`.
106+
107+
- **Trigger.** A `KeyMapping` under Controls → `<Mod>`, **unbound by default**, named
108+
"Peek `<Domain>` Detail" (e.g. "Peek Tier Detail", "Peek Reputation Detail"). Shown only
109+
while the key is held; released, it dismisses.
110+
- **Non-capturing.** It behaves like vanilla's hold-Tab player list — it never captures the
111+
mouse, pauses the game, or blocks movement. It is drawn from a `HudRenderCallback`, never
112+
by opening a `Screen`.
113+
- **Visibility.** Governed by the **same four rules as the badge** (§5); reuse the badge's
114+
visibility predicate rather than re-deriving it.
115+
- **No slot, no coordination.** The panel is transient, so it takes **no slot-registry row
116+
(§2) and no `isHudVisible()`/`getHudHeight()` accessors (§6)** — it is never stacked.
117+
Anchor it adjacent to the mod's badge.
118+
- **Framing.** A framed panel (9-slice) in the mod's theme; **vanilla font only** (§3):
119+
a header expanding the badge's headline stat, the relevant progress, and the mod's domain
120+
detail.
121+
- **Proximity element.** Any "what's around me right now" listing is built from a **cached,
122+
throttled scan** (refreshed on a tick interval, not per frame) so the render path stays a
123+
lookup, not an entity sweep.
124+
- **Overflow pages, never scrolls.** A non-focused HUD layer cannot scroll without capturing
125+
input, so overflow is **paged with a cross-fade and page dots**, not a scrollbar.
126+
- **It cannot lie.** Every figure is derived from the same config/registry the server acts
127+
on (the same source the badge and `/`-commands read), never a parallel copy.
128+
- **It does not duplicate the catalog.** Possible-loot / possible-reward listings live in
129+
the recipe viewers (EMI/REI/JEI) and tooltips (Jade/WTHIT); the panel is the *live,
130+
contextual* view — current state and what is physically around the player — not a static
131+
index of what *could* appear.
132+
- **Class convention.** `*DetailPanelRenderer` (a `HudRenderCallback`).
133+
134+
Reference implementations: Tribulation's `TierDetailPanelRenderer`, Mercantile's
135+
`ReputationDetailPanelRenderer`.
136+
137+
## 9. Conformance checklist
93138

94139
- [ ] Slot registered in §2 of this file (or explicit no-slot decision recorded in the
95140
mod's `design/DESIGN.md`)
@@ -101,4 +146,7 @@ and all four visibility rules.
101146
- [ ] `isHudVisible()` / `getHudHeight()` exposed in the `api` package,
102147
reflection-safe from common code
103148
- [ ] Offset computed from sibling accessors — no hardcoded sibling heights
149+
- [ ] A hold-to-peek detail panel (if any) follows §8: unbound keybind, non-capturing
150+
(not a `Screen`), the badge's four visibility rules reused, no slot/accessors, paged
151+
(not scrolled) overflow, and no duplication of recipe-viewer/tooltip catalogs
104152
- [ ] `AGENTS.md` declares "conforms to Concord HUD Standard v1"

0 commit comments

Comments
 (0)