跳转到正文
iPlugin

文件与 ID

Xerr 常用目录、顶层 ID 和图片地址规则

常用目录

config.yml

顶层节点是 ID

以下配置都使用 YAML 顶层节点作为 ID:

  • Layout
  • HUD
  • Popup 显示组和 Popup 类型
  • Screen
  • Compass 模板
  • Tooltip 模板
  • 人物模板
  • 头像模板
  • 背景模板
  • 字体
core/layout/player/status.yml
player_status:
  title:
    value: "&f玩家状态"

引用时填写 player_status。文件名和子目录只用于整理,不会加入 ID。

同一种配置中的顶层 ID 必须全局唯一。不同文件中出现同名 Layout,重载会报错。

图片地址

图片由三部分组成:

namespace + basename + id

例如:

xerr_ui + icon + health

对应:

core/assets/image/xerr_ui/icon/config.yml
core/assets/image/xerr_ui/icon/textures/health.png
img:
  health:
    path: health
    height: 8

默认图片组

Layout 文件可以设置默认值:

defaults:
  image:
    namespace: xerr_ui
    basename: icon

元素只需填写:

image:
  id: health

文件释放规则

Xerr 会释放缺失的默认文件,但不会覆盖已有文件。升级后没有看到新默认配置,通常是因为旧文件仍然存在。

默认组件包与独立分发结构见默认图片资产包。

物品提示模板由用户在 core/template/tooltips/ 中自行创建;Xerr 只创建空目录,不释放演示文件,详见物品提示。