ships now have their own control manager that the avatar uses when he takes the wheel

This commit is contained in:
Josh Wilson 2007-01-25 05:24:40 +00:00
parent f4d998e214
commit 6e32e478cf
2 changed files with 185 additions and 624 deletions

View File

@ -13,7 +13,6 @@ from direct.directnotify import DirectNotifyGlobal
#if __debug__: #if __debug__:
# import DevWalker # import DevWalker
from direct.task import Task from direct.task import Task
CollisionHandlerRayStart = 4000.0 # This is a hack, it may be better to use a line instead of a ray. CollisionHandlerRayStart = 4000.0 # This is a hack, it may be better to use a line instead of a ray.
class ControlManager: class ControlManager:
@ -162,6 +161,7 @@ class ControlManager:
def delete(self): def delete(self):
assert self.notify.debugCall(id(self)) assert self.notify.debugCall(id(self))
self.disable() self.disable()
# TODO: put controls delete code in here
del self.controls del self.controls
del self.currentControls del self.currentControls
@ -201,13 +201,21 @@ class ControlManager:
def enable(self): def enable(self):
assert self.notify.debugCall(id(self)) assert self.notify.debugCall(id(self))
self.isEnabled = 1 self.isEnabled = 1
self.currentControls.enableAvatarControls() if self.currentControls:
self.currentControls.enableAvatarControls()
def disable(self): def disable(self):
assert self.notify.debugCall(id(self)) assert self.notify.debugCall(id(self))
self.isEnabled = 0 self.isEnabled = 0
self.currentControls.disableAvatarControls() if self.currentControls:
self.currentControls.disableAvatarControls()
def stop(self):
self.disable()
self.currentControls.setCollisionsActive(0)
self.currentControls.setAvatar(None)
self.currentControls = None
def disableAvatarJump(self): def disableAvatarJump(self):
""" """
prevent prevent

File diff suppressed because it is too large Load Diff