| 460 | } |
| 461 | |
| 462 | void CStaticMapMain::DrawLabel(struct SignInfo& info, PackedColor color) |
| 463 | { |
| 464 | AICenter* myCenter = GetMyCenter(); |
| 465 | |
| 466 | RString text; |
| 467 | Point3 pos; |
| 468 | switch (info._type) |
| 469 | { |
| 470 | case signNone: |
| 471 | break; |
| 472 | case signUnit: |
| 473 | if (info._unit) |
| 474 | { |
| 475 | text = info._unit->GetGroup()->GetName(); |
| 476 | pos = info._unit->Position(); |
| 477 | } |
| 478 | break; |
| 479 | case signVehicle: |
| 480 | if (myCenter && info._id != nullptr) |
| 481 | { |
| 482 | const AITargetInfo* enemy = myCenter->FindTargetInfo(info._id); |
| 483 | if (enemy) |
| 484 | { |
| 485 | text = enemy->_type->GetDisplayName(); |
| 486 | pos = enemy->_realPos; |
| 487 | } |
| 488 | } |
| 489 | break; |
| 490 | case signStatic: |
| 491 | if (myCenter && info._id != nullptr) |
| 492 | { |
| 493 | const AITargetInfo* building = myCenter->FindTargetInfo(info._id); |
| 494 | if (building) |
| 495 | { |
| 496 | text = building->_type->GetDisplayName(); |
| 497 | pos = building->_realPos; |
| 498 | } |
| 499 | } |
| 500 | break; |
| 501 | case signArcadeWaypoint: |
| 502 | if (myCenter) |
| 503 | { |
| 504 | if (info._indexGroup < 0 || info._indexGroup >= myCenter->NGroups()) |
| 505 | { |
| 506 | break; |
| 507 | } |
| 508 | AIGroup* group = myCenter->GetGroup(info._indexGroup); |
| 509 | if (group) |
| 510 | { |
| 511 | PoseidonAssert(info._index < group->NWaypoints()); |
| 512 | const ArcadeWaypointInfo& wInfo = group->GetWaypoint(info._index); |
| 513 | text = LocalizeString(IDS_AC_MOVE + wInfo.type - ACMOVE); |
| 514 | pos = wInfo.position; |
| 515 | } |
| 516 | } |
| 517 | break; |
| 518 | case signArcadeSensor: |
| 519 | { |
nothing calls this directly
no test coverage detected