UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_optiontree.cpp File Reference
#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_actions.h"
#include "../ui_font.h"
#include "../ui_data.h"
#include "../ui_sprite.h"
#include "../ui_render.h"
#include "../ui_input.h"
#include "../ui_lua.h"
#include "ui_node_abstractoption.h"
#include "ui_node_abstractnode.h"
#include "ui_node_optiontree.h"
#include "ui_node_option.h"
#include "ui_node_panel.h"
#include "../../cl_language.h"
#include "../../input/cl_keys.h"
#include "../../../common/scripts_lua.h"
Include dependency graph for ui_node_optiontree.cpp:

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   abstractOptionExtraData_t
#define EXTRADATA(node)

Functions

static void UI_OptionTreeNodeUpdateScroll (uiNode_t *node)
 Update the scroll according to the number of items and the size of the node.
static uiNode_tUI_OptionTreeNodeGetFirstOption (uiNode_t *node)
 Return the first option of the node.
static void UI_OptionTreeNodeUpdateCache (uiNode_t *node)
static uiNode_tUI_OptionTreeNodeGetOptionAtPosition (uiNode_t *node, int x, int y, int *depth)
void UI_OptionTree_SelectValue (uiNode_t *node, const char *value)
static void UI_OptionTreeSetSelectedValue (uiNode_t *node, const uiCallContext_t *context)
void UI_RegisterOptionTreeNode (uiBehaviour_t *behaviour)

Variables

static const int COLLAPSEBUTTON_WIDTH = 20
static const int DEPTH_WIDTH = 25
static uiSprite_tsystemCollapse
static uiSprite_tsystemExpand
static int mouseScrollX
static int mouseScrollY

Detailed Description

Todo
manage disabled option

Definition in file ui_node_optiontree.cpp.

Macro Definition Documentation

◆ EXTRADATA

◆ EXTRADATA_TYPE

#define EXTRADATA_TYPE   abstractOptionExtraData_t

Definition at line 48 of file ui_node_optiontree.cpp.

Function Documentation

◆ UI_OptionTree_SelectValue()

◆ UI_OptionTreeNodeGetFirstOption()

uiNode_t * UI_OptionTreeNodeGetFirstOption ( uiNode_t * node)
static

Return the first option of the node.

Todo
we should remove this call loop
Todo
check versionId and update cached data, and fire events
Todo
FIXME it MUST be an option behaviour

Definition at line 103 of file ui_node_optiontree.cpp.

References uiNode_t::behaviour, EXTRADATA, uiNode_t::firstChild, UI_GetDataVersion(), UI_GetOption(), ui_optionBehaviour, UI_OptionTreeNodeUpdateCache(), and v.

Referenced by uiOptionTreeNode::draw(), UI_OptionTree_SelectValue(), UI_OptionTreeNodeGetOptionAtPosition(), and UI_OptionTreeNodeUpdateCache().

◆ UI_OptionTreeNodeGetOptionAtPosition()

◆ UI_OptionTreeNodeUpdateCache()

◆ UI_OptionTreeNodeUpdateScroll()

void UI_OptionTreeNodeUpdateScroll ( uiNode_t * node)
static

Update the scroll according to the number of items and the size of the node.

Definition at line 65 of file ui_node_optiontree.cpp.

References uiNode_t::box, count, EXTRADATA, uiNode_t::padding, uiBox_t::size, UI_ExecuteEventActions(), UI_ExecuteLuaEventScript(), UI_FontGetHeight(), and UI_GetFontFromNode().

Referenced by uiOptionTreeNode::draw(), and UI_OptionTree_SelectValue().

◆ UI_OptionTreeSetSelectedValue()

void UI_OptionTreeSetSelectedValue ( uiNode_t * node,
const uiCallContext_t * context )
static

◆ UI_RegisterOptionTreeNode()

Variable Documentation

◆ COLLAPSEBUTTON_WIDTH

const int COLLAPSEBUTTON_WIDTH = 20
static

Size used for the collapse button

Definition at line 51 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw(), and uiOptionTreeNode::onLeftClick().

◆ DEPTH_WIDTH

const int DEPTH_WIDTH = 25
static

Width between each depth level

Definition at line 52 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw(), and uiOptionTreeNode::onLeftClick().

◆ mouseScrollX

int mouseScrollX
static

Definition at line 58 of file ui_node_optiontree.cpp.

◆ mouseScrollY

int mouseScrollY
static

Definition at line 59 of file ui_node_optiontree.cpp.

◆ systemCollapse

uiSprite_t* systemCollapse
static

Definition at line 54 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw().

◆ systemExpand

uiSprite_t* systemExpand
static

Definition at line 55 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw().