mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Handle always run in the inputmanager, instead of using forced stance.
This commit is contained in:
parent
2d8f0949a4
commit
5b943a965f
7 changed files with 7 additions and 23 deletions
|
@ -84,7 +84,7 @@ namespace MWClass
|
|||
|
||||
virtual bool getStance (const MWWorld::Ptr& ptr, Stance stance, bool ignoreForce = false)
|
||||
const;
|
||||
////< Check if a stance is active or not.
|
||||
///< Check if a stance is active or not.
|
||||
|
||||
virtual float getSpeed (const MWWorld::Ptr& ptr) const;
|
||||
///< Return movement speed.
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace MWInput
|
|||
, mPreviewPOVDelay(0.f)
|
||||
, mTimeIdle(0.f)
|
||||
, mOverencumberedMessageDelay(0.f)
|
||||
, mAlwaysRunActive(false)
|
||||
{
|
||||
Ogre::RenderWindow* window = mOgre.getWindow ();
|
||||
size_t windowHnd;
|
||||
|
@ -315,10 +316,10 @@ namespace MWInput
|
|||
else
|
||||
mPlayer.setUpDown (0);
|
||||
|
||||
if(actionIsActive(A_Run))
|
||||
mPlayer.setRunState(true);
|
||||
if (mAlwaysRunActive)
|
||||
mPlayer.setRunState(!actionIsActive(A_Run));
|
||||
else
|
||||
mPlayer.setRunState(false);
|
||||
mPlayer.setRunState(actionIsActive(A_Run));
|
||||
|
||||
// if player tried to start moving, but can't (due to being overencumbered), display a notification.
|
||||
if (triedToMove)
|
||||
|
@ -699,7 +700,7 @@ namespace MWInput
|
|||
void InputManager::toggleWalking()
|
||||
{
|
||||
if (mWindows.isGuiMode()) return;
|
||||
mPlayer.toggleRunning();
|
||||
mAlwaysRunActive = !mAlwaysRunActive;
|
||||
}
|
||||
|
||||
// Exit program now button (which is disabled in GUI mode)
|
||||
|
|
|
@ -152,6 +152,7 @@ namespace MWInput
|
|||
int mMouseWheel;
|
||||
bool mDebug;
|
||||
bool mUserFileExists;
|
||||
bool mAlwaysRunActive;
|
||||
|
||||
std::map<std::string, bool> mControlSwitch;
|
||||
|
||||
|
|
|
@ -117,11 +117,6 @@ namespace MWWorld
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Class::getForceStance (const Ptr& ptr, Stance stance) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
float Class::getSpeed (const Ptr& ptr) const
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -131,9 +131,6 @@ namespace MWWorld
|
|||
virtual void setForceStance (const Ptr& ptr, Stance stance, bool force) const;
|
||||
///< Force or unforce a stance.
|
||||
|
||||
virtual bool getForceStance (const Ptr& ptr, Stance stance) const;
|
||||
///< Check if a stance forced.
|
||||
|
||||
virtual void setStance (const Ptr& ptr, Stance stance, bool set) const;
|
||||
///< Set or unset a stance.
|
||||
|
||||
|
|
|
@ -77,15 +77,6 @@ namespace MWWorld
|
|||
MWWorld::Class::get(ptr).setStance(ptr, MWWorld::Class::Run, run);
|
||||
}
|
||||
|
||||
void Player::toggleRunning()
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
|
||||
bool running = MWWorld::Class::get (ptr).getForceStance(ptr, MWWorld::Class::Run);
|
||||
|
||||
MWWorld::Class::get (ptr).setForceStance(ptr, MWWorld::Class::Run, !running);
|
||||
}
|
||||
|
||||
void Player::setSneak(bool sneak)
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
|
|
|
@ -66,7 +66,6 @@ namespace MWWorld
|
|||
void setUpDown(int value);
|
||||
|
||||
void setRunState(bool run);
|
||||
void toggleRunning();
|
||||
void setSneak(bool sneak);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue