]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/effects/effects.qh
Properly hide minigame panels from the hud editor
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / effects.qh
1 #ifndef P_EFFECTS_H
2 #define P_EFFECTS_H
3
4 #ifdef CSQC
5 void Read_Effect(bool is_new);
6 #elif defined(SVQC)
7 void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
8 void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
9 #endif
10
11 #define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
12
13 REGISTRY(Effects, BIT(8))
14 REGISTER_REGISTRY(RegisterEffects)
15 #define EFFECT(istrail, name, realname) \
16     REGISTER(RegisterEffects, EFFECT, Effects, name, m_id, Create_Effect_Entity(realname, istrail));
17
18 .int m_id;
19 .string eent_eff_name;
20 .int eent_eff_trail;
21
22 .vector eent_net_location;
23 .vector eent_net_velocity;
24 .int eent_net_count;
25
26 entity Create_Effect_Entity(string eff_name, bool eff_trail)
27 {
28         entity this = new(effect_entity);
29         this.eent_eff_name = eff_name;
30         this.eent_eff_trail = eff_trail;
31         return this;
32 }
33
34 void RegisterEffects_First()
35 {
36     #ifdef SVQC
37     #define dedi (server_is_dedicated ? "a dedicated " : "")
38     #else
39     #define dedi ""
40     #endif
41
42     LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
43     #undef dedi
44 }
45
46 void RegisterEffects_Done()
47 {
48     LOG_TRACE("Effects initialization successful!\n");
49 }
50
51 // NOW we actually activate the declarations
52 ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
53 EFFECT(0, Null, string_null)
54 #include "effects.inc"
55 ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
56
57 #endif