From e204ad6cc60021d2d67f369016419278065ba197 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Thu, 5 May 2005 21:49:52 +0000 Subject: [PATCH] added remove() --- direct/src/controls/ControlManager.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/direct/src/controls/ControlManager.py b/direct/src/controls/ControlManager.py index 535dbdc0ca..105c520bab 100755 --- a/direct/src/controls/ControlManager.py +++ b/direct/src/controls/ControlManager.py @@ -108,6 +108,25 @@ class ControlManager: controls.setCollisionsActive(0) self.controls[name] = controls + def remove(self, name): + """ + name is any key that was used to refer to the + the controls when they were added (e.g. + using the add(, ) call). + + Remove a control instance from the list of available control systems. + + See also: add(). + """ + assert self.notify.debugCall(id(self)) + oldControls = self.controls.get(name) + if oldControls is not None: + print "Removing controls:", name + oldControls.disableAvatarControls() + oldControls.setCollisionsActive(0) + oldControls.delete() + del self.controls[name] + def use(self, name, avatar): """ name is a key (string) that was previously passed to add().