Exemple #1
0
 def loadGui(self):
     if StowawayItemGui.guiLoaded:
         return
     StowawayListItem.loadGui(self)
     StowawayItemGui.genericButton = (
         StowawayListItem.topGui.find('**/generic_button'),
         StowawayListItem.topGui.find('**/generic_button_down'),
         StowawayListItem.topGui.find('**/generic_button_over'),
         StowawayListItem.topGui.find('**/generic_button_disabled'))
Exemple #2
0
 def destroy(self):
     taskMgr.remove('helpInfoTask')
     taskMgr.remove(self.taskName('dragTask'))
     if self.helpBox:
         self.helpBox.destroy()
         self.helpBox = None
     del self.picture
     if self.weapon:
         taskMgr.remove(DGG.B1PRESS)
         taskMgr.remove(DGG.B2PRESS)
         taskMgr.remove(DGG.B3PRESS)
     StowawayListItem.destroy(self)
     return
 def __init__(self, data, trade = 0, buy = 0, sell = 0, use = 0, weapon = 0, isDisabled = 0, **kw):
     if (trade and buy and sell and use or weapon) and not isDisabled:
         buttonRelief = DGG.RAISED
         buttonState = DGG.NORMAL
     else:
         buttonRelief = DGG.RIDGE
         buttonState = DGG.DISABLED
     self.loadGui()
     optiondefs = (('relief', None, None), ('state', buttonState, None), ('frameSize', (0, self.width, 0, self.height), None), ('image', StowawayItemGui.genericButton, None), ('image_scale', (0.54000000000000004, 1, 0.41999999999999998), None), ('image_pos', (0.26000000000000001, 0, 0.080000000000000002), None), ('pressEffect', 0, None), ('command', self.sendEvents, None))
     self.defineoptions(kw, optiondefs)
     StowawayListItem.__init__(self, data, trade = trade, buy = buy, sell = sell, use = use, weapon = weapon, isDisabled = isDisabled, width = self.width, height = self.height)
     self.initialiseoptions(StowawayItemGui)
     self.createGui()
     self.helpBox = None
 def destroy(self):
     taskMgr.remove('helpInfoTask')
     taskMgr.remove(self.taskName('dragTask'))
     if self.helpBox:
         self.helpBox.destroy()
         self.helpBox = None
     
     del self.picture
     if self.weapon:
         taskMgr.remove(DGG.B1PRESS)
         taskMgr.remove(DGG.B2PRESS)
         taskMgr.remove(DGG.B3PRESS)
     
     StowawayListItem.destroy(self)
 def __init__(self, data, trade=0, buy=0, sell=0, use=0, weapon=0, isDisabled=0, **kw):
     if trade or buy or sell or use or weapon:
         buttonRelief = (not isDisabled and DGG).RAISED
         buttonState = DGG.NORMAL
     else:
         buttonRelief = DGG.RIDGE
         buttonState = DGG.DISABLED
     self.loadGui()
     optiondefs = (
      ('relief', None, None), ('state', buttonState, None), ('frameSize', (0, self.width, 0, self.height), None), ('image', StowawayItemGui.genericButton, None), ('image_scale', (0.54, 1, 0.42), None), ('image_pos', (0.26, 0, 0.08), None), ('pressEffect', 0, None), ('command', self.sendEvents, None))
     self.defineoptions(kw, optiondefs)
     StowawayListItem.__init__(self, data, trade=trade, buy=buy, sell=sell, use=use, weapon=weapon, isDisabled=isDisabled, width=self.width, height=self.height)
     self.initialiseoptions(StowawayItemGui)
     self.createGui()
     self.helpBox = None
     return
 def loadGui(self):
     if StowawayItemGui.guiLoaded:
         return None
     
     StowawayListItem.loadGui(self)
     StowawayItemGui.genericButton = (StowawayListItem.topGui.find('**/generic_button'), StowawayListItem.topGui.find('**/generic_button_down'), StowawayListItem.topGui.find('**/generic_button_over'), StowawayListItem.topGui.find('**/generic_button_disabled'))