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

Method lstItemsMousePress

src/Basescape/TransferItemsState.cpp:457–480  ·  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

455 * @param action Pointer to an action.
456 */
457void TransferItemsState::lstItemsMousePress(Action *action)
458{
459 _sel = _lstItems->getSelectedRow();
460 if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP)
461 {
462 _timerInc->stop();
463 _timerDec->stop();
464 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
465 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
466 {
467 increaseByValue(Options::changeValueByMouseWheel);
468 }
469 }
470 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN)
471 {
472 _timerInc->stop();
473 _timerDec->stop();
474 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
475 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
476 {
477 decreaseByValue(Options::changeValueByMouseWheel);
478 }
479 }
480}
481
482/**
483 * Gets the transfer cost of the currently selected item.

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