Skip to main content

Building Codex Menus

The Quest Codex draws zero hardcoded menus. Every screen a player sees — the category browser, the quest list, the sort button — is a regular GUI Extension layout pool that you design. The codex only injects content into the slots you mark for it. If you haven’t read the GUI guides yet, start there: IntroductionLayout TypesInteractions. Everything on this page builds on those concepts.

The big picture

Three entry types share the work:
EntryRoleAnalogy
quest_categoryDeclares a category: title, icon, parent, visibility criteriaThe folder
quest_assignmentLinks quests into a category, with ordering and per-status overridesThe folder’s contents
category_menuThe menu design: a full GUI layoutPool with placeholder slotsThe folder’s appearance

Slot placeholders — the one codex-specific concept

Inside a category_menu layout pool you place placeholder slots. At render time the codex replaces them with live content:
PlaceholderReplaced by
CATEGORY_SLOTOne sub-category icon per visible category (title, icon, click → opens it)
QUEST_SLOTOne quest per assignment (icon + per-status lore from quest_lore, click → track/untrack)
SORT_SLOTThe sort-mode button (cycles All → Not Started → Active → Completed)
Everything else in the pool — borders, titles, decoration, extra buttons — is plain GUI content and behaves exactly as documented in the GUI guides.

A complete category menu

A 6-row browser: border, scrollable quest area, sort button bottom-right:
{
  "type": "category_menu",
  "name": "default_codex_menu",
  "mainLayoutId": "main",
  "layoutPool": [
    { "case": "composite", "value": { "id": "main", "children": ["border", "quests", "controls"] } },

    { "case": "simple", "value": { "id": "border", "items": [
        { "x": 0, "y": 0, "count": 9, "direction": "right",
          "item": { "material": "BLACK_STAINED_GLASS_PANE" }, "displayName": " " },
        { "x": 0, "y": 5, "count": 9, "direction": "right",
          "item": { "material": "BLACK_STAINED_GLASS_PANE" }, "displayName": " " }
    ] } },

    { "case": "scrollable", "value": {
        "id": "quests", "innerId": "quest_grid",
        "virtualWidth": 9, "virtualHeight": 12,
        "buttons": [
          { "direction": "UP",   "step": 1, "item": { "x": 8, "y": 1, "item": { "material": "ARROW" }, "displayName": "<white>▲" } },
          { "direction": "DOWN", "step": 1, "item": { "x": 8, "y": 4, "item": { "material": "ARROW" }, "displayName": "<white>▼" } }
        ] } },

    { "case": "simple", "value": { "id": "quest_grid", "items": [
        { "x": 1, "y": 1, "buttonType": "QUEST_SLOT", "item": {} }
    ] } },

    { "case": "simple", "value": { "id": "controls", "items": [
        { "x": 8, "y": 5, "buttonType": "SORT_SLOT", "item": {} }
    ] } }
  ]
}
What to notice:
  • The structure is 100 % GUI Extension: composite stacking, a scrollable viewport, repetition fields for the border.
  • Placeholder slots are ordinary items tagged with buttonType — the codex fills them and multiplies QUEST_SLOT/CATEGORY_SLOT across the available area.
  • Scrolling, clicks and sounds are handled by the GUI engine; the codex only decides what goes in each slot.

The sort button

SORT_SLOT renders the current sort mode and cycles on click. Each mode can have its own label, lore and item via the menu’s sortDisplay configuration — see category_menu. Modes: All → Not Started → Active → Completed.

Per-status quest appearance

A quest slot adapts to the player’s progress. quest_lore defines the lore blocks per status (not started / active / completed), and quest_assignment can override icon or visibility per status. Clicking an active quest tracks/untracks it through QuestExtension’s native tracker.

Checklist for a working codex

  1. A quest_codex_config entry (global sounds, defaults, messages).
  2. At least one quest_category (top level = no parent).
  3. One quest_assignment per category, listing quest entries.
  4. A category_menu whose layout pool contains at least one QUEST_SLOT (and CATEGORY_SLOT if you use sub-categories).
  5. Open it via the commands or a Typewriter trigger.
Design tip: build and test your layout as a plain open_gui menu first (fast iteration with the GUI cookbook recipes), then transplant the pool into your category_menu and swap the content slots for placeholders.