]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Chat: store messages in buffer
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Apr 2018 11:58:48 +0000 (21:58 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Apr 2018 11:58:48 +0000 (21:58 +1000)
qcsrc/menu/command/notice.qc

index 51ed0d3c628962d11dba6d4cbc4fb835b8fa2d22..ba8dc327b22060bfc249f208ef5be35355e2eb3c 100644 (file)
@@ -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;
         }