diff --git a/css/popupboxes.css b/css/popupboxes.css
index 97081d669..9a6ce8843 100644
--- a/css/popupboxes.css
+++ b/css/popupboxes.css
@@ -18,19 +18,20 @@
z-index: 2;
width: 50%;
height: auto;
- top: 50%;
+ max-height: 40%;
+ top: 40%;
left: 50%;
margin: -10% 0 0 -25%;
overflow: auto;
background-color: black;
background-color: rgba(0,0,0,0.4);
+ border: 5px solid #FFFFFF;
}
.dialog-box-content {
z-index: 2;
background-color: black;
padding: 10px;
- border: 5px solid #FFFFFF;
}
.dialog-box-close-button {
diff --git a/src/Constants.js b/src/Constants.js
index 7fb1f8a13..7b68ed8e4 100644
--- a/src/Constants.js
+++ b/src/Constants.js
@@ -1,5 +1,5 @@
CONSTANTS = {
- Version: "0.19.7",
+ Version: "0.20.0",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@@ -538,29 +538,29 @@ CONSTANTS = {
"v0.20.0
" +
"-Refactored Netscript Interpreter code. Operations in Netscript should now run significantly faster (Every operation " +
"such as a variable assignment, a function call, a binary operator, getting a variable's value, etc. used to take up to several seconds, " +
- "now each one should only take 750 milliseconds).
" +
- "-Percentage money stolen when hacking lowered to compensate for faster script speeds
" +
- "-Hacking experience granted by grow() halved
" +
- "-Weaken() is now ~11% faster, but only grants 3 base hacking exp upon completion instead of 5
" +
+ "now each one should only take 750 milliseconds).
" +
+ "-Percentage money stolen when hacking lowered to compensate for faster script speeds
" +
+ "-Hacking experience granted by grow() halved
" +
+ "-Weaken() is now ~11% faster, but only grants 3 base hacking exp upon completion instead of 5
" +
"-Rebalancing of script RAM costs. Base RAM Cost for a script increased from 1GB to 1.5GB. Loops, hack(), grow() " +
- "and weaken() all cost slightly less RAM than before
" +
- "-Added getServerRequiredHackingLevel(server) Netscript command.
" +
+ "and weaken() all cost slightly less RAM than before
" +
+ "-Added getServerRequiredHackingLevel(server) Netscript command.
" +
"-Added fileExists(file, [server]) Netscript command, which is used to check if a script/program exists on a " +
- "specified server
" +
- "-Added isRunning(script, [server]) Netscript command, which is used to check if a script is running on the specified server
" +
- "-Added killall Terminal command. Kills all running scripts on the current machine
" +
- "-Added kill() and killall() Netscript commands. Used to kill scripts on specified machines. See Netscript documentation
" +
- "-Re-designed 'Active Scripts' tab
" +
- "-Hacknet Node base production rate lowered from 1.6 to 1.55 ($/second)
" +
- "-Increased monetary cost of RAM (Upgrading home computer and purchasing servers will now be more expensive)
" +
+ "specified server
" +
+ "-Added isRunning(script, [server]) Netscript command, which is used to check if a script is running on the specified server
" +
+ "-Added killall Terminal command. Kills all running scripts on the current machine
" +
+ "-Added kill() and killall() Netscript commands. Used to kill scripts on specified machines. See Netscript documentation
" +
+ "-Re-designed 'Active Scripts' tab
" +
+ "-Hacknet Node base production rate lowered from 1.6 to 1.55 ($/second)
" +
+ "-Increased monetary cost of RAM (Upgrading home computer and purchasing servers will now be more expensive)
" +
"-NEW GROWTH MECHANICS - The rate of growth on a server now depends on a server's security level. A higher security level " +
"will result in lower growth on a server when using the grow() command. Furthermore, calling grow() on a server raises that " +
"server's security level by " + (2 * this.ServerFortifyAmount) + ". For reference, if a server has a security level of 10 " +
- "it will have approximately the same growth rate as before.
" +
- "-Server growth no longer happens naturally
" +
- "-Servers now have a maximum limit to their money. This limit is 50 times it's starting money
" +
- "-Hacking now grants 10% less hacking experience
" +
- "-You can now edit scripts that are running
" +
+ "it will have approximately the same growth rate as before.
" +
+ "-Server growth no longer happens naturally
" +
+ "-Servers now have a maximum limit to their money. This limit is 50 times it's starting money
" +
+ "-Hacking now grants 10% less hacking experience
" +
+ "-You can now edit scripts that are running
" +
"v0.19.7
" +
"-Added changelog to Options menu
" +
"-Bug fix with autocompletion (wasn't working properly for capitalized filenames/programs
" +
@@ -644,7 +644,30 @@ CONSTANTS = {
"-You can now see what an Augmentation does and its price even while its locked
",
LatestUpdate:
- "",
-
-
+ "v0.20.0
" +
+ "-Refactored Netscript Interpreter code. Operations in Netscript should now run significantly faster (Every operation " +
+ "such as a variable assignment, a function call, a binary operator, getting a variable's value, etc. used to take up to several seconds, " +
+ "now each one should only take 750 milliseconds).
" +
+ "-Percentage money stolen when hacking lowered to compensate for faster script speeds
" +
+ "-Hacking experience granted by grow() halved
" +
+ "-Weaken() is now ~11% faster, but only grants 3 base hacking exp upon completion instead of 5
" +
+ "-Rebalancing of script RAM costs. Base RAM Cost for a script increased from 1GB to 1.5GB. Loops, hack(), grow() " +
+ "and weaken() all cost slightly less RAM than before
" +
+ "-Added getServerRequiredHackingLevel(server) Netscript command.
" +
+ "-Added fileExists(file, [server]) Netscript command, which is used to check if a script/program exists on a " +
+ "specified server
" +
+ "-Added isRunning(script, [server]) Netscript command, which is used to check if a script is running on the specified server
" +
+ "-Added killall Terminal command. Kills all running scripts on the current machine
" +
+ "-Added kill() and killall() Netscript commands. Used to kill scripts on specified machines. See Netscript documentation
" +
+ "-Re-designed 'Active Scripts' tab
" +
+ "-Hacknet Node base production rate lowered from 1.6 to 1.55 ($/second)
" +
+ "-Increased monetary cost of RAM (Upgrading home computer and purchasing servers will now be more expensive)
" +
+ "-NEW GROWTH MECHANICS - The rate of growth on a server now depends on a server's security level. A higher security level " +
+ "will result in lower growth on a server when using the grow() command. Furthermore, calling grow() on a server raises that " +
+ "server's security level by " + (2 * this.ServerFortifyAmount) + ". For reference, if a server has a security level of 10 " +
+ "it will have approximately the same growth rate as before.
" +
+ "-Server growth no longer happens naturally
" +
+ "-Servers now have a maximum limit to their money. This limit is 50 times it's starting money
" +
+ "-Hacking now grants 10% less hacking experience
" +
+ "-You can now edit scripts that are running
",
}
\ No newline at end of file
diff --git a/src/SaveObject.js b/src/SaveObject.js
index 585f82f6b..032a10a4a 100644
--- a/src/SaveObject.js
+++ b/src/SaveObject.js
@@ -67,15 +67,17 @@ loadGame = function(saveObj) {
}
if (saveObj.hasOwnProperty("VersionSave")) {
try {
+ console.log("here");
var ver = JSON.parse(saveObj.VersionSave, Reviver);
+ console.log("version from save: " + ver);
if (ver != CONSTANTS.Version) {
- //TODO Create update pop up
+ createNewUpdateText();
}
} catch(e) {
- Engine.version = CONSTANTS.Version;
+ createNewUpdateText();
}
} else {
- Engine.version = CONSTANTS.Version;
+ createNewUpdateText();
}
return true;
@@ -88,6 +90,13 @@ BitburnerSaveObject.prototype.deleteGame = function() {
Engine.createStatusText("Game deleted!");
}
+createNewUpdateText = function() {
+ dialogBoxCreate("New update!
" +
+ "Please report any bugs/issues through the github repository " +
+ "or the Bitburner subreddit (reddit.com/r/bitburner).
" +
+ CONSTANTS.LatestUpdate);
+}
+
BitburnerSaveObject.prototype.toJSON = function() {
return Generic_toJSON("BitburnerSaveObject", this);
diff --git a/utils/DialogBox.js b/utils/DialogBox.js
index 9fa89cadc..50e9d72f7 100644
--- a/utils/DialogBox.js
+++ b/utils/DialogBox.js
@@ -1,32 +1,64 @@
/* Pop up Dialog Box */
+dialogBoxes = [];
//Close dialog box when clicking outside
+/*
$(document).click(function(event) {
if (dialogBoxOpened) {
if (!$(event.target).closest('.dialog-box-container').length){
--dialogBoxCount;
+ dialogBoxes.splice(0, 1);
$(".dialog-box-container").remove();
- if (dialogBoxCount == 0) {
+
+ if (dialogBoxes.length == 0) {
dialogBoxOpened = false;
+ } else {
+ dialogBoxes[0].style.display +
+ }
+ }
+ }
+});*/
+$(document).click(function(event) {
+ if (dialogBoxOpened && dialogBoxes.length >= 1) {
+ if (!$(event.target).closest(dialogBoxes[0]).length){
+ dialogBoxes[0].remove();
+ dialogBoxes.splice(0, 1);
+ if (dialogBoxes.length == 0) {
+ dialogBoxOpened = false;
+ } else {
+ dialogBoxes[0].style.visibility = "visible";
}
}
}
});
+
//Dialog box close buttons
+/*
$(document).on('click', '.dialog-box-close-button', function( event ) {
console.log("clicked close button");
if (dialogBoxOpened) {
$(this).closest('.dialog-box-container').remove();
--dialogBoxCount;
- if (dialogBoxCount == 0) {
+ if (dialogBoxes.length == 0) {
dialogBoxOpened = false;
}
}
});
+*/
+$(document).on('click', '.dialog-box-close-button', function( event ) {
+ if (dialogBoxOpened && dialogBoxes.length >= 1) {
+ dialogBoxes[0].remove();
+ dialogBoxes.splice(0, 1);
+ if (dialogBoxes.length == 0) {
+ dialogBoxOpened = false;
+ } else {
+ dialogBoxes[0].style.visibility = "visible";
+ }
+ }
+});
var dialogBoxOpened = false;
-var dialogBoxCount = 0;
dialogBoxCreate = function(txt) {
var container = document.createElement("div");
@@ -47,9 +79,12 @@ dialogBoxCreate = function(txt) {
container.appendChild(content);
document.body.appendChild(container);
+ if (dialogBoxes.length >= 1) {
+ container.style.visibility = "hidden";
+ }
+ dialogBoxes.push(container);
setTimeout(function() {
dialogBoxOpened = true;
- ++dialogBoxCount;
- }, 500);
+ }, 400);
}
\ No newline at end of file