EventNotifier should show dates/times in the client's timezone

This commit is contained in:
2026-09-29 18:58:22 +01:00
parent cbe461ac26
commit d6f3d622dd
6 changed files with 7787 additions and 14 deletions
+9 -3
View File
@@ -4,7 +4,7 @@
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_VERSION "1.1"
#define PLUGIN_VERSION "1.2"
#define CHAT_PREFIX "\x04[Events]\x01"
#define PANEL_LINE_WIDTH 60
@@ -83,9 +83,15 @@ void ShowEventList(int client)
if (!EventNotifier_GetEvent(i, ev))
continue;
char info[16], display[EVENT_STR_LEN + 16];
char info[16], display[EVENT_STR_LEN + 64];
IntToString(ev.number, info, sizeof(info));
Format(display, sizeof(display), "%d: %s", ev.number, ev.name);
if (ev.start > 0)
{
char when[48];
EventNotifier_FormatClientTime(client, ev.start, when, sizeof(when), false);
Format(display, sizeof(display), "%s (%s)", display, when);
}
menu.AddItem(info, display);
}
@@ -140,7 +146,7 @@ void ShowEventDetails(int client, int index)
if (ev.start > 0)
{
char when[64];
FormatTime(when, sizeof(when), "%a %d %b %Y, %H:%M %Z", ev.start);
EventNotifier_FormatClientTime(client, ev.start, when, sizeof(when));
Format(line, sizeof(line), "Date: %s", when);
panel.DrawText(line);