}
}
+void GenericCommand_dumpnotifs(float request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ float fh;
+ string filename = "notifications_dump.txt";
+ fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ fputs(fh, "dump of notifications list:\n");
+ Dump_Notifications(fh);
+ print("Completed dump of notifications in ^2data/data/notifications_dump.txt^7.\n");
+ fclose(fh);
+ }
+ else
+ {
+ print("^1Error: ^7Could not dump to file!\n");
+ }
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs"));
+ print(" No arguments required.\n");
+ return;
+ }
+ }
+}
+
void GenericCommand_maplist(float request, float argc)
{
switch(request)
GENERIC_COMMAND("addtolist", GenericCommand_addtolist(request, arguments), "Add a string to a cvar") \
GENERIC_COMMAND("curl", GenericCommand_curl(request, arguments), "Queries an URL") \
GENERIC_COMMAND("dumpcommands", GenericCommand_dumpcommands(request), "Dump all commands on the program to *_cmd_dump.txt") \
+ GENERIC_COMMAND("dumpnotifs", GenericCommand_dumpnotifs(request), "Dump all notifications into notifications_dump.txt") \
GENERIC_COMMAND("maplist", GenericCommand_maplist(request, arguments), "Automatic control of maplist") \
GENERIC_COMMAND("nextframe", GenericCommand_nextframe(request, arguments, command), "Execute the given command next frame of this VM") \
GENERIC_COMMAND("removefromlist", GenericCommand_removefromlist(request, arguments), "Remove a string from a cvar") \
// select between the normal or the gentle message string based on client (or server) settings
string normal_or_gentle(string normal, string gentle)
{
- #ifdef CSQC
- if(autocvar_cl_gentle || autocvar_cl_gentle_messages)
+ #ifndef MENUQC
+ #ifdef CSQC
+ if(autocvar_cl_gentle || autocvar_cl_gentle_messages)
+ #else
+ if(autocvar_sv_gentle)
+ #endif
+ return ((gentle != "") ? gentle : normal);
+ else
+ return normal;
#else
- if(autocvar_sv_gentle)
- #endif
- return ((gentle != "") ? gentle : normal);
- else
return normal;
+ #endif
}
float notif_stringcount(string s1, string s2)
}
+// =============================
+// Debug/Maintenance Functions
+// =============================
+
+#define NOTIF_Write(type,name,text) fputs(fh, (sprintf("seta %s 1 // %s - %s\n", name, type, strreplace("\n", "\\n", text))))
+void Dump_Notifications(float fh)
+{
+ #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) { NOTIF_Write("MSG_INFO", VAR_TO_TEXT(name), normal); }
+ #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) { NOTIF_Write("MSG_CENTER", VAR_TO_TEXT(name), normal); }
+ #define MSG_WEAPON_NOTIF(name,strnum,flnum,args,normal,gentle) { NOTIF_Write("MSG_WEAPON", VAR_TO_TEXT(name), normal); }
+ MSG_INFO_NOTIFICATIONS
+ MSG_CENTER_NOTIFICATIONS
+ MSG_WEAPON_NOTIFICATIONS
+ return;
+}
+
+
// ===============================
// Frontend Notification Pushing
// ===============================