From 76d90792bb28633f39bb57f9817b1c42a3397fa4 Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Tue, 7 Nov 2023 03:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8E=9F=E7=A5=9E4.2?= =?UTF-8?q?=E6=96=B0=E8=A7=92=E8=89=B2=E6=95=B0=E6=8D=AE=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Common.js | 11 +++++- components/common/Render.js | 5 ++- models/Character.js | 7 ++-- resources/character/artis-mark.css | 1 - resources/character/artis-mark.html | 3 ++ resources/character/artis-mark.less | 1 - resources/meta-gs/artifact/artis-mark.js | 1 + resources/meta-gs/character/data.json | 15 ++++++-- .../meta-gs/character/夏洛蒂/data.json | 16 +++++---- resources/meta-gs/character/安柏/data.json | 3 +- .../character/安柏/icons/cons-1.webp | Bin 12712 -> 12994 bytes .../character/安柏/icons/cons-2.webp | Bin 11800 -> 12208 bytes .../character/安柏/icons/cons-3.webp | Bin 8962 -> 9402 bytes .../character/安柏/icons/cons-4.webp | Bin 8058 -> 8560 bytes .../character/安柏/icons/cons-5.webp | Bin 13116 -> 13492 bytes .../character/安柏/icons/cons-6.webp | Bin 9202 -> 9450 bytes .../meta-gs/character/芙宁娜/data.json | 34 ++++++++++-------- .../character/芙宁娜/icons/cons-3.webp | Bin 14412 -> 13256 bytes .../character/芙宁娜/icons/cons-5.webp | Bin 11986 -> 12970 bytes resources/meta-gs/material/abbr.js | 2 ++ resources/meta-gs/material/data.json | 12 +++++++ .../meta-gs/material/weekly/无光丝线.webp | Bin 0 -> 23669 bytes .../meta-gs/material/weekly/无光质块.webp | Bin 0 -> 22707 bytes .../meta-gs/material/weekly/???.webp | Bin 122 -> 0 bytes resources/meta-sr/character/index.js | 17 +++++++++ resources/wiki/character-talent.html | 14 ++++---- 26 files changed, 101 insertions(+), 41 deletions(-) create mode 100644 resources/meta-gs/material/weekly/无光丝线.webp create mode 100644 resources/meta-gs/material/weekly/无光质块.webp delete mode 100644 resources/meta-gs/material/weekly/???.webp diff --git a/components/Common.js b/components/Common.js index 23efc80c..a9f9ec91 100644 --- a/components/Common.js +++ b/components/Common.js @@ -2,7 +2,16 @@ import Cfg from './Cfg.js' import Render from './common/Render.js' const Common = { - render: Render.render, + render: async function (arg1, arg2, arg3, arg4) { + if (arguments.length === 4 && typeof (arguments[1]) === 'string') { + return Render.render(arg2, arg3, { + ...arg4, + plugin: arg1 + }) + } else { + return Render.render(arg1, arg2, arg3) + } + }, cfg: Cfg.get, sleep (ms) { return new Promise((resolve) => setTimeout(resolve, ms)) diff --git a/components/common/Render.js b/components/common/Render.js index 3171602c..f95a2be7 100644 --- a/components/common/Render.js +++ b/components/common/Render.js @@ -6,7 +6,7 @@ const Render = { if (!e.runtime) { console.log('未找到e.runtime,请升级至最新版Yunzai') } - return e.runtime.render('miao-plugin', path, params, { + return e.runtime.render(cfg.plugin || 'miao-plugin', path, params, { retType: cfg.retMsgId ? 'msgId' : 'default', beforeRender ({ data }) { let pluginName = '' @@ -21,7 +21,6 @@ const Render = { return { ...data, _res_path: resPath, - _miao_path: resPath, _layout_path: layoutPath, _tpl_path: process.cwd() + '/plugins/miao-plugin/resources/common/tpl/', defaultLayout: layoutPath + 'default.html', @@ -39,4 +38,4 @@ const Render = { } } -export default Render \ No newline at end of file +export default Render diff --git a/models/Character.js b/models/Character.js index 01e2bffd..d2fec48f 100644 --- a/models/Character.js +++ b/models/Character.js @@ -33,7 +33,7 @@ class Character extends Base { this.game = game if (!this.isCustom) { let meta = Meta.getData(game, 'char', name) - this.meta = meta + this.meta = meta || {} if (this.isGs) { this.elem = Format.elem(elem || meta.elem, 'anemo') } @@ -246,7 +246,7 @@ class Character extends Base { // 检查老婆类型 checkWifeType (type) { - let { wifeData } = Meta.getMeta(this.game, 'char') + let { wifeData } = Meta.getMeta('gs', 'char') let key = ['girlfriend', 'boyfriend', 'daughter', 'son'][type] || 'girlfriend' return !!wifeData[key]?.[this.id] } @@ -290,7 +290,7 @@ class Character extends Base { // 基于角色名获取Character // 获取详情数据 - getDetail (elem = '') { + getDetail () { if (this.meta?._detail) { return this.meta._detail } @@ -299,6 +299,7 @@ class Character extends Base { } try { let name = this.isTraveler ? `旅行者/${this.elem}` : this.name + this.meta = this.meta || {} this.meta._detail = Data.readJSON(`resources/meta-${this.game}/character/${name}/data.json`, 'miao') } catch (e) { console.log(e) diff --git a/resources/character/artis-mark.css b/resources/character/artis-mark.css index a1b3d7f4..9fde6a55 100644 --- a/resources/character/artis-mark.css +++ b/resources/character/artis-mark.css @@ -29,7 +29,6 @@ body, height: 35px; line-height: 35px; vertical-align: middle; - width: 16%; } .mark-table .thead > div.th { width: 20%; diff --git a/resources/character/artis-mark.html b/resources/character/artis-mark.html index dbdfcd5d..aa52165c 100644 --- a/resources/character/artis-mark.html +++ b/resources/character/artis-mark.html @@ -200,6 +200,9 @@
{{charCfg.posMaxMark.m3}}
{{charCfg.posMaxMark.m4}}
{{charCfg.posMaxMark.m5}}
+ {{if game === 'sr'}} +
{{charCfg.posMaxMark.m6}}
+ {{/if}}