parent
33f643642a
commit
8c5680fd11
2 changed files with 16 additions and 8 deletions
|
@ -49,6 +49,7 @@
|
|||
<thead><tr>
|
||||
<th>ID</th>
|
||||
<th>Visible</th>
|
||||
<th>Brouillé</th>
|
||||
<th>Tracker</th>
|
||||
<th>Npc</th>
|
||||
<th>Last Update</th>
|
||||
|
@ -96,6 +97,7 @@
|
|||
function sendUpdate(id){
|
||||
var state = {};
|
||||
state.shown = document.getElementById(`${id}.shown`).checked;
|
||||
state.blurred = document.getElementById(`${id}.blurred`).checked;
|
||||
state.tracker = document.getElementById(`${id}.tracker`).checked;
|
||||
state.npc = document.getElementById(`${id}.npc`).value;
|
||||
socket.emit('setState', { id: id, state: state });
|
||||
|
@ -105,20 +107,24 @@
|
|||
var id = data.id;
|
||||
if(!(id in equipes)){
|
||||
var row = `<td>${id}</td>`;
|
||||
row = row + `<td><input type="checkbox"
|
||||
id="${id}.shown"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row = row + `<td><input type="checkbox"
|
||||
id="${id}.tracker"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row = row + `<td><input type="number" min=0 max=3
|
||||
row += `<td><input type="checkbox"
|
||||
id="${id}.shown"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row += `<td><input type="checkbox"
|
||||
id="${id}.blurred"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row += `<td><input type="checkbox"
|
||||
id="${id}.tracker"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row += `<td><input type="number" min=0 max=3
|
||||
id="${id}.npc"
|
||||
onchange="sendUpdate('${id}')" /></td>`
|
||||
row = row + `<td id="${id}.time"></td>`
|
||||
row += `<td id="${id}.time"></td>`
|
||||
info_table.innerHTML = info_table.innerHTML + `<tr>${row}</tr>`
|
||||
}
|
||||
equipes[id] = data.state;
|
||||
document.getElementById(`${id}.shown`).checked = data.state.shown;
|
||||
document.getElementById(`${id}.blurred`).checked = data.state.blurred;
|
||||
document.getElementById(`${id}.tracker`).checked = data.state.tracker;
|
||||
document.getElementById(`${id}.npc`).value = data.state.npc;
|
||||
var now = new Date();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"vieux": bool,
|
||||
"state" : {
|
||||
"shown" : bool,
|
||||
"blurred": bool,
|
||||
"tracker" : bool,
|
||||
"npc" : int
|
||||
}
|
||||
|
@ -180,6 +181,7 @@ function default_team(team_id, valid) {
|
|||
var equipe = {};
|
||||
var state = {};
|
||||
state.shown = valid == 0;
|
||||
state.blurred = false;
|
||||
state.tracker = false;
|
||||
state.npc = valid;
|
||||
equipe.state = state;
|
||||
|
|
Loading…
Reference in a new issue