*** empty log message ***
This commit is contained in:
parent
2aa9966e12
commit
80ff2a8b92
|
|
@ -30,7 +30,8 @@ class DialogBox(OnscreenPanel.OnscreenPanel):
|
|||
self.isLoaded = 0
|
||||
|
||||
# initialize our OnscreenPanel essence
|
||||
OnscreenPanel.OnscreenPanel.__init__(self, self.doneEvent)
|
||||
# NOTE: all db's have the same name so we can kill tem easily
|
||||
OnscreenPanel.OnscreenPanel.__init__(self, "globalDialog")
|
||||
|
||||
return None
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel):
|
|||
|
||||
# make the panel
|
||||
self.makePanel(rect = (-0.5, 0.5, -0.4, 0.4),
|
||||
font = self.font,
|
||||
drawOrder = 32000, font = self.font,
|
||||
bg = (0.8, 0.8, 0.8, 1.0))
|
||||
|
||||
# create a message
|
||||
|
|
|
|||
|
|
@ -18,6 +18,20 @@ def findPanel(uniqueName):
|
|||
return OnscreenPanel.AllPanels[uniqueName]
|
||||
return None
|
||||
|
||||
def cleanupPanel(uniqueName):
|
||||
"""cleanupPanel(string uniqueName)
|
||||
|
||||
Cleans up (removes) the panel with the given uniqueName. This
|
||||
may be useful when some panels know about each other and know
|
||||
that opening panel A should automatically close panel B, for
|
||||
instance.
|
||||
"""
|
||||
|
||||
if OnscreenPanel.AllPanels.has_key(uniqueName):
|
||||
OnscreenPanel.AllPanels[uniqueName].cleanup()
|
||||
del OnscreenPanel.AllPanels[uniqueName]
|
||||
|
||||
|
||||
class OnscreenPanel(PandaObject.PandaObject, NodePath):
|
||||
"""OnscreenPanel:
|
||||
|
||||
|
|
@ -37,19 +51,6 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
|
|||
NodePath.__init__(self, aspect2d.attachNewNode(panelName))
|
||||
NodePath.hide(self)
|
||||
|
||||
def cleanupPanel(self, uniqueName):
|
||||
"""cleanupPanel(self, string uniqueName)
|
||||
|
||||
Cleans up (removes) the panel with the given uniqueName. This
|
||||
may be useful when some panels know about each other and know
|
||||
that opening panel A should automatically close panel B, for
|
||||
instance.
|
||||
"""
|
||||
|
||||
if OnscreenPanel.AllPanels.has_key(uniqueName):
|
||||
OnscreenPanel.AllPanels[uniqueName].cleanup()
|
||||
del OnscreenPanel.AllPanels[uniqueName]
|
||||
|
||||
def makePanel(self,
|
||||
rect = (-0.5, 0.5, -0.5, 0.5),
|
||||
bg = (1, 1, 1, 1),
|
||||
|
|
@ -103,7 +104,7 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
|
|||
# name. We don't allow any two panels with the same name to
|
||||
# coexist.
|
||||
uniqueName = self.getUniqueName()
|
||||
self.cleanupPanel(uniqueName)
|
||||
cleanupPanel(uniqueName)
|
||||
|
||||
# Store this panel in our map of all open panels.
|
||||
OnscreenPanel.AllPanels[uniqueName] = self
|
||||
|
|
|
|||
Loading…
Reference in New Issue