mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 01:09:50 +00:00
Changed: Add new lua command force_camera_fp to force camarea to first person view
--HG-- branch : develop
This commit is contained in:
parent
603b0e6a84
commit
18823c28fa
3 changed files with 29 additions and 1 deletions
|
@ -225,6 +225,17 @@ class CAHToggleCamera : public IActionHandler
|
|||
};
|
||||
REGISTER_ACTION_HANDLER (CAHToggleCamera, "toggle_camera");
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CAHToggleForceFP : public IActionHandler
|
||||
{
|
||||
virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */)
|
||||
{
|
||||
// Change the camera view to first person
|
||||
UserEntity->forceCamareaFirstPerson();
|
||||
}
|
||||
};
|
||||
REGISTER_ACTION_HANDLER (CAHToggleForceFP, "force_camera_fp");
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
class CAHToggleNames : public IActionHandler
|
||||
{
|
||||
|
@ -446,4 +457,3 @@ class CAHToggleDodgeParry : public IActionHandler
|
|||
}
|
||||
};
|
||||
REGISTER_ACTION_HANDLER (CAHToggleDodgeParry, "toggle_dodge_parry");
|
||||
|
||||
|
|
|
@ -748,6 +748,7 @@ void displayHelp()
|
|||
// DISP_TEXT(0.0f, "SHIFT + F11 : Test");
|
||||
DISP_TEXT(0.0f, getActionKey("enter_modal", "group=ui:interface:quit_dialog") + " : Quit");
|
||||
DISP_TEXT(0.0f, getActionKey("toggle_camera") + " : First/Third Person View");
|
||||
DISP_TEXT(0.0f, getActionKey("force_camera_fp") + " : Force Camera to First Person View");
|
||||
|
||||
line = 1.f;
|
||||
TextContext->setHotSpot(UTextContext::TopRight);
|
||||
|
|
|
@ -3213,6 +3213,23 @@ void CUserEntity::toggleCamera()
|
|||
}
|
||||
}// toggleCamera //
|
||||
|
||||
//-----------------------------------------------
|
||||
// forceCamareaFirstPerson :
|
||||
// Force Camera to First Person View
|
||||
//-----------------------------------------------
|
||||
void CUserEntity::forceCamareaFirstPerson()
|
||||
{
|
||||
// You cannot change the camera view when dead.
|
||||
if(isDead())
|
||||
return;
|
||||
// Only if not inside a building.
|
||||
if(!UserEntity->forceIndoorFPV())
|
||||
{
|
||||
//Enter the 1st Person View Mode
|
||||
UserEntity->viewMode(CUserEntity::FirstPV);
|
||||
}
|
||||
}// forceCamareaFirstPerson //
|
||||
|
||||
//---------------------------------------------------
|
||||
// getScale :
|
||||
// Return the entity scale. (return 1.0 if there is any problem).
|
||||
|
|
Loading…
Reference in a new issue