Skip to main content

Building Codex menus

Quest Codex has no built-in screen. Every menu is a GUI layout pool that you design, and the codex only fills the marker slots you place in it. Read the GUI guides first: Understand a GUI menu, Layouts, frames and slots and Interactions and navigation.

The pieces​

EntryRole
Quest CategoryDeclares a category: title, icon, parent, criteria.
Quest AssignmentPuts quests in a category, with order and per-status overrides.
Category MenuThe menu for one category (or the main menu, or the tracked menu). Its menu field references an Open GUI that holds the layouts.

Markers​

Place an item in a simple layout of the referenced Open GUI, set buttonPrefix to codex_button: and buttonType to a marker:

buttonTypeReplaced by
CATEGORY_SLOTOne root category per slot, in the main menu.
QUEST_SLOTOne quest per slot, in a category menu.
TRACKED_QUEST_SLOTOne tracked quest per slot, in the @tracked menu.
SORT_SLOTThe sort button, drawn above the layout so it never scrolls away.

Two rules:

  1. One marker, one slot. A marker only expands through its own count, direction, gap and repeatY. A 7 by 8 grid is one item with count 7, direction right and repeatY 8. Without a direction, the marker stays a single slot. gap is a step: 1 is adjacent.
  2. Markers follow the layout. They are indexed in reading order before the layout is parsed, so put the marker item in the simple layout that a scrollable layout wraps and the quest list scrolls with a stable order.

Markers outside simple layouts, or in a shared chassis rather than in the Open GUI named by menu, are not filled.

A scrollable category menu​

A six-row browser with a border, fixed controls and a scrolling 7 by 4 window on a 7 by 8 grid of quests:

  1. Create an Open GUI main_quests_gui with guiType CUSTOM and size SIZE_54.
  2. Add a simple layout deco. Add a black glass pane at x 0, y 0 with count 9, direction right and the name set to a single space, and the same at y 5. On row 5 add a BACK item at x 0 (buttonPrefix codex_button:, buttonType BACK), a SORT_SLOT item at x 4 and a CLOSE item at x 8.
  3. Add a simple layout quest_grid with one item: buttonPrefix codex_button:, buttonType QUEST_SLOT, x 0, y 0, count 7, direction right, repeatY 8.
  4. Add a scrollable layout quests with innerId quest_grid, virtualWidth 7, virtualHeight 8 and two buttons, an UP arrow at x 1, y 4 and a DOWN arrow at x 5, y 4.
  5. Add a frame layout root with two frames: deco at 0,0 sized 9 by 6, and quests at 1,1 sized 7 by 4. Set mainLayoutId to root.
  6. Create the Category Menu with category main_quests, rows 6 and menu set to main_quests_gui.

The quest grid lives inside the scrollable content, so quests scroll with the window. The arrows only appear when there is something to scroll to.

The sort button​

SORT_SLOT shows the current sort mode and cycles on click: All, Not started, In progress, Completed. The mode is kept per player until the server restarts and applies to every category menu. Configure the item, label and lore of each mode in sortDisplay of the Category Menu; without it, a built-in label is used.

Tag a slot with PAGE_NEXT, PAGE_PREV, SCROLL_UP, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT, BACK, CLOSE or SORT to wire its click action. The item, name and lore you configure are kept; the default arrow, barrier or hopper only appears when the slot has no item. You can also use plain items with gui:back, gui:close or gui:scroll commands.

PAGE_NEXT and PAGE_PREV page the list of quests or categories when the menu has markers, and otherwise page a paginated layout.

Quest appearance​

A quest slot adapts to the player's progress. Quest Lore adds lore per status, and the Quest Assignment can override the icon, name, lore and visibility per status. Clicking an active quest tracks or untracks it; clicking a not started or completed quest sends the matching message from the global settings.

Checklist​

  1. A Quest Codex Global Settings entry, with a tracking artifact.
  2. At least one Quest Category, with no parent for the main menu.
  3. A Quest Assignment per category.
  4. A Category Menu per category, and one with an empty category for the main menu, each with its marker.
  5. rows of the Category Menu equal to the height of the Open GUI.
  6. Players hold typewriter.codex.open, or open the menu from an action.