]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/config.qc
Lets now make the weapon config dump system actually work
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / config.qc
1 // ==========================
2 //  Balance Config Generator
3 // ==========================
4
5 void Dump_Weapon_Settings(void)
6 {
7         float i;
8         for(i = WEP_FIRST; i <= WEP_LAST; ++i)
9         {
10                 WEP_CONFIG_WRITE(sprintf("// {{{ #%d: %s\n", i, W_Name(i)))
11                 WEP_ACTION(i, WR_CONFIG);
12                 WEP_CONFIG_WRITE("// }}}\n")
13         }
14 }
15         /*
16         #define WEP_BAL_WRITE(a) { \
17                 fputs(fh, a); \
18                 if(alsoprint) { print(a); } }
19         #define WEP_BAL_WRITE_ENTITY(description) { \
20                 notif_msg = \
21                         sprintf( \
22                                 "seta notification_%s \"%d\" \"%s\"\n", \
23                                 e.nent_name, e.nent_default, description \
24                         ); \
25                 WEP_BAL_WRITE(notif_msg) }
26         #define WEP_BAL_WRITE_HARDCODED(cvar,default,description) { \
27                 notif_msg = \
28                         sprintf( \
29                                 "seta notification_%s \"%s\" \"%s\"\n", \
30                                 cvar, default, description \
31                         ); \
32                 WEP_BAL_WRITE(notif_msg) }
33
34         string notif_msg;
35         float i;
36         entity e;
37
38         NOTIF_WRITE(sprintf("\n// MSG_ANNCE notifications (count = %d):\n", NOTIF_ANNCE_COUNT));
39         for(i = 1; i <= NOTIF_ANNCE_COUNT; ++i)
40         {
41                 e = Get_Notif_Ent(MSG_ANNCE, i);
42                 if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
43                 
44                 NOTIF_WRITE_ENTITY(
45                         "Notification control cvar: 0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled)"
46                 );
47         }
48
49         NOTIF_WRITE(sprintf("\n// MSG_INFO notifications (count = %d):\n", NOTIF_INFO_COUNT));
50         for(i = 1; i <= NOTIF_INFO_COUNT; ++i)
51         {
52                 e = Get_Notif_Ent(MSG_INFO, i);
53                 if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
54                 
55                 NOTIF_WRITE_ENTITY(
56                         "Notification control cvar: 0 = off, 1 = print to console, "
57                         "2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
58                 );
59         }
60
61         NOTIF_WRITE(sprintf("\n// MSG_CENTER notifications (count = %d):\n", NOTIF_CENTER_COUNT));
62         for(i = 1; i <= NOTIF_CENTER_COUNT; ++i)
63         {
64                 e = Get_Notif_Ent(MSG_CENTER, i);
65                 if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
66                 
67                 NOTIF_WRITE_ENTITY(
68                         "Notification control cvar: 0 = off, 1 = centerprint"
69                 );
70         }
71
72         NOTIF_WRITE(sprintf("\n// MSG_MULTI notifications (count = %d):\n", NOTIF_MULTI_COUNT));
73         for(i = 1; i <= NOTIF_MULTI_COUNT; ++i)
74         {
75                 e = Get_Notif_Ent(MSG_MULTI, i);
76                 if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
77                 
78                 NOTIF_WRITE_ENTITY(
79                         "Notification control cvar: 0 = off, 1 = trigger subcalls"
80                 );
81         }
82
83         // edit these to match whichever cvars are used for specific notification options
84         NOTIF_WRITE("\n// HARD CODED notification variables:\n");
85         
86         NOTIF_WRITE_HARDCODED(
87                 "allow_chatboxprint", "1",
88                 "Allow notifications to be printed to chat box by setting notification cvar to 2 "
89                 "(You can also set this cvar to 2 to force ALL notifications to be printed to the chatbox)"
90         );
91
92         NOTIF_WRITE(sprintf(
93                 strcat(
94                         "\n// Notification counts (total = %d): ",
95                         "MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d\n"
96                 ),
97                 (
98                         NOTIF_ANNCE_COUNT +
99                         NOTIF_INFO_COUNT +
100                         NOTIF_CENTER_COUNT +
101                         NOTIF_MULTI_COUNT
102                 ),
103                 NOTIF_ANNCE_COUNT,
104                 NOTIF_INFO_COUNT,
105                 NOTIF_CENTER_COUNT,
106                 NOTIF_MULTI_COUNT
107         ));
108         
109         return;
110         #undef NOTIF_WRITE_HARDCODED
111         #undef NOTIF_WRITE_ENTITY
112         #undef NOTIF_WRITE
113 }*/