Page 1 of 1

onUpdateActionButtons removes buttons

Posted: 07 May 2024, 13:27
by AxeCrazy
Goodday,
i have a strange issue.
when entering a multipleactiveplayer state a onUpdateActionButtons is called
first onUpdateActionButtons placeCard
then enterstate placeCard
then again onUpdateActionButtons placeCard

in the enterstate i add buttons to the titlebar do set cardstae/ confirm, but these dissappear after last onUpdateActionButtons

when i refresh the page (F5) the buttons remain visible.

Any clue on how to fix this?

Re: onUpdateActionButtons removes buttons

Posted: 07 May 2024, 16:24
by Tisaac
AxeCrazy wrote: 07 May 2024, 13:27 Goodday,
i have a strange issue.
when entering a multipleactiveplayer state a onUpdateActionButtons is called
first onUpdateActionButtons placeCard
then enterstate placeCard
then again onUpdateActionButtons placeCard

in the enterstate i add buttons to the titlebar do set cardstae/ confirm, but these dissappear after last onUpdateActionButtons

when i refresh the page (F5) the buttons remain visible.

Any clue on how to fix this?
Nothing to fix, this is a feature, not a bug...
If you want to avoid this, easiest solution is to just make your own div next to generalactions and place all your buttons here instead (check my boilerplate or my games for some example)

Re: onUpdateActionButtons removes buttons

Posted: 10 May 2024, 21:39
by AxeCrazy
Oké.
Which game can I use to look at your example?

Re: onUpdateActionButtons removes buttons

Posted: 12 May 2024, 02:13
by Victoria_La
you don't need a game, its trivial
can add this in your onUpdateActionButtons
Something like (did not test this code)

Code: Select all

if (!$('extra_actions')) dojo.place("<div id='extra_actions'></div>",'generalactions');
this.addActionButton(..., 'extra_actions'); // one of parameters is place