mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Merge branch 'race_scroll' into 'master'
Allow mouse scrolling in the race preview widget See merge request OpenMW/openmw!2246
This commit is contained in:
commit
43db803938
@ -203,6 +203,7 @@
|
|||||||
Feature #6721: [OpenMW-CS] Add option to open records in new window
|
Feature #6721: [OpenMW-CS] Add option to open records in new window
|
||||||
Feature #6867: Add a way to localize hardcoded strings in GUI
|
Feature #6867: Add a way to localize hardcoded strings in GUI
|
||||||
Feature #6888: Add switch for armor degradation fix.
|
Feature #6888: Add switch for armor degradation fix.
|
||||||
|
Feature #6925: Allow to use a mouse wheel to rotate a head in the race selection menu
|
||||||
Task #6078: First person should not clear depth buffer
|
Task #6078: First person should not clear depth buffer
|
||||||
Task #6161: Refactor Sky to use shaders and be GLES/GL3 friendly
|
Task #6161: Refactor Sky to use shaders and be GLES/GL3 friendly
|
||||||
Task #6162: Refactor GUI to use shaders and to be GLES and GL3+ friendly
|
Task #6162: Refactor GUI to use shaders and to be GLES and GL3+ friendly
|
||||||
|
@ -56,6 +56,8 @@ namespace MWGui
|
|||||||
setText("AppearanceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu1", "Appearance"));
|
setText("AppearanceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu1", "Appearance"));
|
||||||
getWidget(mPreviewImage, "PreviewImage");
|
getWidget(mPreviewImage, "PreviewImage");
|
||||||
|
|
||||||
|
mPreviewImage->eventMouseWheel += MyGUI::newDelegate(this, &RaceDialog::onPreviewScroll);
|
||||||
|
|
||||||
getWidget(mHeadRotate, "HeadRotate");
|
getWidget(mHeadRotate, "HeadRotate");
|
||||||
|
|
||||||
mHeadRotate->setScrollRange(1000);
|
mHeadRotate->setScrollRange(1000);
|
||||||
@ -211,6 +213,19 @@ namespace MWGui
|
|||||||
eventBack();
|
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)
|
void RaceDialog::onHeadRotate(MyGUI::ScrollBar* scroll, size_t _position)
|
||||||
{
|
{
|
||||||
float angle = (float(_position) / (scroll->getScrollRange()-1) - 0.5f) * osg::PI * 2;
|
float angle = (float(_position) / (scroll->getScrollRange()-1) - 0.5f) * osg::PI * 2;
|
||||||
|
@ -66,6 +66,7 @@ namespace MWGui
|
|||||||
EventHandle_WindowBase eventDone;
|
EventHandle_WindowBase eventDone;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void onPreviewScroll(MyGUI::Widget* _sender, int _delta);
|
||||||
void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
|
void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
|
||||||
|
|
||||||
void onSelectPreviousGender(MyGUI::Widget* _sender);
|
void onSelectPreviousGender(MyGUI::Widget* _sender);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user