完善计分板、开发文档
This commit is contained in:
parent
288c0a3d5f
commit
460b39698a
28
DEVDOC.md
28
DEVDOC.md
@ -1,6 +1,14 @@
|
||||
1. 主要逻辑和模块逻辑分离
|
||||
2. 细化版本管理,提供不同版本之间的升级函数,由`update_manager`控制。*务必仔细测试再发布,一旦升级无法降级!*
|
||||
3. 函数由两个以上的函数调用,或由不同包下的函数调用,或需要作为接口开放给下游数据包时,应改用标签调用!
|
||||
# 开发文档
|
||||
|
||||
|
||||
## 基本要求
|
||||
|
||||
- 主要逻辑和模块逻辑分离
|
||||
- 函数由两个以上的函数调用,或由不同包下的函数调用,或需要作为接口开放给下游数据包时,应改用标签调用!
|
||||
|
||||
|
||||
## 未来计划
|
||||
- 细化版本管理,提供不同版本之间的升级函数,由`update_manager`控制。*务必仔细测试再发布,一旦升级无法降级!*
|
||||
|
||||
|
||||
## 系统模块
|
||||
@ -8,11 +16,11 @@
|
||||
### 频繁使用的计算单元
|
||||
- 位于`tags/functions/calculation`目录下的标签通常被用来进行简单重复的计算任务
|
||||
|
||||
### 事件
|
||||
### 事件模块
|
||||
- 通常由**进度**触发,触发后调用同名的事件标签
|
||||
- 将需要调用的函数填入`tags/functions/event/<事件名称>`标签即可
|
||||
|
||||
### 日志
|
||||
### 日志模块
|
||||
- 仓库中提供了日志相关的代码片段,位于`.vscode/settings.json`
|
||||
- 暂时没有找到方法在控制台记录日志
|
||||
|
||||
@ -42,7 +50,7 @@
|
||||
|
||||
## 功能模块
|
||||
|
||||
### 配置
|
||||
### 配置模块
|
||||
- 标签`tags/functions/module/config/timeout`:注册超时时的操作
|
||||
- 标签`tags/functions/module/config/reset_trigger`:用于重置玩家`@s`的触发器计分板
|
||||
|
||||
@ -52,7 +60,13 @@
|
||||
3. 定义一个点击按钮时执行的函数,使用形如`execute if score @s fz.module.config.trigger matches <min>..<max> run ...`的指令判断玩家的触发器分数,并执行你的操作
|
||||
4. 在`tags/functions/module/config/on_click`标签中注册上述函数
|
||||
|
||||
### 计分板
|
||||
### 计分板模块
|
||||
|
||||
#### 自定义计分板颜色
|
||||
- 数据包提供了所有计分板的全部16色命名函数
|
||||
- 使用方法:***覆盖***`tags/functions/module/scoreboard/`
|
||||
|
||||
#### 自定义计分板名称
|
||||
|
||||
|
||||
#### 扩展自己的计分板
|
||||
|
@ -18,8 +18,10 @@ execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @
|
||||
## 初始化计分板
|
||||
### 重置计分板最大id计数
|
||||
scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1
|
||||
### 设置颜色、名称、运行时数字id,同时会计算最大id数
|
||||
function #fz:module/scoreboard/display/init
|
||||
### 设置颜色、名称
|
||||
function #fz:module/scoreboard/display/set_text
|
||||
### 设置运行时计分板id,同时会计算最大id数
|
||||
function #fz:module/scoreboard/display/register_id
|
||||
|
||||
## 重置轮播计分板ID
|
||||
scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0
|
||||
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:fz:module/scoreboard/load",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"replace": false,
|
||||
"values": [
|
||||
"#fz:module/scoreboard/display/init/carousel",
|
||||
"#fz:module/scoreboard/display/init/activation",
|
||||
"#fz:module/scoreboard/display/init/aviating_distance",
|
||||
"#fz:module/scoreboard/display/init/damage_taken",
|
||||
"#fz:module/scoreboard/display/init/death_count",
|
||||
"#fz:module/scoreboard/display/init/dig_count",
|
||||
"#fz:module/scoreboard/display/init/fishing_count",
|
||||
"#fz:module/scoreboard/display/init/general",
|
||||
"#fz:module/scoreboard/display/init/kill_count",
|
||||
"#fz:module/scoreboard/display/init/trade_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:fz:module/scoreboard/load",
|
||||
"用于在加载注册计分板的运行时ID"
|
||||
],
|
||||
"replace": false,
|
||||
"values": [
|
||||
"#fz:module/scoreboard/display/register_id/activation",
|
||||
"#fz:module/scoreboard/display/register_id/aviating_distance",
|
||||
"#fz:module/scoreboard/display/register_id/damage_taken",
|
||||
"#fz:module/scoreboard/display/register_id/death_count",
|
||||
"#fz:module/scoreboard/display/register_id/dig_count",
|
||||
"#fz:module/scoreboard/display/register_id/fishing_count",
|
||||
"#fz:module/scoreboard/display/register_id/general",
|
||||
"#fz:module/scoreboard/display/register_id/kill_count",
|
||||
"#fz:module/scoreboard/display/register_id/trade_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/activation"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/aviating_distance"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/damage_taken"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/death_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/dig_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/fishing_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/general"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/kill_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/register_id/trade_count"
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:fz:module/scoreboard/load",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!"
|
||||
],
|
||||
"replace": false,
|
||||
"values": [
|
||||
"#fz:module/scoreboard/display/set_text/carousel",
|
||||
"#fz:module/scoreboard/display/set_text/activation",
|
||||
"#fz:module/scoreboard/display/set_text/aviating_distance",
|
||||
"#fz:module/scoreboard/display/set_text/damage_taken",
|
||||
"#fz:module/scoreboard/display/set_text/death_count",
|
||||
"#fz:module/scoreboard/display/set_text/dig_count",
|
||||
"#fz:module/scoreboard/display/set_text/fishing_count",
|
||||
"#fz:module/scoreboard/display/set_text/general",
|
||||
"#fz:module/scoreboard/display/set_text/kill_count",
|
||||
"#fz:module/scoreboard/display/set_text/trade_count"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/activation/aqua",
|
||||
"fz:module/scoreboard/display/register_id/activation"
|
||||
"fz:module/scoreboard/display/set_text/activation/aqua"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/aviating_distance/light_purple",
|
||||
"fz:module/scoreboard/display/register_id/aviating_distance"
|
||||
"fz:module/scoreboard/display/set_text/aviating_distance/light_purple"
|
||||
]
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/carousel/gold"
|
||||
]
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/damage_taken/yellow",
|
||||
"fz:module/scoreboard/display/register_id/damage_taken"
|
||||
"fz:module/scoreboard/display/set_text/damage_taken/yellow"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/death_count/dark_red",
|
||||
"fz:module/scoreboard/display/register_id/death_count"
|
||||
"fz:module/scoreboard/display/set_text/death_count/dark_red"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/dig_count/gray",
|
||||
"fz:module/scoreboard/display/register_id/dig_count"
|
||||
"fz:module/scoreboard/display/set_text/dig_count/gray"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/fishing_count/blue",
|
||||
"fz:module/scoreboard/display/register_id/fishing_count"
|
||||
"fz:module/scoreboard/display/set_text/fishing_count/blue"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/general/dark_aqua",
|
||||
"fz:module/scoreboard/display/register_id/general"
|
||||
"fz:module/scoreboard/display/set_text/general/dark_aqua"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/kill_count/red",
|
||||
"fz:module/scoreboard/display/register_id/kill_count"
|
||||
"fz:module/scoreboard/display/set_text/kill_count/red"
|
||||
]
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"__comments": [
|
||||
"调用者:#fz:module/scoreboard/display/init",
|
||||
"调用者:#fz:module/scoreboard/display/set_text",
|
||||
"用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!",
|
||||
"建议不要直接修改本文件,可编写扩展数据包并覆写本标签!"
|
||||
],
|
||||
"__comment_replace": "编写扩展数据包时必须为true",
|
||||
"replace": false,
|
||||
"__comment_values": "此处只能填写一个函数!",
|
||||
"values": [
|
||||
"fz:module/scoreboard/display/set_text/trade_count/green",
|
||||
"fz:module/scoreboard/display/register_id/trade_count"
|
||||
"fz:module/scoreboard/display/set_text/trade_count/green"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user