43#define EXTRADATA(node) UI_EXTRADATA(node, textExtraData_t)
44#define EXTRADATACONST(node) UI_EXTRADATACONST(node, textExtraData_t)
55 if (lineHeight == 0) {
62 return (
int) (y / lineHeight) +
EXTRADATACONST(node).super.scrollY.viewPos;
92 viewSizeY = node->
box.
size[1] / lineHeight;
94 viewSizeY =
EXTRADATA(node).super.scrollY.viewSize;
103 colorHover[3] = node->
color[3];
118 const char* text = (
const char*) list->
data;
119 if (currentY > maxHeight)
139 currentY += lineHeight;
170 Com_Printf(
"UI_TextListNodeDraw: Only linkedlist text supported (dataid %d).\n",
EXTRADATA(node).dataID);
186 if (line < 0 || line >=
EXTRADATA(node).super.scrollY.fullSize)
189 if (line !=
EXTRADATA(node).textLineSelected) {
216 if (line < 0 || line >=
EXTRADATA(node).super.scrollY.fullSize)
219 if (line !=
EXTRADATA(node).textLineSelected) {
249 behaviour->
name =
"textlist";
void R_Color(const vec4_t rgba)
Change the color to given value.
void onLeftClick(uiNode_t *node, int x, int y) override
Calls the script command for a text node that is clickable.
void drawText(uiNode_t *node, const linkedList_t *list)
Handles line breaks and drawing for shared data text.
void onLoading(uiNode_t *node) override
void onRightClick(uiNode_t *node, int x, int y) override
Calls the script command for a text node that is clickable via right mouse button.
void draw(uiNode_t *node) override
Draw a text node.
void onMouseMove(uiNode_t *node, int x, int y) override
Primary header for client.
void Com_Printf(const char *const fmt,...)
Shared parsing functions.
align_t
We need this here for checking the boundaries from script values.
Header for lua script functions.
node behaviour, how a node work
Atomic structure used to define most of the UI.
LUA_EVENT lua_onRightClick
struct uiAction_s * onChange
struct uiAction_s * onClick
struct uiAction_s * onRightClick
union uiSharedData_t::@061052176262211162172023345235067125273303251247 data
linkedList_t * linkedListText
Holds a linked list for displaying in the UI.
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
void UI_ResetData(int dataId)
Reset a shared data. Type became NONE and value became nullptr.
Data and interface to share data.
@ UI_SHARED_LINKEDLISTTEXT
int UI_FontGetHeight(const char *fontID)
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
Internal data use by the UI package.
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
bool UI_ExecuteLuaEventScript_XY(uiNode_t *node, LUA_EVENT event, int x, int y)
Executes a lua event handler with (x,y) argument.
Basic lua initialization for the ui.
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_TextNodeGetSelectedText(uiNode_t *node, int num)
static int UI_TextListNodeGetLine(const uiNode_t *node, int x, int y)
Get the line number under an absolute position.
void UI_RegisterTextListNode(uiBehaviour_t *behaviour)
#define EXTRADATACONST(node)
int UI_DrawStringInBox(const char *fontID, align_t align, int x, int y, int width, int height, const char *text, longlines_t method)
draw a line into a bounding box
#define Vector4Set(v, r, g, b, a)
#define VectorScale(in, scale, out)