UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_node_data.cpp
Go to the documentation of this file.
1
12
13
/*
14
Copyright (C) 2002-2025 UFO: Alien Invasion.
15
16
This program is free software; you can redistribute it and/or
17
modify it under the terms of the GNU General Public License
18
as published by the Free Software Foundation; either version 2
19
of the License, or (at your option) any later version.
20
21
This program is distributed in the hope that it will be useful,
22
but WITHOUT ANY WARRANTY; without even the implied warranty of
23
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24
25
See the GNU General Public License for more details.
26
27
You should have received a copy of the GNU General Public License
28
along with this program; if not, write to the Free Software
29
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30
31
*/
32
33
#include "
../ui_nodes.h
"
34
#include "
../ui_parse.h
"
35
#include "
../ui_behaviour.h
"
36
#include "
ui_node_data.h
"
37
#include "
ui_node_abstractnode.h
"
38
39
#include "
../../client.h
"
40
41
#include "
../../../common/scripts_lua.h
"
42
43
#define EXTRADATA_TYPE dataExtraData_t
44
#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
45
#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
46
47
void
UI_RegisterDataNode
(
uiBehaviour_t
* behaviour)
48
{
49
behaviour->
name
=
"data"
;
50
behaviour->
isVirtual
=
true
;
51
behaviour->
extraDataSize
=
sizeof
(
EXTRADATA_TYPE
);
52
behaviour->
manager
=
UINodePtr
(
new
uiDataNode
());
53
behaviour->
lua_SWIG_typeinfo
=
UI_SWIG_TypeQuery
(
"uiDataNode_t *"
);
54
55
/* Store a string into the node.
56
* @note you should note store a cvar ref
57
* @todo use a REF_STRING when it is possible
58
*/
59
UI_RegisterOveridedNodeProperty
(behaviour,
"string"
);
60
61
/* Store a float number into the node. */
62
UI_RegisterExtradataNodeProperty
(behaviour,
"number"
,
V_FLOAT
,
EXTRADATA_TYPE
, number);
63
64
/* Store a integer number into the node. */
65
UI_RegisterExtradataNodeProperty
(behaviour,
"integer"
,
V_INT
,
EXTRADATA_TYPE
, integer);
66
}
uiDataNode
Definition
ui_node_data.h:27
client.h
Primary header for client.
V_FLOAT
@ V_FLOAT
Definition
scripts.h:54
V_INT
@ V_INT
Definition
scripts.h:52
scripts_lua.h
Header for lua script functions.
uiBehaviour_t
node behaviour, how a node work
Definition
ui_behaviour.h:39
uiBehaviour_t::name
const char * name
Definition
ui_behaviour.h:41
uiBehaviour_t::lua_SWIG_typeinfo
void * lua_SWIG_typeinfo
Definition
ui_behaviour.h:57
uiBehaviour_t::isVirtual
bool isVirtual
Definition
ui_behaviour.h:45
uiBehaviour_t::manager
UINodePtr manager
Definition
ui_behaviour.h:43
uiBehaviour_t::extraDataSize
intptr_t extraDataSize
Definition
ui_behaviour.h:54
ui_behaviour.h
UI_RegisterOveridedNodeProperty
#define UI_RegisterOveridedNodeProperty(BEHAVIOUR, NAME)
Initialize a property which override an inherited property. It is yet only used for the documentation...
Definition
ui_behaviour.h:117
UI_RegisterExtradataNodeProperty
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
Definition
ui_behaviour.h:109
UI_SWIG_TypeQuery
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
Definition
ui_lua_shared.cpp:2903
ui_node_abstractnode.h
UINodePtr
SharedPtr< uiNode > UINodePtr
Definition
ui_node_abstractnode.h:66
EXTRADATA_TYPE
#define EXTRADATA_TYPE
Definition
ui_node_abstractoption.cpp:38
UI_RegisterDataNode
void UI_RegisterDataNode(uiBehaviour_t *behaviour)
Definition
ui_node_data.cpp:47
ui_node_data.h
ui_nodes.h
ui_parse.h
src
client
ui
node
ui_node_data.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0