Index: src/main_gui.cpp =================================================================== --- src/main_gui.cpp (revision 17146) +++ src/main_gui.cpp (working copy) @@ -35,6 +35,8 @@ #include "table/sprites.h" #include "table/strings.h" +extern int _last_message_client_id; + static int _rename_id = 1; static int _rename_what = -1; @@ -272,7 +274,7 @@ case WKC_ESC: ResetObjectToPlace(); break; case WKC_DELETE: DeleteNonVitalWindows(); break; case WKC_DELETE | WKC_SHIFT: DeleteAllNonVitalWindows(); break; - case 'R' | WKC_CTRL: MarkWholeScreenDirty(); break; + case 'R' | WKC_SHIFT: MarkWholeScreenDirty(); break; #if defined(_DEBUG) case '0' | WKC_ALT: // Crash the game @@ -349,6 +351,15 @@ ShowNetworkChatQueryWindow(DESTTYPE_TEAM, cio->client_playas); } break; + case WKC_CTRL | 'R': // send text to whomever messaged us last + if (_networking && _last_message_client_id > -1) { + const NetworkClientInfo *cio = NetworkFindClientInfoFromClientID((ClientID)_last_message_client_id); + if (cio == NULL) break; + + ShowNetworkChatQueryWindow(DESTTYPE_CLIENT, cio->client_id); + } + break; + #endif default: return ES_NOT_HANDLED; Index: src/network/network_client.cpp =================================================================== --- src/network/network_client.cpp (revision 17146) +++ src/network/network_client.cpp (working copy) @@ -28,6 +28,8 @@ /* This file handles all the client-commands */ +/* Keep track of the last user that message us privately */ +int _last_message_client_id = -1; /* So we don't make too much typos ;) */ #define MY_CLIENT NetworkClientSocket::Get(0) @@ -751,10 +753,14 @@ /* Display message from somebody else */ snprintf(name, sizeof(name), "%s", ci_to->client_name); ci = ci_to; + if (ci != NULL && action == NETWORK_ACTION_CHAT_CLIENT) { + _last_message_client_id = ci->client_id; + } } - if (ci != NULL) + if (ci != NULL) { NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), self_send, name, msg, data); + } return NETWORK_RECV_STATUS_OKAY; } @@ -934,6 +940,8 @@ /* Is called after a client is connected to the server */ void NetworkClient_Connected() { + /* New server and new users connected to each id. */ + _last_message_client_id = -1; /* Set the frame-counter to 0 so nothing happens till we are ready */ _frame_counter = 0; _frame_counter_server = 0;