+#if ENABLE_EFFECTINFO
+
#include "effectinfo.qh"
#define EFFECTINFO_PARSER(on, MY) \
on(type, MY(type) \
#undef WRITE
}
-GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
+#define DEFAULT_FILENAME "effectinfo_dump.txt"
+// NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code
+GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo into " DEFAULT_FILENAME, false)
{
switch (request) {
case CMD_REQUEST_COMMAND: {
string filename = argv(1);
bool alsoprint = false;
if (filename == "") {
- filename = "effectinfo_dump.txt";
+ filename = DEFAULT_FILENAME;
alsoprint = false;
} else if (filename == "-") {
- filename = "effectinfo_dump.txt";
+ filename = DEFAULT_FILENAME;
alsoprint = true;
}
int fh = fopen(filename, FILE_WRITE);
}
default:
case CMD_REQUEST_USAGE: {
- LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]");
- LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),");
- LOG_INFO(" if supplied with '-' output to console as well as default,");
- LOG_INFO(" if left blank, it will only write to default.");
+ LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [<filename>]");
+ LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
+ LOG_HELP(" if supplied with '-' output to console as well as default,");
+ LOG_HELP(" if left blank, it will only write to default.");
return;
}
}
}
+#undef DEFAULT_FILENAME
REGISTRY(EffectInfos, BITS(9))
-#define EffectInfos_from(i) _EffectInfos_from(i, NULL)
REGISTER_REGISTRY(EffectInfos)
+
+REGISTRY_DEFINE_GET(EffectInfos, NULL)
#define EFFECTINFO(name) \
ACCUMULATE void effectinfo_##name(EffectInfoGroup parent, EffectInfo this) { } \
REGISTER(EffectInfos, EFFECTINFO, name, m_id, NEW(EffectInfoGroup)) { \
#undef MY
#undef DEF
#undef SUB
+
+#endif