+GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
+{
+ switch (request) {
+ case CMD_REQUEST_COMMAND: {
+ string filename = argv(1);
+ bool alsoprint = false;
+ if (filename == "") {
+ filename = "effectinfo_dump.txt";
+ alsoprint = false;
+ } else if (filename == "-") {
+ filename = "effectinfo_dump.txt";
+ alsoprint = true;
+ }
+ int fh = fopen(filename, FILE_WRITE);
+ if (fh >= 0) {
+ effectinfo_dump(fh, alsoprint);
+ LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.\n", filename);
+ LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename);
+ fclose(fh);
+ } else {
+ LOG_WARNINGF("Could not open file '%s'!\n", filename);
+ }
+ return;
+ }
+ default:
+ case CMD_REQUEST_USAGE: {
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]"));
+ LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),\n");
+ LOG_INFO(" if supplied with '-' output to console as well as default,\n");
+ LOG_INFO(" if left blank, it will only write to default.\n");
+ return;
+ }
+ }
+}