From f4b059297ad7cba4673909c455d19a328e345058 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 20 Aug 2023 17:12:45 -0600 Subject: [PATCH] maximum on dialog history shown --- src/hollywoo/Movie.kiss | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hollywoo/Movie.kiss b/src/hollywoo/Movie.kiss index 47f2bdd..23eb5b9 100644 --- a/src/hollywoo/Movie.kiss +++ b/src/hollywoo/Movie.kiss @@ -14,6 +14,8 @@ (prop &mut :Int captionId 0) (prop :Array> dialogHistory []) + (var MAX_DIALOG_HISTORY 50) + // Mostly immutable, reusable resources: (prop :FuzzyMap sets (new FuzzyMap)) @@ -373,7 +375,12 @@ (shortcutHandler.registerItem "{escape} Pause the movie" ->cc (director.showPauseMenu cc)) (shortcutHandler.registerItem "{tab} show dialog history" - ->cc (director.showDialogHistory dialogHistory cc)) + ->cc { + (director.showDialogHistory + (if (> dialogHistory.length MAX_DIALOG_HISTORY) + (dialogHistory.slice (- dialogHistory.length MAX_DIALOG_HISTORY)) + dialogHistory) cc) + }) (#when debug (shortcutHandler.registerItem "[d]efine [d]elay"