fix: 全局提示最大数量

This commit is contained in:
unanmed 2024-04-23 22:38:54 +08:00
parent 3af1050525
commit 6202dbce62
2 changed files with 7 additions and 1 deletions

View File

@ -230,6 +230,9 @@ export function type(
return content;
}
message.config({
maxCount: 3
});
export function tip(
type: Exclude<keyof MessageApi, 'open' | 'config' | 'destroy'>,
text: string

View File

@ -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;
}