Feature Editor Help Panel - bh679/dungeon-train-mc GitHub Wiki

Editor help panel

Since: v0.146.0 — PR #187

A worldspace help panel that floats beside the first template navigation menu every time the editor is active. Onboards new players to the three editor keybinds and links to this wiki — no chat command or menu drill-down required.

What the player sees

While inside any editor category (Carriages, Contents, Tracks, Parts), a small floating panel appears beside the first nav menu. The panel reads:

Dungeon Train Editor                [X]
Welcome to the Dungeon Train Editor.
Here you can add your own designs to
the train, and send them to the developer.
X - Editor Menu
C - Container Menu
Z - Block Variant Menu
[ Read the Wiki to learn more ]

The bottom row is a clickable button that opens this wiki's Editor page through Minecraft's standard ConfirmLinkScreen (same UX as the Discord title-screen button).

The X in the top-right corner of the header band closes the panel — see Closing the panel.

Closing the panel

Since: v0.674.0 — PR #1122

The header band's right-hand square is a close (X) button. Clicking it hides the panel and leaves every other worldspace editor menu — nav menus, variant lists, plot labels — exactly where they were. Before this, the only way to hide the panel was the Editor Menus toggle, which hides all of them at once.

The dismissal is stored per player, in the world save, so:

  • it survives a relog and a restart of that world;
  • it does not follow you into another world — a new world shows the panel again;
  • two builders in the same world dismiss it independently (the flag is keyed by player UUID).

To bring it back, press X for the editor menu and toggle Welcome Panel back on. Both the close button and that row run the same command:

/dungeontrain editor helppanel on
/dungeontrain editor helppanel off

Clicking the X never punches the block behind the panel — the input handler cancels the attack the same way it does for the wiki button.

Anchor + facing

The panel sits on the reader's left of the first nav menu, offset along the nav menu's grid axis by both panels' half-widths plus a small gap, so it never overlaps the nav menu however wide that grows (PR #1550). It holds its own facing: it faces the player when it appears and after a teleport, then stays still. Its ↻ button (just left of the close X) turns only this panel; shift-click squares it to the grid. See Facing and the ↻ button.

Direction by row axis:

Active category Row axis Help offset
Carriages / Contents / Parts +X row +Z of nav menu
Tracks +Z row -X of nav menu

Click → ConfirmLinkScreen

Hovering the wiki button highlights it (warm yellow tint). Clicking opens the vanilla ConfirmLinkScreen pointing at https://github.com/bh679/dungeon-train-mc/wiki/Editor — same Util.getPlatform().openUri(URI) path the title screen's Discord button uses. Yes opens the system browser; No / Cancel closes the screen.

The input handler defers when the keyboard X menu is open or the part-position menu is active, so the help panel never grabs clicks meant for those menus.

Implementation

Mostly client-side. Three files under client/menu/plot/:

  • EditorHelpPanelRenderer — subscribes to RenderLevelStageEvent.Stage.AFTER_TRANSLUCENT_BLOCKS, finds the first nav menu in EditorTypeMenuRenderer.menus(), anchors the panel at a fixed world offset and draws 8 rows (header / 3-line welcome / 3 keybind hints / wiki button) using the same render type composite as the per-plot panel.
  • EditorHelpPanelRaycast — ray-plane hit test; hitFor maps the header row's right-hand square to the close button and the last row to the wiki button.
  • EditorHelpPanelInputHandler — press-arm in InteractionKeyMappingTriggered, release dispatch in MouseButton.Pre; routes the wiki click through ConfirmLinkScreen and the close click through the helppanel off command.

The dismissal adds server state and one packet field:

  • DungeonTrainWorldData — optional NBT tag editorHelpPanelDismissed, a list of player UUIDs. Absent until someone closes the panel, so old worlds load unchanged and a world saved by a newer build still loads on an older one.
  • EditorTypeMenusPacket — a helpPanelDismissed boolean, written before the menu count so the empty() snapshot stays buffer-symmetric. It rides this packet rather than EditorStatusPacket because the status packet stops while the player stands outside a plot, and its clear packet would pop a dismissed panel back up. VariantOverlayRenderer includes the flag in the snapshot dedup key so toggling always re-pushes.
  • EditorCommand — the editor helppanel on|off subcommand.

The panel's row count and height are unchanged: the X sits inside the existing header band, so nothing else on the panel moved.

Lang keys in assets/dungeontrain/lang/en_us.json start with gui.dungeontrain.editor_help.* so all panel text is translatable.

See also