| 1512 | } |
| 1513 | |
| 1514 | std::optional<EncodedString> GetTooltip(Rect r, const Point &pt) const override |
| 1515 | { |
| 1516 | bool rtl = _current_text_dir == TD_RTL; |
| 1517 | Dimension d = GetScaledSpriteSize(SPR_PLAYER_SELF); |
| 1518 | |
| 1519 | if (r.WithWidth(d.width, rtl).Contains(pt)) { |
| 1520 | const NetworkClientInfo *ci = NetworkClientInfo::GetIfValid(this->client_pool_id); |
| 1521 | if (ci != nullptr) { |
| 1522 | if (ci->client_id == _network_own_client_id) { |
| 1523 | return GetEncodedString(STR_NETWORK_CLIENT_LIST_PLAYER_ICON_SELF_TOOLTIP); |
| 1524 | } else if (ci->client_id == CLIENT_ID_SERVER) { |
| 1525 | return GetEncodedString(STR_NETWORK_CLIENT_LIST_PLAYER_ICON_HOST_TOOLTIP); |
| 1526 | } |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | return this->ButtonLine::GetTooltip(r, pt); |
| 1531 | } |
| 1532 | |
| 1533 | private: |
| 1534 | ClientPoolID client_pool_id; |
nothing calls this directly
no test coverage detected