角色图像增加小清新开关,默认关闭

对自带的部分角色图像进行了更改
修正`#喵喵日历`祈愿时间获取错误的问题
This commit is contained in:
yoimiya-kokomi 2022-06-17 04:19:27 +08:00
parent b393fbcba9
commit cccf21d5bd
41 changed files with 54 additions and 32 deletions

View File

@ -1,4 +1,14 @@
# 1.7.6
# 1.7.7
* 角色图像增加小清新开关,默认关闭
* 对自带的部分角色图像进行了更改
* 对增量包内的角色图像进行分级,较为清凉的图像独立管理
* 安装了增量包的小伙伴请使用`#喵喵更新图像`先获取最新版增量包图像
* 勇士们可使用 `#喵喵设置小清新开启` 启用
* 自行添加的图像请添加到 **resources/character-img/** 的对应角色目录下
* 修正`#喵喵日历`祈愿时间获取错误的问题Again..
# 1.7.5 ~ 1.7.6
* `#角色面板`现在支持B服角色数据获取
* 数据来自喵喵API部分功能尚未完全稳定如有问题请反馈给喵喵
@ -10,7 +20,7 @@
* ACE档的评分档位由>50降低为>49.5 (理论最高分的75%)
* `#圣遗物列表` 根据新版圣遗物评分规则进行词条高亮
# 1.7.1 ~ 1.7.5
# 1.7.1 ~ 1.7.4
* 增加`#原图`命令,可获取喵喵角色卡片原图,感谢 **@牧星长** 提供功能
* 对由`#老婆``#刻晴`发出的角色卡片图回复`#原图`可获取对应图像

View File

@ -13,6 +13,7 @@ let cfgMap = {
"角色": "char.char",
"面板": "char.profile",
"老婆": "char.wife",
"小清新": "char.se",
"查他人": "char.queryOther",
"图鉴": "wiki.wiki",
"图片": "wiki.pic",
@ -89,6 +90,7 @@ export async function sysCfg(e, { render }) {
chars: getStatus("char.char"),
profile: getStatus("char.profile"),
wife: getStatus("char.wife"),
se: getStatus("char.se", false),
other: getStatus("char.queryOther"),
wiki: getStatus("wiki.wiki"),
pic: getStatus("wiki.pic"),

View File

@ -384,7 +384,7 @@ async function renderCard(e, avatar, render, renderType = "card") {
if (!char) {
return false;
}
let bg = char.getCardImg();
let bg = char.getCardImg(Cfg.get("char.se", false));
if (renderType === "photo") {
e.reply(segment.image(process.cwd() + "/plugins/miao-plugin/resources/" + bg.img));
@ -917,7 +917,7 @@ export async function getArtis(e, { render }) {
}
let usefulMark;
let usefulMark;
if (isNewScore) {
let charCfg = Reliquaries2.getCharCfg(name);
usefulMark = charCfg.titleWeight;

View File

@ -3,6 +3,7 @@ import { Character } from "../components/models.js";
import lodash from "lodash";
import Calendar from "../components/Calendar.js";
import Common from "../components/Common.js";
import { Cfg } from "../components/index.js";
let action = {
@ -43,7 +44,7 @@ export async function wiki(e, { render }) {
}
if (mode === "pic") {
let img = char.getCardImg(false);
let img = char.getCardImg(Cfg.get("char.se", false),false);
if (img && img.img) {
e.reply(segment.image(process.cwd() + "/plugins/miao-plugin/resources/" + img.img));
} else {

View File

@ -60,7 +60,7 @@ let Cal = {
let annTime = [];
// 第一种简单格式
let timeRet = /(?:活动时间)?(?:〓|\s)*([0-9\\/\\: ~]*)/.exec(content);
let timeRet = /(?:活动时间)?(?:〓|\s)*([0-9\\/\\: ~]+)/.exec(content);
if (timeRet && timeRet[1]) {
annTime = timeRet[1].split("~");
} else if (/\d\.\d版本更新后/.test(content)) {

View File

@ -28,40 +28,41 @@ class Character extends Base {
}
}
getCardImg(def = true) {
getCardImg(se = false, def = true) {
let name = this.name;
const charImgPath = `./plugins/miao-plugin/resources/character-img/${name}/`;
if (!fs.existsSync(charImgPath)) {
fs.mkdirSync(charImgPath);
let list = [];
let addImg = function (charImgPath, disable = false) {
let dirPath = `./plugins/miao-plugin/resources/${charImgPath}`;
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
if (disable) {
return
}
let imgs = fs.readdirSync(dirPath);
imgs = imgs.filter((img) => /\.(png|jpg|webp|jpeg)/i.test(img));
lodash.forEach(imgs, (img) => {
list.push(`${charImgPath}/${img}`);
});
}
let list = {};
let imgs = fs.readdirSync(charImgPath);
imgs = imgs.filter((img) => /\.(png|jpg|webp|jpeg)/i.test(img));
lodash.forEach(imgs, (img) => {
list[img] = `character-img/${name}/${img}`
});
addImg(`character-img/${name}`);
addImg(`character-img/${name}/se`, !se)
const plusPath = `./plugins/miao-plugin/resources/miao-res-plus/`;
if (fs.existsSync(plusPath)) {
const charImgPlusPath = `${plusPath}/character-img/${name}/`;
if (!fs.existsSync(charImgPlusPath)) {
fs.mkdirSync(charImgPlusPath);
}
imgs = fs.readdirSync(charImgPlusPath);
imgs = imgs.filter((img) => /\.(png|jpg|webp|jpeg)/i.test(img));
lodash.forEach(imgs, (img) => {
list[img] = `miao-res-plus/character-img/${name}/${img}`
});
addImg(`miao-res-plus/character-img/${name}`);
addImg(`miao-res-plus/character-img/${name}/se`, !se);
}
let img = lodash.sample(lodash.values(list));
let img = lodash.sample(list);
if (!img) {
if (def) {

View File

@ -82,6 +82,14 @@
</div>
<div class="cfg-desc">角色图片的扩展包,包含更多的角色图片</div>
</li>
<li class="cfg-li">
<div class="cfg-line">
小清新角色图
<span class="cfg-hint"> #喵喵设置小清新 + 开启/关闭</span>
{{@se}}
</div>
<div class="cfg-desc">启用后会启用角色图及增量包中的小清新图像,勇士啊,你准备好了吗</div>
</li>
</ul>
</div>
<div class="cfg-box">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

After

Width:  |  Height:  |  Size: 780 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 490 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 KiB

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 399 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 627 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 471 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 271 KiB

View File

@ -65,7 +65,6 @@ body {
}
.log-cont .new:before {
content: "NEW";
font-family: Number;
display: inline-block;
transform: scale(0.6);
transform-origin: 0 0;

View File

@ -85,7 +85,6 @@ body {
.new:before {
content: "NEW";
font-family: Number;
display: inline-block;
transform: scale(0.6);
transform-origin: 0 0;

View File

@ -83,6 +83,7 @@ body {
.cal-list {
position: relative;
padding-top: 80px;
overflow: hidden;
}
.cal-list .cal-item {
margin-bottom: 15px;

View File

@ -106,6 +106,7 @@ body {
.cal-list {
position: relative;
padding-top: 80px;
overflow: hidden;
.cal-item {