From 0aecce709fe9d158e6175a1cab46697a52678086 Mon Sep 17 00:00:00 2001 From: Bukz Date: Fri, 29 Apr 2011 15:51:10 +0000 Subject: [PATCH] hudecho git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6392 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/docs.cfg | 4 +++- docs/reference.xml | 8 ++++++++ source/src/client.cpp | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/docs.cfg b/config/docs.cfg index 858b5e37..f005654d 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -247,7 +247,9 @@ docargument [B] [triangle debug] [min 0/max 1/default 0]; docremark [Prints details while connecting triangles of 3d models.]; docident [debugargs] [Dump all command arguments to STDOUT]; docargument [...] [...] [] [1]; -docident [echo] []; +docident [echo] [Outputs text to the console.]; +docargument [L] [List of strings] [] [0]; +docident [hudecho] [Outputs text to the console and heads up display.]; docargument [L] [List of strings] [] [0]; docident [exec] [Executes all commands in a specified config file.]; docargument [C] [the config file] [] [0]; diff --git a/docs/reference.xml b/docs/reference.xml index 6306e272..ab8cbad2 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -853,6 +853,14 @@ + Outputs text to the console. + + + + + + + Outputs text to the console and heads up display. diff --git a/source/src/client.cpp b/source/src/client.cpp index a7d760eb..11611ed1 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -270,7 +270,19 @@ void echo(char *text) while(s); } +void hudecho(char *text) +{ + const char *s = strtok(text, "\n"); + do + { + hudoutf("%s", s ? s : ""); + s = strtok(NULL, "\n"); + } + while(s); +} + COMMAND(echo, ARG_CONC); +COMMAND(hudecho, ARG_CONC); COMMANDN(say, toserver, ARG_CONC); COMMANDN(me, toserverme, ARG_CONC); COMMANDN(connect, connectserv, ARG_3STR);