mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
fix: 全局提示最大数量
This commit is contained in:
parent
3af1050525
commit
6202dbce62
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user