2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

图鉴设置增加显示

This commit is contained in:
Ctrlcvs 2022-10-31 14:14:45 +08:00
parent 42c817ff52
commit 31eee4c8ca
3 changed files with 31 additions and 12 deletions

View File

@ -412,7 +412,11 @@ export async function Note_appoint(e) {
let type = 0;
if (msg.includes("列表")) {
let isUser= msg.includes('我的')
let temp =tempData[e.user_id]["temp"];
let temp =tempData[e.user_id]?.temp;
if(!temp&&isUser){
e.reply("未获取到您设置的模板信息哦~")
return true;
}
let xlmsg = msg.replace(/列表|我的/g, "") * 1 || 1
let listLength=isUser?temp.length:keyType.length
let sumCount = (listLength / 80 + 0.49).toFixed(0);
@ -501,12 +505,13 @@ const note_file = function(xiaoyao) {
let url2 = `./plugins/xiaoyao-cvs-plugin/resources/BJT-Templet/` //冤种情况。。
let url3 = `./plugins/xiaoyao-cvs-plugin/resources/dailyNote/background_image/`
var urlFile = fs.readdirSync(url1);
var bJTurlFile = fs.readdirSync(url2);
var urlType = {};
for (let val of urlFile) {
if (val.includes(".")) continue;
urlType[val] = url1 + val
}
if (fs.existsSync(url2)) {
var bJTurlFile = fs.readdirSync(url2);
for (let val of bJTurlFile) {
if (!val.includes("Template")) continue;
let file = fs.readdirSync(`${url2}${val}`);
@ -515,11 +520,12 @@ const note_file = function(xiaoyao) {
urlType[va] = url2 + val + "/" + va
}
}
}
if (!xiaoyao) {
var urlFileOne = fs.readdirSync(url3);
for (let val of urlFileOne) {
if (!val.includes(".")) continue;
urlType[val] = url3 + "background_image/" + val
urlType[val] = url3 + val
}
}
return urlType;

View File

@ -53,7 +53,7 @@ export const rule = {
const _path = process.cwd();
const resPath = `${_path}/plugins/xiaoyao-cvs-plugin/resources/`;
const plusPath = `${resPath}/xiaoyao-plus/`;
const notePlus=`${resPath}/BJT-Templet/`;
export async function sysCfg(e, {
render
}) {
@ -94,6 +94,7 @@ export async function sysCfg(e, {
len:Cfg.get("mb.len", 0),
poke: getStatus("note.poke",false),
imgPlus: fs.existsSync(plusPath),
notePlus: fs.existsSync(notePlus),
bg: await rodom(), //获取底图
Atlasall:getStatus("Atlas.all",false),
}

View File

@ -72,7 +72,7 @@
</ul>
</div>
<div class="cfg-box">
<div class="cfg-group">角色资料与信息查询</div>
<div class="cfg-group">图鉴扩展包</div>
<ul class="cfg-ul">
<li class="cfg-li">
<div class="cfg-line">
@ -86,6 +86,18 @@
</div>
<div class="cfg-desc">角色图片的扩展包,包含更多的角色图片</div>
</li>
<li class="cfg-li">
<div class="cfg-line">
体力模板扩展包
<span class="cfg-hint"> #图鉴模板更新</span>
{{if notePlus}}
<div class="cfg-status">已安装</div>
{{else}}
<div class="cfg-status status-off">未安装</div>
{{/if}}
</div>
<div class="cfg-desc">体力模板的扩展包,包含更多的体力模板</div>
</li>
</ul>
</div>
<div class="cfg-box">