mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
自定义面板图自动识别简称、全称路径
This commit is contained in:
parent
35e3cfb4ee
commit
5e669f0afd
2 changed files with 11 additions and 8 deletions
|
|
@ -58,9 +58,9 @@ git clone --depth=1 https://gitee.com/bietiaop/ZZZ-Plugin.git ./plugins/ZZZ-Plug
|
||||||
|
|
||||||
## 自定义面板图
|
## 自定义面板图
|
||||||
|
|
||||||
将你下载的面板图放在`zzz插件目录/resources/images/panel/[角色名简称]/`文件夹下。若文件夹不存在请自行创建。
|
将你下载的面板图放在`zzz插件目录/resources/images/panel/[角色名称]/`文件夹下。若文件夹不存在请自行创建。
|
||||||
|
|
||||||
**角色名简称**请参考官方wiki中代理人名称:[米游社·绝区零 绳网情报站](https://baike.mihoyo.com/zzz/wiki/channel/map/2/43)
|
**角色名称**可以是[米游社绳网情报站](https://baike.mihoyo.com/zzz/wiki/channel/map/2/43)中显示的代理人`简称`或`全称`,也可以是[插件数据PartnerId2Data](resources\map\PartnerId2Data.json)中的`name`或`full_name`。四个路径依序检测,取第一个存在的路径中的面板图
|
||||||
|
|
||||||
若要查看或者批量删除自定义面板图,请发送指令 `%帮助` 进行查看如何使用相关指令。
|
若要查看或者批量删除自定义面板图,请发送指令 `%帮助` 进行查看如何使用相关指令。
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { element } from '../lib/convert.js';
|
import { char, element } from '../lib/convert.js';
|
||||||
import {
|
import {
|
||||||
getRoleImage,
|
getRoleImage,
|
||||||
getSmallSquareAvatar,
|
getSmallSquareAvatar,
|
||||||
|
|
@ -507,12 +507,15 @@ export class ZZZAvatarInfo {
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async get_detail_assets() {
|
async get_detail_assets() {
|
||||||
const custom_panel_images = path.join(
|
const paths = Array.from(new Set([
|
||||||
imageResourcesPath,
|
this.name_mi18n,
|
||||||
`panel/${this.name_mi18n}`
|
this.full_name_mi18n,
|
||||||
);
|
char.IDToCharName(this.id, false),
|
||||||
|
char.IDToCharName(this.id, true)
|
||||||
|
].filter(Boolean))).map(p => path.join(imageResourcesPath, 'panel', p));
|
||||||
let role_icon = '';
|
let role_icon = '';
|
||||||
if (fs.existsSync(custom_panel_images)) {
|
const custom_panel_images = paths.find(p => fs.existsSync(p));
|
||||||
|
if (custom_panel_images) {
|
||||||
const panel_images = fs
|
const panel_images = fs
|
||||||
.readdirSync(custom_panel_images)
|
.readdirSync(custom_panel_images)
|
||||||
.map(file => path.join(custom_panel_images, file));
|
.map(file => path.join(custom_panel_images, file));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue