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", SongItemGui.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)
     SongListItem.__init__(
         self,
         data,
         trade=trade,
         buy=buy,
         sell=sell,
         use=use,
         weapon=weapon,
         isDisabled=isDisabled,
         width=self.width,
         height=self.height,
     )
     self.initialiseoptions(SongItemGui)
     self.createGui()
     self.helpBox = None
Пример #2
0
 def loadGui(self):
     if SongItemGui.guiLoaded:
         return
     SongListItem.loadGui(self)
     SongItemGui.genericButton = (
         SongListItem.topGui.find('**/generic_button'),
         SongListItem.topGui.find('**/generic_button_down'),
         SongListItem.topGui.find('**/generic_button_over'),
         SongListItem.topGui.find('**/generic_button_disabled'))
    def loadGui(self):
        if SongItemGui.guiLoaded:
            return None

        SongListItem.loadGui(self)
        SongItemGui.genericButton = (
            SongListItem.topGui.find("**/generic_button"),
            SongListItem.topGui.find("**/generic_button_down"),
            SongListItem.topGui.find("**/generic_button_over"),
            SongListItem.topGui.find("**/generic_button_disabled"),
        )
Пример #4
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)
     SongListItem.destroy(self)
     return
Пример #5
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)
     
     SongListItem.destroy(self)
Пример #6
0
 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', SongItemGui.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)
     SongListItem.__init__(self,
                           data,
                           trade=trade,
                           buy=buy,
                           sell=sell,
                           use=use,
                           weapon=weapon,
                           isDisabled=isDisabled,
                           width=self.width,
                           height=self.height)
     self.initialiseoptions(SongItemGui)
     self.createGui()
     self.helpBox = None