This node implements the key binding change and display. More...
#include "../ui_main.h"
#include "../ui_draw.h"
#include "../ui_nodes.h"
#include "../ui_font.h"
#include "../ui_parse.h"
#include "../ui_input.h"
#include "../ui_actions.h"
#include "../ui_render.h"
#include "ui_node_keybinding.h"
#include "ui_node_abstractnode.h"
#include "ui_node_panel.h"
#include "../../client.h"
Go to the source code of this file.
Defines | |
#define | TILE_SIZE 64 |
#define | CORNER_SIZE 17 |
#define | MID_SIZE 1 |
#define | MARGE 3 |
#define | EXTRADATA_TYPE keyBindingExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
Functions | |
static void | UI_KeyBindingNodeClick (uiNode_t *node, int x, int y) |
Called when the user click with the right mouse button. | |
static qboolean | UI_KeyBindingNodeKeyPressed (uiNode_t *node, unsigned int key, unsigned short unicode) |
Called when we press a key when the node got the focus. | |
static void | UI_KeyBindingNodeDraw (uiNode_t *node) |
static void | UI_KeyBindingNodeLoading (uiNode_t *node) |
Call before the script initialization of the node. | |
void | UI_RegisterKeyBindingNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
This node implements the key binding change and display.
Definition in file ui_node_keybinding.c.
#define CORNER_SIZE 17 |
Definition at line 41 of file ui_node_keybinding.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 46 of file ui_node_keybinding.c.
#define EXTRADATA_TYPE keyBindingExtraData_t |
Definition at line 45 of file ui_node_keybinding.c.
#define MARGE 3 |
Definition at line 43 of file ui_node_keybinding.c.
#define MID_SIZE 1 |
Definition at line 42 of file ui_node_keybinding.c.
#define TILE_SIZE 64 |
Definition at line 40 of file ui_node_keybinding.c.
static void UI_KeyBindingNodeClick | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Called when the user click with the right mouse button.
Definition at line 51 of file ui_node_keybinding.c.
References uiNode_s::disabled, uiNode_s::onClick, uiNode_s::text, UI_ExecuteEventActions(), UI_HasFocus(), and UI_RequestFocus().
Referenced by UI_RegisterKeyBindingNode().
static void UI_KeyBindingNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 109 of file ui_node_keybinding.c.
References _, binding, Cmd_GetCommandDesc(), uiNode_s::color, CORNER_SIZE, EXTRADATA, uiNode_s::image, LONGLINES_PRETTYCHOP, MARGE, MID_SIZE, uiNode_s::padding, pos, R_Color(), uiNode_s::selectedColor, uiNode_s::size, uiNode_s::state, uiNode_s::text, uiNode_s::textalign, TILE_SIZE, UI_DrawPanel(), UI_DrawStringInBox(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), UI_GetReferenceString(), UI_HasFocus(), and Vector2Set.
Referenced by UI_RegisterKeyBindingNode().
static qboolean UI_KeyBindingNodeKeyPressed | ( | uiNode_t * | node, | |
unsigned int | key, | |||
unsigned short | unicode | |||
) | [static] |
Called when we press a key when the node got the focus.
Definition at line 74 of file ui_node_keybinding.c.
References _, binding, EXTRADATA, Key_GetBinding(), Key_KeynumToString(), Key_SetBinding(), uiNode_s::onChange, qfalse, qtrue, uiNode_s::text, UI_DisplayNotice(), UI_ExecuteEventActions(), UI_RemoveFocus(), and va().
Referenced by UI_RegisterKeyBindingNode().
static void UI_KeyBindingNodeLoading | ( | uiNode_t * | node | ) | [static] |
Call before the script initialization of the node.
Definition at line 180 of file ui_node_keybinding.c.
References ALIGN_CL, uiNode_s::color, EXTRADATA, uiNode_s::padding, uiNode_s::selectedColor, uiNode_s::textalign, and Vector4Set.
Referenced by UI_RegisterKeyBindingNode().
void UI_RegisterKeyBindingNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 196 of file ui_node_keybinding.c.
References uiBehaviour_s::draw, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::keyPressed, uiBehaviour_s::leftClick, uiBehaviour_s::loading, uiBehaviour_s::name, uiBehaviour_s::properties, UI_KeyBindingNodeClick(), UI_KeyBindingNodeDraw(), UI_KeyBindingNodeKeyPressed(), and UI_KeyBindingNodeLoading().
const value_t properties[] [static] |
{ {"keyspace", V_INT, UI_EXTRADATA_OFFSETOF(keyBindingExtraData_t, keySpace), MEMBER_SIZEOF(keyBindingExtraData_t, keySpace)}, {"bindingwidth", V_INT, UI_EXTRADATA_OFFSETOF(keyBindingExtraData_t, bindingWidth), MEMBER_SIZEOF(keyBindingExtraData_t, bindingWidth)}, {NULL, V_NULL, 0, 0} }
Definition at line 189 of file ui_node_keybinding.c.