diff options
Diffstat (limited to 'engines/titanic/pet_control/pet_slider.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_slider.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp index 3e579a4b33..1bbad969a2 100644 --- a/engines/titanic/pet_control/pet_slider.cpp +++ b/engines/titanic/pet_control/pet_slider.cpp @@ -168,6 +168,18 @@ void CPetSlider::setOrientation(SliderOrientation orientation) { _orientation |= orientation; } +void CPetSlider::stepPosition(int direction) { + double val = getOffsetPixels(); + + if (direction == -1) { + val = MAX(val - 0.1, 0.0); + } else if (direction == 1) { + val = MIN(val + 0.1, 1.0); + } + + setSliderOffset(val); +} + /*------------------------------------------------------------------------*/ void CPetSoundSlider::setupBackground(const CString &name, CPetControl *petControl) { |