Merge pull request #2641 from MartinFournier/feature/save-command-history

Copy terminal command history into game save
This commit is contained in:
hydroflame
2022-01-26 00:47:02 -05:00
committed by GitHub
6 changed files with 46 additions and 0 deletions
+3
View File
@@ -48,6 +48,7 @@ import { free } from "./commands/free";
import { grow } from "./commands/grow";
import { hack } from "./commands/hack";
import { help } from "./commands/help";
import { history } from "./commands/history";
import { home } from "./commands/home";
import { hostname } from "./commands/hostname";
import { kill } from "./commands/kill";
@@ -576,6 +577,7 @@ export class Terminal implements ITerminal {
if (this.commandHistory.length > 50) {
this.commandHistory.splice(0, 1);
}
player.terminalCommandHistory = this.commandHistory;
}
this.commandHistoryIndex = this.commandHistory.length;
const allCommands = ParseCommands(commands);
@@ -785,6 +787,7 @@ export class Terminal implements ITerminal {
grow: grow,
hack: hack,
help: help,
history: history,
home: home,
hostname: hostname,
kill: kill,