47 #include "../ui_nodes.h"
48 #include "../ui_font.h"
49 #include "../ui_parse.h"
50 #include "../ui_behaviour.h"
51 #include "../ui_tooltip.h"
52 #include "../ui_render.h"
56 #include "../../../common/scripts_lua.h"
58 #define EXTRADATA_TYPE stringExtraData_t
59 #define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
60 #define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
105 R_FontTextSize(font, text, maxWidth, longLines,
nullptr,
nullptr,
nullptr, &isTruncated);
109 const int tooltipWidth = 250;
110 static char tooltiptext[256];
111 tooltiptext[0] =
'\0';
112 Q_strcat(tooltiptext,
sizeof(tooltiptext),
"%s", text);
126 behaviour->
name =
"string";
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 UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
void R_Color(const vec4_t rgba)
Change the color to given value.
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, without actually rendering it. Any of the output parameters may be nullptr.
align_t
We need this here for checking the boundaries from script values.
#define Vector4Set(v, r, g, b, a)
void UI_RegisterStringNode(uiBehaviour_t *behaviour)
SharedPtr< uiNode > UINodePtr
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
Atomic structure used to define most of the UI.
void onLoading(uiNode_t *node) override
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_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
node behaviour, how a node work
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
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 draw(uiNode_t *node) override
#define EXTRADATACONST(node)
void drawTooltip(const uiNode_t *node, int x, int y) const override
Custom tooltip of string node.