From 6bfe7443914ff3fee94585b13aec7f5abd2582cc Mon Sep 17 00:00:00 2001
From: Lloyd Hannesson <dasme@vert.synchro.net>
Date: Tue, 4 Apr 2023 19:14:36 +0000
Subject: [PATCH] Added key buffer flush to prevent auto skipping prompts.
 Version updated to 1.1.

---
 xtrn/lord/gravyard/gravyard.gra |  2 +-
 xtrn/lord/gravyard/gravyard.js  | 23 +++++++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/xtrn/lord/gravyard/gravyard.gra b/xtrn/lord/gravyard/gravyard.gra
index 9e21c0279e..dc2226809c 100644
--- a/xtrn/lord/gravyard/gravyard.gra
+++ b/xtrn/lord/gravyard/gravyard.gra
@@ -12,7 +12,7 @@
 
         `5�`2[`0e`2]`5� `2Enter Shack
         `5�`2[`0t`2]`5� `2Talk to Grave Digger
-        `5�`2[`0g`2]`5� `2Search the Newly Dug Gave
+        `5�`2[`0g`2]`5� `2Search the Newly Dug Grave
         `5�`2[`0s`2]`5� `2Check Out the Stand!
         `5�`2[`0l`2]`5� `2Flee In Terror!!!!
 
diff --git a/xtrn/lord/gravyard/gravyard.js b/xtrn/lord/gravyard/gravyard.js
index e184c53901..dfb89eaeba 100644
--- a/xtrn/lord/gravyard/gravyard.js
+++ b/xtrn/lord/gravyard/gravyard.js
@@ -5,8 +5,8 @@
 	(c) 2023 Lloyd Hannesson - dasme@dasme.org
 */
 var graName = 'The Warrior\'s Graveyard';
-var graNameFancy = ' `$- `%The Warrior\'s Graveyard `$- ';
-var graVersion = 'JS v1.0';
+var graNameFancy = '`8� `%T`7he `%W`7arrior\'s `%G`7raveyard `8�';
+var graVersion = 'JS v1.1';
 var graDebug = false;
 var menu_redisplay = true;
 var menu_file;
@@ -332,7 +332,9 @@ function command_prompt(currentPlace,menu_keys) {
 
 function press_a_key(no_clear) {
 	var ch;
-	lw('  `2<`0MORE`2>');	
+	//lw('  `2<`0MORE`2>');
+	lw(' `@� `0Press A Key `@�');	
+	flush_keys();	
 	ch = getkey();
 	if(no_clear) {
 		dk.console.print('\r');
@@ -355,6 +357,12 @@ function are_you_sure() {
 	return(false);
 }
 
+function flush_keys() {
+	while (dk.console.waitkey(0)) {
+		dk.console.getkey();
+	}
+}
+
 // Adding in some functions to match the old door driver I used..
 function CharmCheck(Charm) {
 	player.cha = player.cha + parseInt(Charm);
@@ -1003,7 +1011,7 @@ function graKitten() {
 			lw('  `0You gain '+TempInt.toString()+' Strength!');
 			sln('');
 			StrCheck(TempInt);
-			sln('');			
+			sln('');
 			press_a_key();
 			break;
 		case 1:
@@ -1151,7 +1159,7 @@ function graGraveRob() {
 }
 
 /* -=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
-/*	Menus
+/*	Menus                                                                               */
 /* -=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */
 
 function graDebugMenu() {
@@ -1761,11 +1769,10 @@ function main() {
 
 if (argc == 1 && argv[0] == 'INSTALL') {
 	var install = {
-		desc:'`6- `%The Warrior\'s Graveyard `6-'
+		desc:graNameFancy
 	}
 	exit(0);
-}
-else {
+} else {
 	main();
 	exit(0);
 }
-- 
GitLab