diff --git a/mota.config.ts b/mota.config.ts index fdfa1a1..1f6285e 100644 --- a/mota.config.ts +++ b/mota.config.ts @@ -1,7 +1,5 @@ interface MotaConfig { name: string; - /** 资源分组打包信息 */ - resourceZip?: string[][]; resourceName?: string; } diff --git a/src/plugin/shadow/gameShadow.ts b/src/plugin/shadow/gameShadow.ts index 8c81c53..9aa9149 100644 --- a/src/plugin/shadow/gameShadow.ts +++ b/src/plugin/shadow/gameShadow.ts @@ -12,6 +12,7 @@ import { setLightList, setShadowNodes } from './shadow'; +import { pColor } from '../utils'; export default function init() { const origin4 = control.prototype.drawHero; @@ -39,7 +40,7 @@ const shadowInfo: Partial> = { y: 144, decay: 20, r: 150, - color: '#e953', + color: pColor('#e953'), noShelter: true }, { @@ -48,7 +49,7 @@ const shadowInfo: Partial> = { y: 144, decay: 20, r: 150, - color: '#e953', + color: pColor('#e953'), noShelter: true }, { @@ -57,7 +58,7 @@ const shadowInfo: Partial> = { y: 336, decay: 20, r: 150, - color: '#e953', + color: pColor('#e953'), noShelter: true }, { @@ -66,13 +67,13 @@ const shadowInfo: Partial> = { y: 336, decay: 20, r: 150, - color: '#e953', + color: pColor('#e953'), noShelter: true } ] }; const backgroundInfo: Partial> = { - MT50: '#0006' + MT50: pColor('#0006') }; const blurInfo: Partial> = {}; const immersionInfo: Partial> = {}; @@ -86,7 +87,7 @@ export function updateShadow(nocache: boolean = false) { if (!shadowInfo[floor] || !backgroundInfo[floor]) { removeAllLights(); setShadowNodes([]); - setBackground('#0000'); + setBackground('transparent'); return; } const f = core.status.thisMap; diff --git a/src/plugin/utils.ts b/src/plugin/utils.ts index 1efc3bf..dd953fc 100644 --- a/src/plugin/utils.ts +++ b/src/plugin/utils.ts @@ -6,6 +6,7 @@ import { ComputedRef, ref } from 'vue'; import { EVENT_KEY_CODE_MAP } from './keyCodes'; import axios from 'axios'; import { decompressFromBase64 } from 'lz-string'; +import { parseColor } from './webgl/utils'; type CanParseCss = keyof { [P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string @@ -258,3 +259,7 @@ export function ensureArray(arr: T): T extends any[] ? T : T[] { // @ts-ignore return arr instanceof Array ? arr : [arr]; } + +export function pColor(color: string) { + return core.arrayToRGBA(parseColor(color)); +} diff --git a/src/types/util.d.ts b/src/types/util.d.ts index 776785b..e22fc68 100644 --- a/src/types/util.d.ts +++ b/src/types/util.d.ts @@ -563,7 +563,7 @@ type RGBArray = [number, number, number, number?]; /** * 样板的颜色字符串 */ -type Color = `#${string}` | _RGBA | RGBArray; +type Color = `#${string}` | _RGBA | RGBArray | 'transparent'; /** * 四个方向