From 6ecf201beb2de73758e555bdaa4189a12327e169 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 20 Jun 2023 11:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=81=E5=85=AD=E8=BF=9B?= =?UTF-8?q?=E5=88=B6=E9=A2=9C=E8=89=B2=E4=B8=8D=E5=85=BC=E5=AE=B9=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mota.config.ts | 2 -- src/plugin/shadow/gameShadow.ts | 13 +++++++------ src/plugin/utils.ts | 5 +++++ src/types/util.d.ts | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) 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'; /** * 四个方向