Another fix

This commit is contained in:
John 2015-08-05 11:05:01 +03:00
parent c609a44980
commit ead19d7c63

View file

@ -285,10 +285,10 @@ class ColorShop(StateData.StateData):
self.notify.debug('Entering changeColor') self.notify.debug('Entering changeColor')
colorList = self.getColorList() colorList = self.getColorList()
newChoice = self.shuffleButton.getCurrChoice() newChoice = self.shuffleButton.getCurrChoice()
newHeadColorIndex = colorList.index(newChoice[0]) newHeadColorIndex = self.indexOf(colorList, newChoice[0], 25)
newArmColorIndex = colorList.index(newChoice[1]) newArmColorIndex = self.indexOf(colorList, newChoice[1], 25)
newGloveColorIndex = colorList.index(newChoice[2]) newGloveColorIndex = self.indexOf(colorList, newChoice[2], 0)
newLegColorIndex = colorList.index(newChoice[3]) newLegColorIndex = self.indexOf(colorList, newChoice[3], 25)
self.__swapHeadColor(newHeadColorIndex - self.headChoice) self.__swapHeadColor(newHeadColorIndex - self.headChoice)
if self.colorAll: if self.colorAll:
self.__swapArmColor(newHeadColorIndex - self.armChoice) self.__swapArmColor(newHeadColorIndex - self.armChoice)
@ -298,6 +298,12 @@ class ColorShop(StateData.StateData):
self.__swapArmColor(newArmColorIndex - self.armChoice) self.__swapArmColor(newArmColorIndex - self.armChoice)
self.__swapGloveColor(newGloveColorIndex - self.gloveChoice) self.__swapGloveColor(newGloveColorIndex - self.gloveChoice)
self.__swapLegColor(newLegColorIndex - self.legChoice) self.__swapLegColor(newLegColorIndex - self.legChoice)
def indexOf(self, list, item, default):
try:
return list.index(item)
except:
return default
def getCurrToonSetting(self): def getCurrToonSetting(self):
return [self.dna.headColor, self.dna.armColor, self.dna.gloveColor, self.dna.legColor] return [self.dna.headColor, self.dna.armColor, self.dna.gloveColor, self.dna.legColor]