This commit is contained in:
gnieark 2016-06-29 23:08:43 +02:00
parent 35fc852ee9
commit 561d76001b
2 changed files with 18 additions and 2 deletions

View File

@ -11,6 +11,22 @@ function createElemNS(type,attributes){
{elem.setAttributeNS(null,i,attributes[i]);}
return elem;
}
function show_bot_panel(number){
//configurePlayers
var fieldset = createElem('fieldset',{'class':'botFormulaire'});
var p=createElem('p');
var select = createElem('select',{'id':'selectBot' + number, 'onchange':'changeSelect(this.value);'});
for each (var bot in botsAvailable){
var option = createElem('option',{'value':bot['id']});
option.innerHTML = bot['name'];
select.appendChild(option);
}
p.appendChild(select);
fieldset.appendChild(p);
document.getElementById('configurePlayers').appendChild(fieldset);
}
function applyInitMessage(req){
//callback function when init game request

View File

@ -19,9 +19,9 @@ foreach($bots as $bot){
?>
<article id="mainArticle">
<h2><?php echo $lang['MAKE_DUEL'];?></h2>
<div id="configurePlayers">
<aside id="configurePlayers">
</div>
</aside>
<script>
var botsAvailable = <?php echo json_encode($botsArr); ?>;
show_bot_panel(0);