Scrollmap bug

Game development with Board Game Arena Studio
Post Reply
User avatar
xiongmao1298
Posts: 3
Joined: 08 December 2020, 20:29

Scrollmap bug

Post by xiongmao1298 »

There is a typo in scrollmap event handling setup for the down button.
At ly_studio.js:(1,900870):

e.query("#"+this.container_div.id+" .movedown").connect("onclick",this,"onMouseDown")

which is likely meant to be

e.query("#"+this.container_div.id+" .movedown").connect("onclick",this,"onMoveDown")
User avatar
Een
Posts: 3819
Joined: 16 June 2010, 19:52

Re: Scrollmap bug

Post by Een »

We want to handle the click event so it's indeed about the mouse event onMouseDown, and the scrollmap down button works, so it's all good. No typo here :)
User avatar
xiongmao1298
Posts: 3
Joined: 08 December 2020, 20:29

Re: Scrollmap bug

Post by xiongmao1298 »

I believe why it works in some instances is because there are two sets of event handler setups:

$("movetop") && e.connect($("movetop"), "onclick", this, "onMoveTop");
$("moveleft") && e.connect($("moveleft"), "onclick", this, "onMoveLeft");
$("moveright") && e.connect($("moveright"), "onclick", this, "onMoveRight");
$("movedown") && e.connect($("movedown"), "onclick", this, "onMoveDown");

e.query("#" + this.container_div.id + " .movetop").connect("onclick", this, "onMoveTop").style("cursor", "pointer");
e.query("#" + this.container_div.id + " .movedown").connect("onclick", this, "onMouseDown").style("cursor", "pointer");
e.query("#" + this.container_div.id + " .moveleft").connect("onclick", this, "onMoveLeft").style("cursor", "pointer");
e.query("#" + this.container_div.id + " .moveright").connect("onclick", this, "onMoveRight").style("cursor", "pointer")

In the first case, the correct onMoveDown event handler is called which does a scroll by a fixed amount and prevents bubbling up to the handler that causes mouse move scrolling as expected. But when the second set ends up being used (which happens in some alpha games like Rallyman Dirt or Nova Luna), pressing the down arrow ends up calling onMouseDown instead, after which the maps keeps scrolling on mouse move, since there's no corresponding call to onMouseUp being made.

Granted, I don't have access to developer docs, so maybe they didn't setup the scrollmap properly, but the intent in the implementation appeared to be quite clear. :)
User avatar
Een
Posts: 3819
Joined: 16 June 2010, 19:52

Re: Scrollmap bug

Post by Een »

Thanks, I looked too quickly at your first post. I'll check this.
User avatar
Een
Posts: 3819
Joined: 16 June 2010, 19:52

Re: Scrollmap bug

Post by Een »

xiongmao1298 wrote: 09 November 2022, 15:28 Granted, I don't have access to developer docs, so maybe they didn't setup the scrollmap properly, but the intent in the implementation appeared to be quite clear. :)
Indeed quite clear that it's a mistake when looking at the code. Thanks for investigating this and providing a detailed breakdown.
This will be fixed with the next site release.
User avatar
xiongmao1298
Posts: 3
Joined: 08 December 2020, 20:29

Re: Scrollmap bug

Post by xiongmao1298 »

Great, glad it helped! 👍
User avatar
shadowphiar
Posts: 112
Joined: 01 January 2017, 16:07

Re: Scrollmap bug

Post by shadowphiar »

For what it's worth, this was already reported in https://studio.boardgamearena.com/bug?id=30
User avatar
Een
Posts: 3819
Joined: 16 June 2010, 19:52

Re: Scrollmap bug

Post by Een »

shadowphiar wrote: 11 November 2022, 21:54 For what it's worth, this was already reported in https://studio.boardgamearena.com/bug?id=30
Indeed. Thanks to you too then!
User avatar
Een
Posts: 3819
Joined: 16 June 2010, 19:52

Re: Scrollmap bug

Post by Een »

Deployed with today's release: viewtopic.php?p=126767#p126767
Post Reply

Return to “Developers”