mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Always run key (Y)
This commit is contained in:
parent
e30af28860
commit
2d8f0949a4
@ -322,6 +322,24 @@ namespace MWClass
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Npc::getForceStance(const MWWorld::Ptr& ptr, Stance stance) const
|
||||||
|
{
|
||||||
|
MWMechanics::NpcStats& stats = getNpcStats (ptr);
|
||||||
|
|
||||||
|
switch (stance)
|
||||||
|
{
|
||||||
|
case Run:
|
||||||
|
return stats.getMovementFlag (MWMechanics::NpcStats::Flag_ForceRun);
|
||||||
|
case Sneak:
|
||||||
|
return stats.getMovementFlag (MWMechanics::NpcStats::Flag_ForceSneak);
|
||||||
|
|
||||||
|
case Combat:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
float Npc::getSpeed(const MWWorld::Ptr& ptr) const
|
float Npc::getSpeed(const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
@ -76,6 +76,9 @@ namespace MWClass
|
|||||||
virtual void setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const;
|
virtual void setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const;
|
||||||
///< Force or unforce a stance.
|
///< Force or unforce a stance.
|
||||||
|
|
||||||
|
virtual bool getForceStance (const MWWorld::Ptr& ptr, Stance stance) const;
|
||||||
|
///< Check if a stance forced.
|
||||||
|
|
||||||
virtual void setStance (const MWWorld::Ptr& ptr, Stance stance, bool set) const;
|
virtual void setStance (const MWWorld::Ptr& ptr, Stance stance, bool set) const;
|
||||||
///< Set or unset a stance.
|
///< Set or unset a stance.
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ namespace MWInput
|
|||||||
case A_AutoMove:
|
case A_AutoMove:
|
||||||
toggleAutoMove ();
|
toggleAutoMove ();
|
||||||
break;
|
break;
|
||||||
case A_ToggleWalk:
|
case A_AlwaysRun:
|
||||||
toggleWalking ();
|
toggleWalking ();
|
||||||
break;
|
break;
|
||||||
case A_ToggleWeapon:
|
case A_ToggleWeapon:
|
||||||
@ -768,6 +768,7 @@ namespace MWInput
|
|||||||
defaultKeyBindings[A_QuickKey10] = OIS::KC_0;
|
defaultKeyBindings[A_QuickKey10] = OIS::KC_0;
|
||||||
defaultKeyBindings[A_Screenshot] = OIS::KC_SYSRQ;
|
defaultKeyBindings[A_Screenshot] = OIS::KC_SYSRQ;
|
||||||
defaultKeyBindings[A_ToggleHUD] = OIS::KC_F12;
|
defaultKeyBindings[A_ToggleHUD] = OIS::KC_F12;
|
||||||
|
defaultKeyBindings[A_AlwaysRun] = OIS::KC_Y;
|
||||||
|
|
||||||
std::map<int, int> defaultMouseButtonBindings;
|
std::map<int, int> defaultMouseButtonBindings;
|
||||||
defaultMouseButtonBindings[A_Inventory] = OIS::MB_Right;
|
defaultMouseButtonBindings[A_Inventory] = OIS::MB_Right;
|
||||||
@ -834,6 +835,7 @@ namespace MWInput
|
|||||||
descriptions[A_QuickKey8] = "sQuick8Cmd";
|
descriptions[A_QuickKey8] = "sQuick8Cmd";
|
||||||
descriptions[A_QuickKey9] = "sQuick9Cmd";
|
descriptions[A_QuickKey9] = "sQuick9Cmd";
|
||||||
descriptions[A_QuickKey10] = "sQuick10Cmd";
|
descriptions[A_QuickKey10] = "sQuick10Cmd";
|
||||||
|
descriptions[A_AlwaysRun] = "sAlways_Run";
|
||||||
|
|
||||||
if (descriptions[action] == "")
|
if (descriptions[action] == "")
|
||||||
return ""; // not configurable
|
return ""; // not configurable
|
||||||
@ -865,6 +867,7 @@ namespace MWInput
|
|||||||
ret.push_back(A_MoveRight);
|
ret.push_back(A_MoveRight);
|
||||||
ret.push_back(A_TogglePOV);
|
ret.push_back(A_TogglePOV);
|
||||||
ret.push_back(A_Run);
|
ret.push_back(A_Run);
|
||||||
|
ret.push_back(A_AlwaysRun);
|
||||||
ret.push_back(A_Sneak);
|
ret.push_back(A_Sneak);
|
||||||
ret.push_back(A_Activate);
|
ret.push_back(A_Activate);
|
||||||
ret.push_back(A_ToggleWeapon);
|
ret.push_back(A_ToggleWeapon);
|
||||||
|
@ -217,7 +217,7 @@ namespace MWInput
|
|||||||
A_CycleWeaponLeft,//Cycling through weapons
|
A_CycleWeaponLeft,//Cycling through weapons
|
||||||
A_CycleWeaponRight,
|
A_CycleWeaponRight,
|
||||||
A_ToggleSneak, //Toggles Sneak
|
A_ToggleSneak, //Toggles Sneak
|
||||||
A_ToggleWalk, //Toggle Walking/Running
|
A_AlwaysRun, //Toggle Walking/Running
|
||||||
A_Sneak,
|
A_Sneak,
|
||||||
|
|
||||||
A_QuickSave,
|
A_QuickSave,
|
||||||
|
@ -117,6 +117,11 @@ namespace MWWorld
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Class::getForceStance (const Ptr& ptr, Stance stance) const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
float Class::getSpeed (const Ptr& ptr) const
|
float Class::getSpeed (const Ptr& ptr) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -131,6 +131,9 @@ namespace MWWorld
|
|||||||
virtual void setForceStance (const Ptr& ptr, Stance stance, bool force) const;
|
virtual void setForceStance (const Ptr& ptr, Stance stance, bool force) const;
|
||||||
///< Force or unforce a stance.
|
///< 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;
|
virtual void setStance (const Ptr& ptr, Stance stance, bool set) const;
|
||||||
///< Set or unset a stance.
|
///< Set or unset a stance.
|
||||||
|
|
||||||
|
@ -81,9 +81,9 @@ namespace MWWorld
|
|||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
|
|
||||||
bool running = MWWorld::Class::get (ptr).getStance (ptr, MWWorld::Class::Run, true);
|
bool running = MWWorld::Class::get (ptr).getForceStance(ptr, MWWorld::Class::Run);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Run, !running);
|
MWWorld::Class::get (ptr).setForceStance(ptr, MWWorld::Class::Run, !running);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setSneak(bool sneak)
|
void Player::setSneak(bool sneak)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user