mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 10:42:51 +02:00
Fixed numerous reported bugs. Refactored some of the directory-related code. Added documentation for MasonDs changes to hack/grow/weaken
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Script } from "./Script";
|
||||
|
||||
import { RamCalculationErrorCode } from "./RamCalculationErrorCodes";
|
||||
import { calculateRamUsage } from "./RamCalculations";
|
||||
import { isScriptFilename } from "./ScriptHelpersTS";
|
||||
|
||||
@@ -190,10 +191,22 @@ export async function updateScriptEditorContent() {
|
||||
|
||||
var codeCopy = code.repeat(1);
|
||||
var ramUsage = await calculateRamUsage(codeCopy, Player.getCurrentServer().scripts);
|
||||
if (ramUsage !== -1) {
|
||||
if (ramUsage > 0) {
|
||||
scriptEditorRamText.innerText = "RAM: " + numeralWrapper.format(ramUsage, '0.00') + " GB";
|
||||
} else {
|
||||
scriptEditorRamText.innerText = "RAM: Syntax Error";
|
||||
switch (ramUsage) {
|
||||
case RamCalculationErrorCode.ImportError:
|
||||
scriptEditorRamText.innerText = "RAM: Import Error";
|
||||
break;
|
||||
case RamCalculationErrorCode.URLImportError:
|
||||
scriptEditorRamText.innerText = "RAM: HTTP Import Error";
|
||||
break;
|
||||
case RamCalculationErrorCode.SyntaxError:
|
||||
default:
|
||||
scriptEditorRamText.innerText = "RAM: Syntax Error";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user