2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
|
2017-08-28 20:02:23 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2024-09-02 16:09:32 +02:00
|
|
|
#include "irrlichttypes.h"
|
|
|
|
#include "client/hud.h" // HudElementStat
|
2020-05-22 13:23:25 +02:00
|
|
|
|
|
|
|
struct ParticleParameters;
|
|
|
|
struct ParticleSpawnerParameters;
|
|
|
|
struct SkyboxParams;
|
|
|
|
struct SunParams;
|
|
|
|
struct MoonParams;
|
|
|
|
struct StarParams;
|
2017-08-28 20:02:23 +02:00
|
|
|
|
|
|
|
enum ClientEventType : u8
|
|
|
|
{
|
|
|
|
CE_NONE,
|
|
|
|
CE_PLAYER_DAMAGE,
|
|
|
|
CE_PLAYER_FORCE_MOVE,
|
2024-09-24 22:37:44 +02:00
|
|
|
CE_DEATHSCREEN_LEGACY,
|
2017-08-28 20:02:23 +02:00
|
|
|
CE_SHOW_FORMSPEC,
|
|
|
|
CE_SHOW_LOCAL_FORMSPEC,
|
|
|
|
CE_SPAWN_PARTICLE,
|
|
|
|
CE_ADD_PARTICLESPAWNER,
|
|
|
|
CE_DELETE_PARTICLESPAWNER,
|
|
|
|
CE_HUDADD,
|
|
|
|
CE_HUDRM,
|
|
|
|
CE_HUDCHANGE,
|
|
|
|
CE_SET_SKY,
|
2019-08-21 21:47:45 +01:00
|
|
|
CE_SET_SUN,
|
|
|
|
CE_SET_MOON,
|
|
|
|
CE_SET_STARS,
|
2017-08-28 20:02:23 +02:00
|
|
|
CE_OVERRIDE_DAY_NIGHT_RATIO,
|
|
|
|
CE_CLOUD_PARAMS,
|
|
|
|
CLIENTEVENT_MAX,
|
|
|
|
};
|
|
|
|
|
2021-03-05 12:54:53 +01:00
|
|
|
struct ClientEventHudAdd
|
|
|
|
{
|
|
|
|
u32 server_id;
|
|
|
|
u8 type;
|
|
|
|
v2f pos, scale;
|
|
|
|
std::string name;
|
|
|
|
std::string text, text2;
|
2021-07-27 19:11:46 +02:00
|
|
|
u32 number, item, dir, style;
|
2021-03-05 12:54:53 +01:00
|
|
|
v2f align, offset;
|
|
|
|
v3f world_pos;
|
|
|
|
v2s32 size;
|
|
|
|
s16 z_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ClientEventHudChange
|
|
|
|
{
|
|
|
|
u32 id;
|
|
|
|
HudElementStat stat;
|
|
|
|
v2f v2fdata;
|
|
|
|
std::string sdata;
|
|
|
|
u32 data;
|
|
|
|
v3f v3fdata;
|
|
|
|
v2s32 v2s32data;
|
|
|
|
};
|
|
|
|
|
2017-08-28 20:02:23 +02:00
|
|
|
struct ClientEvent
|
|
|
|
{
|
|
|
|
ClientEventType type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
// struct{
|
|
|
|
//} none;
|
|
|
|
struct
|
|
|
|
{
|
2017-08-29 20:37:54 +02:00
|
|
|
u16 amount;
|
2022-06-11 20:00:40 +02:00
|
|
|
bool effect;
|
2017-08-28 20:02:23 +02:00
|
|
|
} player_damage;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
f32 pitch;
|
|
|
|
f32 yaw;
|
|
|
|
} player_force_move;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
std::string *formspec;
|
|
|
|
std::string *formname;
|
|
|
|
} show_formspec;
|
|
|
|
// struct{
|
|
|
|
//} textures_updated;
|
2020-05-22 13:23:25 +02:00
|
|
|
ParticleParameters *spawn_particle;
|
2017-08-28 20:02:23 +02:00
|
|
|
struct
|
|
|
|
{
|
2020-05-22 13:23:25 +02:00
|
|
|
ParticleSpawnerParameters *p;
|
2017-08-28 20:02:23 +02:00
|
|
|
u16 attached_id;
|
2019-03-01 20:16:11 +01:00
|
|
|
u64 id;
|
2017-08-28 20:02:23 +02:00
|
|
|
} add_particlespawner;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
u32 id;
|
|
|
|
} delete_particlespawner;
|
2021-03-05 12:54:53 +01:00
|
|
|
ClientEventHudAdd *hudadd;
|
2017-08-28 20:02:23 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
u32 id;
|
|
|
|
} hudrm;
|
2021-03-05 12:54:53 +01:00
|
|
|
ClientEventHudChange *hudchange;
|
2019-08-21 21:47:45 +01:00
|
|
|
SkyboxParams *set_sky;
|
2017-08-28 20:02:23 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
bool do_override;
|
|
|
|
float ratio_f;
|
|
|
|
} override_day_night_ratio;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
f32 density;
|
|
|
|
u32 color_bright;
|
|
|
|
u32 color_ambient;
|
2024-09-24 20:14:27 +02:00
|
|
|
u32 color_shadow;
|
2017-08-28 20:02:23 +02:00
|
|
|
f32 height;
|
|
|
|
f32 thickness;
|
|
|
|
f32 speed_x;
|
|
|
|
f32 speed_y;
|
|
|
|
} cloud_params;
|
2019-08-21 21:47:45 +01:00
|
|
|
SunParams *sun_params;
|
|
|
|
MoonParams *moon_params;
|
|
|
|
StarParams *star_params;
|
2017-08-28 20:02:23 +02:00
|
|
|
};
|
|
|
|
};
|