55#define EXTRADATA(node) UI_EXTRADATA(node, abstractScrollbarExtraData_t)
63 const int low = cuttableSize * ((float)(
EXTRADATA(node).pos + 0) / (float)
EXTRADATA(node).fullsize);
64 const int middle = cuttableSize * ((float)(
EXTRADATA(node).viewsize) / (float)
EXTRADATA(node).fullsize);
65 const int hight = cuttableSize - low - middle;
69 description[3] = hight;
71 assert(description[0] + description[1] + description[2] + description[3] + description[4] == node->
box.
size[1]);
83 for (
int i = 0;
i < 5;
i++) {
84 if (y < description[
i])
105 if (
timer->calledTime == 1) {
117 switch (hoveredElement) {
227 const int posSize =
EXTRADATA(node).fullsize;
234 const int pos =
oldPos + (((float)y * (float)posSize) / (float)graphicSize);
285 int hoveredElement = -1;
290 else if (node->
state)
295 texX = (hoveredElement == 0) ?
TILE_WIDTH : 0;
302 if (description[1]) {
303 texX = (hoveredElement == 1) ?
TILE_WIDTH : 0;
312 texX = (hoveredElement == 2) ?
TILE_WIDTH : 0;
321 if (description[2]) {
337 if (description[3]) {
338 texX = (hoveredElement == 3) ?
TILE_WIDTH : 0;
348 texX = (hoveredElement == 4) ?
TILE_WIDTH : 0;
369 behaviour->
name =
"vscrollbar";
370 behaviour->
extends =
"abstractscrollbar";
Header file for keyboard handler.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
Header for lua script functions.
node behaviour, how a node work
Atomic structure used to define most of the UI.
#define UI_RegisterNodeProperty(BEHAVIOUR, NAME, TYPE, OBJECTTYPE, ATTRIBUTE)
Initialize a property.
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
static uiTimer_t * capturedTimer
static const int TILE_HEIGHT
static const int TILE_WIDTH
const char * UI_GetPath(const uiNode_t *node)
Return a path from a window to a node.
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
const struct image_s * UI_LoadImage(const char *name)
Searches for an image in the image array.
void UI_DrawNormImage(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const image_t *image)
Draw a normalized (to the screen) image.
uiTimer_t * UI_AllocTimer(uiNode_t *node, int firstDelay, timerCallback_t callback)
Allocate a new time for a node.
void UI_TimerStart(uiTimer_t *timer)
Restart a timer.
void UI_TimerRelease(uiTimer_t *timer)
Release the timer. It no more exists.