#ifndef NOTIFICATIONS_H
#define NOTIFICATIONS_H
+#include "command/all.qh"
+
#include "constants.qh"
#include "teams.qh"
#include "util.qh"
void Dump_Notifications(float fh, float alsoprint);
+
+GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt")
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ #ifndef MENUQC
+ float fh, alsoprint = false;
+ string filename = argv(1);
+
+ if(filename == "")
+ {
+ filename = "notifications_dump.cfg";
+ alsoprint = false;
+ }
+ else if(filename == "-")
+ {
+ filename = "notifications_dump.cfg";
+ alsoprint = true;
+ }
+ fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ Dump_Notifications(fh, alsoprint);
+ LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+ fclose(fh);
+ }
+ else
+ {
+ LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
+ }
+ #else
+ LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+ #endif
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+ LOG_INFO(" Where 'filename' is the file to write (default is notifications_dump.cfg),\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;
+ }
+ }
+}
+
#ifdef NOTIFICATIONS_DEBUG
void Debug_Notification(string input);
#endif
ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \
ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \
ARG_CASE(ARG_CS_SV, "item_wepname", WEP_NAME(f1)) \
- ARG_CASE(ARG_CS_SV, "item_buffname", sprintf("%s%s", rgb_to_hexcolor(BUFFS[f1].m_color), BUFFS[f1].m_prettyName)) \
- ARG_CASE(ARG_CS_SV, "f3buffname", sprintf("%s%s", rgb_to_hexcolor(BUFFS[f3].m_color), BUFFS[f3].m_prettyName)) \
+ ARG_CASE(ARG_CS_SV, "item_buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs_from(f1).m_color), Buffs_from(f1).m_prettyName)) \
+ ARG_CASE(ARG_CS_SV, "f3buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs_from(f3).m_color), Buffs_from(f3).m_prettyName)) \
ARG_CASE(ARG_CS_SV, "item_wepammo", (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \
ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \
ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \
float NOTIF_CHOICE_COUNT;
// notification limits -- INCREASE AS NECESSARY
-const float NOTIF_ANNCE_MAX = 100;
-const float NOTIF_INFO_MAX = 350;
-const float NOTIF_CENTER_MAX = 250;
-const float NOTIF_MULTI_MAX = 200;
-const float NOTIF_CHOICE_MAX = 30;
+const float NOTIF_ANNCE_MAX = 400;
+const float NOTIF_INFO_MAX = 450;
+const float NOTIF_CENTER_MAX = 350;
+const float NOTIF_MULTI_MAX = 300;
+const float NOTIF_CHOICE_MAX = 50;
// notification entities
entity msg_annce_notifs[NOTIF_ANNCE_MAX];
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
#define MSG_INFO_NOTIF(default,name,strnum,flnum,args,hudargs,icon,normal,gentle) \
NOTIF_ADD_AUTOCVAR(name, default) \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
.string nent_iconargs;
#define MULTIICON_INFO(default,name,strnum,flnum,args,hudargs,iconargs,icon,normal,gentle) \
NO_MSG); /* optionb */ \
msg_info_notifs[name - 1].nent_iconargs = iconargs; \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
#define MSG_CENTER_NOTIF(default,name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
NOTIF_ADD_AUTOCVAR(name, default) \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
#define MSG_MULTI_NOTIF(default,name,anncename,infoname,centername) \
NOTIF_ADD_AUTOCVAR(name, default) \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
#define ACVNN(name) autocvar_notification_##name
optiona, /* optiona */ \
optionb); /* optionb */ \
} \
- ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name);
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
void RegisterNotifications_First()
{
}
// NOW we actually activate the declarations
-ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First);
+ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First)
#include "notifications.inc"
-ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done);
+ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
+
+STATIC_INIT(RegisterNotifications) { CALL_ACCUMULATED_FUNCTION(RegisterNotifications); }
#endif