fix:修改弹幕相关的若干小bug
This commit is contained in:
parent
8f3dc23cd1
commit
b1086f5218
@ -602,34 +602,54 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
|
||||
"canUseItemEffect": "true",
|
||||
"useItemEvent": [
|
||||
{
|
||||
"type": "choices",
|
||||
"text": "本功能需要您在h5mota.com在线游玩并处于登录状态时使用,可以发送和接受留言。\n发言后需要选择\"获取最新留言\"才能看到自己新发的留言。\n您当前\"在地图上显示在线留言\"功能处于${flag:comment?'打开状态':'关闭状态,在设置中可打开。'}",
|
||||
"choices": [
|
||||
"type": "while",
|
||||
"condition": "true",
|
||||
"data": [
|
||||
{
|
||||
"text": "获取最新留言",
|
||||
"action": [
|
||||
"type": "choices",
|
||||
"text": "本功能需要您在h5mota.com在线游玩并处于登录状态时使用,可以发送和接受留言。\n发言后需要选择\"获取最新留言\"才能看到自己新发的留言。",
|
||||
"choices": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nif (!core.isReplaying()) {\n\tcore.plugin.getComment();\n\tsetTimeout(core.plugin.drawCommentSign, 1000);\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "写留言",
|
||||
"action": [
|
||||
{
|
||||
"type": "input2",
|
||||
"text": "请输入要发送的评论,文明友善发言,拒绝放假、剧透。"
|
||||
"text": "地图上显示在线留言:${flag:comment?'开':'关'}",
|
||||
"icon": "postman",
|
||||
"action": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nif (core.hasFlag('comment')) {\n\tcore.setFlag('comment', false);\n\tcore.plugin.clearCommentSign();\n} else {\n\tcore.setFlag('comment', true);\n\tcore.plugin.drawCommentSign();\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nconst input = core.getFlag('input', '');\nconst tags = [core.status.floorId,\n\tcore.getHeroLoc().x.toString(), core.getHeroLoc().y.toString()\n]\nif (!core.isReplaying()) {\n\tcore.plugin.postComment(input, tags);\n}\n}"
|
||||
"text": "写留言",
|
||||
"action": [
|
||||
{
|
||||
"type": "input2",
|
||||
"text": "请输入要发送的评论,文明友善发言,拒绝放假、剧透。"
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nconst input = core.getFlag('input', '');\nconst tags = [core.status.floorId,\n\tcore.getHeroLoc().x.toString(), core.getHeroLoc().y.toString()\n]\nif (!core.isReplaying()) {\n\tcore.plugin.postComment(input, tags);\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "获取最新留言",
|
||||
"action": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nif (!core.isReplaying()) {\n\tcore.plugin.getComment();\n\tsetTimeout(core.plugin.drawCommentSign, 1000);\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "退出",
|
||||
"action": [
|
||||
{
|
||||
"type": "exit"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "退出",
|
||||
"action": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -2399,10 +2399,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
ani.ticker.add(() => {
|
||||
core.fillText(ctxName, content, x + ani.x, y, 'white', '16px Verdana');
|
||||
})
|
||||
// 弹幕的最大长度5600,再长属于异常数据
|
||||
const aim = 600 + Math.min(core.calWidth(ctxName, content, '16px Verdana'), 5000);
|
||||
ani.mode(linear())
|
||||
.time(600 / vx)
|
||||
.time(aim / vx)
|
||||
.absolute()
|
||||
.move(-600, 0)
|
||||
.move(-aim, 0)
|
||||
ani.all().then(() => {
|
||||
ani.ticker.destroy();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user