new menu for edit mode key binds

Two new commands, menuitemeditkeyinput and menuitemspectkeyinput, both
work the same as menuitemkeyinput - only for edit and spect binds.
The new edit keys menu should also work fine as edit key help :)

menuitem[|edit|spect]keyinput text bindcmd

  Menuitem, that displays "text" and all keys, that bind "bindcmd" - in
  game-, edit- or spect mode.

DOCREF menuitemeditkeyinput menuitemspectkeyinput
This commit is contained in:
ac-stef
2016-08-26 14:34:44 +02:00
parent ebd1c917dc
commit b7d797d73c
4 changed files with 142 additions and 34 deletions
+17 -3
View File
@@ -683,8 +683,8 @@ struct mitemkeyinput : mitem
static const char *unknown, *empty;
bool capture;
mitemkeyinput(gmenu *parent, char *text, char *bindcmd, color *bgcolor) : mitem(parent, bgcolor, mitem::TYPE_KEYINPUT), text(text), bindcmd(bindcmd),
keyname(NULL), isup(0), bindtype(keym::ACTION_DEFAULT), capture(false) {};
mitemkeyinput(gmenu *parent, char *text, char *bindcmd, color *bgcolor, int bindtype) : mitem(parent, bgcolor, mitem::TYPE_KEYINPUT), text(text), bindcmd(bindcmd),
keyname(NULL), isup(0), bindtype(bindtype), capture(false) {};
~mitemkeyinput()
{
@@ -1027,10 +1027,24 @@ COMMAND(menuitemslider, "siisiss");
void menuitemkeyinput(char *text, char *bindcmd)
{
if(!lastmenu) return;
lastmenu->items.add(new mitemkeyinput(lastmenu, newstring(text), newstring(bindcmd), NULL));
lastmenu->items.add(new mitemkeyinput(lastmenu, newstring(text), newstring(bindcmd), NULL, keym::ACTION_DEFAULT));
}
COMMAND(menuitemkeyinput, "ss");
void menuitemeditkeyinput(char *text, char *bindcmd)
{
if(!lastmenu) return;
lastmenu->items.add(new mitemkeyinput(lastmenu, newstring(text), newstring(bindcmd), NULL, keym::ACTION_EDITING));
}
COMMAND(menuitemeditkeyinput, "ss");
void menuitemspectkeyinput(char *text, char *bindcmd)
{
if(!lastmenu) return;
lastmenu->items.add(new mitemkeyinput(lastmenu, newstring(text), newstring(bindcmd), NULL, keym::ACTION_SPECTATOR));
}
COMMAND(menuitemspectkeyinput, "ss");
void menuitemcheckbox(char *text, char *value, char *action)
{
if(!lastmenu) return;