Persist terminal command history in game save

Copy the terminal commands into the player object so that they are saved
between game reloads.

Adds a 'history' command to display history, and a 'history -c' command
to clear it from both the current terminal & the player's save.
This commit is contained in:
Martin Fournier
2022-01-15 06:26:58 -05:00
parent 07fe3c1906
commit e7aa977eb0
6 changed files with 46 additions and 0 deletions
+2
View File
@@ -77,6 +77,7 @@ export class PlayerObject implements IPlayer {
sourceFiles: IPlayerOwnedSourceFile[];
exploits: Exploit[];
achievements: PlayerAchievement[];
terminalCommandHistory: string[];
lastUpdate: number;
totalPlaytime: number;
@@ -471,6 +472,7 @@ export class PlayerObject implements IPlayer {
this.exploits = [];
this.achievements = [];
this.terminalCommandHistory = [];
this.init = generalMethods.init;
this.prestigeAugmentation = generalMethods.prestigeAugmentation;