Fix Glove NPC.. I promise

This commit is contained in:
John 2015-08-04 22:08:38 +03:00
parent ed9c41bbf4
commit 859eba5e10

View file

@ -80,7 +80,7 @@ class GloveShopGui:
def setClientGlove(self, color): def setClientGlove(self, color):
dna = base.localAvatar.style dna = base.localAvatar.style
dna.gloveColor = ToonDNA.allColorsList[color] dna.gloveColor = color
base.localAvatar.setDNA(dna) base.localAvatar.setDNA(dna)
def __exit(self, state): def __exit(self, state):
@ -91,6 +91,7 @@ class GloveShopGui:
def __updateIndex(self, offset): def __updateIndex(self, offset):
self.index += offset self.index += offset
hitLimit = 0 hitLimit = 0
color = ToonDNA.allColorsList[self.index]
if self.index <= 0: if self.index <= 0:
self.downArrow['state'] = DGG.DISABLED self.downArrow['state'] = DGG.DISABLED
@ -104,7 +105,7 @@ class GloveShopGui:
else: else:
self.upArrow['state'] = DGG.NORMAL self.upArrow['state'] = DGG.NORMAL
if self.lastGlove == self.index: if self.lastGlove == color:
self.buyButton['state'] = DGG.DISABLED self.buyButton['state'] = DGG.DISABLED
self.notice['text'] = TTLocalizer.GloveGuiSameColor self.notice['text'] = TTLocalizer.GloveGuiSameColor
else: else:
@ -112,8 +113,8 @@ class GloveShopGui:
self.notice['text'] = TTLocalizer.GloveGuiNotice % ToontownGlobals.GloveCost self.notice['text'] = TTLocalizer.GloveGuiNotice % ToontownGlobals.GloveCost
self.color['text'] = TTLocalizer.NumToColor[self.index] self.color['text'] = TTLocalizer.NumToColor[self.index]
self.color['text_fg'] = ToonDNA.allColorsList[self.index] self.color['text_fg'] = color
self.setClientGlove(self.index) self.setClientGlove(color)
return hitLimit return hitLimit
def __runTask(self, task): def __runTask(self, task):