#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_actions.h"
#include "../ui_font.h"
#include "../ui_input.h"
#include "../ui_icon.h"
#include "../ui_render.h"
#include "../ui_tooltip.h"
#include "ui_node_tab.h"
#include "ui_node_abstractnode.h"
#include "ui_node_abstractoption.h"
#include "../../client.h"
#include "../../input/cl_input.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE abstractOptionExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Enumerations | |
enum | mn_tab_type_t { UI_TAB_NOTHING = 0, UI_TAB_NORMAL = 1, UI_TAB_SELECTED = 2, UI_TAB_HIGHLIGHTED = 3, UI_TAB_DISABLED = 4 } |
Functions | |
static uiNode_t * | UI_TabNodeTabAtPosition (const uiNode_t *node, int x, int y) |
Return a tab located at a screen position. | |
static void | UI_TabNodeClick (uiNode_t *node, int x, int y) |
Handles tab clicks. | |
static void | UI_TabNodeDrawPlain (const char *image, int x, int y, int width, mn_tab_type_t type) |
Normalized access to the texture structure of tab to display the plain part of a tab. | |
static void | UI_TabNodeDrawJunction (const char *image, int x, int y, mn_tab_type_t leftType, mn_tab_type_t rightType) |
Normalized access to the texture structure of tab to display a junction between each tabs. | |
static void | UI_TabNodeDraw (uiNode_t *node) |
static void | UI_TabNodeDrawTooltip (uiNode_t *node, int x, int y) |
Custom tooltip of tab node. | |
static void | UI_TabNodeInit (uiNode_t *node) |
void | UI_RegisterTabNode (uiBehaviour_t *behaviour) |
Variables | |
static const int | TILE_WIDTH = 33 |
static const int | TILE_HEIGHT = 36 |
static const int | TILE_SIZE = 40 |
Definition in file ui_node_tab.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 42 of file ui_node_tab.c.
#define EXTRADATA_TYPE abstractOptionExtraData_t |
Definition at line 41 of file ui_node_tab.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 43 of file ui_node_tab.c.
enum mn_tab_type_t |
Definition at line 45 of file ui_node_tab.c.
void UI_RegisterTabNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 342 of file ui_node_tab.c.
References uiBehaviour_s::draw, uiBehaviour_s::drawItselfChild, uiBehaviour_s::drawTooltip, uiBehaviour_s::extends, uiBehaviour_s::init, uiBehaviour_s::leftClick, uiBehaviour_s::name, qtrue, UI_TabNodeClick(), UI_TabNodeDraw(), UI_TabNodeDrawTooltip(), and UI_TabNodeInit().
static void UI_TabNodeClick | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Handles tab clicks.
Definition at line 127 of file ui_node_tab.c.
References uiNode_s::disabled, OPTIONEXTRADATA, uiNode_s::state, UI_AbstractOptionGetCurrentValue(), UI_AbstractOptionSetCurrentValue(), and UI_TabNodeTabAtPosition().
Referenced by UI_RegisterTabNode().
static void UI_TabNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 175 of file ui_node_tab.c.
References _, ALIGN_UL, uiNode_s::behaviour, uiNode_s::disabled, EXTRADATA, uiNode_s::firstChild, ICON_STATUS_DISABLED, ICON_STATUS_NORMAL, uiNode_s::image, uiNode_s::invis, LONGLINES_PRETTYCHOP, mousePosX, mousePosY, uiNode_s::next, OPTIONEXTRADATA, pos, qfalse, qtrue, R_FontTextSize(), uiNode_s::size, uiNode_s::state, TILE_HEIGHT, TILE_WIDTH, UI_AbstractOptionGetCurrentValue(), UI_DrawIconInBox(), UI_DrawString(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), UI_GetReferenceString(), ui_optionBehaviour, UI_TAB_DISABLED, UI_TAB_HIGHLIGHTED, UI_TAB_NORMAL, UI_TAB_NOTHING, UI_TAB_SELECTED, UI_TabNodeDrawJunction(), UI_TabNodeDrawPlain(), and UI_TabNodeTabAtPosition().
Referenced by UI_RegisterTabNode().
static void UI_TabNodeDrawJunction | ( | const char * | image, | |
int | x, | |||
int | y, | |||
mn_tab_type_t | leftType, | |||
mn_tab_type_t | rightType | |||
) | [inline, static] |
Normalized access to the texture structure of tab to display a junction between each tabs.
[in] | image | The normalized tab texture to use |
[in] | x | The upper-left position of the screen to draw the texture |
[in] | y | The upper-left position of the screen to draw the texture |
[in] | leftType | The status of the left tab of the junction we display |
[in] | rightType | The status of the right tab of the junction we display |
Definition at line 169 of file ui_node_tab.c.
References TILE_HEIGHT, TILE_SIZE, TILE_WIDTH, and UI_DrawNormImageByName().
Referenced by UI_TabNodeDraw().
static void UI_TabNodeDrawPlain | ( | const char * | image, | |
int | x, | |||
int | y, | |||
int | width, | |||
mn_tab_type_t | type | |||
) | [inline, static] |
Normalized access to the texture structure of tab to display the plain part of a tab.
[in] | image | The normalized tab texture to use |
[in] | x | The upper-left position of the screen to draw the texture |
[in] | y | The upper-left position of the screen to draw the texture |
[in] | width | The width size of the screen to use (stretch) |
[in] | type | The status of the tab we display |
Definition at line 154 of file ui_node_tab.c.
References TILE_HEIGHT, TILE_SIZE, TILE_WIDTH, and UI_DrawNormImageByName().
Referenced by UI_TabNodeDraw().
static void UI_TabNodeDrawTooltip | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Custom tooltip of tab node.
[in] | node | Node we request to draw tooltip |
[in] | x | Position x of the mouse |
[in] | y | Position y of the mouse |
Definition at line 292 of file ui_node_tab.c.
References _, OPTIONEXTRADATA, UI_DrawTooltip(), and UI_TabNodeTabAtPosition().
Referenced by UI_RegisterTabNode().
static void UI_TabNodeInit | ( | uiNode_t * | node | ) | [static] |
called when the window is pushed check cvar then, reduce runtime check
Definition at line 316 of file ui_node_tab.c.
References uiNode_s::behaviour, Com_Printf(), Cvar_FindVar(), Cvar_ForceSet(), EXTRADATA, uiNode_s::firstChild, OPTIONEXTRADATA, UI_GetPath(), and ui_optionBehaviour.
Referenced by UI_RegisterTabNode().
Return a tab located at a screen position.
[in] | node | A tab node |
[in] | x | The x position of the screen to test |
[in] | y | The x position of the screen to test |
improve test when we are on a junction
improve test when we are on a chopped tab
Definition at line 66 of file ui_node_tab.c.
References _, uiNode_s::behaviour, EXTRADATACONST, uiNode_s::firstChild, uiNode_s::invis, LONGLINES_PRETTYCHOP, uiNode_s::next, OPTIONEXTRADATA, R_FontTextSize(), uiNode_s::size, TILE_WIDTH, UI_GetFontFromNode(), UI_NodeAbsoluteToRelativePos(), and ui_optionBehaviour.
Referenced by UI_TabNodeClick(), UI_TabNodeDraw(), and UI_TabNodeDrawTooltip().
const int TILE_HEIGHT = 36 [static] |
Definition at line 54 of file ui_node_tab.c.
const int TILE_SIZE = 40 [static] |
Definition at line 55 of file ui_node_tab.c.
const int TILE_WIDTH = 33 [static] |
Definition at line 53 of file ui_node_tab.c.
Referenced by UI_TabNodeDraw(), UI_TabNodeDrawJunction(), UI_TabNodeDrawPlain(), and UI_TabNodeTabAtPosition().