]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/config.qh
Merge branch 'master' into Mario/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / config.qh
1 #ifndef WEAPONS_CONFIG_H
2 #define WEAPONS_CONFIG_H
3
4 #ifdef SVQC
5 // ==========================
6 //  Balance Config Generator
7 // ==========================
8
9 void Dump_Weapon_Settings();
10 int wep_config_file;
11 bool wep_config_alsoprint;
12
13 const int MAX_WEP_CONFIG = 256;
14 int WEP_CONFIG_COUNT;
15 string wep_config_queue[MAX_WEP_CONFIG];
16
17 #define WEP_CONFIG_QUEUE(a) { \
18         wep_config_queue[WEP_CONFIG_COUNT] = a; \
19         ++WEP_CONFIG_COUNT; }
20
21 #define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN { \
22         fputs(wep_config_file, a); \
23         if(wep_config_alsoprint) { LOG_INFO(a); } \
24 } MACRO_END
25
26
27 #define WEP_CONFIG_WRITE_CVARS(wepname, name, T) WEP_CONFIG_WRITE_PROPS_##T(wepname, name)
28
29 #define WEP_CONFIG_WRITE_PROPS_string(wepname, name) \
30         { WEP_CONFIG_QUEUE( \
31                 sprintf("set g_balance_%s_%s \"%s\"\n", #wepname, #name, \
32                 cvar_string(sprintf("g_balance_%s_%s", #wepname, #name)))) }
33
34 #define WEP_CONFIG_WRITE_PROPS_float(wepname, name) \
35         { WEP_CONFIG_QUEUE( \
36                 sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \
37                 cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
38
39 #endif
40 #endif