* Add a text message to the 'chat window' to be shown * @param colour The colour this message is to be shown in * @param duration The duration of the chat message in seconds * @param message message itself */
| 83 | * @param message message itself |
| 84 | */ |
| 85 | void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const std::string &message) |
| 86 | { |
| 87 | if (_chatmsg_list.size() == MAX_CHAT_MESSAGES) { |
| 88 | _chatmsg_list.pop_back(); |
| 89 | } |
| 90 | |
| 91 | ChatMessage *cmsg = &_chatmsg_list.emplace_front(); |
| 92 | cmsg->message = message; |
| 93 | cmsg->colour = colour; |
| 94 | cmsg->remove_time = std::chrono::steady_clock::now() + std::chrono::seconds(duration); |
| 95 | |
| 96 | _chatmessage_dirty_time = std::chrono::steady_clock::now(); |
| 97 | _chatmessage_dirty = true; |
| 98 | } |
| 99 | |
| 100 | /** Initialize all font-dependent chat box sizes. */ |
| 101 | void NetworkReInitChatBoxSize() |
no test coverage detected