|
|
|
@ -56,6 +56,8 @@ namespace MWGui
|
|
|
|
|
setText("AppearanceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu1", "Appearance"));
|
|
|
|
|
getWidget(mPreviewImage, "PreviewImage");
|
|
|
|
|
|
|
|
|
|
mPreviewImage->eventMouseWheel += MyGUI::newDelegate(this, &RaceDialog::onPreviewScroll);
|
|
|
|
|
|
|
|
|
|
getWidget(mHeadRotate, "HeadRotate");
|
|
|
|
|
|
|
|
|
|
mHeadRotate->setScrollRange(1000);
|
|
|
|
@ -211,6 +213,19 @@ namespace MWGui
|
|
|
|
|
eventBack();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RaceDialog::onPreviewScroll(MyGUI::Widget*, int _delta)
|
|
|
|
|
{
|
|
|
|
|
size_t oldPos = mHeadRotate->getScrollPosition();
|
|
|
|
|
size_t maxPos = mHeadRotate->getScrollRange() - 1;
|
|
|
|
|
size_t scrollPage = mHeadRotate->getScrollWheelPage();
|
|
|
|
|
if (_delta < 0)
|
|
|
|
|
mHeadRotate->setScrollPosition(oldPos + std::min(maxPos - oldPos, scrollPage));
|
|
|
|
|
else
|
|
|
|
|
mHeadRotate->setScrollPosition(oldPos - std::min(oldPos, scrollPage));
|
|
|
|
|
|
|
|
|
|
onHeadRotate(mHeadRotate, mHeadRotate->getScrollPosition());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RaceDialog::onHeadRotate(MyGUI::ScrollBar* scroll, size_t _position)
|
|
|
|
|
{
|
|
|
|
|
float angle = (float(_position) / (scroll->getScrollRange()-1) - 0.5f) * osg::PI * 2;
|
|
|
|
|