45#define EXTRADATA_TYPE abstractOptionExtraData_t
46#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
47#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
76 if (x < 0 || y < 0 || x >= node->
box.
size[0] || y >= node->
box.
size[1])
100 if (tabWidth > allowedWidth) {
101 if (allowedWidth > 0)
102 tabWidth = allowedWidth;
110 allowedWidth -= tabWidth;
130 if (option ==
nullptr)
151 uiNode_t* overMouseOption =
nullptr;
158 int currentX = pos[0];
169 bool drawIcon =
false;
175 option = option->
next;
184 }
else if (option == overMouseOption) {
193 tabWidth = fontWidth;
198 if (tabWidth > allowedWidth) {
199 if (allowedWidth > 0)
200 tabWidth = allowedWidth;
216 OPTIONEXTRADATA(option).truncated = tabWidth < fontWidth || tabWidth == 0;
219 currentX += tabWidth;
220 allowedWidth -= tabWidth;
223 option = option->
next;
235 const int tooltipWidth = 250;
238 if (option ==
nullptr)
278 behaviour->
name =
"tab";
279 behaviour->
extends =
"abstractoption";
const char * CL_Translate(const char *t)
void R_FontTextSize(const char *fontId, const char *text, int maxWidth, longlines_t method, int *width, int *height, int *lines, bool *isTruncated)
Supply information about the size of the text when it is linewrapped and rendered,...
void draw(uiNode_t *node) override
void onLeftClick(uiNode_t *node, int x, int y) override
Handles tab clicks.
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
void drawTooltip(const uiNode_t *node, int x, int y) const override
Custom tooltip of tab node.
void Com_Printf(const char *const fmt,...)
cvar_t * Cvar_ForceSet(const char *varName, const char *value)
Will set the variable even if NOSET or LATCH.
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
Header for lua script functions.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
node behaviour, how a node work
Atomic structure used to define most of the UI.
uiBehaviour_t * behaviour
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_NodeAbsoluteToRelativePos(const uiNode_t *node, int *x, int *y)
Update an absolute position to a relative one.
void UI_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
SharedPtr< uiNode > UINodePtr
const char * UI_AbstractOption_GetCurrentValue(uiNode_t *node)
void UI_AbstractOption_SetCurrentValue(uiNode_t *node, const char *value)
const uiBehaviour_t * ui_optionBehaviour
#define OPTIONEXTRADATA(node)
static uiNode_t * UI_TabNodeTabAtPosition(const uiNode_t *node, int x, int y)
Return a tab located at a screen position.
static const int TILE_HEIGHT
static const int TILE_WIDTH
#define EXTRADATACONST(node)
void UI_RegisterTabNode(uiBehaviour_t *behaviour)
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.
int UI_DrawString(const char *fontID, align_t align, int x, int y, int absX, int maxWidth, int lineHeight, const char *c, int boxHeight, int scrollPos, int *curLine, bool increaseLine, longlines_t method)
void UI_PlaySound(const char *soundFile)
Plays a ui sound.
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)