From 6202dbce62057994da9c8149a5a84ee577673d45 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 23 Apr 2024 22:38:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=80=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/utils.ts | 3 +++ src/ui/danmakuEditor.vue | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugin/utils.ts b/src/plugin/utils.ts index fb93cff..bc546df 100644 --- a/src/plugin/utils.ts +++ b/src/plugin/utils.ts @@ -230,6 +230,9 @@ export function type( return content; } +message.config({ + maxCount: 3 +}); export function tip( type: Exclude, text: string diff --git a/src/ui/danmakuEditor.vue b/src/ui/danmakuEditor.vue index b431ca0..a22715f 100644 --- a/src/ui/danmakuEditor.vue +++ b/src/ui/danmakuEditor.vue @@ -259,6 +259,10 @@ function send() { tip('warning', '请进入游戏后再发送弹幕'); return; } + if (calStringSize(danmaku.text) > 200) { + tip('warning', '弹幕长度超限!'); + return; + } const { x, y } = core.status.hero.loc; const floor = core.status.floorId; if (isNil(x) || isNil(y) || isNil(floor)) { @@ -297,7 +301,6 @@ function input(value: string) { const size = calStringSize(value); if (size > 200) { tip('warning', '弹幕长度超限!'); - return; } danmaku.text = value; }