diff --git a/css/styles.css b/css/styles.css index 64d8b63e3..53a3e59a6 100644 --- a/css/styles.css +++ b/css/styles.css @@ -165,7 +165,7 @@ tr:focus { visibility: visible; } -/* Flashing button */ +/* Flashing button (Red) */ @-webkit-keyframes glowing { 0% { background-color: #B20000; -webkit-box-shadow: 0 0 3px #B20000; } 50% { background-color: #FF0000; -webkit-box-shadow: 0 0 40px #FF0000; } @@ -195,4 +195,30 @@ tr:focus { -moz-animation: glowing 1500ms infinite; -o-animation: glowing 1500ms infinite; animation: glowing 1500ms infinite; -} \ No newline at end of file +} + +/* Status text */ +@-webkit-keyframes status-text{ + from{ + opacity:1; + top:0px; + } + to{ + opacity:0; + top:0px; + } +} + +.status-text{ + display:inline; + position:fixed; + top:0px; + -webkit-animation:status-text 3s 1; +} + +#status-text { + font-size: 20px; + color: #FFFFFF; + right: 0; + bottom: 0; +} diff --git a/index.html b/index.html index 3b30df5e3..6552f4cab 100644 --- a/index.html +++ b/index.html @@ -698,5 +698,10 @@ Back + +
+

+
+ \ No newline at end of file diff --git a/src/Constants.js b/src/Constants.js index 346994bf3..939af58e8 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -12,7 +12,7 @@ CONSTANTS = { /* Base costs */ BaseCostFor1GBOfRamHome: 50000, BaseCostFor1GBOfRamServer: 40000, //1 GB of RAM - BaseCostFor1GBOfRamHacknetNode: 25000, + BaseCostFor1GBOfRamHacknetNode: 30000, BaseCostForHacknetNode: 1000, BaseCostForHacknetNodeCore: 1000000, diff --git a/src/SaveObject.js b/src/SaveObject.js index d2c3ba532..f6cc92867 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -22,6 +22,8 @@ BitburnerSaveObject.prototype.saveGame = function() { var saveString = btoa(unescape(encodeURIComponent(JSON.stringify(this)))); window.localStorage.setItem("bitburnerSave", saveString); + + Engine.createStatusText("Game saved!"); } loadGame = function(saveObj) { @@ -45,6 +47,7 @@ BitburnerSaveObject.prototype.deleteGame = function() { if (window.localStorage.getItem("bitburnerSave")) { window.localStorage.removeItem("bitburnerSave"); } + Engine.createStatusText("Game deleted!"); } diff --git a/src/engine.js b/src/engine.js index 087bc88d3..1fc033daf 100644 --- a/src/engine.js +++ b/src/engine.js @@ -691,6 +691,21 @@ var Engine = { } }, + _prevTimeout: null, + createStatusText: function(txt) { + if (Engine._prevTimeout != null) { + clearTimeout(Engine._prevTimeout); + Engine._prevTimeout = null; + } + var statusText = document.getElementById("status-text") + statusText.setAttribute("class", "status-text"); + statusText.innerHTML = txt; + Engine._prevTimeout = setTimeout(function() { + statusText.removeAttribute("class"); + statusText.innerHTML = ""; + }, 3000); + }, + load: function() { //Load game from save or create new game if (loadGame(saveObject)) { @@ -729,6 +744,11 @@ var Engine = { //Passive faction rep gain offline processPassiveFactionRepGain(numCyclesOffline); + + //Update total playtime + var time = numCyclesOffline * Engine._idleSpeed; + if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;} + Player.totalPlaytime += time; } else { //No save found, start new game console.log("Initializing new game");