From c78d1d193887fdf1d738a0a617d2da9701667f14 Mon Sep 17 00:00:00 2001
From: mcmlxxix <>
Date: Tue, 14 Apr 2009 19:30:00 +0000
Subject: [PATCH] Added command list method

---
 xtrn/chess/menu.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/xtrn/chess/menu.js b/xtrn/chess/menu.js
index 9eb904d0e5..f9f8965255 100644
--- a/xtrn/chess/menu.js
+++ b/xtrn/chess/menu.js
@@ -53,6 +53,20 @@ function 	Menu(x,y,color,hkey_color)
 			if(e<enabled.length-1) write(console.ansi(ANSI_NORMAL) + " ");
 		}
 	}
+	this.getList=function()
+	{
+		var list=[];
+		list.push(this.color + "\1hMenu Commands:");
+		var items=this.countEnabled();
+		for(item in items)
+		{
+			var cmd=this.items[items[item]];
+			var text=(cmd.displayColor + "[" + cmd.keyColor + cmd.hotkey.toUpperCase() + cmd.displayColor + "] ");
+			text+=cmd.item.replace(("~" + cmd.hotkey) , (cmd.hotkey));
+			list.push(text);
+		}
+		return list;
+	}
 	this.displayHorizontal=function()
 	{
 		var enabled=this.countEnabled();
@@ -69,7 +83,7 @@ function 	Menu(x,y,color,hkey_color)
 }
 function 	MenuItem(item,color,hotkey,hkey_color)
 {							
-	this.item=item;
+	this.item=color + item;
 	this.displayColor=color;
 	this.keyColor=hkey_color;
 	this.hotkey=hotkey;
-- 
GitLab