diff --git a/css/style.css b/css/style.css index 4d7c8d5..391f83a 100644 --- a/css/style.css +++ b/css/style.css @@ -72,7 +72,11 @@ h1 br { #achievements-container .alert-text, #messages-container .alert-text { - font-size: 14px; font-weight: bold; + font-size: 14px; +} + +#achievements-container .alert-text { + font-weight: bold; } #messages-container .btn { diff --git a/index.html b/index.html index 95df588..9b89a96 100644 --- a/index.html +++ b/index.html @@ -210,7 +210,7 @@ - + diff --git a/js/game.js b/js/game.js index b7b5af5..7c7363d 100644 --- a/js/game.js +++ b/js/game.js @@ -5,6 +5,8 @@ var workers = GameObjects.workers; var upgrades = GameObjects.upgrades; + UI.validateVersion(lab.version); + achievements.addResearch(research); achievements.addWorkers(workers); diff --git a/js/gameobjects.js b/js/gameobjects.js index bbf8fc7..c037796 100644 --- a/js/gameobjects.js +++ b/js/gameobjects.js @@ -8,6 +8,7 @@ var GameObjects = (function() { /** Lab */ var labPrototype = { + version: '0.2', name: 'My Awesome Lab', detector: { rate: 1 diff --git a/js/helpers.js b/js/helpers.js index 8aad0bc..f569d59 100644 --- a/js/helpers.js +++ b/js/helpers.js @@ -37,6 +37,7 @@ var Helpers = (function() { return { loadFile: loadFile, - formatNumberPostfix: formatNumberPostfix + formatNumberPostfix: formatNumberPostfix, + version: '0.2' }; })(); diff --git a/js/ui.js b/js/ui.js index 5034cc4..567abdf 100644 --- a/js/ui.js +++ b/js/ui.js @@ -51,6 +51,25 @@ var UI = (function () { }}); } + var validateVersion = function(version) { + if (version != Helpers.version) { + var alert = ''; + alert = $(alert); + alert.find('a').click(function () + { + if (window.confirm('Do you really want to restart the game? All progress will be lost.')) { + ObjectStorage.clear(); + window.location.reload(true); + } + }) + + $('#messages-container').append(alert); + } + } + if (typeof $.cookie('cookielaw') === 'undefined') { var alert = '