]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/config.qh
Put some more work into the config system
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / config.qh
1 // ==========================
2 //  Balance Config Generator
3 // ==========================
4
5 void Dump_Weapon_Settings(float fh, float alsoprint);
6 float wep_config_file;
7 float wep_config_alsoprint;
8
9 #define WEP_CONFIG_WRITE(a) { \
10         fputs(wep_config_file, a); \
11         if(wep_config_alsoprint) { print(a); } }
12
13 #define WEP_CONFIG_WRITE_CVARS(weapon,mode,name) \
14         #if mode == MO_PRI \
15                 WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s", #weapon, #name)) \
16         #endif \
17         #if mode == MO_SEC \
18                 WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s", #weapon, #name)) \
19         #endif \
20         #if mode == MO_BOTH \
21                 WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s", #weapon, #name)) \
22                 WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s", #weapon, #name)) \
23         #endif \
24         #if mode == MO_NONE \
25                 WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s", #weapon, #name)) \
26         #endif
27         
28 #define WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \
29         { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s", #weapon, #name)) }