* Centers on the unit corresponding to this button. * @param action Pointer to an action. */
| 1128 | * @param action Pointer to an action. |
| 1129 | */ |
| 1130 | void BattlescapeState::btnVisibleUnitClick(Action *action) |
| 1131 | { |
| 1132 | int btnID = -1; |
| 1133 | |
| 1134 | // got to find out which button was pressed |
| 1135 | for (int i = 0; i < VISIBLE_MAX && btnID == -1; ++i) |
| 1136 | { |
| 1137 | if (action->getSender() == _btnVisibleUnit[i]) |
| 1138 | { |
| 1139 | btnID = i; |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | if (btnID != -1) |
| 1144 | { |
| 1145 | _map->getCamera()->centerOnPosition(_visibleUnit[btnID]->getPosition()); |
| 1146 | } |
| 1147 | |
| 1148 | action->getDetails()->type = SDL_NOEVENT; // consume the event |
| 1149 | } |
| 1150 | |
| 1151 | /** |
| 1152 | * Launches the blaster bomb. |
nothing calls this directly
no test coverage detected