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
| Entry | Role |
|---|---|
| Quest Category | Declares a category: title, icon, parent, criteria. |
| Quest Assignment | Puts quests in a category, with order and per-status overrides. |
| Category Menu | The 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:
buttonType | Replaced by |
|---|---|
CATEGORY_SLOT | One root category per slot, in the main menu. |
QUEST_SLOT | One quest per slot, in a category menu. |
TRACKED_QUEST_SLOT | One tracked quest per slot, in the @tracked menu. |
SORT_SLOT | The sort button, drawn above the layout so it never scrolls away. |
Two rules:
- One marker, one slot. A marker only expands through its own
count,direction,gapandrepeatY. A 7 by 8 grid is one item withcount7,directionrightandrepeatY8. Without adirection, the marker stays a single slot.gapis a step:1is adjacent. - Markers follow the layout. They are indexed in reading order before the layout is parsed, so put the marker item in the
simplelayout that ascrollablelayout 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:
- Create an Open GUI
main_quests_guiwithguiTypeCUSTOMandsizeSIZE_54. - Add a
simplelayoutdeco. Add a black glass pane atx0,y0 withcount9,directionrightand the name set to a single space, and the same aty5. On row 5 add aBACKitem atx0 (buttonPrefixcodex_button:,buttonTypeBACK), aSORT_SLOTitem atx4 and aCLOSEitem atx8. - Add a
simplelayoutquest_gridwith one item:buttonPrefixcodex_button:,buttonTypeQUEST_SLOT,x0,y0,count7,directionright,repeatY8. - Add a
scrollablelayoutquestswithinnerIdquest_grid,virtualWidth7,virtualHeight8 and twobuttons, anUParrow atx1,y4 and aDOWNarrow atx5,y4. - Add a
framelayoutrootwith two frames:decoat 0,0 sized 9 by 6, andquestsat 1,1 sized 7 by 4. SetmainLayoutIdtoroot. - Create the Category Menu with
categorymain_quests,rows6andmenuset tomain_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.
Navigation buttons
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
- A Quest Codex Global Settings entry, with a tracking artifact.
- At least one Quest Category, with no
parentfor the main menu. - A Quest Assignment per category.
- A Category Menu per category, and one with an empty
categoryfor the main menu, each with its marker. rowsof the Category Menu equal to the height of the Open GUI.- Players hold
typewriter.codex.open, or open the menu from an action.