added debug info

This commit is contained in:
Dave Schuyler 2004-04-23 03:51:02 +00:00
parent c876c52dbd
commit 9bd3e99d5c

View File

@ -22,6 +22,7 @@ import DirectObject
class DevWalker(DirectObject.DirectObject): class DevWalker(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory("DevWalker") notify = DirectNotifyGlobal.directNotify.newCategory("DevWalker")
wantDebugIndicator = base.config.GetBool('want-avatar-physics-indicator', 0)
# Ghost mode overrides this: # Ghost mode overrides this:
slideName = "slide-is-disabled" slideName = "slide-is-disabled"
@ -69,6 +70,12 @@ class DevWalker(DirectObject.DirectObject):
def oneTimeCollide(self): def oneTimeCollide(self):
pass pass
def displayDebugInfo(self):
"""
For debug use.
"""
onScreenDebug.add("controls", "DevWalker")
def handleAvatarControls(self, task): def handleAvatarControls(self, task):
""" """
Check on the arrow keys and update the avatar. Check on the arrow keys and update the avatar.
@ -97,6 +104,9 @@ class DevWalker(DirectObject.DirectObject):
(turnLeft and self.avatarControlRotateSpeed) or (turnLeft and self.avatarControlRotateSpeed) or
(turnRight and -self.avatarControlRotateSpeed)) (turnRight and -self.avatarControlRotateSpeed))
if self.wantDebugIndicator:
self.displayDebugInfo()
# Check to see if we're moving at all: # Check to see if we're moving at all:
if self.speed or self.liftSpeed or self.slideSpeed or self.rotationSpeed: if self.speed or self.liftSpeed or self.slideSpeed or self.rotationSpeed:
# How far did we move based on the amount of time elapsed? # How far did we move based on the amount of time elapsed?