Skip to content

Commit

Permalink
更新schema
Browse files Browse the repository at this point in the history
  • Loading branch information
boybook committed Feb 4, 2024
1 parent d9c439c commit c3fdbe1
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 90 deletions.
169 changes: 90 additions & 79 deletions ecnpc/dialogue.schema.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,98 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/dialogue.schema.json",
"title": "ECNPC dialogue schema",
"description": "ECNPC交互对话,用于实现游戏内打开对话框后NPC实体与玩家进行交互",
"type": "object",
"properties": {
"type": {
"const": "dialogue",
"description": "钩子类型,此处应为 'dialogue'"
},
"key": {
"type": "string",
"description": "可以直接复用在外层注册的dialogue"
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://easecation.github.io/ECConfigSchema/ecnpc/dialogue.schema.json",
"title": "ECNPC dialogue schema",
"description": "ECNPC交互对话,用于实现游戏内打开对话框后NPC实体与玩家进行交互",
"type": "object",
"properties": {
"type": {
"const": "dialogue",
"description": "钩子类型,此处应为 'dialogue'"
},
"key": {
"type": "string",
"description": "可以直接复用在外层注册的dialogue"
},
"condition": {
"type": "string",
"description": "触发对话的条件判断"
},
"dialogue": {
"oneOf": [
{
"type": "string",
"description": "对话内容"
},
"condition": {
{
"type": "array",
"description": "随机对话内容",
"items": {
"type": "string"
}
}
]
},
"button": {
"type": "array",
"description": "按钮配置",
"items": {
"type": "object",
"properties": {
"buttonName": {
"type": "string",
"description": "触发对话的条件判断"
},
"dialogue": {
"description": "按钮名称"
},
"condition": {
"type": "string",
"description": "对话内容"
},
"button": {
"type": "array",
"description": "按钮配置",
"items": {
"description": "按钮显示的条件"
},
"forceCloseOnClick": {
"type": "boolean",
"description": "点击按钮后是否关闭对话弹窗"
},
"handler": {
"oneOf": [
{
"type": "object",
"properties": {
"buttonName": {
"type": "string",
"description": "按钮名称"
},
"condition": {
"type": "string",
"description": "按钮显示的条件"
},
"forceCloseOnClick": {
"type": "boolean",
"description": "点击按钮后是否关闭对话弹窗"
},
"handler": {
"oneOf": [
{
"type": "object",
"$ref": "dialogue.handler.schema.json"
},
{
"type": "array",
"items": {
"type": "object",
"$ref": "dialogue.handler.schema.json"
}
}
]
}
},
"required": [
"buttonName"
],
"description": "按钮配置项"
}
"$ref": "dialogue.handler.schema.json"
},
{
"type": "array",
"items": {
"type": "object",
"$ref": "dialogue.handler.schema.json"
}
}
]
}
},
"animation": {
"type": "string",
"description": "开始对话时,NPC播放的动画"
},
"sound": {
"type": "string",
"description": "开始对话时,播放的音效"
},
"portraitScale": {
"type": "number",
"description": "对话弹窗左侧的NPC模型的放大倍率"
},
"profileOffset": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3,
"description": "对话弹窗左侧的NPC模型的位置平移"
}
"required": [
"buttonName"
],
"description": "按钮配置项"
}
},
"animation": {
"type": "string",
"description": "开始对话时,NPC播放的动画"
},
"sound": {
"type": "string",
"description": "开始对话时,播放的音效"
},
"portraitScale": {
"type": "number",
"description": "对话弹窗左侧的NPC模型的放大倍率"
},
"additionalProperties": false
"portraitOffset": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3,
"description": "对话弹窗左侧的NPC模型的位置平移"
}
},
"additionalProperties": false
}
8 changes: 7 additions & 1 deletion ecnpc/hook.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"description": "控制NPC随机播放实体动画"
},
"animation": {
"oneOf": [
"anyOf": [
{
"anyOf": [
{
Expand Down Expand Up @@ -327,6 +327,12 @@
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"const": "dialogue"
}
},
"$ref": "dialogue.schema.json"
},
{
Expand Down
42 changes: 32 additions & 10 deletions playeraction/playeraction.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,22 @@
"image": {
"type": "string"
},
"actions": {
"type": "array",
"items": {
"type": "object"
}
"click": {
"oneOf": [
{
"type": "object",
"$ref": "#"
},
{
"type": "array",
"items": {
"type": "object",
"$ref": "#"
}
}
]
}
},
"required": [
"text",
"actions"
]
}
}
}
},
Expand Down Expand Up @@ -547,6 +552,23 @@
"type",
"content"
]
},
{
"type": "object",
"properties": {
"type": {
"const": "npc.touch",
"description": "模拟玩家点击NPC"
},
"npcTag": {
"type": "string",
"description": "NPC的Tag"
}
},
"required": [
"type",
"npcTag"
]
}
]
}

0 comments on commit c3fdbe1

Please sign in to comment.