UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_model.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "../ui_nodes.h"
29#include "../../cl_renderer.h"
30
31class 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
47typedef 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
63typedef struct modelExtraData_s {
69 const char* skin;
70 const char* model;
71 const char* tag;
73 const char* animation;
74 bool autoscale;
79
80uiModel_t* UI_GetUIModel(const char* modelName);
81void UI_DrawModelNode(uiNode_t* node, const char* source);
82void UI_RegisterModelNode(uiBehaviour_t* behaviour);
83
84void UI_Model_SetModelSource (uiNode_t* node, const char* modelName);
85void UI_Model_SetSkinSource (uiNode_t* node, const char* skinName);
86void UI_Model_SetAnimationSource (uiNode_t* node, const char* animName);
87void UI_Model_SetTagSource (uiNode_t* node, const char* tagName);
void onLoading(uiNode_t *node) override
Called before loading. Used to set default attribute values.
void deleteNode(uiNode_t *node) override
void initNodeDynamic(uiNode_t *node) override
void onMouseDown(uiNode_t *node, int x, int y, int button) override
void onLoaded(uiNode_t *node) override
void draw(uiNode_t *node) override
void clone(uiNode_t const *source, uiNode_t *clone) override
Call to update a cloned node.
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void onMouseUp(uiNode_t *node, int x, int y, int button) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
extradata for the model node
const char * animation
const char * model
const char * tag
const char * skin
animState_t * animationState
node behaviour, how a node work
Model that have more than one part (top and down part of an aircraft).
char * parent
struct uiModel_s * next
vec3_t center
char * anim
vec3_t angles
animState_t animState
vec3_t scale
char * model
vec3_t origin
vec4_t color
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40
void UI_Model_SetTagSource(uiNode_t *node, const char *tagName)
void UI_Model_SetAnimationSource(uiNode_t *node, const char *animName)
uiModel_t * UI_GetUIModel(const char *modelName)
Returns pointer to UI model.
void UI_DrawModelNode(uiNode_t *node, const char *source)
void UI_RegisterModelNode(uiBehaviour_t *behaviour)
void UI_Model_SetModelSource(uiNode_t *node, const char *modelName)
void UI_Model_SetSkinSource(uiNode_t *node, const char *skinName)