UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_model.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 #include "../ui_nodes.h"
28 #include "ui_node_abstractnode.h"
29 #include "../../cl_renderer.h"
31 class uiModelNode : public uiLocatedNode {
32  void draw(uiNode_t* node) override;
33  void onMouseDown(uiNode_t* node, int x, int y, int button) override;
34  void onMouseUp(uiNode_t* node, int x, int y, int button) override;
35  void onLoading(uiNode_t* node) override;
36  void onLoaded(uiNode_t* node) override;
37  void clone(uiNode_t const* source, uiNode_t* clone) override;
38  void initNodeDynamic(uiNode_t* node) override;
39  void deleteNode(uiNode_t* node) override;
40  void onCapturedMouseMove(uiNode_t* node, int x, int y) override;
41  void doLayout (uiNode_t* node) override;
42 };
43 
44 #define UI_MAX_MODELS 128
45 
47 typedef struct uiModel_s {
48  char* id;
49  char* anim;
50  char* parent;
51  char* tag;
52  int skin;
53  char* model;
57  struct uiModel_s* next;
58 } uiModel_t;
59 
63 typedef struct modelExtraData_s {
64  char* oldRefValue;
69  const char* skin;
70  const char* model;
71  const char* tag;
73  const char* animation;
74  bool autoscale;
76  bool clipOverflow;
79 
80 uiModel_t* UI_GetUIModel(const char* modelName);
81 void UI_DrawModelNode(uiNode_t* node, const char* source);
82 void UI_RegisterModelNode(uiBehaviour_t* behaviour);
83 
84 void UI_Model_SetModelSource (uiNode_t* node, const char* modelName);
85 void UI_Model_SetSkinSource (uiNode_t* node, const char* skinName);
86 void UI_Model_SetAnimationSource (uiNode_t* node, const char* animName);
87 void UI_Model_SetTagSource (uiNode_t* node, const char* tagName);
const char * tag
Definition: ui_node_model.h:71
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
vec3_t center
Definition: ui_node_model.h:55
animState_t * animationState
Definition: ui_node_model.h:72
void UI_RegisterModelNode(uiBehaviour_t *behaviour)
extradata for the model node
Definition: ui_node_model.h:63
void onMouseDown(uiNode_t *node, int x, int y, int button) override
uiModel_t * UI_GetUIModel(const char *modelName)
Returns pointer to UI model.
char * id
Definition: ui_node_model.h:48
void draw(uiNode_t *node) override
void UI_DrawModelNode(uiNode_t *node, const char *source)
void UI_Model_SetModelSource(uiNode_t *node, const char *modelName)
char * model
Definition: ui_node_model.h:53
struct modelExtraData_s modelExtraData_t
extradata for the model node
void clone(uiNode_t const *source, uiNode_t *clone) override
Call to update a cloned node.
void onMouseUp(uiNode_t *node, int x, int y, int button) override
vec3_t scale
Definition: ui_node_model.h:55
void UI_Model_SetAnimationSource(uiNode_t *node, const char *animName)
char * tag
Definition: ui_node_model.h:51
char * parent
Definition: ui_node_model.h:50
animState_t animState
Definition: ui_node_model.h:54
void UI_Model_SetSkinSource(uiNode_t *node, const char *skinName)
vec3_t origin
Definition: ui_node_model.h:55
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
vec3_t angles
Definition: ui_node_model.h:55
const char * animation
Definition: ui_node_model.h:73
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
struct uiModel_s uiModel_t
Model that have more than one part (top and down part of an aircraft)
const char * skin
Definition: ui_node_model.h:69
vec4_t color
Definition: ui_node_model.h:56
void UI_Model_SetTagSource(uiNode_t *node, const char *tagName)
void initNodeDynamic(uiNode_t *node) override
node behaviour, how a node work
Definition: ui_behaviour.h:39
const char * model
Definition: ui_node_model.h:70
void deleteNode(uiNode_t *node) override
vec_t vec3_t[3]
Definition: ufotypes.h:39
void onLoading(uiNode_t *node) override
Called before loading. Used to set default attribute values.
struct uiModel_s * next
Definition: ui_node_model.h:57
Model that have more than one part (top and down part of an aircraft)
Definition: ui_node_model.h:47
char * anim
Definition: ui_node_model.h:49
void onLoaded(uiNode_t *node) override
vec_t vec4_t[4]
Definition: ufotypes.h:40