| 260 | { |
| 261 | snprintf(from, sizeof(from), "%s", (const char*)LocalizeString(IDS_DRIVER)); |
| 262 | } |
| 263 | } |
| 264 | else if (person == veh->Gunner()) |
| 265 | { |
| 266 | snprintf(from, sizeof(from), "%s", (const char*)LocalizeString(IDS_GUNNER)); |
| 267 | } |
| 268 | else if (sender == veh->CommanderUnit()) |
| 269 | { |
| 270 | snprintf(from, sizeof(from), "%s", (const char*)LocalizeString(IDS_COMMANDER)); |
| 271 | } |
| 272 | else |
| 273 | { |
| 274 | LOG_DEBUG(Script, "Warning: unknown position"); |
| 275 | } |
| 276 | } |
| 277 | break; |
| 278 | case CCDirect: |
| 279 | GWorld->SetTitleEffect(CreateTitleEffect(TitPlainDown, text)); |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | if (person && person->IsNetworkPlayer()) |
| 284 | { |
| 285 | if (from[0]) |
| 286 | { |
| 287 | strncat(from, " (", sizeof(from) - strlen(from) - 1); |
| 288 | strncat(from, GetFullPlayerName(person), sizeof(from) - strlen(from) - 1); |
| 289 | strncat(from, ")", sizeof(from) - strlen(from) - 1); |
| 290 | } |
| 291 | else |
| 292 | { |
| 293 | snprintf(from, sizeof(from), "%s", (const char*)GetFullPlayerName(person)); |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | Add(channel, from, text, playerMsg, forceDisplay); |
| 298 | } |
| 299 | |
| 300 | void ChatList::OnDraw() |
| 301 | { |
| 302 | if (_rows <= 0) |
| 303 | { |
| 304 | return; |
| 305 | } |
| 306 | |
| 307 | const float startDim = 25, endDim = 30; |
| 308 | int w = GEngine->Width2D(); |
| 309 | int h = GEngine->Height2D(); |
| 310 | |
| 311 | if (!_font) |
| 312 | { |
| 313 | _font = GEngine->LoadFont(GetFontID("tahomaB24")); |
| 314 | PoseidonAssert(_font); |
| 315 | _size = 0.02; |
| 316 | } |
| 317 | |
| 318 | float top = _y + (_rows - 1) * _h; |
| 319 | int row = _rows - 1; |
no test coverage detected