X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Feffectinfo.qc;h=d6da6c4aa7d71fdb0f685992b80a879a06a65cde;hb=54baffb62bc1c17091399dfa8c3b8ddb03ffc33b;hp=6b97dd91b55fa94abeb488e48fd5a6cdc45eb9f2;hpb=717defe5e02506bb5c857025d71fb605d6eb8c55;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/effectinfo.qc b/qcsrc/common/effects/effectinfo.qc index 6b97dd91b..d6da6c4aa 100644 --- a/qcsrc/common/effects/effectinfo.qc +++ b/qcsrc/common/effects/effectinfo.qc @@ -1,3 +1,5 @@ +#if ENABLE_EFFECTINFO + #include "effectinfo.qh" #define EFFECTINFO_PARSER(on, MY) \ on(type, MY(type) \ @@ -285,17 +287,19 @@ void effectinfo_dump(int fh, bool alsoprint) #undef WRITE } -GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt", false) +#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); @@ -311,14 +315,15 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt", fa } 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 []"); + LOG_HELPF(" Where 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)) @@ -340,3 +345,5 @@ REGISTRY_DEFINE_GET(EffectInfos, NULL) #undef MY #undef DEF #undef SUB + +#endif