From 054f84ff7ddfb248d934addb96f5388ee01cc548 Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Thu, 28 Apr 2022 03:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 +++++++--- components/Changelog.js | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4189b973..d4077bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ # 1.2.1 + * `#角色面板` 增加伤害计算功能 - * 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子 - * 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 - * 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 + * 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子 # 1.2.0 + +* `#角色面板` 增加伤害计算功能 + * 目前支持角色:雷神、胡桃、魈、神子、甘雨 + * 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 + * 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 * `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制 * 增加 `#喵喵更新` 功能 * 感谢 @碎月 @清秋 的代码支持 diff --git a/components/Changelog.js b/components/Changelog.js index f2005485..7789564d 100644 --- a/components/Changelog.js +++ b/components/Changelog.js @@ -7,26 +7,35 @@ const _logPath = `${_path}/plugins/miao-plugin/CHANGELOG.md`; let logs = {}; let changelogs = []; let currentVersion; -let isNew = 1; +let versionCount = 2; try { if (fs.existsSync(_logPath)) { logs = fs.readFileSync(_logPath, "utf8") || ""; logs = logs.split("\n"); lodash.forEach(logs, (line) => { - if (isNew === -1) { + if (versionCount === -1) { return false; } let versionRet = /^#\s*([0-9\\.]+)\s*$/.exec(line); if (versionRet && versionRet[1]) { let v = versionRet[1]; + + if (!currentVersion) { currentVersion = v; } - isNew--; + versionCount--; + versionCount === 0 && changelogs.push(" "); + versionCount > -1 && changelogs.push(`【 版本: ${v} 】`) + return; } - if (isNew > -1) { - changelogs.push(line); + if (versionCount > -1) { + line = line.trim(); + line = line.replace(/`/g, ""); + if (line) { + changelogs.push(line); + } } }); }