令武将默认图片可变

This commit is contained in:
kuangthree 2024-01-04 22:06:21 +08:00
parent a162629269
commit f2272634a6
3 changed files with 5 additions and 3 deletions

View File

@ -161,8 +161,8 @@ Reflect.defineProperty(HTMLDivElement.prototype, 'setBackground', {
const sex = nameinfo ? nameinfo[0] : 'male';
this.style.backgroundImage = [
this.style.backgroundImage,
`url("${lib.assetURL}image/character/default_silhouette_${sex}${ext}")`,
`url("${lib.assetURL}image/character/default_silhouette_male${ext}")`,
`url("${lib.assetURL}${lib.characterDefaultPicturePath}${sex}${ext}")`,
`url("${lib.assetURL}${lib.characterDefaultPicturePath}male${ext}")`,
].join(",");
}
return this;

View File

@ -8,7 +8,7 @@
* @typedef { InstanceType<typeof lib.element.GameEvent> & InstanceType<typeof lib.element.GameEventPromise> & typeof Promise<typeof lib.element.GameEvent> } GameEventPromise
* @typedef { InstanceType<typeof lib.element.NodeWS> } NodeWS
*/
import { nonameInitialized, assetURL, userAgent, Uninstantable, GeneratorFunction, AsyncFunction } from "../util/index.js";
import { nonameInitialized, assetURL, userAgent, Uninstantable, GeneratorFunction, AsyncFunction, characterDefaultPicturePath } from "../util/index.js";
import { AI as ai } from '../ai/index.js';
import { Get as get } from '../get/index.js';
import { Game as game } from '../game/index.js';
@ -35,6 +35,7 @@ export class Library extends Uninstantable {
static hallURL = '47.99.105.222';
static assetURL = assetURL;
static userAgent = userAgent;
static characterDefaultPicturePath = characterDefaultPicturePath;
static compatibleEdition = Boolean(typeof nonameInitialized == 'string' && nonameInitialized.match(/\/(?:com\.widget|yuri\.nakamura)\.noname\//));
static changeLog = [];
static updates = [];

View File

@ -3,6 +3,7 @@ export const assetURL = typeof nonameInitialized != 'string' || nonameInitialize
export const GeneratorFunction = (function* () { }).constructor;
export const AsyncFunction = (async function () { }).constructor;
export const userAgent = navigator.userAgent.toLowerCase();
export const characterDefaultPicturePath = "image/character/default_silhouette_";
// 我靠循环引用问题在这?
// export * as config from './config.js'