From db476ee902fdc356095c2b828e14e207ad5ea409 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Fri, 24 Feb 2017 09:11:45 -0600 Subject: [PATCH] Changed text to show 'Apply for Promotion' At a company if you already have a job there. Script runtime errors create dialog boxes now --- src/Location.js | 34 +++++++++++++++++++++++++++++++- src/Netscript/NetscriptWorker.js | 1 + 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Location.js b/src/Location.js index bf5b64163..c741d917c 100644 --- a/src/Location.js +++ b/src/Location.js @@ -144,6 +144,16 @@ displayLocationContent = function() { employeeJob.style.display = "none"; waiterJob.style.display = "none"; + softwareJob.innerHTML = "Apply for Software Job"; + itJob.innerHTML = "Apply for IT Job"; + securityEngineerJob.innerHTML = "Apply for Security Engineer Job"; + networkEngineerJob.innerHTML = "Apply for Network Engineer Job"; + businessJob.innerHTML = "Apply for Business Job"; + securityJob.innerHTML = "Apply for Security Job"; + agentJob.innerHTML = "Apply for Agent Job"; + employeeJob.innerHTML = "Apply to be an Employee"; + waiterJob.innerHTML = "Apply to be a Waiter"; + work.style.display = "none"; gymTrainStr.style.display = "none"; @@ -178,13 +188,35 @@ displayLocationContent = function() { jobTitle.style.display = "block"; jobReputation.style.display = "block"; jobTitle.innerHTML = "Job Title: " + Player.companyPosition.positionName; - jobReputation.innerHTML = "Company reputation: " + company.playerReputation; + jobReputation.innerHTML = "Company reputation: " + (company.playerReputation.toFixed(4)).toLocaleString(); work.style.display = "block"; work.addEventListener("click", function() { Player.startWork(); return false; }); + + //Change the text for the corresponding position from "Apply for X Job" to "Apply for promotion" + var currPos = Player.companyPosition; + if (currPos.isSoftwareJob()) { + softwareJob.innerHTML = "Apply for a promotion (Software)"; + } else if (currPos.isITJob()) { + itJob.innerHTML = "Apply for a promotion (IT)"; + } else if (currPos.isSecurityEngineerJob()) { + securityEngineerJob.innerHTML = "Apply for a promotion (Security Engineer)"; + } else if (currPos.isNetworkEngineerJob()) { + networkEngineerJob.innerHTML = "Apply for a promotion (Network Engineer)"; + } else if (currPos.isBusinessJob()) { + businessJob.innerHTML = "Apply for a promotion (Business)"; + } else if (currPos.isSecurityJob()) { + securityJob.innerHTML = "Apply for a promotion (Security)"; + } else if (currPos.isAgentJob()) { + agentJob.innerHTML = "Apply for a promotion (Agent)"; + } else if (currPos.positionName == CompanyPositions.Employee) { + employeeJob.style.display = "none"; + } else if (currPos.positionName == CompanyPositions.Waiter) { + waiterJob.style.display = "none"; + } } else { jobTitle.style.display = "none"; jobReputation.style.display = "none"; diff --git a/src/Netscript/NetscriptWorker.js b/src/Netscript/NetscriptWorker.js index 4a50fe02e..e605d29ca 100644 --- a/src/Netscript/NetscriptWorker.js +++ b/src/Netscript/NetscriptWorker.js @@ -69,6 +69,7 @@ function runScriptsLoop() { //Post error message to terminal //TODO Only post this if you're on the machine the script is running on? post("Script runtime error: " + errorMsg); + dialogBoxCreate("Script runtime error: ", "Server Ip: " + serverIp, "Script name: " + scriptName, errorMsg); //Find the corresponding workerscript and set its flags to kill it for (var i = 0; i < workerScripts.length; ++i) {