mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Added status text for saving. Minor rebalancing for Hacknet Node RAM Cost
This commit is contained in:
parent
bb73fe1101
commit
56a7ed66a5
@ -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; }
|
||||
@ -196,3 +196,29 @@ tr:focus {
|
||||
-o-animation: glowing 1500ms infinite;
|
||||
animation: glowing 1500ms infinite;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
@ -698,5 +698,10 @@
|
||||
<span id="interactive-tutorial-back"> Back </span>
|
||||
</div>
|
||||
|
||||
<!-- Status text -->
|
||||
<div id="status-text-container">
|
||||
<p id="status-text"> </p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -12,7 +12,7 @@ CONSTANTS = {
|
||||
/* Base costs */
|
||||
BaseCostFor1GBOfRamHome: 50000,
|
||||
BaseCostFor1GBOfRamServer: 40000, //1 GB of RAM
|
||||
BaseCostFor1GBOfRamHacknetNode: 25000,
|
||||
BaseCostFor1GBOfRamHacknetNode: 30000,
|
||||
|
||||
BaseCostForHacknetNode: 1000,
|
||||
BaseCostForHacknetNodeCore: 1000000,
|
||||
|
@ -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!");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user