mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Restore Gamepad Zooming
This commit is contained in:
parent
1995e43b46
commit
4bf24a955e
6 changed files with 15 additions and 3 deletions
|
@ -416,6 +416,7 @@ namespace MWBase
|
|||
|
||||
virtual void togglePOV(bool force = false) = 0;
|
||||
virtual bool isFirstPerson() const = 0;
|
||||
virtual bool isPreviewModeEnabled() const = 0;
|
||||
virtual void togglePreviewMode(bool enable) = 0;
|
||||
virtual bool toggleVanityMode(bool enable) = 0;
|
||||
virtual void allowVanityMode(bool allow) = 0;
|
||||
|
|
|
@ -167,6 +167,11 @@ namespace MWInput
|
|||
|
||||
mAttemptJump = false;
|
||||
}
|
||||
|
||||
bool ActionManager::isPreviewModeEnabled()
|
||||
{
|
||||
return MWBase::Environment::get().getWorld()->isPreviewModeEnabled();
|
||||
}
|
||||
|
||||
void ActionManager::resetIdleTime()
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace MWInput
|
|||
|
||||
void setAttemptJump(bool enabled) { mAttemptJump = enabled; }
|
||||
|
||||
float getPreviewDelay() const { return mPreviewPOVDelay; };
|
||||
bool isPreviewModeEnabled();
|
||||
|
||||
private:
|
||||
void handleGuiArrowKey(int action);
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace MWInput
|
|||
|
||||
bool ControllerManager::update(float dt)
|
||||
{
|
||||
mGamepadPreviewMode = mActionManager->getPreviewDelay() == 1.f;
|
||||
mGamepadPreviewMode = mActionManager->isPreviewModeEnabled();
|
||||
|
||||
if (mGuiCursorEnabled && !(mJoystickLastUsed && !mGamepadGuiCursorEnabled))
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ namespace MWInput
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mGamepadPreviewMode && arg.value) // Preview Mode Gamepad Zooming
|
||||
if (mGamepadPreviewMode) // Preview Mode Gamepad Zooming
|
||||
{
|
||||
if (arg.axis == SDL_CONTROLLER_AXIS_TRIGGERRIGHT)
|
||||
{
|
||||
|
|
|
@ -2394,6 +2394,11 @@ namespace MWWorld
|
|||
{
|
||||
return mRendering->getCamera()->isFirstPerson();
|
||||
}
|
||||
|
||||
bool World::isPreviewModeEnabled() const
|
||||
{
|
||||
return mRendering->getCamera()->getMode() == MWRender::Camera::Mode::Preview;
|
||||
}
|
||||
|
||||
void World::togglePreviewMode(bool enable)
|
||||
{
|
||||
|
|
|
@ -524,6 +524,7 @@ namespace MWWorld
|
|||
void togglePOV(bool force = false) override;
|
||||
|
||||
bool isFirstPerson() const override;
|
||||
bool isPreviewModeEnabled() const override;
|
||||
|
||||
void togglePreviewMode(bool enable) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue