# GUI

## 句法

> ```yaml
> gui_menus:
>  # 菜单名
>  menuname:
>    # 菜单标题
>    menu_title: "文本"
>    # 打开命令
>    open_command: COMMAND
>    # 打开需求
>    open_requirement: EXPRESSION
>    # 打开命令类型
>    open_commands:
>      - "[ACTIONTYPE] ACTION"
>      - "[ACTIONTYPE] ACTION"
>    # 背包类型
>    inventory_type: "TEXT"
>    # 界面大小
>    size: #
>    # 刷新间隔
>    update_interval: #
>    # 菜单物品
>    items:
> ```
>
> 如果您使用的是 外部GUI文件（独立的.yml文件），则配置将从 menu\_title：选项开始。

## 菜单标题

> ```yaml
> menu_title: "TEXT"
> ```

显示在GUI界面顶部的菜单标题，您可以在此处使用颜色代码以及PlaceholderAPI变量。

## 打开命令

> ```yaml
> open_command: COMMAND
> ```
>
> > **多命令打开:**
> >
> > ```yaml
> > open_command:
> >   - COMMAND
> >   - COMMAND_2
> > ```

用于打开GUI菜单的命令，它只能是一个单独的文字。

要禁用打开命令，只需删除此行选项即可。

## 打开要求

> ```yaml
> open_requirement:
>  requirements:
>    TEXT:
>      type: <type>
> ```

设置玩家打开GUI菜单的必要条件，查看`Requirements`页获取更多信息。

## 打开命令

> ```yaml
> open_commands:
>   - "[ACTIONTYPE] ACTION"
>   - "[ACTIONTYPE] ACTION"
> ```

让玩家通过命令打开菜单。

## 关闭命令

> ```yaml
> close_commands:
>   - "[ACTIONTYPE] ACTION"
>   - "[ACTIONTYPE] ACTION"
> ```

在玩家通过点击带有关闭动作(`close`)的菜单选项时执行的命令。

## 界面类型

> ```yaml
> inventory_type: "TEXT"
> ```
>
> > **默认类型:** `CHEST` **支持类型:**
> >
> > * `ANVIL` 铁砧
> > * `BARREL` 木桶
> > * `BEACON` 信标
> > * `BLAST_FURNACE` 高炉
> > * `BREWING` 酿造台
> > * `CARTOGRAPHY` 制图台
> > * `DISPENSER` 发射器
> > * `DROPPER` 投掷器
> > * `ENCHANTING` 附魔台
> > * `ENDER_CHEST` 末影箱
> > * `FURNACE` 熔炉
> > * `GRINDSTONE` 砂轮
> > * `HOPPER` 漏斗
> > * `LOOM` 织布机
> > * `PLAYER` 玩家背包
> > * `SHULKER_BOX` 潜影盒
> > * `SMOKER` 烟熏炉
> > * `WORKBENCH` 工作台

可自定义的GUI界面类型。

## 界面大小

> ```yaml
> size: #
> ```
>
> > **默认大小:** `54`\
> > **支持范围:**
> >
> > * `9`
> > * `18`
> > * `27`
> > * `36`
> > * `45`
> > * `54`

设置界面大小。

界面大小必须设置，但不适用于所有界面类型。

## 注册命令

> ```yaml
> register_command: true
> ```

在服务器中注册此命令。

必须手动添加到菜单中。

### 参数

> ```yaml
> args:
> - "TEXT"
> - "TEXT"
> - "TEXT"
> ```
>
> > * **TEXT** 参数名称是唯一的。

使您能够在打开命令之后设置参数, 并通过添加参数变量在菜单中使用 (括号 `{TEXT}` 中的参数名称).

您可以有多个参数，并且将在打开命令中以相同顺序设置它们。

```
/COMMAND FirstArg SecondArg And the rest
```

```yaml
args:
- first
- second
- last
```

* `{first}` 返回 `FirstArg`
* `{second}` 返回 `SecondArg`
* `{last}` 返回 `And the rest`
* 参数变量可用于 [Placeholder-Material](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md#material), [Display Name](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md#display-name), [Lore](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md#lore), [Actions](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md#shift-left-middle-right-click-commands).
* 强烈建议添加 [Args Usage Message](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/gui.md#args-usage-message) 选项.
* 需要 [Register Command](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/gui.md#register-command) 为 `true`.

### 参数使用信息

> ```yaml
> args_usage_message: "TEXT"
> ```

设置菜单的使用信息。如果没有设置参数，它将被发送给玩家。您可以在此处使用颜色代码和格式代码. 需要定义 [Arguments](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/gui.md#args).

## 更新间隔

> ```yaml
> update_interval: #
> ```

这适用于使用 `update:` 选项 (点击[此处](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md#update)).\
此项 (单位每秒) 体现在在物品的LORE/显示名称中变量的每次刷新之间。

**注意:** 这仅仅刷新/更新变量。

## 菜单选项

> ```yaml
> items:
> ```

此行需保持不变，这只是告诉插件您即将开始创建菜单选项。 查看 [**Item**](https://app.gitbook.com/s/-MEBjMj0q0kRJRPaL88C/xuan-xiang-pei-zhi/item.md) 页面获得更多信息.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deluxemenu.wiki.complexstudio.net/xuan-xiang-pei-zhi/gui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
