Store multiple scoring tables

Game development with Board Game Arena Studio
Post Reply
User avatar
Woodruff
Posts: 423
Joined: 08 March 2014, 00:53

Store multiple scoring tables

Post by Woodruff »

Hi!

I have been managing a game which consists of rounds, each round displaying a scoring dialog.
Currently, when you close that scoring dialog, it is no longer accessible. I am now improving the system so that the score dialogs can be stored between rounds and be accessible through buttons.

Following the advice of Een, I use this.displayTableWindow on JS side in spite of merely a tableWindow notification on PHP side because I have to manage translatable strings (method used for Sushi Go! if I remember well).

The trouble is that even if I can store the dialog in a array:

Code: Select all

this.scoring_dialogs[round_no] = this.displayTableWindow( /* ... */ );
when I try to retrieve an element it is just the last dialog, no matter the position in the array.
Apparently, the score dialog composants have a fixed id base on a prefix named "tableWindow":

Code: Select all

<div id="popin_tableWindow_underlay" class="standard_popin_underlay" style="opacity: 0.7; display: block; width: 1663px; height: 18401px;"></div>
<div id="popin_tableWindow" class="standard_popin" style="opacity: 1; display: inline-block; top: 487px; left: 451.383px;">
    <h2 id="popin_tableWindow_title" class="standard_popin_title">My title</h2>
    <!-- ... -->
</div>
Hence, it leads to conflict when storing several of these...

Any chance that id could be ovverriden so that I can ensure it is unique? Just adding a suffix indicating the round number would do the trick.

Thanks for your help :)

Wood
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: Store multiple scoring tables

Post by tchobello »

hi

can you show us here or on discord a print screen of what you want to be displayed ?
User avatar
Woodruff
Posts: 423
Joined: 08 March 2014, 00:53

Re: Store multiple scoring tables

Post by Woodruff »

tchobello wrote: 01 May 2021, 13:59 hi

can you show us here or on discord a print screen of what you want to be displayed ?
Hi tchobello,


Sure, here for the table score dialog:
Image
https://imgur.com/a/TUkgkrp

Here is a screenshot of spot you can click on in order to show that score dialog again (the magnifying glass has an event handler to show the round score dialog):
Image
https://imgur.com/a/xQzHuns
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: Store multiple scoring tables

Post by tchobello »

well, I think I would have created a DB table with each round scoring information...if you want to display the same table.

As a Tarot player, I don't need to read again all calculation in a table. One expanded line ( bouts, result...) might be enough.
User avatar
Woodruff
Posts: 423
Joined: 08 March 2014, 00:53

Re: Store multiple scoring tables

Post by Woodruff »

tchobello wrote: 01 May 2021, 16:28 well, I think I would have created a DB table with each round scoring information...if you want to display the same table.

As a Tarot player, I don't need to read again all calculation in a table. One expanded line ( bouts, result...) might be enough.
OK thanks.
This is effectively not as useful but some players would like to have that.

I do not store the table contents because there are lots of cases so the table does not have the same structure. Not mentionning the translatable strings to manage. It would be doable but that is too muc work for little more value.

My idea was just to keep previous scoring tables which can be read as long as one does not refresh the page.

I there are no workaround, I think I will convert scoring table into regular dialogs; dropping the support of displayTableWindow and build the HTML for the table using JS manually.
This way I can define unique IDs for each dialog.
Post Reply

Return to “Developers”