feat:help

This commit is contained in:
bietiaop 2024-07-22 19:06:52 +08:00
parent 9061bcbaa7
commit c2aca285cb
6 changed files with 453 additions and 58 deletions

View file

@ -1,3 +1,10 @@
# 1.0
* 重构帮助指令,发送 `%帮助`
# 0.3
* 修复攻略图角色“本”图片错误
* 将 `mysid` 比较转为字符串,解决部分适配问题
# 0.2
* 添加“式舆防卫战”查询,发送 `%式舆防卫战` 或者 `%深渊`

View file

@ -29,51 +29,18 @@ git clone --depth=1 https://github.com/ZZZure/ZZZ-Plugin.git ./plugins/ZZZ-Plugi
以下所有功能前缀为:`#zzz``%``#ZZZ``#绝区零` 任选其一
<details>
<summary>便签 - 命令: note、便签、便笺、体力、每日</summary>
<p><a><img src="https://s2.loli.net/2024/07/10/zM472pxdVIS3hvF.jpg"></a></p>
</details>
![功能图片](https://s2.loli.net/2024/07/22/bJwasnB3XZASvP6.jpg)
<details>
<summary>基本信息汇总(角色和邦布) - 命令: card、卡片、个人信息</summary>
<p><a><img src="https://s2.loli.net/2024/07/10/GiZmV1Cf7wTLOUp.jpg"></a></p>
</details>
## 攻略、图鉴
<details>
<summary>更新抽卡记录(需要逍遥插件支持) - 命令: 刷新抽卡链接、更新抽卡链接、刷新抽卡记录、更新抽卡记录</summary>
<p><a><img src="https://s2.loli.net/2024/07/10/K6dg5EFGaHV7SW2.png"></a></p>
</details>
**攻略、图鉴建议使用第三方插件**,本插件的攻略功能是在没有专业插件的情况下的保底功能。
<details>
<summary>获取抽卡记录链接(需要逍遥插件支持) - 命令: 获取抽卡链接</summary>
<p>暂时没有图片</p>
</details>
推荐使用的图鉴插件:
<details>
<summary>抽卡记录 - 命令: 抽卡分析、抽卡记录</summary>
<p><a><img src="https://s2.loli.net/2024/07/10/RTxz5IvcQBNOVMi.jpg"></a></p>
</details>
<details>
<summary>角色攻略 - 命令: 角色名称/别名+攻略+(可选)来源数字</summary>
<p>老图片,功能差不多</p>
<p><a><img src="https://s2.loli.net/2024/07/10/sqRC2BpntlkNgP6.png"></a></p>
</details>
<details>
<summary>刷新角色面板 - 命令: 刷新面板、更新面板、面板刷新、面板更新</summary>
<p>暂时没有图片</p>
</details>
<details>
<summary>查看角色面板列表 - 命令: 面板、面板列表</summary>
<p>暂时没有图片</p>
</details>
<details>
<summary>查看角色面板 - 命令: 角色名/别名+面板</summary>
<p><a><img src="https://s2.loli.net/2024/07/13/8FVT1AfD6IxYpcq.jpg"></a></p>
</details>
* [Atlas](https://github.com/Nwflower/Atlas)
Atlas是一个适用于V3版本及以上Yunzai-Bot的图鉴查询插件可通过Yunzai-Bot查询游戏图鉴插件代码严格遵循ES6规范。
* [Mora-Plugin](https://gitee.com/Rrrrrrray/mora-plugin)
Mora-Plugin是一个Yunzai-Bot的插件 仅用于自我学习其他优秀插件
# 贡献

View file

@ -1,8 +1,129 @@
import { ZZZPlugin } from '../lib/plugin.js';
import { rulePrefix } from '../lib/common.js';
import render from '../lib/render.js';
import settings from '../lib/settings.js';
import _ from 'lodash';
/**
* @typedef {Object} HelpItem
* @property {string} title
* @property {string} desc
* @property {boolean} needCK
* @property {boolean} needSK
* @property {string[]} commands
*/
/**
* @typedef {Object} HelpData
* @property {string} title
* @property {'fire'|'ice'|'physdmg'|'thunder'|'dungeon'} icon
* @property {HelpItem[]} items
*/
/**
* @type {HelpData[]}
* @description 帮助数据
*/
const helpData = [
{
title: '信息查询',
icon: 'fire',
items: [
{
title: '基本信息',
desc: '查看玩家的角色和邦布列表',
needCK: true,
needSK: false,
commands: ['card', '卡片', '个人信息'],
},
{
title: '便签',
desc: '查看便签',
needCK: true,
needSK: false,
commands: ['note', '便签', '便笺', '体力', '每日'],
},
],
},
{
title: '抽卡记录',
icon: 'ice',
items: [
{
title: '刷新抽卡记录',
desc: '刷新抽卡记录',
needCK: true,
needSK: true,
commands: ['刷新/更新抽卡链接', '刷新/更新抽卡记录'],
},
{
title: '获取抽卡记录链接',
desc: '获取抽卡记录链接',
needCK: true,
needSK: true,
commands: ['获取抽卡链接'],
},
{
title: '查看抽卡记录',
desc: '查看抽卡记录',
needCK: false,
needSK: false,
commands: ['抽卡分析', '抽卡记录'],
},
],
},
{
title: '角色面板',
icon: 'thunder',
items: [
{
title: '刷新角色面板',
desc: '刷新角色面板',
needCK: true,
needSK: false,
commands: ['刷新面板', '更新面板', '面板刷新', '面板更新'],
},
{
title: '查看角色面板列表',
desc: '查看已保存的角色面板列表',
needCK: false,
needSK: false,
commands: ['面板', '面板列表'],
},
{
title: '查看角色面板',
desc: '查看角色面板',
needCK: false,
needSK: false,
commands: ['角色名+面板'],
},
],
},
{
title: '式舆防卫战',
icon: 'dungeon',
items: [
{
title: '查看式舆防卫战',
desc: '查看式舆防卫战(深渊)信息',
needCK: false,
needSK: false,
commands: ['式舆防卫战', '防卫战', '式舆', '深渊', '防卫'],
},
],
},
{
title: '角色攻略',
icon: 'physdmg',
items: [
{
title: '查看角色攻略',
desc: '查看角色攻略',
needCK: false,
needSK: false,
commands: ['角色名+攻略[+来源]'],
},
],
},
];
export class Help extends ZZZPlugin {
constructor() {
super({
@ -19,22 +140,37 @@ export class Help extends ZZZPlugin {
});
}
async help() {
const reply_msg = [
'ZZZ-Plugin 帮助还在制作中',
'目前主要功能如下:',
'所有功能前缀为:#zzz、%、#ZZZ、#绝区零 任选其一',
'便签 - 命令: note、便签、便笺、体力、每日',
'基本信息汇总(角色和邦布) - 命令: card、卡片、个人信息',
'更新抽卡记录(需要逍遥插件支持) - 命令: 刷新抽卡链接、更新抽卡链接、刷新抽卡记录、更新抽卡记录',
'获取抽卡记录链接(需要逍遥插件支持) - 命令: 获取抽卡链接',
'抽卡记录 - 命令: 抽卡分析、抽卡记录',
'角色攻略 - 命令: 角色名称/别名+攻略+(可选)来源数字',
'刷新角色面板 - 命令: 刷新面板、更新面板、面板刷新、面板更新',
'查看角色面板列表 - 命令: 面板、面板列表',
'查看角色面板 - 命令: 角色名/别名+面板',
'仓库地址https://github.com/ZZZure/ZZZ-Plugin',
'GsCore版https://github.com/ZZZure/ZZZeroUID',
].join('\n');
await this.reply(reply_msg);
if (this.e?.isMaster) {
helpData.push({
title: '管理功能',
icon: 'dungeon',
items: [
{
title: '更新',
desc: '更新绝区零插件',
needCK: false,
needSK: false,
commands: ['[插件][强制]更新'],
},
{
title: '下载资源',
desc: '提前下载插件所需资源,查询时无需再次下载',
needCK: false,
needSK: false,
commands: ['下载全部/所有资源'],
},
{
title: '删除资源',
desc: '删除已经下载的资源,查询时需要再次下载(用于删除错误下载缓存)',
needCK: false,
needSK: false,
commands: ['删除全部/所有资源'],
},
],
});
}
await render(this.e, 'help/index.html', {
helpData,
});
}
}

122
resources/help/index.css Normal file
View file

@ -0,0 +1,122 @@
.special-title {
padding: 0;
font-size: 1.2em;
}
.card {
margin: 0 1em;
padding: 1em 0;
}
.card .part {
border-radius: 0.5em;
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(1em);
margin-top: 1.5em;
}
.card .part .title {
font-size: 1.2em;
padding: 0.3em 0.7em;
border-bottom: 1px solid rgba(126, 126, 126, 0.5);
display: flex;
gap: 0.2em;
align-items: flex-end;
color: rgb(234, 225, 213);
box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
background-color: rgba(152, 152, 152, 0.3);
border-radius: 0.5em 0.5em 0 0;
position: relative;
}
.card .part .title .property {
width: 1.8em;
position: absolute;
filter: drop-shadow(0.06em 0.06em 0 rgba(255, 255, 255, 0.5));
left: 0.3em;
}
.card .part .title .content {
flex: 1;
margin-bottom: -0.13em;
filter: drop-shadow(0.06em 0.06em 0 rgba(0, 0, 0, 0.5));
margin-left: 1.6em;
}
.card .part .list {
width: 100%;
overflow: hidden;
padding: 0.6em;
display: grid;
gap: 0.5em;
grid-template-columns: repeat(3, 1fr);
align-items: flex-start;
}
.card .part .list .item {
width: 100%;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 0.4em;
padding: 0.4em 0.7em;
font-size: 0.8em;
display: flex;
flex-direction: column;
gap: 0.3em;
box-shadow: 0 0 0.7em rgba(0, 0, 0, 0.2);
overflow: hidden;
}
.card .part .list .item .name {
width: 100%;
font-size: 1.2em;
display: flex;
overflow: hidden;
align-items: flex-start;
}
.card .part .list .item .name.ck::before {
content: "CK";
margin-top: 0.3em;
margin-right: 0.3em;
font-size: 0.6em;
padding: 0.1em 0.3em;
border-radius: 0.3em;
background-color: rgb(249, 149, 55);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.5);
}
.card .part .list .item .name.sk::before {
content: "SK";
margin-top: 0.3em;
margin-right: 0.3em;
font-size: 0.6em;
padding: 0.1em 0.3em;
border-radius: 0.3em;
background-color: rgb(249, 65, 55);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.5);
}
.card .part .list .item .commands {
display: flex;
flex-wrap: wrap;
gap: 0.3em;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-weight: 500;
font-size: 0.9em;
}
.card .part .list .item .commands .command {
height: 1.6em;
line-height: 1.6em;
padding: 0em 0.5em;
border-radius: 0.5em 0.2em 0.5em 0.2em;
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
color: rgb(255, 186, 96);
box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.6);
border-bottom: 0.1em solid rgba(241, 22, 22, 0.7);
}
.card .part .list .item .commands .command::before {
content: "%";
color: rgba(112, 13, 13, 0.45);
text-shadow: none;
margin-right: 0.1em;
margin-left: -0.2em;
}
.card .part .list .item .desc {
font-size: 1em;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 0.8em;
color: rgb(225, 225, 225);
}
/*# sourceMappingURL=index.css.map */

33
resources/help/index.html Normal file
View file

@ -0,0 +1,33 @@
{{extend defaultLayout}}
{{block 'css'}}
<link rel="stylesheet" href="{{@sys.currentPath}}/index.css">
{{/block}}
{{block 'main'}}
<div class="card">
<% include(sys.specialTitle, {en: 'HELP' , cn: '绝区零帮助' }) %>
{{each helpData help i}}
<div class="part">
<div class="title">
<div class="property {{help.icon}}"></div>
<div class="content">{{help.title}}</div>
</div>
<div class="list">
{{each help.items item j}}
<div class="item">
<div class="name {{item?.needSK ? 'sk' : item?.needCK ? 'ck' : ''}}">{{item.title}}</div>
<div class="commands">
{{each item.commands command k}}
<span class="command">{{command}}</span>
{{/each}}
</div>
<div class="desc">{{item.desc}}</div>
</div>
{{/each}}
</div>
</div>
{{/each}}
</div>
{{/block}}

130
resources/help/index.scss Normal file
View file

@ -0,0 +1,130 @@
.special-title {
padding: 0;
font-size: 1.2em;
}
.card {
margin: 0 1em;
padding: 1em 0;
.part {
border-radius: 0.5em;
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(1em);
margin-top: 1.5em;
// overflow: hidden;
.title {
font-size: 1.2em;
padding: 0.3em 0.7em;
border-bottom: 1px solid rgba(126, 126, 126, 0.5);
display: flex;
gap: 0.2em;
align-items: flex-end;
color: rgb(234, 225, 213);
box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
background-color: rgba(152, 152, 152, 0.3);
border-radius: 0.5em 0.5em 0 0;
position: relative;
.property {
width: 1.8em;
position: absolute;
filter: drop-shadow(0.06em 0.06em 0 rgba(255, 255, 255, 0.5));
left: 0.3em;
}
.content {
flex: 1;
margin-bottom: -0.13em;
// -webkit-text-stroke: 0.05em rgb(13, 63, 90);
filter: drop-shadow(0.06em 0.06em 0 rgba(0, 0, 0, 0.5));
margin-left: 1.6em;
}
}
.list {
width: 100%;
overflow: hidden;
padding: 0.6em;
display: grid;
gap: 0.5em;
grid-template-columns: repeat(3, 1fr);
align-items: flex-start;
.item {
width: 100%;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 0.4em;
padding: 0.4em 0.7em;
font-size: 0.8em;
display: flex;
flex-direction: column;
gap: 0.3em;
box-shadow: 0 0 0.7em rgba(0, 0, 0, 0.2);
overflow: hidden;
.name {
width: 100%;
font-size: 1.2em;
display: flex;
overflow: hidden;
align-items: flex-start;
&.ck {
&::before {
content: 'CK';
margin-top: 0.3em;
margin-right: 0.3em;
font-size: 0.6em;
padding: 0.1em 0.3em;
border-radius: 0.3em;
background-color: rgb(249, 149, 55);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.5);
}
}
&.sk {
&::before {
content: 'SK';
margin-top: 0.3em;
margin-right: 0.3em;
font-size: 0.6em;
padding: 0.1em 0.3em;
border-radius: 0.3em;
background-color: rgb(249, 65, 55);
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.5);
}
}
}
.commands {
display: flex;
flex-wrap: wrap;
gap: 0.3em;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
sans-serif;
font-weight: 500;
font-size: 0.9em;
.command {
height: 1.6em;
line-height: 1.6em;
padding: 0em 0.5em;
border-radius: 0.5em 0.2em 0.5em 0.2em;
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
color: rgb(255, 186, 96);
box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.6);
border-bottom: 0.1em solid rgba(241, 22, 22, 0.7);
// text-shadow: 0.05em 0.05em 0.2em rgba(0, 0, 0, 0.3);
&::before {
content: '%';
color: rgba(112, 13, 13, 0.45);
text-shadow: none;
margin-right: 0.1em;
margin-left: -0.2em;
}
}
}
.desc {
font-size: 1em;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
sans-serif;
font-size: 0.8em;
color: rgb(225, 225, 225);
}
}
}
}
}