Skip to content
Snippets Groups Projects
Commit c78d1d19 authored by mcmlxxix's avatar mcmlxxix
Browse files

Added command list method

parent d0b2d867
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment