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

Method lstItemsMousePress

src/Basescape/SellState.cpp:525–548  ·  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

523 * @param action Pointer to an action.
524 */
525void SellState::lstItemsMousePress(Action *action)
526{
527 _sel = _lstItems->getSelectedRow();
528 if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP)
529 {
530 _timerInc->stop();
531 _timerDec->stop();
532 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
533 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
534 {
535 changeByValue(Options::changeValueByMouseWheel, 1);
536 }
537 }
538 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN)
539 {
540 _timerInc->stop();
541 _timerDec->stop();
542 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
543 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
544 {
545 changeByValue(Options::changeValueByMouseWheel, -1);
546 }
547 }
548}
549
550/**
551 * Gets the price 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