mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 20:59:37 +08:00
fix: 全局提示最大数量
This commit is contained in:
parent
3af1050525
commit
6202dbce62
@ -230,6 +230,9 @@ export function type(
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message.config({
|
||||||
|
maxCount: 3
|
||||||
|
});
|
||||||
export function tip(
|
export function tip(
|
||||||
type: Exclude<keyof MessageApi, 'open' | 'config' | 'destroy'>,
|
type: Exclude<keyof MessageApi, 'open' | 'config' | 'destroy'>,
|
||||||
text: string
|
text: string
|
||||||
|
@ -259,6 +259,10 @@ function send() {
|
|||||||
tip('warning', '请进入游戏后再发送弹幕');
|
tip('warning', '请进入游戏后再发送弹幕');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (calStringSize(danmaku.text) > 200) {
|
||||||
|
tip('warning', '弹幕长度超限!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { x, y } = core.status.hero.loc;
|
const { x, y } = core.status.hero.loc;
|
||||||
const floor = core.status.floorId;
|
const floor = core.status.floorId;
|
||||||
if (isNil(x) || isNil(y) || isNil(floor)) {
|
if (isNil(x) || isNil(y) || isNil(floor)) {
|
||||||
@ -297,7 +301,6 @@ function input(value: string) {
|
|||||||
const size = calStringSize(value);
|
const size = calStringSize(value);
|
||||||
if (size > 200) {
|
if (size > 200) {
|
||||||
tip('warning', '弹幕长度超限!');
|
tip('warning', '弹幕长度超限!');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
danmaku.text = value;
|
danmaku.text = value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user