Add ~setFov

Requested by Voltage
This commit is contained in:
John Cote 2015-06-17 14:05:49 -04:00
parent 09f8e68410
commit 67ae3df899

View file

@ -254,7 +254,6 @@ class DistributedAvatar(DistributedActor, Avatar):
def getDialogueArray(self):
return None
@magicWord(category=CATEGORY_COMMUNITY_MANAGER)
def warp():
"""
@ -266,7 +265,6 @@ def warp():
return "You can't warp yourself!"
target.setPosHpr(invoker.getPos(), invoker.getHpr())
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[str])
def loop(anim):
"""
@ -275,7 +273,6 @@ def loop(anim):
target = spellbook.getTarget()
target.loop(anim)
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[str, int, str])
def pose(anim, frame, part=None):
"""
@ -285,7 +282,6 @@ def pose(anim, frame, part=None):
target = spellbook.getTarget()
target.pose(anim, frame, partName=part)
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[str, int, int, str])
def pingpong(anim, start=None, end=None, part=None):
"""
@ -333,4 +329,15 @@ def getPos():
"""
Return your target's position.
"""
return spellbook.getTarget().getPos()
return spellbook.getTarget().getPos()
@magicWord(category=CATEGORY_PROGRAMMER, types=[int])
def setFov(fov=OTPGlobals.DefaultCameraFov):
"""
Set your field of view in-game.
"""
base.camLens.setMinFov(fov/(4./3.))
if fov == OTPGlobals.DefaultCameraFov:
return 'Set FOV to the default.'
else:
return 'Set FOV to %s.' % fov