def LoadImage(self, imageName): try: self.handle = grpImage.Generate(imageName) except: import sys dbg.TraceError("%s %s" % (sys.exc_info()[0], sys.exc_info()[1])) self.handle = 0
def AttachMoney(self, owner, type, count): self.LastAttachedSlotNumber = self.AttachedSlotNumber self.AttachedFlag = True self.AttachedOwner = owner self.AttachedType = type self.AttachedSlotNumber = -1 self.AttachedItemIndex = player.ITEM_MONEY self.AttachedCount = count self.AttachedIconHandle = grpImage.Generate("icon/item/money.tga") self.AttachedIconHalfWidth = grpImage.GetWidth( self.AttachedIconHandle) / 2 self.AttachedIconHalfHeight = grpImage.GetHeight( self.AttachedIconHandle) / 2 wndMgr.AttachIcon(self.AttachedType, self.AttachedItemIndex, self.AttachedSlotNumber, 1, 1) if count > 1: self.countNumberLine.SetNumber(str(count)) self.countNumberLine.Show()