39#define EXTRADATA_TYPE abstractValueExtraData_t
40#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
41#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
48 if (*adress ==
nullptr) {
50 **adress = defaultValue;
57 if (
Q_strstart(*(
const char*
const*)sourceData,
"*cvar:")) {
61 *(
const char**)cloneData = *(
const char*
const*)sourceData;
66 **cloneData = **sourceData;
87 EXTRADATA(node).shiftIncreaseFactor = 2.0F;
150 return EXTRADATA(node).shiftIncreaseFactor;
178 else if (value > max)
262 return setValue(node, value + delta);
269 return setValue(node, value - delta);
401 EXTRADATA(node).shiftIncreaseFactor = factor;
406 behaviour->
name =
"abstractvalue";
bool Key_IsDown(unsigned int key)
Checks whether a given key is currently pressed.
Header file for keyboard handler.
bool setDelta(uiNode_t *node, float delta)
void onLoaded(uiNode_t *node) override
bool setMin(uiNode_t *node, float min)
bool setMax(uiNode_t *node, float max)
void initNode(uiNode_t *node) override
float getValue(uiNode_t const *node)
void onLoading(uiNode_t *node) override
float getShiftIncreaseFactor(uiNode_t *const node)
bool setValue(uiNode_t *node, float value)
float getLastDiff(uiNode_t const *node)
bool decValue(uiNode_t *node)
bool incValue(uiNode_t *node)
void deleteNode(uiNode_t *node) override
float getDelta(uiNode_t const *node)
void initNodeDynamic(uiNode_t *node) override
float getFactorFloat(uiNode_t const *node)
float getMax(uiNode_t const *node)
float getMin(uiNode_t const *node)
void clone(uiNode_t const *source, uiNode_t *clone) override
Call to update a cloned node.
void setRange(uiNode_t *node, float min, float max)
virtual void initNodeDynamic(uiNode_t *node)
virtual void onLoading(uiNode_t *node)
virtual void onLoaded(uiNode_t *node)
virtual void deleteNode(uiNode_t *node)
virtual void clone(uiNode_t const *source, uiNode_t *clone)
virtual void initNode(uiNode_t *node)
void Cvar_SetValue(const char *varName, float value)
Expands value to a string and calls Cvar_Set.
#define Mem_PoolAllocType(type, pool)
QGL_EXTERN GLsizei const GLvoid * data
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
struct uiAction_s * onChange
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
Internal data use by the UI package.
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
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...
SharedPtr< uiNode > UINodePtr
void UI_AbstractValue_SetMin(uiNode_t *node, float min)
void UI_AbstractValue_SetValueCvar(uiNode_t *node, const char *value)
float UI_AbstractValue_GetLastDiff(uiNode_t *node)
void UI_AbstractValue_SetRange(uiNode_t *node, float min, float max)
float UI_AbstractValue_GetDelta(uiNode_t *node)
void UI_AbstractValue_SetRangeCvar(uiNode_t *node, const char *min, const char *max)
void UI_AbstractValue_SetMaxCvar(uiNode_t *node, const char *max)
void UI_AbstractValue_DecValue(uiNode_t *node)
float UI_AbstractValue_GetMin(uiNode_t *node)
float UI_AbstractValue_GetValue(uiNode_t *node)
void UI_AbstractValue_SetShiftIncreaseFactor(uiNode_t *node, float factor)
void UI_AbstractValue_SetMax(uiNode_t *node, float max)
void UI_AbstractValue_IncValue(uiNode_t *node)
void UI_AbstractValue_SetValue(uiNode_t *node, float value)
float UI_AbstractValue_GetMax(uiNode_t *node)
void UI_AbstractValue_SetMinCvar(uiNode_t *node, const char *min)
static void UI_InitCvarOrFloat(float **adress, float defaultValue)
Allocates a float and initializes it if the pointer value is not set, else does nothing.
#define EXTRADATACONST(node)
float UI_AbstractValue_GetShiftIncreaseFactor(uiNode_t *node)
static void UI_CloneCvarOrFloat(const uiNode_t *source, uiNode_t *clone, const float *const *sourceData, float **cloneData)
void UI_RegisterAbstractValueNode(uiBehaviour_t *behaviour)
void UI_AbstractValue_SetDelta(uiNode_t *node, float delta)
static void UI_FreeCvarOrFloat(const uiNode_t *node, void **data)
Define common thing for GUI controls which allow to edit a value (scroolbar, spinner,...
float UI_GetReferenceFloat(const uiNode_t *const node, const void *ref)
Returns the value of the reference variable.
float * UI_AllocStaticFloat(int count)
Allocate a float into the UI static memory.