Redundant call to onUpdateActionButtons

Game development with Board Game Arena Studio
Post Reply
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Redundant call to onUpdateActionButtons

Post by pikiou »

Usually when entering a state, onUpdateActionButtons and onEnteringState are called once in that order.
But if it's a multiactiveplayer state, onUpdateActionButtons, onEnteringState then onUpdateActionButtons again are called.
Is there a reason for that second onUpdateActionButtons call ? I had to ignore it, just like any other call to it when a player becomes inactive or active in a multiactiveplayer state (that feature could be useful, though).
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Re: Redundant call to onUpdateActionButtons

Post by sourisdudesert »

Hello,

Yes, onUpdateActionButtons can be called at any time to refresh the action button on the status bar, and this can happens multiple time during a state.

This is the reason why onUpdateActionButtons must only be used for "this.addActionButton" calls, and not for anything else. If you need to do something only once when entering in a gamestate, you can use onEnteringGameState instead.

Cheers,
Post Reply

Return to “Developers”