UFO: Alien Invasion
ui_node_option.cpp File Reference
#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_sprite.h"
#include "ui_node_abstractnode.h"
#include "ui_node_option.h"
#include "../../client.h"
#include "../../../common/scripts_lua.h"
Include dependency graph for ui_node_option.cpp:

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   optionExtraData_t
 
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)
 
#define EXTRADATACONST(node)   UI_EXTRADATACONST(node, EXTRADATA_TYPE)
 

Functions

int UI_OptionUpdateCache (uiNode_t *option)
 update option cache about child, according to collapse and visible status More...
 
static void UI_InitOption (uiNode_t *option, const char *label, const char *value)
 Initializes an option with a very little set of values. More...
 
uiNode_tUI_AllocOptionNode (const char *name, const char *label, const char *value)
 Initializes an option with a very little set of values. More...
 
void UI_Option_SetLabel (uiNode_t *node, const char *text)
 
void UI_Option_SetValue (uiNode_t *node, const char *text)
 
void UI_Option_SetIconByName (uiNode_t *node, const char *name)
 
void UI_RegisterOptionNode (uiBehaviour_t *behaviour)
 

Variables

const uiBehaviour_tui_optionBehaviour = nullptr
 
static const value_tpropertyCollapsed
 

Macro Definition Documentation

◆ EXTRADATA

#define EXTRADATA (   node)    UI_EXTRADATA(node, EXTRADATA_TYPE)

Definition at line 42 of file ui_node_option.cpp.

◆ EXTRADATA_TYPE

#define EXTRADATA_TYPE   optionExtraData_t

Definition at line 41 of file ui_node_option.cpp.

◆ EXTRADATACONST

#define EXTRADATACONST (   node)    UI_EXTRADATACONST(node, EXTRADATA_TYPE)

Definition at line 43 of file ui_node_option.cpp.

Function Documentation

◆ UI_AllocOptionNode()

uiNode_t * UI_AllocOptionNode ( const char *  name,
const char *  label,
const char *  value 
)

Initializes an option with a very little set of values.

Parameters
[in]nameThe name of the new node
[in]labellabel displayed
[in]valuevalue used when this option is selected

Definition at line 126 of file ui_node_option.cpp.

References name, UI_AllocNode(), and UI_InitOption().

Referenced by UI_AddOption().

◆ UI_InitOption()

static void UI_InitOption ( uiNode_t option,
const char *  label,
const char *  value 
)
static

Initializes an option with a very little set of values.

Parameters
[in]optionContext option
[in]labellabel displayed
[in]valuevalue used when this option is selected

Definition at line 112 of file ui_node_option.cpp.

References uiNode_t::behaviour, OPTIONEXTRADATA, Q_strncpyz(), and ui_optionBehaviour.

Referenced by UI_AllocOptionNode().

◆ UI_Option_SetIconByName()

void UI_Option_SetIconByName ( uiNode_t node,
const char *  name 
)

Definition at line 142 of file ui_node_option.cpp.

References name, OPTIONEXTRADATA, and UI_GetSpriteByName().

Referenced by uiOptionNode_t_set_icon().

◆ UI_Option_SetLabel()

void UI_Option_SetLabel ( uiNode_t node,
const char *  text 
)

Definition at line 134 of file ui_node_option.cpp.

References OPTIONEXTRADATA, and Q_strncpyz().

Referenced by uiOptionNode_t_set_label().

◆ UI_Option_SetValue()

void UI_Option_SetValue ( uiNode_t node,
const char *  text 
)

Definition at line 138 of file ui_node_option.cpp.

References OPTIONEXTRADATA, and Q_strncpyz().

Referenced by uiOptionNode_t_set_value().

◆ UI_OptionUpdateCache()

int UI_OptionUpdateCache ( uiNode_t option)

update option cache about child, according to collapse and visible status

Note
can be a common function for all option node
Returns
number of visible elements

Definition at line 53 of file ui_node_option.cpp.

References uiNode_t::behaviour, count, uiNode_t::firstChild, uiNode_t::invis, uiNode_t::next, OPTIONEXTRADATA, ui_optionBehaviour, and UI_OptionUpdateCache().

Referenced by UI_OptionTreeNodeUpdateCache(), and UI_OptionUpdateCache().

◆ UI_RegisterOptionNode()

void UI_RegisterOptionNode ( uiBehaviour_t behaviour)

Variable Documentation

◆ propertyCollapsed

const value_t* propertyCollapsed
static

Definition at line 45 of file ui_node_option.cpp.

Referenced by uiOptionNode::onPropertyChanged(), and UI_RegisterOptionNode().

◆ ui_optionBehaviour