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:
+17
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user