From 38158844737edb2dddfc1e97e58c713928d898a3 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Tue, 27 Sep 2022 10:25:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/profile-detail.js | 5 ++++ apps/help/theme.js | 2 +- config/help_default.js | 37 +++++++++++++++---------- config/system/help_system.js | 1 - resources/character/profile-detail.css | 3 -- resources/character/profile-detail.less | 2 +- resources/common/common.css | 1 - resources/common/common.less | 2 +- resources/help/index.html | 4 ++- resources/help/theme/目录说明.txt | 19 +++++++------ resources/meta/character/多莉/calc.js | 5 +--- 11 files changed, 46 insertions(+), 35 deletions(-) diff --git a/apps/character/profile-detail.js b/apps/character/profile-detail.js index ba8c98dd..b6a6ee36 100644 --- a/apps/character/profile-detail.js +++ b/apps/character/profile-detail.js @@ -6,6 +6,11 @@ import { MysApi, Avatar } from '../../models/index.js' export async function renderProfile (e, char, mode = 'profile', params = {}) { let selfUser = await MysApi.initUser(e) + if (!selfUser) { + e.reply('尚未绑定UID') + return true + } + let { uid } = e if (char.isCustom) { diff --git a/apps/help/theme.js b/apps/help/theme.js index c32bdac9..5c54418b 100644 --- a/apps/help/theme.js +++ b/apps/help/theme.js @@ -55,7 +55,7 @@ let Theme = { css('.help-title,.help-group', 'text-shadow', 'fontShadow', 'none') css('.help-desc', 'color', 'descColor', '#eee') css('.cont-box', 'background', 'contBgColor', 'rgba(43, 52, 61, 0.8)') - css('.cont-box', 'backdrop-filter', 'contBgBlur', 3, (n) => `blur(${n}px)`) + css('.cont-box', 'backdrop-filter', 'contBgBlur', 3, (n) => diyStyle.bgBlur === false ? 'none' : `blur(${n}px)`) css('.help-group', 'background', 'headerBgColor', 'rgba(34, 41, 51, .4)') css('.help-table .tr:nth-child(odd)', 'background', 'rowBgColor1', 'rgba(34, 41, 51, .2)') css('.help-table .tr:nth-child(even)', 'background', 'rowBgColor2', 'rgba(34, 41, 51, .4)') diff --git a/config/help_default.js b/config/help_default.js index b0b5d7cd..eb80d1d2 100644 --- a/config/help_default.js +++ b/config/help_default.js @@ -1,6 +1,6 @@ /* -* 请注意!!!! -* 【请勿直接修改此文件,可能会导致后续更新冲突】 +* 请注意,系统不会读取help_default.js !!!! +* 【请勿直接修改此文件,且可能导致后续冲突】 * * 如需自定义可将文件【复制】一份,并重命名为 help.js * @@ -10,23 +10,32 @@ export const helpCfg = { // 帮助标题 title: '喵喵帮助', + // 帮助副标题 subTitle: 'Yunzai-Bot & Miao-Plugin', - // 帮助表格列数,可选:2-5 - // 注意:设置列数过多可能导致阅读困难,请参考实际效果设置 + + // 帮助表格列数,可选:2-5,默认3 + // 注意:设置列数过多可能导致阅读困难,请参考实际效果进行设置 colCount: 3, - // 单列宽度,默认265,过窄可能导致较多换行,请根据实际配置项长度设定 + + // 单列宽度,默认265 + // 注意:过窄可能导致文字有较多换行,请根据实际帮助项设定 colWidth: 265, - /* 皮肤选择,可多选,或设置为all - 皮肤包放置于 resources/help/theme - 皮肤名为对应文件夹名 - theme: 'all', // 设置为全部皮肤 - theme: ['default','theme2'], // 设置为指定皮肤 - */ + + // 皮肤选择,可多选,或设置为all + // 皮肤包放置于 resources/help/theme + // 皮肤名为对应文件夹名 + // theme: 'all', // 设置为全部皮肤 + // theme: ['default','theme2'], // 设置为指定皮肤 theme: 'all', - // 排除皮肤:使用全部皮肤时会忽略该项设置的皮肤 - // 如使用其他皮肤时仍希望随机default皮肤可删除default - themeExclude: ['default'] + + // 排除皮肤:在存在其他皮肤时会忽略该项内设置的皮肤 + // 默认忽略default:即存在其他皮肤时会忽略自带的default皮肤 + // 如希望default皮肤也加入随机池可删除default项 + themeExclude: ['default'], + + // 是否启用背景毛玻璃效果,若渲染遇到问题可设置为false关闭 + bgBlur: true } // 帮助菜单内容 diff --git a/config/system/help_system.js b/config/system/help_system.js index 17f501fd..a60333ab 100644 --- a/config/system/help_system.js +++ b/config/system/help_system.js @@ -11,7 +11,6 @@ export const helpCfg = { columnCount: 3, colWidth: 265, theme: 'all', - // 排除皮肤,在theme设置为all时会忽略此设置项中的皮肤 themeExclude: ['default'], style: { fontColor: '#ceb78b', diff --git a/resources/character/profile-detail.css b/resources/character/profile-detail.css index 0e1c351a..9282e262 100644 --- a/resources/character/profile-detail.css +++ b/resources/character/profile-detail.css @@ -65,9 +65,6 @@ body { border-radius: 4px; overflow: hidden; } -.detail ul.attr { - backdrop-filter: blur(4px); -} .detail ul.attr li { width: 300px; font-size: 17px; diff --git a/resources/character/profile-detail.less b/resources/character/profile-detail.less index f5b340e5..6e989d1e 100644 --- a/resources/character/profile-detail.less +++ b/resources/character/profile-detail.less @@ -73,7 +73,7 @@ body { } .detail ul.attr { - backdrop-filter: blur(4px); + // backdrop-filter: blur(4px); li { width: 300px; diff --git a/resources/common/common.css b/resources/common/common.css index 57b3c80d..c3a191a8 100644 --- a/resources/common/common.css +++ b/resources/common/common.css @@ -259,7 +259,6 @@ body { border-radius: 10px; background: url("../common/cont/card-bg.png") top left repeat-x; background-size: auto 100%; - backdrop-filter: blur(3px); margin: 5px 15px 5px 10px; position: relative; box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, 0.8); diff --git a/resources/common/common.less b/resources/common/common.less index a3a43d34..85fad951 100644 --- a/resources/common/common.less +++ b/resources/common/common.less @@ -183,7 +183,7 @@ each(@elems, { border-radius: 10px; background: url("../common/cont/card-bg.png") top left repeat-x; background-size: auto 100%; - backdrop-filter: blur(3px); + // backdrop-filter: blur(3px); margin: 5px 15px 5px 10px; position: relative; box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, .8); diff --git a/resources/help/index.html b/resources/help/index.html index 5a638c7d..cac6d03f 100644 --- a/resources/help/index.html +++ b/resources/help/index.html @@ -16,11 +16,12 @@ {{each helpGroup group}} +{{set len = group?.list?.length || 0 }}
{{group.group}}
+ {{if len > 0}}
- {{set len = group.list.length }} {{each group.list help idx}}
@@ -37,6 +38,7 @@ <% } %>
+ {{/if}}
{{/each}} {{/block}} \ No newline at end of file diff --git a/resources/help/theme/目录说明.txt b/resources/help/theme/目录说明.txt index 23b2006e..a65c3df1 100644 --- a/resources/help/theme/目录说明.txt +++ b/resources/help/theme/目录说明.txt @@ -1,21 +1,24 @@ 【default皮肤】 default为默认皮肤,不建议改动,防止后续更新冲突 -如不想使用default可创建其他皮肤 +如不想使用default可创建或下载其他皮肤,存在其他皮肤时会默认忽略default皮肤 【增加自定义皮肤】 -可创建或下载皮肤包,放置在当前目录下,文件夹的名称为皮肤包的名称 +可创建或下载皮肤包,放置在当前目录(theme)下,皮肤名称为皮肤文件夹名字 -皮肤包中包含的文件: +皮肤包内应包含的文件: main.png:主图,高度自适应 -bg.jpg:背景图,如果main.png图片不够高的话则会使用bg.jpg进行填充 -config.js 颜色配置,可选。如无此文件会使用默认配置,如需自定义具体字段可参考default/config.js +bg.jpg:背景图,如果main.png图片不够高或存在透明的话则会使用bg.jpg作为背景进行填充 +config.js:当前皮肤元素的颜色、透明度等配置,可选。如无此文件会使用默认配置,如需自定义,可参考default/config.js 【皮肤选择】 -默认为随机皮肤,如需指定可到config/help.js中,设置theme的选项 +默认为随机皮肤,如需指定固定某个皮肤可到config/help.js中,设置theme的字段选项 -在有其他可选项时,会默认忽略default皮肤 -如在设置all时也包含default,可修改config/help.js,将themeExclude中的default删掉 +在有其他皮肤时,会默认忽略自带的default皮肤 +如希望default皮肤也出现在随机中,可修改config/help.js,将themeExclude中配置的default项删掉 +如需临时增加其他皮肤屏蔽,也可以追加至themeExclude中(当然也可以直接删掉对应皮肤) + +新增皮肤或修改配置后无需重启,可直接生效 diff --git a/resources/meta/character/多莉/calc.js b/resources/meta/character/多莉/calc.js index 863e6af4..82fed4c4 100644 --- a/resources/meta/character/多莉/calc.js +++ b/resources/meta/character/多莉/calc.js @@ -5,10 +5,7 @@ export const details = [{ title: 'Q每跳恢复生命', dmg: ({ talent, calc, attr }, { heal - }) => { - console.log(talent.q) - return heal(talent.q['持续治疗量2'][0] * calc(attr.hp) / 100 + talent.q['持续治疗量2'][1] * 1) - } + }) => heal(talent.q['持续治疗量2'][0] * calc(attr.hp) / 100 + talent.q['持续治疗量2'][1] * 1) }] export const mainAttr = 'atk,hp,cpct,cdmg'