[SOLVED] TableWindow : display strings with variable values
Posted: 20 October 2021, 11:43
Hello,
I'm trying to display a string that contains variable values in my 'round result' tableWindow.
It is said in the game interface logic documentation that "you can also display a complex value with a template and associated arguments".
I followed the syntax used in the example provided, but I get an error message once the tableWindow is displayed that says the variable is not defined.
In this bit of code I push into the array $table the new row.
Here is the code you can find on the documentation :
I surely miss something important here, but I cannot figure out what it is...
Your help will be very appreciated.
Thanks!
I'm trying to display a string that contains variable values in my 'round result' tableWindow.
It is said in the game interface logic documentation that "you can also display a complex value with a template and associated arguments".
I followed the syntax used in the example provided, but I get an error message once the tableWindow is displayed that says the variable is not defined.
In this bit of code I push into the array $table the new row.
Code: Select all
array_push($table, array(
"str" => clienttranslate( "Boss : ${boss_hp} hp"),
"args" => array('boss_hp' => $this->getBossHealth() )
)
);
Code: Select all
$table = array(
array( "one", "two", array( "str" => clienttranslate("a string with an ${argument}"), "args" => array( 'argument' => 'argument_value' ) ) ),
array( "four", "five", "six" ),
array( "seven", "height", "nine" )
);
Your help will be very appreciated.
Thanks!