🖥️ GUI 界面自定义
MMOItemsUpgrade 提供了一个高度动态的 GUI 系统,它可以根据当前物品的状态实时调整显示内容。
�️ 槽位布局总览 (3x9 布局)
默认界面大小为 3 行 (0-26 槽位)。以下是默认的逻辑布局:
| 槽位 | 功能说明 | 对应配置项 |
|---|---|---|
| 10 | 待强化物品输入口 | slots.input |
| 11-15 | 材料放置区 (共5格) | slots.materials |
| 16 | 辅助卷轴放置区 | slots.scroll |
| 19 | 强化执行按钮 | slots.upgrade-button |
| 其他 | 背景填充/装饰 | items.background |
📄 完整配置示例 (gui.yml)
你可以参考以下完整的 gui.yml 内容进行深度定制:
# 强化界面标题
title: "&6&l装备强化中心"
# 界面行数 (1-6)
rows: 3
# 核心逻辑槽位
slots:
input: 10
upgrade-button: 19
materials: [11, 12, 13, 14, 15]
scroll: 16
# 界面元素定义
items:
# 背景填充
background:
material: GRAY_STAINED_GLASS_PANE
name: " "
# 空置槽位时的占位提示
input-placeholder:
material: RED_STAINED_GLASS_PANE
name: "&c请放入待强化的装备"
material-display:
material: ORANGE_STAINED_GLASS_PANE
name: "&e消耗材料预览"
lore:
- "&7请在该区域放入指定的强化材料"
scroll-placeholder:
material: LIGHT_BLUE_STAINED_GLASS_PANE
name: "&b放入辅助卷轴"
lore:
- "&7(可选) 放入成功率卷轴、保护卷轴或放大器"
# 强化按钮:不可点击状态 (条件未满足)
upgrade-button-disabled:
material: ANVIL
name: "&c无法强化"
base-lore:
- "&7当前等级: &e{current_level}"
- "&7目标等级: &e{next_level}"
- ""
# 智能提示缺失内容
missing-money: "&c✘ 缺少金币: &f{missing} &7(需要 {need})"
missing-exp: "&c✘ 缺少经验: &f{missing} &7(需要 {need})"
missing-materials-header: "&c✘ 缺少必要材料:"
missing-material-item: " &7- &f{name} &cx{missing} &7(还差{missing}个)"
no-item-lore:
- "&7请先放入一件 MMOItems 装备"
# 强化按钮:可点击状态 (条件满足)
upgrade-button-enabled:
material: ANVIL
name: "&a▶ 点击开始强化 ◀"
base-lore:
- "&7当前等级: &e{current_level} &7→ &e{next_level}"
- ""
success-rate-line: "&7成功率: &b{rate}%"
scroll-bonus-line: "&7 └ 卷轴加成: &a+{bonus}%"
# 属性变化预览
attribute-preview-header: "&e▸ 属性强化预览:"
attribute-preview-item: " &7{name}: &f{current} &a→ &e{next} &7(&a+{diff}&7)"
# AuraSkills 联动加成显示
auraskills-header: "&d▸ 技能属性收益:"
auraskills-total-bonus: " &7总概率加成: &a+{bonus}%"
auraskills-wisdom-reduction: " &7智慧成本减免: &e-{reduction}%"
cost-header: "&6▸ 本次强化成本:"
cost-money: " &7需扣除金币: &f{amount}"
# 自定义功能按钮 (可在任意位置添加)
custom-buttons:
close_menu:
slots: [26]
material: BARRIER
name: "&c关闭界面"
commands:
- "[close]"
💡 动态 Lore 变量说明
强化按钮支持丰富的宏变量,使玩家在点击前就能清楚了解强化结果:
| 变量 | 说明 | 适用状态 |
|---|---|---|
{current_level} | 装备当前的强化等级 | 全部 |
{next_level} | 强化后的目标等级 | 全部 |
{rate} | 最终成功的百分比几率 | Enabled |
{bonus} | 来源卷轴、技能的额外几率 | Enabled |
{missing} | 缺失的材料或金币数量 | Disabled |
{need} / {have} | 需求总量 vs 玩家持有量 | Disabled |
{name} / {diff} | 属性名称与提升的差值 | Enabled (属性预览) |
[!TIP] 建议在
upgrade-button-enabled的配置中使用{diff}变量。看到明确的属性提升(如攻击力 +5)会极大地刺激玩家的强化欲望。