mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-08 20:34:31 +00:00
Disable right stick from panning map if zooming maps is enabled
This commit is contained in:
parent
c35e0d7336
commit
dc68f28a40
1 changed files with 9 additions and 5 deletions
|
|
@ -839,7 +839,7 @@ namespace MWGui
|
||||||
mControllerButtons.b = "#{sBack}";
|
mControllerButtons.b = "#{sBack}";
|
||||||
mControllerButtons.x = global ? "#{sLocal}" : "#{sWorld}";
|
mControllerButtons.x = global ? "#{sLocal}" : "#{sWorld}";
|
||||||
mControllerButtons.y = "#{sCenter}";
|
mControllerButtons.y = "#{sCenter}";
|
||||||
mControllerButtons.rStick = "#{sMove}";
|
mControllerButtons.rStick = Settings::map().mAllowZooming ? "" : "#{sMove}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1420,11 +1420,15 @@ namespace MWGui
|
||||||
|
|
||||||
bool MapWindow::onControllerThumbstickEvent(const SDL_ControllerAxisEvent& arg)
|
bool MapWindow::onControllerThumbstickEvent(const SDL_ControllerAxisEvent& arg)
|
||||||
{
|
{
|
||||||
int dx = arg.axis == SDL_CONTROLLER_AXIS_RIGHTX ? -30.0f * arg.value / 32767 : 0;
|
if (!Settings::map().mAllowZooming)
|
||||||
int dy = arg.axis == SDL_CONTROLLER_AXIS_RIGHTY ? -30.0f * arg.value / 32767 : 0;
|
{
|
||||||
shiftMap(dx, dy);
|
int dx = arg.axis == SDL_CONTROLLER_AXIS_RIGHTX ? -30.0f * arg.value / 32767 : 0;
|
||||||
|
int dy = arg.axis == SDL_CONTROLLER_AXIS_RIGHTY ? -30.0f * arg.value / 32767 : 0;
|
||||||
|
shiftMap(dx, dy);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWindow::shiftMap(int dx, int dy)
|
void MapWindow::shiftMap(int dx, int dy)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue