| 711 | |
| 712 | if (_dragging) |
| 713 | { |
| 714 | if (_parent) |
| 715 | { |
| 716 | _parent->OnLBDrop(x, y); |
| 717 | } |
| 718 | _dragging = false; |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | void CMPRoles::DrawTooltip(float x, float y) |
| 723 | { |
| 724 | if (_scrollbar.IsLocked()) |
| 725 | { |
| 726 | return; |
| 727 | } |
| 728 | if (!IsReadOnly() && IsInside(x, y)) |
| 729 | { |
| 730 | if (_scrollbar.IsEnabled() && _u > (1.0 - _sb3DWidth)) |
| 731 | { |
| 732 | return; |
| 733 | } |
| 734 | |
| 735 | float index = _v * _rows; |
| 736 | if (index >= 0 && index < _rows) |
| 737 | { |
| 738 | if (GetNetworkManager().GetMissionHeader()->disabledAI) |
| 739 | { |
| 740 | return; |
| 741 | } |
| 742 | int sel = toIntFloor(_topString + index); |
| 743 | if (sel < 0 || sel >= GetSize()) |
| 744 | { |
| 745 | return; |
| 746 | } |
| 747 | |
| 748 | float column1 = (1.0 - _sb3DWidth) * col1coef; |
| 749 | if (_u <= column1) |
| 750 | { |
| 751 | return; |
| 752 | } |
| 753 | |
| 754 | // enable / disable AI |
| 755 | int value = GetValue(sel); |
| 756 | const PlayerRole* role = GetNetworkManager().GetPlayerRole(value); |
| 757 | if (role) |
| 758 | { |
| 759 | if (role->player == AI_PLAYER) |
| 760 | { |
| 761 | _tooltip = LocalizeString(IDS_TOOLTIP_DISABLE_AI); |
| 762 | base::DrawTooltip(x, y); |
| 763 | } |
| 764 | else if (role->player == NO_PLAYER) |
| 765 | { |
| 766 | _tooltip = LocalizeString(IDS_TOOLTIP_ENABLE_AI); |
nothing calls this directly
no test coverage detected