mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Changed tabbing i script editor so that it uses four spaces rather than the tab char"
This commit is contained in:
parent
c0f5f9da9e
commit
b8ccddf256
@ -15,7 +15,7 @@ CONSTANTS = {
|
||||
BaseCostFor1GBOfRamHacknetNode: 30000,
|
||||
|
||||
BaseCostForHacknetNode: 1000,
|
||||
BaseCostForHacknetNodeCore: 1000000,
|
||||
BaseCostForHacknetNodeCore: 250000,
|
||||
|
||||
/* Hacknet Node constants */
|
||||
HacknetNodeMoneyGainPerLevel: 1,
|
||||
|
@ -17,9 +17,15 @@ function scriptEditorInit() {
|
||||
textareas[i].onkeydown = function(e){
|
||||
if(e.keyCode==9 || e.which==9){
|
||||
e.preventDefault();
|
||||
var s = this.selectionStart;
|
||||
this.value = this.value.substring(0,this.selectionStart) + "\t" + this.value.substring(this.selectionEnd);
|
||||
this.selectionEnd = s+1;
|
||||
var start = this.selectionStart;
|
||||
var end = this.selectionEnd;
|
||||
|
||||
// set textarea value to: text before caret + tab + text after caret
|
||||
spaces = " ";
|
||||
this.value = this.value.substring(0, start) + spaces + this.value.substring(end);
|
||||
|
||||
// put caret at right position again
|
||||
this.selectionStart = this.selectionEnd = start + spaces.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ $(document).keydown(function(event) {
|
||||
|
||||
//Enter
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
event.preventDefault(); //Prevent newline from being entered in Script Editor
|
||||
var command = $('input[class=terminal-input]').val();
|
||||
if (command.length > 0) {
|
||||
post("> " + command);
|
||||
|
Loading…
Reference in New Issue
Block a user