From: TimePath Date: Thu, 5 Apr 2018 11:58:48 +0000 (+1000) Subject: Chat: store messages in buffer X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9e1dc59ed8eac6a8a5c3ed4b0152da40a9b3be78;p=xonotic%2Fxonotic-data.pk3dir.git Chat: store messages in buffer --- diff --git a/qcsrc/menu/command/notice.qc b/qcsrc/menu/command/notice.qc index 51ed0d3c6..ba8dc327b 100644 --- a/qcsrc/menu/command/notice.qc +++ b/qcsrc/menu/command/notice.qc @@ -4,6 +4,13 @@ noref string autocvar__cl_hook_print = "menu_cmd notice"; +int notice_buffer; +int notice_buffer_idx; + +STATIC_INIT(notice_buffer) { + notice_buffer = buf_create(); +} + GENERIC_COMMAND(notice, "Append a notice to chat") { switch(request) @@ -18,6 +25,7 @@ GENERIC_COMMAND(notice, "Append a notice to chat") entity snd = (flags & NOTICE_PRIVATE) ? SND_TALK2 : SND_TALK; localsound(Sound_fixpath(snd)); } + bufstr_set(notice_buffer, notice_buffer_idx++, s); print(prefix, "^7", s, "\n"); return; }