Page 1 of 1
Incorrect BGA blocks arrangement
Posted: 15 August 2020, 19:27
by KuWizard
I'm not sure where to add this bug. It's not about a game itself and it doesn't fit a BGA bug template either.
The thing is when a replay is launched there's a mess on screen, see screenshot here:
https://i.imgur.com/ZQk02ZY.png - the event log is on the right of users boards forcing a game itself fit into 500px while I have 'game_interface_width' parameter set to minimum 787px and the same for maximum (I am a game developer).
It happens only if browser has width approx > 1500px. If I shrink the window width with a cursor making it ~1000px and then back - bug is no more! This all makes me think this is some glitch on BGA side - it shouldn't allow game board to be less than minimum set in gameinfos.inc.php, right? Especially when I have a huge browser window opened.
Is there something I can do with it? Should I report it to a bugtracker? If yes, how to choose a project properly?
Thanks in advance!
P.S. You can reproduce it opening a replay here with a wide browser window:
https://boardgamearena.com/archive/repl ... s=84794042;
Re: Incorrect BGA blocks arrangement
Posted: 15 August 2020, 22:04
by quietmint
I think it's related to CSS your game applies to the page that does this. The bug is only present when the user has selected "Display game logs: On a second column" from the gear/preferences menu within the game (which only applies to wide screens). When this is in effect, the class "logs_on_additional_column" is added to the <body>. Are you adjusting some part of the BGA framework? I see #leftright_page_wrapper has "max-width: 1027px; margin: auto;" -- are you adding this? When I remove it, the game looks much better. The CSS you add may need to be different when "logs_on_additional_column" is present...
Re: Incorrect BGA blocks arrangement
Posted: 16 August 2020, 14:42
by KuWizard
quietmint wrote: ↑15 August 2020, 22:04
I think it's related to CSS your game applies to the page that does this. The bug is only present when the user has selected "Display game logs: On a second column" from the gear/preferences menu within the game (which only applies to wide screens). When this is in effect, the class "logs_on_additional_column" is added to the <body>. Are you adjusting some part of the BGA framework? I see #leftright_page_wrapper has "max-width: 1027px; margin: auto;" -- are you adding this? When I remove it, the game looks much better. The CSS you add may need to be different when "logs_on_additional_column" is present...
Thanks a lot for pointing out what to do in order to reproduce this, now I know about this second column thing

No, this is absolutely not my game adding anything "max-width: 1027px" to #leftright_page_wrapper. My game is pretty simple and it have pretty simple CSS. I add everything to the game elements only, not BGA native elements.
I wonder how to avoid adding those styles. Alternatively I can work with "logs_on_additional_column" class but the problem is that on setup it is not there. And in "onEnteringState" method this class is not applied yet! WTF??? How can I work with it in JS while it is applied after my code being executed?
Re: Incorrect BGA blocks arrangement
Posted: 18 August 2020, 11:33
by KuWizard
Up
Does anyone has an idea of how to handle logs_on_additional_column in JS code? When exactly is this class set?
Re: Incorrect BGA blocks arrangement
Posted: 18 August 2020, 12:38
by Tisaac
Retroengineering the BGA framework code, seems this function is responsible for that :
Code: Select all
switchLogModeTo: function (mode) {
if (mode != 0 && this.log_mode != '2cols') {
this.log_mode = '2cols';
dojo.addClass('ebd-body', 'logs_on_additional_column');
this.onGameUiWidthChange();
} else {
if (mode == 0 && this.log_mode != 'normal') {
this.log_mode = 'normal';
dojo.removeClass('ebd-body', 'logs_on_additional_column');
this.onGameUiWidthChange();
}
}
}
This function seems to be triggered :
- when a player change its preference in the top right
- when the size of screen is too small, even if the preference is 2col, it's set back to 1 col
You could eventually inherit the onGameUiWidthChange if you want to catch these changes.
Re: Incorrect BGA blocks arrangement
Posted: 18 August 2020, 12:48
by Volker78
I also experienced problems with the second-column setting, as it does not respect the min-width setting in the gameinfos. For me this seems like a bug on BGA.
Re: Incorrect BGA blocks arrangement
Posted: 18 August 2020, 13:07
by quietmint
KuWizard wrote: ↑15 August 2020, 19:27
I have 'game_interface_width' parameter set to minimum 787px and the same for maximum (I am a game developer).
What if you remove the maximum width 787?
1027 = 787 + 240. I'm guessing BGA adds 240 to your width from gameinfos for the left sidebar. But it must not be adding extra for the 2 column mode (probably needs to add 500 or so). Indeed seems like a framework bug.
Re: Incorrect BGA blocks arrangement
Posted: 18 August 2020, 17:36
by KuWizard
Tisaac wrote: ↑18 August 2020, 12:38
Retroengineering the BGA framework code, seems this function is responsible for that :
...
This function seems to be triggered :
- when a player change its preference in the top right
- when the size of screen is too small, even if the preference is 2col, it's set back to 1 col
You could eventually inherit the onGameUiWidthChange if you want to catch these changes.
Thanks a lot for the retroengineering!
quietmint wrote: ↑18 August 2020, 13:07
What if you remove the maximum width 787?
1027 = 787 + 240. I'm guessing BGA adds 240 to your width from gameinfos for the left sidebar. But it must not be adding extra for the 2 column mode (probably needs to add 500 or so). Indeed seems like a framework bug.
Thanks for supporting me on this, I agree this looks like a framework bug.
> What if you remove the maximum width 787?
And huge thanks for the advice, it actually helped!