Properly focuses on Script editor when its opened

This commit is contained in:
Daniel Xie 2017-05-15 22:27:47 -05:00
parent f1b7d78ba3
commit 223bc3c2c6
5 changed files with 15 additions and 14 deletions

@ -41,9 +41,6 @@ Private beta feedback
Now, only other suggestion before sleep would be to be able to buy multiple Hacknet upgrades in one click
1) - multiple commands to do the same thing? (why?) <--- there are a few of these in the initial help... clear/cls, scan/netstat, connect/telnet... Maybe just pick one to unclutter it?
2) - "Wrong Command! Try Again!" seemed a bit out of place for a terminal. Trying to repro this, it seems you may have already fixed it?
3) - If you can help it, please don't require the code to be exactly pasted from the tutorial to finish the tutorial. I copied the code and then "corrected" the brackets and spacing... and it wouldn't let me continue. :D
5) - As a programmer... you cannot take the TAB key from us in the script editor. :neutral_face: Not sure how the game itself is coded, but if you've got to EAT a ghost-tab just to give me one in-editor... let me tab out my code in-script, or I'll go mad.
6) - Maybe show total $ somewhere onscreen at all (or most) times. $/sec would also be good to know, depending on if you want the player to know that. Bottom of the menu on the left is an empty enough place to keep these.
7) - default the focus to in-editor when you nano up a new script, so you can start typing immediately upon commanding one to be created.

@ -1,5 +1,5 @@
CONSTANTS = {
Version: "0.9",
Version: "0.10",
//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
@ -141,14 +141,12 @@ CONSTANTS = {
"ls Displays all programs and scripts on the machine<br>" +
"mem [script name] Displays the amount of RAM the script requires to run<br>" +
"nano [script name] Text editor - Open up and edit a script<br>" +
"netstat Displays all available network connections<br>" +
"ps Display all scripts that are currently running<br>" +
"rm Delete a script/program from the machine. (WARNING: Permanent)<br>" +
"run [script/program] Execute a program or a script<br>" +
"scan See 'netstat' command<br>" +
"scan Displays all available network connections<br>" +
"sudov Shows whether or not you have root access on this computer<br>" +
"tail [script] Display script logs (logs contain details about active scripts)<br>" +
"telnet [ip/hostname] See 'connect' command<br>" +
"top Display all running scripts and their RAM usage<br>",
/* Tutorial related things */

@ -18,7 +18,7 @@ HacknetNode.prototype.updateMoneyGainRate = function() {
//Each CPU core doubles the speed. Every 1GB of ram adds 15% increase
this.moneyGainRatePerSecond = (this.level * gainPerLevel) *
Math.pow(1.05, this.ram-1) *
Math.pow(1.07, this.ram-1) *
((this.numCores + 1) / 2) * Player.hacknet_node_money_mult;
if (isNaN(this.moneyGainRatePerSecond)) {
this.moneyGainRatePerSecond = 0;

@ -151,8 +151,7 @@ function iTutorialEvaluateStep() {
"on the computer. Right now, it shows that you have a program called 'NUKE.exe' on your computer. " +
"We'll get to what this does later. <br><br> Through your home computer's terminal, you can connect " +
"to other machines throughout the world. Let's do that now by first entering " +
"the 'scan' command (Alternatively, you can also enter the 'netstat' command " +
"which does the same thing). ");
"the 'scan' command. ");
//next step triggered by terminal command
break;
case iTutorialSteps.TerminalConnect:
@ -160,8 +159,7 @@ function iTutorialEvaluateStep() {
"it displays a list of all servers that can be connected to from your " +
"current machine. A server is identified by either its IP or its hostname. <br><br> " +
"To connect to a machine, use the 'connect [ip/hostname]' command. You can type in " +
"the ip or the hostname, but dont use both. (Alternatively, " +
"the 'telnet [ip/hostname]' command does the same thing).<br><br>" +
"the ip or the hostname, but dont use both.<br><br>" +
"Let's try this now by connecting to the 'foodnstuff' server (connect foodnstuff)");
//next step triggered by terminal command
break;

@ -27,6 +27,15 @@ var postNetburnerText = function() {
post("Bitburner v" + CONSTANTS.Version);
}
/*
$(document).keyup(function(event) {
//Enter
if (event.keyCode == 13) {
}
});
*/
//Defines key commands in terminal
$(document).keydown(function(event) {
//Terminal
@ -36,6 +45,7 @@ $(document).keydown(function(event) {
//Enter
if (event.keyCode == 13) {
event.preventDefault();
var command = $('input[class=terminal-input]').val();
if (command.length > 0) {
post("> " + command);
@ -501,7 +511,6 @@ var Terminal = {
postNetburnerText();
break;
case "connect":
case "telnet":
//Disconnect from current server in terminal and connect to new one
if (commandArray.length != 2) {
post("Incorrect usage of connect/telnet command. Usage: connect/telnet [ip/hostname]");
@ -644,7 +653,6 @@ var Terminal = {
}
Engine.loadScriptEditorContent(scriptname, "");
break;
case "netstat":
case "scan":
Terminal.executeScanCommand(commandArray);
break;