Hi there,
I have a multi-active state where several players have to do an action, but not all.
I'd like to display the list of active players in the state description, like "Albert, Betty and Carl must move their meeple".
For this, in states.inc.php, I have the following:
And in game.php:
I feel it's a bit of an overkill to just get the list of players, and the 'and' will not be translated correctly. Any idea about how to get this done?
Could we maybe have a generic variable like ${actplayer}?
Or maybe I shall just describe my state as "Other players must move their meeple"... anyway, nothing urgent here.
I have a multi-active state where several players have to do an action, but not all.
I'd like to display the list of active players in the state description, like "Albert, Betty and Carl must move their meeple".
For this, in states.inc.php, I have the following:
Code: Select all
15 => array(
"description" => clienttranslate('${playersList} must move their meeple'),
"descriptionmyturn" => clienttranslate('${you} must move your meeple'),
"args" => "argActivePlayerList",
Code: Select all
function argActivePlayerList() {
$players = $this->gamestate->getActivePlayerList();
$playersList = '';
for($i = 0; $i<count($players); $i++) {
$player_name = self::getUniqueValueFromDB( "SELECT player_name FROM player WHERE player_id = {$players[$i]}" );
$playersList .= ($i > 0 ?($i == count($players)-1 ? ' and ' : ', ') : '') . $player_name;
}
return array('playersList' => $playersList);
}
Could we maybe have a generic variable like ${actplayer}?
Or maybe I shall just describe my state as "Other players must move their meeple"... anyway, nothing urgent here.