Page 1 of 1

Actions in the state description

Posted: 15 December 2014, 23:23
by sparr
"You may play a card" is a typical game state description. I've seen some games put clickable links in that text, such as "You may play a card or Pass". How is that done?

Re: Actions in the state description

Posted: 16 December 2014, 01:44
by sparr

Code: Select all

        onUpdateActionButtons: function( stateName, args )
        {
            console.log( 'onUpdateActionButtons: '+stateName );
                      
            if( this.isCurrentPlayerActive() )
            {            
                switch( stateName )
                {
/*               
                 Example:
 
                 case 'myGameState':
                    
                    // Add 3 action buttons in the action status bar:
                    
                    this.addActionButton( 'button_1_id', _('Button 1 label'), 'onMyMethodToCall1' ); 
                    this.addActionButton( 'button_2_id', _('Button 2 label'), 'onMyMethodToCall2' ); 
                    this.addActionButton( 'button_3_id', _('Button 3 label'), 'onMyMethodToCall3' ); 
                    break;
*/
                }
            }
        },