diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-30 07:05:34 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-30 07:05:34 +0000 |
| commit | 57da0cae4f2d072211b39a6618a102c6b620197f (patch) | |
| tree | 000d2453aa8ff7524257fd639e70a92b6248e926 /src/game/client | |
| parent | 8780c2fd9b49f52913e190bc83972a4d2be8483d (diff) | |
| download | zcatch-57da0cae4f2d072211b39a6618a102c6b620197f.tar.gz zcatch-57da0cae4f2d072211b39a6618a102c6b620197f.zip | |
cleaned up the kill messages
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/game_client.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 1434f8f9..5ff6f777 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -391,6 +391,7 @@ static const int chat_max_lines = 10; struct chatline { int tick; + int client_id; char text[512+64]; }; @@ -408,14 +409,11 @@ void chat_add_line(int client_id, const char *line) { chat_current_line = (chat_current_line+1)%chat_max_lines; chat_lines[chat_current_line].tick = client_tick(); - sprintf(chat_lines[chat_current_line].text, "%s: %s", client_datas[client_id].name, line); // TODO: abit nasty -} - -void status_add_line(const char *line) -{ - chat_current_line = (chat_current_line+1)%chat_max_lines; - chat_lines[chat_current_line].tick = client_tick(); - strcpy(chat_lines[chat_current_line].text, line); + chat_lines[chat_current_line].client_id = client_id; + if(client_id == -1) // server message + sprintf(chat_lines[chat_current_line].text, "*** %s", line); + else + sprintf(chat_lines[chat_current_line].text, "%s: %s", client_datas[client_id].name, line); // TODO: abit nasty } struct killmsg @@ -1354,8 +1352,12 @@ void modc_render() // pseudo format float zoom = 3.0f; - if(!chat_active && inp_key_pressed('I')) - zoom = 1.0f; + + if(config.debug) + { + if(!chat_active && inp_key_pressed(input::f8)) + zoom = 1.0f; + } float width = 400*zoom; float height = 300*zoom; @@ -1589,7 +1591,7 @@ void modc_render() int r = ((chat_current_line-i)+chat_max_lines)%chat_max_lines; if(client_tick() > chat_lines[r].tick+50*15) break; - + gfx_pretty_text(x, y, 10, chat_lines[r].text); y -= 8; } @@ -1815,18 +1817,4 @@ void modc_message(int msg) killmsgs[killmsg_current].weapon = msg_unpack_int(); killmsgs[killmsg_current].tick = client_tick(); } - else if(msg == MSG_JOIN) - { - int cid = msg_unpack_int(); - char message[256]; - sprintf(message, "%s joined the game", client_datas[cid].name); - status_add_line(message); - } - else if(msg == MSG_QUIT) - { - int cid = msg_unpack_int(); - char message[256]; - sprintf(message, "%s quit the game", client_datas[cid].name); - status_add_line(message); - } } |