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

Method lstItemsMousePress

src/Basescape/PurchaseState.cpp:398–421  ·  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

396 * @param action Pointer to an action.
397 */
398void PurchaseState::lstItemsMousePress(Action *action)
399{
400 _sel = _lstItems->getSelectedRow();
401 if (action->getDetails()->button.button == SDL_BUTTON_WHEELUP)
402 {
403 _timerInc->stop();
404 _timerDec->stop();
405 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
406 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
407 {
408 increaseByValue(Options::changeValueByMouseWheel);
409 }
410 }
411 else if (action->getDetails()->button.button == SDL_BUTTON_WHEELDOWN)
412 {
413 _timerInc->stop();
414 _timerDec->stop();
415 if (action->getAbsoluteXMouse() >= _lstItems->getArrowsLeftEdge() &&
416 action->getAbsoluteXMouse() <= _lstItems->getArrowsRightEdge())
417 {
418 decreaseByValue(Options::changeValueByMouseWheel);
419 }
420 }
421}
422
423/**
424 * 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