25 #include "../ui_nodes.h" 26 #include "../ui_parse.h" 27 #include "../ui_behaviour.h" 28 #include "../ui_render.h" 29 #include "../ui_actions.h" 34 #include "../../../common/scripts_lua.h" 36 #define EXTRADATA_TYPE tbarExtraData_t 37 #define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) 38 #define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) 40 #define TEXTURE_WIDTH 250.0 61 const float min =
getMin(node);
62 const float max =
getMax(node);
69 ps = (value - min) / (max - min) * 100;
71 shx += round(ps * pointWidth);
87 behaviour->
name =
"tbar";
88 behaviour->
extends =
"abstractvalue";
bool Q_strnull(const char *string)
memPool_t * ui_dynStringPool
float getMax(uiNode_t const *node)
float getValue(uiNode_t const *node)
Define common thing for GUI controls which allow to edit a value (scroolbar, spinner, and more)
void UI_FreeStringProperty(void *pointer)
Free a string property if it is allocated into ui_dynStringPool.
void draw(uiNode_t *node) override
void UI_RegisterTBarNode(uiBehaviour_t *behaviour)
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
Atomic structure used to define most of the UI.
const image_t * UI_DrawNormImageByName(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const char *name)
Draws an image or parts of it.
SharedPtr< uiNode > UINodePtr
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
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.
float getMin(uiNode_t const *node)
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void UI_TBar_SetImage(uiNode_t *node, const char *name)
#define Mem_PoolStrDup(in, pool, tagNum)
node behaviour, how a node work