fix some estate crashes
This commit is contained in:
parent
949fc5e50e
commit
c9495aa06d
5 changed files with 17 additions and 14 deletions
|
@ -10,9 +10,9 @@ class FlowerBrowser(DirectScrolledList):
|
|||
notify = DirectNotifyGlobal.directNotify.newCategory('FlowerBrowser')
|
||||
|
||||
def __init__(self, parent = aspect2d, **kw):
|
||||
self.parent = parent
|
||||
self._parent = parent
|
||||
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
|
||||
optiondefs = (('parent', self.parent, None),
|
||||
optiondefs = (('parent', self._parent, None),
|
||||
('relief', None, None),
|
||||
('incButton_image', (gui.find('**/FndsLst_ScrollUp'),
|
||||
gui.find('**/FndsLst_ScrollDN'),
|
||||
|
@ -43,7 +43,7 @@ class FlowerBrowser(DirectScrolledList):
|
|||
|
||||
def destroy(self):
|
||||
DirectScrolledList.destroy(self)
|
||||
self.parent = None
|
||||
self._parent = None
|
||||
return
|
||||
|
||||
def update(self):
|
||||
|
|
|
@ -27,7 +27,7 @@ class FlowerPanel(DirectFrame):
|
|||
self.initialiseoptions(FlowerPanel)
|
||||
self.doneEvent = doneEvent
|
||||
self.flower = flower
|
||||
self.parent = parent
|
||||
self._parent = parent
|
||||
self.photo = None
|
||||
return
|
||||
|
||||
|
@ -37,7 +37,7 @@ class FlowerPanel(DirectFrame):
|
|||
self.photo = None
|
||||
self.flower = None
|
||||
DirectFrame.destroy(self)
|
||||
self.parent = None
|
||||
self._parent = None
|
||||
return
|
||||
|
||||
def load(self):
|
||||
|
|
|
@ -10,10 +10,10 @@ class FlowerPicker(DirectScrolledList):
|
|||
|
||||
def __init__(self, parent = aspect2d, **kw):
|
||||
self.flowerList = []
|
||||
self.parent = parent
|
||||
self._parent = parent
|
||||
self.shown = 0
|
||||
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
|
||||
optiondefs = (('parent', self.parent, None),
|
||||
optiondefs = (('parent', self._parent, None),
|
||||
('relief', None, None),
|
||||
('incButton_image', (gui.find('**/FndsLst_ScrollUp'),
|
||||
gui.find('**/FndsLst_ScrollDN'),
|
||||
|
@ -63,7 +63,7 @@ class FlowerPicker(DirectScrolledList):
|
|||
|
||||
def destroy(self):
|
||||
DirectScrolledList.destroy(self)
|
||||
self.parent = None
|
||||
self._parent = None
|
||||
self.flowerList = []
|
||||
self.flowerPanel = None
|
||||
return
|
||||
|
|
|
@ -28,7 +28,7 @@ class DirectRegion(NodePath):
|
|||
pass
|
||||
|
||||
def hide(self):
|
||||
NodePath.NodePath.hide(self)
|
||||
NodePath.hide(self)
|
||||
|
||||
def load(self):
|
||||
if not hasattr(self, 'cRender'):
|
||||
|
@ -127,9 +127,12 @@ class SpecialsPhoto(NodePath):
|
|||
rotate = pitch.attachNewNode('rotate')
|
||||
scale = rotate.attachNewNode('scale')
|
||||
actor.reparentTo(scale)
|
||||
bMin, bMax = actor.getTightBounds()
|
||||
center = (bMin + bMax) / 2.0
|
||||
actor.setPos(-center[0], -center[1], -center[2])
|
||||
if actor.getTightBounds():
|
||||
bMin, bMax = actor.getTightBounds()
|
||||
center = (bMin + bMax) / 2.0
|
||||
actor.setPos(-center[0], -center[1], -center[2])
|
||||
else:
|
||||
actor.setPos(0, 0, 0)
|
||||
pitch.setY(2.5)
|
||||
return frame
|
||||
|
||||
|
@ -193,7 +196,7 @@ class SpecialsPhoto(NodePath):
|
|||
self.background.reparentTo(self.specialsFrame)
|
||||
|
||||
def hide(self):
|
||||
NodePath.NodePath.hide(self)
|
||||
NodePath.hide(self)
|
||||
if hasattr(self, 'specialsDisplayRegion'):
|
||||
self.specialsDisplayRegion.unload()
|
||||
if hasattr(self, 'background'):
|
||||
|
|
|
@ -1449,7 +1449,7 @@ class ObjectManager(NodePath, DirectObject):
|
|||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
okButtonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||
cancelButtonImage = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
|
||||
self.verifyFrame = DirectFrame(pos=(-0.4, 0.1, 0.3), scale=0.75, relief=None, image=DGG.getDefaultDialogGeom(), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.2, 1, 1.3), text='', text_wordwrap=19, text_scale=0.06, text_pos=(0, 0.5), textMayChange=1, sortOrder=NO_FADE_SORT_INDEX)
|
||||
self.verifyFrame = DirectFrame(pos=(-0.4, 0.1, 0.3), scale=0.75, relief=None, image=DGG.getDefaultDialogGeom(), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.2, 1, 1.3), text='', text_wordwrap=19, text_scale=0.06, text_pos=(0, 0.5), textMayChange=1, sortOrder=DGG.NO_FADE_SORT_INDEX)
|
||||
self.okButton = DirectButton(parent=self.verifyFrame, image=okButtonImage, relief=None, text=OTPLocalizer.DialogOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.22, 0.0, -0.5))
|
||||
self.cancelButton = DirectButton(parent=self.verifyFrame, image=cancelButtonImage, relief=None, text=OTPLocalizer.DialogCancel, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.22, 0.0, -0.5))
|
||||
self.deleteItemText = DirectLabel(parent=self.verifyFrame, relief=None, text='', text_wordwrap=16, pos=(0.0, 0.0, -0.4), scale=0.09)
|
||||
|
|
Loading…
Reference in a new issue