Addressable Views
Addressable views let one open_gui entry expose several screens without duplicating its inventory shell, tabs, borders, or navigation row. They are useful for dashboards, quest books, profiles, shops, and any menu with a stable chrome and changing content.
How resolution works
- Create a
framelayout for the menu shell. - Set the content frame's
layoutIdto"@view". - Declare one
MenuViewDataobject per screen. - Map the content frame to a layout with
frames, or follow the<viewId>_<frameId>naming convention. - Tag tab items with
buttonPrefix: "view:"andbuttonType: "<viewId>".
The view resolver selects the first visible view in this order: an explicit target from gui:view <id>, defaultViewId, then the first declared visible view. Criteria and viewPermission make a view unreachable and hide its tab.
View fields
| Field | Description |
|---|---|
id | Stable id used by gui:view and view:<id> tabs. |
name | Label used in breadcrumbs and the {view} title token. |
title | Optional per-view title; supports {breadcrumb}, {view}, and {root}. |
parentId | Parent view for nested navigation and breadcrumb ancestry. |
frames | Explicit frame id → layout pool id mappings. |
criteria | Conditions required for the view to be visible. |
viewPermission | Permission required to reach the view. |
activeStyle | Material, glint, name, lore, and custom-model-data overrides for active tabs. |
Complete example
type: open_gui
id: profile_menu
guiType: CUSTOM
size: SIZE_54
title: "<gold>{breadcrumb}"
mainLayoutId: shell
defaultViewId: overview
breadcrumbSeparator: " <gray>›</gray> "
pushHistoryOnViewSwitch: true
views:
- id: overview
name: "Overview"
frames:
content: overview_content
- id: statistics
name: "Statistics"
parentId: overview
frames:
content: statistics_content
viewPermission: profile.stats
layoutPool:
- type: frame
id: shell
frames:
- { id: tabs, x: 0, y: 0, width: 9, height: 1, layoutId: tabs }
- { id: content, x: 0, y: 1, width: 9, height: 5, layoutId: "@view" }
- type: simple
id: tabs
items:
- { x: 2, y: 0, buttonPrefix: "view:", buttonType: overview, item: { material: BOOK } }
- { x: 3, y: 0, buttonPrefix: "view:", buttonType: statistics, item: { material: PAPER } }
- type: simple
id: overview_content
items: []
- type: simple
id: statistics_content
items: []
The view tab resolver automatically appends the gui:view command, hides the statistics tab when the player lacks profile.stats, and applies the active style to the selected view and its parents.
Inheritance and history
baseMenuId allows a menu to inherit a template's layout pool and view declarations. Local ids take precedence. Set pushHistoryOnViewSwitch: true when the back button should return to the previous view; gui:back then restores the previous menu/view without closing and reopening the inventory.
Menus without views retain their regular layout-pool behavior. Existing menus therefore need no migration merely to use OmniGUI v0.10.