Commit 56e424c9 authored by Jyrki's avatar Jyrki 🐾

beware of untested code

parent 16bb3b99
......@@ -156,6 +156,7 @@ warTimer = ->
# random event
eventTimer = ->
NProgress.done()
ev = Math.floor((Math.random() * 10000000) % 7)
console.log "Event #{ev}"
......@@ -226,6 +227,7 @@ eventTimer = ->
message = "A fire destroyed a part of a nearby city!<br /><br />You need to grant shelter for #{i} people."
updateCounters()
NProgress.start()
$.growl {
title: title
message: message
......@@ -389,7 +391,8 @@ whtim = window.setInterval wheatTimer, 100
lstim = window.setInterval livestockTimer, 1000
cgtim = window.setInterval cattleGridTimer, 1000
$(document).ready -> updateCounters()
$(document).ready ->
NProgress.start()
updateCounters()
unless window.localStorage.gv
$('button#game-load').attr "disabled", "disabled"
......@@ -165,6 +165,7 @@
eventTimer = function() {
var ev, f, g, i, message, title, w;
NProgress.done();
ev = Math.floor((Math.random() * 10000000) % 7);
console.log("Event " + ev);
switch (ev) {
......@@ -246,6 +247,7 @@
message = "A fire destroyed a part of a nearby city!<br /><br />You need to grant shelter for " + i + " people.";
}
updateCounters();
NProgress.start();
return $.growl({
title: title,
message: message
......@@ -436,10 +438,8 @@
cgtim = window.setInterval(cattleGridTimer, 1000);
$(document).ready(function() {
return updateCounters();
});
$(document).ready(function() {
NProgress.start();
updateCounters();
if (!window.localStorage.gv) {
return $('button#game-load').attr("disabled", "disabled");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment