]> git.lizzy.rs Git - minetest.git/blob - src/client/clientevent.h
Add object visual type 'item' (#7870)
[minetest.git] / src / client / clientevent.h
1 /*
2 Minetest
3 Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #pragma once
21
22 #include <string>
23 #include "irrlichttypes_bloated.h"
24 #include "hud.h"
25
26 enum ClientEventType : u8
27 {
28         CE_NONE,
29         CE_PLAYER_DAMAGE,
30         CE_PLAYER_FORCE_MOVE,
31         CE_DEATHSCREEN,
32         CE_SHOW_FORMSPEC,
33         CE_SHOW_LOCAL_FORMSPEC,
34         CE_SPAWN_PARTICLE,
35         CE_ADD_PARTICLESPAWNER,
36         CE_DELETE_PARTICLESPAWNER,
37         CE_HUDADD,
38         CE_HUDRM,
39         CE_HUDCHANGE,
40         CE_SET_SKY,
41         CE_OVERRIDE_DAY_NIGHT_RATIO,
42         CE_CLOUD_PARAMS,
43         CLIENTEVENT_MAX,
44 };
45
46 struct ClientEvent
47 {
48         ClientEventType type;
49         union
50         {
51                 // struct{
52                 //} none;
53                 struct
54                 {
55                         u16 amount;
56                 } player_damage;
57                 struct
58                 {
59                         f32 pitch;
60                         f32 yaw;
61                 } player_force_move;
62                 struct
63                 {
64                         bool set_camera_point_target;
65                         f32 camera_point_target_x;
66                         f32 camera_point_target_y;
67                         f32 camera_point_target_z;
68                 } deathscreen;
69                 struct
70                 {
71                         std::string *formspec;
72                         std::string *formname;
73                 } show_formspec;
74                 // struct{
75                 //} textures_updated;
76                 struct
77                 {
78                         v3f *pos;
79                         v3f *vel;
80                         v3f *acc;
81                         f32 expirationtime;
82                         f32 size;
83                         bool collisiondetection;
84                         bool collision_removal;
85                         bool object_collision;
86                         bool vertical;
87                         std::string *texture;
88                         struct TileAnimationParams animation;
89                         u8 glow;
90                 } spawn_particle;
91                 struct
92                 {
93                         u16 amount;
94                         f32 spawntime;
95                         v3f *minpos;
96                         v3f *maxpos;
97                         v3f *minvel;
98                         v3f *maxvel;
99                         v3f *minacc;
100                         v3f *maxacc;
101                         f32 minexptime;
102                         f32 maxexptime;
103                         f32 minsize;
104                         f32 maxsize;
105                         bool collisiondetection;
106                         bool collision_removal;
107                         bool object_collision;
108                         u16 attached_id;
109                         bool vertical;
110                         std::string *texture;
111                         u32 id;
112                         struct TileAnimationParams animation;
113                         u8 glow;
114                 } add_particlespawner;
115                 struct
116                 {
117                         u32 id;
118                 } delete_particlespawner;
119                 struct
120                 {
121                         u32 server_id;
122                         u8 type;
123                         v2f *pos;
124                         std::string *name;
125                         v2f *scale;
126                         std::string *text;
127                         u32 number;
128                         u32 item;
129                         u32 dir;
130                         v2f *align;
131                         v2f *offset;
132                         v3f *world_pos;
133                         v2s32 *size;
134                 } hudadd;
135                 struct
136                 {
137                         u32 id;
138                 } hudrm;
139                 struct
140                 {
141                         u32 id;
142                         HudElementStat stat;
143                         v2f *v2fdata;
144                         std::string *sdata;
145                         u32 data;
146                         v3f *v3fdata;
147                         v2s32 *v2s32data;
148                 } hudchange;
149                 struct
150                 {
151                         video::SColor *bgcolor;
152                         std::string *type;
153                         std::vector<std::string> *params;
154                         bool clouds;
155                 } set_sky;
156                 struct
157                 {
158                         bool do_override;
159                         float ratio_f;
160                 } override_day_night_ratio;
161                 struct
162                 {
163                         f32 density;
164                         u32 color_bright;
165                         u32 color_ambient;
166                         f32 height;
167                         f32 thickness;
168                         f32 speed_x;
169                         f32 speed_y;
170                 } cloud_params;
171         };
172 };