| 156 | |
| 157 | static char sp_lastCol; |
| 158 | static void SPConnection_AddPart(const cc_string* text) { |
| 159 | cc_string tmp; char tmpBuffer[STRING_SIZE * 2]; |
| 160 | char col; |
| 161 | int i; |
| 162 | String_InitArray(tmp, tmpBuffer); |
| 163 | |
| 164 | /* Prepend color codes for subsequent lines of multi-line chat */ |
| 165 | if (!Drawer2D_IsWhiteColor(sp_lastCol)) { |
| 166 | String_Append(&tmp, '&'); |
| 167 | String_Append(&tmp, sp_lastCol); |
| 168 | } |
| 169 | String_AppendString(&tmp, text); |
| 170 | |
| 171 | /* Replace all % with & */ |
| 172 | for (i = 0; i < tmp.length; i++) { |
| 173 | if (tmp.buffer[i] == '%') tmp.buffer[i] = '&'; |
| 174 | } |
| 175 | String_UNSAFE_TrimEnd(&tmp); |
| 176 | |
| 177 | col = Drawer2D_LastColor(&tmp, tmp.length); |
| 178 | if (col) sp_lastCol = col; |
| 179 | Chat_Add(&tmp); |
| 180 | } |
| 181 | |
| 182 | static void SPConnection_SendChat(const cc_string* text) { |
| 183 | cc_string left, part; |
no test coverage detected