Skip to main content

Designing the menus

Dungeon has two menus, and you draw both. This page builds a minimal pair: a browser with two dungeon slots, and a lobby with ready, leave and auto-fill buttons. It assumes you already created a Dungeon Instance and a Dungeon Category as in the Getting started steps.

New to GUI layouts? Read the GUI introduction and the layouts guide first. The menus below use the same layoutPool and mainLayoutId fields as the Open GUI action.

The global menu​

  1. On a sequence page, add a Dungeon Global Menu and set category to your category. Set inventoryRows to 3 and inventoryTitle to <gold>Dungeons.
  2. In layoutPool, add a layout of type simple with the id main. Type main in mainLayoutId.
  3. In items, add a border: a gray stained glass pane at x 0, y 0, with count 9, direction right and a single space as displayName. Repeat at y 2.
  4. Add an item with buttonType DUNGEON_INSTANCE_SLOT at x 3, y 1, count 3, direction right, gap 1. Its material does not matter: it is a marker. The first three dungeons of the category fill the three positions.
  5. Optionally add an item with buttonType DUNGEON_FIND_PARTY at x 8, y 1 (for example a compass named <yellow>Find a party), and one with buttonType DUNGEON_INFO for a help book.
  6. Trigger the entry from an NPC dialogue option or a command event, then Publish.

What each dungeon looks like is set in the category, not in the layout: open the Dungeon Category and edit unlockedItem, unlockedName and unlockLore of its slot. {dungeon_name}, {players} and {max} are replaced when the menu opens and whenever it repaints. To lock a dungeon for some players, add criteria to its slot: they see the locked look and cannot open it.

The party menu​

  1. Add one Dungeon Party Menu. Leave its dungeonInstance empty to serve every dungeon, or name a dungeon to give it its own menu. A menu with an empty dungeonInstance serves the dungeons no other menu names.
  2. Set inventoryRows to 3 and inventoryTitle to <gold>Lobbies.
  3. Choose the lobby look: lobbyItem (a paper by default), lobbyName Lobby {index} and a lobbyLore such as {players}/{max} players and {player_names}.
  4. In layoutPool, add a simple layout main and set mainLayoutId. Place an item with buttonType DUNGEON_LOBBY_SLOT where lobbies should appear (use count, direction and gap for a row). Without a marker, lobbies are drawn from the top-left corner, and lobbyOffsetX and lobbyOffsetY move them away from your border or buttons.
  5. Add three button items in the bottom row: DUNGEON_READY (for example a lime dye named <green>Ready), DUNGEON_LEAVE (a barrier) and DUNGEON_AUTO_FILL.
  6. Publish. Do not trigger this entry yourself: it opens when a player clicks a dungeon in the global menu.

A dungeon has one lobby per maxSimultaneousInstances, so a dungeon with maxSimultaneousInstances 1 shows a single lobby.

What a player experiences​

  1. The player opens the global menu and clicks a dungeon. The party menu opens.
  2. They click a lobby to join it. With MMOCore, Parties or the Typewriter party extension installed, the whole party of a player joins the lobby together when there is room (Dungeon only reads those parties and never changes them).
  3. Other players see the new member without clicking: both menus refresh by themselves (autoRefreshTicks). Each player presses the ready button. When everyone is ready and minPartySize is reached, the startCooldownSeconds countdown runs, then the party is teleported to the spawn point.
  4. When the run ends, players come back to where they were.

Tips​

Prototype first

Draw the layout in a plain Open GUI menu with decorative items, check the positions, then copy the layoutPool into the Dungeon menu and tag the dynamic items.

Button types are exact

buttonType must be written in capitals as listed in Menus. A misspelled type is not an error: the item stays a normal item and does nothing special.