| 1460 | } |
| 1461 | |
| 1462 | static RString GetTooltip(UnitWeaponsInfo& info, RString href) |
| 1463 | { |
| 1464 | const char* name = "fill1:"; |
| 1465 | int n = strlen(name); |
| 1466 | if (strnicmp(href, name, n) == 0) |
| 1467 | { |
| 1468 | return LocalizeString(IDS_TOOLTIP_FILL_ALL_SLOTS); |
| 1469 | } |
| 1470 | |
| 1471 | name = "fill2:"; |
| 1472 | n = strlen(name); |
| 1473 | if (strnicmp(href, name, n) == 0) |
| 1474 | { |
| 1475 | return LocalizeString(IDS_TOOLTIP_FILL_ALL_SLOTS); |
| 1476 | } |
| 1477 | |
| 1478 | name = "fill3:"; |
| 1479 | n = strlen(name); |
| 1480 | if (strnicmp(href, name, n) == 0) |
| 1481 | { |
| 1482 | return LocalizeString(IDS_TOOLTIP_FILL_ALL_SLOTS); |
| 1483 | } |
| 1484 | |
| 1485 | name = "#eq_"; |
| 1486 | n = strlen(name); |
| 1487 | if (strnicmp(href, name, n) == 0) |
| 1488 | { |
| 1489 | return LocalizeString(IDS_TOOLTIP_INFORMATION); |
| 1490 | } |
| 1491 | |
| 1492 | name = "dropweapon:"; |
| 1493 | n = strlen(name); |
| 1494 | if (strnicmp(href, name, n) == 0) |
| 1495 | { |
| 1496 | return LocalizeString(IDS_TOOLTIP_DROP); |
| 1497 | } |
| 1498 | |
| 1499 | name = "dropmagazine:"; |
| 1500 | n = strlen(name); |
| 1501 | if (strnicmp(href, name, n) == 0) |
| 1502 | { |
| 1503 | return LocalizeString(IDS_TOOLTIP_DROP); |
| 1504 | } |
| 1505 | |
| 1506 | name = "slot:"; |
| 1507 | n = strlen(name); |
| 1508 | if (strnicmp(href, name, n) == 0) |
| 1509 | { |
| 1510 | const char* ptr = href; |
| 1511 | int slot = *(ptr + n) - 'A'; |
| 1512 | |
| 1513 | if (slot < WEAPON_SLOTS) |
| 1514 | { |
| 1515 | return RString(); |
| 1516 | } |
| 1517 | else |
| 1518 | { |
| 1519 | const Magazine* magazine = info.magazines[slot - WEAPON_SLOTS]; |
no test coverage detected