mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 08:12:53 +01:00
Fix #22102: Inverted scrollwheel behaviour on terraform tools
This commit is contained in:
@@ -464,6 +464,8 @@ static bool WindowOtherWheelInput(WindowBase& w, WidgetIndex widgetIndex, int32_
|
||||
}
|
||||
|
||||
const auto entryWidgetType = w.widgets[*spinnerGroupIndex].type;
|
||||
auto targetWidgetIndex = *spinnerGroupIndex;
|
||||
|
||||
if (entryWidgetType == WindowWidgetType::ImgBtn)
|
||||
{
|
||||
auto expectedContent1 = ImageId(SPR_LAND_TOOL_DECREASE, FilterPaletteID::PaletteNull);
|
||||
@@ -475,6 +477,9 @@ static bool WindowOtherWheelInput(WindowBase& w, WidgetIndex widgetIndex, int32_
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Expected widget order: decrease, increase
|
||||
targetWidgetIndex += wheel < 0 ? 2 : 1;
|
||||
}
|
||||
else if (entryWidgetType == WindowWidgetType::Spinner)
|
||||
{
|
||||
@@ -484,9 +489,11 @@ static bool WindowOtherWheelInput(WindowBase& w, WidgetIndex widgetIndex, int32_
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Expected widget order: increase, decrease
|
||||
targetWidgetIndex += wheel < 0 ? 1 : 2;
|
||||
}
|
||||
|
||||
const auto targetWidgetIndex = wheel < 0 ? *spinnerGroupIndex + 1 : *spinnerGroupIndex + 2;
|
||||
if (WidgetIsDisabled(w, targetWidgetIndex))
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user