MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / lstItemsMousePress

Method lstItemsMousePress

src/Basescape/ManageAlienContainmentState.cpp:338–361  ·  view source on GitHub ↗

* Handles the mouse-wheels on the arrow-buttons. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

336 * @param action Pointer to an action.
337 */
338void ManageAlienContainmentState::lstItemsMousePress(Action *action)
339{
340 _sel = _lstAliens->getSelectedRow();
341 if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP)
342 {
343 _timerInc->stop();
344 _timerDec->stop();
345 if (action->getAbsoluteXMouse() >= _lstAliens->getArrowsLeftEdge() &&
346 action->getAbsoluteXMouse() <= _lstAliens->getArrowsRightEdge())
347 {
348 increaseByValue(Options::changeValueByMouseWheel);
349 }
350 }
351 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN)
352 {
353 _timerInc->stop();
354 _timerDec->stop();
355 if (action->getAbsoluteXMouse() >= _lstAliens->getArrowsLeftEdge() &&
356 action->getAbsoluteXMouse() <= _lstAliens->getArrowsRightEdge())
357 {
358 decreaseByValue(Options::changeValueByMouseWheel);
359 }
360 }
361}
362
363/**
364 * Gets the quantity of the currently selected alien on the base.

Callers

nothing calls this directly

Calls 6

getSelectedRowMethod · 0.80
getDetailsMethod · 0.80
getAbsoluteXMouseMethod · 0.80
getArrowsLeftEdgeMethod · 0.80
getArrowsRightEdgeMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected