mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Merge pull request #246 from danielyxie/dev
scp Terminal command and Active Scripts UI (hopefully) bug fixes
This commit is contained in:
commit
ae509cf50d
419
dist/engine.bundle.js
vendored
419
dist/engine.bundle.js
vendored
File diff suppressed because one or more lines are too long
511
dist/tests.bundle.js
vendored
511
dist/tests.bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -26,7 +26,6 @@ let ActiveScriptsUI = {};
|
||||
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
||||
|
||||
function createActiveScriptsServerPanel(server) {
|
||||
ActiveScriptsTasks.push(function(server) {
|
||||
let hostname = server.hostname;
|
||||
|
||||
var activeScriptsList = document.getElementById("active-scripts-list");
|
||||
@ -55,13 +54,11 @@ function createActiveScriptsServerPanel(server) {
|
||||
};
|
||||
|
||||
return li;
|
||||
}.bind(null, server));
|
||||
}
|
||||
|
||||
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
||||
//in the Active Scripts page if it exists
|
||||
function deleteActiveScriptsServerPanel(server) {
|
||||
ActiveScriptsTasks.push(function(server) {
|
||||
let hostname = server.hostname;
|
||||
if (ActiveScriptsUI[hostname] == null) {
|
||||
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
||||
@ -77,7 +74,6 @@ function deleteActiveScriptsServerPanel(server) {
|
||||
removeElement(ActiveScriptsUI[hostname].panel);
|
||||
removeElement(ActiveScriptsUI[hostname].header);
|
||||
delete ActiveScriptsUI[hostname];
|
||||
}.bind(null, server));
|
||||
}
|
||||
|
||||
function addActiveScriptsItem(workerscript) {
|
||||
@ -87,11 +83,12 @@ function addActiveScriptsItem(workerscript) {
|
||||
return;
|
||||
}
|
||||
let hostname = server.hostname;
|
||||
|
||||
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
||||
if (ActiveScriptsUI[hostname] == null) {
|
||||
createActiveScriptsServerPanel(server);
|
||||
}
|
||||
|
||||
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
||||
//Create the unique identifier (key) for this script
|
||||
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
||||
for (var i = 0; i < workerscript.args.length; ++i) {
|
||||
|
@ -1432,7 +1432,7 @@ function NetscriptFunctions(workerScript) {
|
||||
}
|
||||
var stock = SymbolToStockMap[symbol];
|
||||
if (stock == null) {
|
||||
throw makeRuntimeRejectMsg(workerScript, "Invalid stock symbol passed into getStockPrice()");
|
||||
throw makeRuntimeRejectMsg(workerScript, "Invalid stock symbol passed into getStockPosition()");
|
||||
}
|
||||
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
|
||||
},
|
||||
|
@ -1379,7 +1379,7 @@ let Terminal = {
|
||||
return;
|
||||
}
|
||||
var scriptname = args[0];
|
||||
if (!scriptname.endsWith(".lit") && !isScriptFilename(scriptName) &&
|
||||
if (!scriptname.endsWith(".lit") && !isScriptFilename(scriptname) &&
|
||||
!scriptname.endsWith(".txt")){
|
||||
post("Error: scp only works for .script, .txt, and .lit files");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user