跳到主要内容

Friend Menu

Friend Menu

Action entry that opens the Friend menu using the GUI extension's layout pool system. Items with buttonType from [FriendButtonType] are resolved dynamically. Dynamic content (friend heads, request heads) is injected at runtime. ### Écrans Une seule entrée porte tous les écrans du menu : chaque écran est une [MenuViewData] de [views], la frame de contenu du châssis vaut @view et les onglets sont des slots taggés view:<id>. Les écrans qui listent des joueurs se déclarent dans [friendListViewIds] / [requestListViewIds] — l'extension ne devine aucun id de vue. Sans views, le menu se comporte exactement comme avant : un écran unique dont le contenu est choisi par [view], et une entrée par écran dans la page.

字段

字段类型默认值描述
inventoryTitleVar<String><dark_gray>AmisTitle of the menu. Supports the {breadcrumb}, {view} and {root} view tokens.占位符颜色
viewStringmainContent of the single screen when no view is declared: 'main', 'friends' or 'requests'.
viewsList<MenuViewData>emptyAddressable screens of this menu. Frames with layoutId '@view' and slots tagged 'view:<id>' resolve against the active one.
defaultViewIdString?—View opened first. Empty = the first declared view.
breadcrumbSeparatorStringDEFAULT_BREADCRUMB_SEPARATORMiniMessage separator inserted between breadcrumb segments by the {breadcrumb} title token.颜色
baseMenuIdString—Entree open_gui servant de chassis partage : son layoutPool et ses vues fusionnent sous les notres (meme id = la notre gagne).
friendListViewIdsList<String>emptyIds of the views whose content panel lists the player's friends.
requestListViewIdsList<String>emptyIds of the views whose content panel lists the incoming friend requests.
inventoryRowsInt6Number of inventory rows (1-6).
guiTypeGuiTypeCUSTOMGUI type.
layoutPoolList<LayoutData>emptyPool of layout definitions. Items with `buttonType` are resolved dynamically.
mainLayoutIdString?—ID of the main layout from the pool.
contentXInt1X origin of the content panel where friend/request heads are injected (right side of a 4/1/4 frame).
contentYInt0Y origin of the content panel where heads are injected.
contentColumnsInt7Number of columns available in the content panel for heads.
contentRowsInt7Number of rows available in the content panel for heads.
emptySlotItemItem—Item shown on a content slot that holds no friend or request yet, so the panel always reads as a grid.
audioGuiAudioData—Audio configuration.
TypeWriter 通用字段(criteria, modifiers, triggers)
字段类型默认值描述
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

One Friend Menu entry carries every screen of the menu. Create it once, then open it with /friend or by triggering it from another entry.

  1. Declare the screens in views (for example friends and requests). Frames with layoutId @view and slots tagged view:<id> follow the active screen, which is how tabs work. See Views, tabs and inheritance.
  2. List the screens that show player heads: friendListViewIds for the friend list, requestListViewIds for incoming requests. Any other screen shows no heads.
  3. Place the head grid with contentX, contentY, contentColumns and contentRows. One page holds contentColumns times contentRows heads.
  4. Add a PAGE_NAV item for pagination: left click goes forward, right click goes back, and the item name shows the page counter.

Without views, the menu has a single screen whose content is chosen by view: friends or requests list heads, any other value lists none.

Head clicks: on the friend list, left click teleports and right click removes the friend. On the request list, left click accepts and right click declines.

Shared frame

Set baseMenuId to an open_gui entry to reuse a shared frame (borders, tabs, close button). Its layouts and views are merged under this entry's, and this entry wins when ids collide.