Added Research lab queue manager.
Updated page display for shipyard, defenses and buildings. Moved legacy template files. Added install/migration.mysql to report changes to the database on testing environments. Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
f2d4b0f7e2
commit
ddfb36efa5
341 changed files with 4238 additions and 3259 deletions
|
|
@ -0,0 +1,39 @@
|
|||
<div>Production Actuelle:
|
||||
<select id="buildList" size="10"></select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var date = new Date();
|
||||
var data = <?php echo $this->getData('data')?>;
|
||||
var select = document.getElementById('buildList');
|
||||
|
||||
setInterval(function(){
|
||||
var now = new Date();
|
||||
var datediff = (now.getTime() - date.getTime()) / 1000;
|
||||
|
||||
var option = null;
|
||||
var index = 0;
|
||||
if (data.length == 0) {
|
||||
select.parentNode.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
select.length = 0;
|
||||
for (i in data) {
|
||||
if (datediff > 0) {
|
||||
data[i]['actual_qty'] = data[i]['qty'] - Math.floor(datediff / data[i]['speed']);
|
||||
} else {
|
||||
data[i]['actual_qty'] = data[i]['qty'];
|
||||
}
|
||||
if (data[i]['actual_qty'] <= 0) {
|
||||
datediff = datediff - (data[i]['speed'] * data[i]['qty']);
|
||||
delete data[i];
|
||||
continue;
|
||||
} else {
|
||||
datediff = 0;
|
||||
}
|
||||
option = new Option(data[i]['label'] + ' (' + data[i]['actual_qty'] + ')', data[i]['speed'], false, true);
|
||||
select.options[index++] = option;
|
||||
}
|
||||
}, 1000);
|
||||
//]]>
|
||||
</script>
|
||||
Loading…
Reference in a new issue