Added Zach's gloves.

This commit is contained in:
Loudrob 2015-03-04 05:35:36 -05:00
parent b033ab02e4
commit 9be3e7f13b
3 changed files with 46 additions and 37 deletions

View file

@ -40,19 +40,22 @@ class ColorShop(StateData.StateData):
try: try:
self.headChoice = colorList.index(self.dna.headColor) self.headChoice = colorList.index(self.dna.headColor)
self.armChoice = colorList.index(self.dna.armColor) self.armChoice = colorList.index(self.dna.armColor)
self.gloveChoice = colorList.index(self.dna.gloveColor)
self.legChoice = colorList.index(self.dna.legColor) self.legChoice = colorList.index(self.dna.legColor)
except: except:
self.headChoice = random.choice(colorList) self.headChoice = random.choice(colorList)
self.armChoice = self.headChoice self.armChoice = self.headChoice
self.gloveChoice = self.gloveChoice
self.legChoice = self.headChoice self.legChoice = self.headChoice
self.__swapHeadColor(0) self.__swapHeadColor(0)
self.__swapArmColor(0) self.__swapArmColor(0)
self.__swapGloveColor(0)
self.__swapLegColor(0) self.__swapLegColor(0)
self.startColor = 0 self.startColor = 0
self.acceptOnce('last', self.__handleBackward) self.acceptOnce('last', self.__handleBackward)
self.acceptOnce('next', self.__handleForward) self.acceptOnce('next', self.__handleForward)
choicePool = [self.getGenderColorList(self.dna), self.getGenderColorList(self.dna), self.getGenderColorList(self.dna)] choicePool = [self.getGenderColorList(self.dna), self.getGenderColorList(self.dna), self.getGenderColorList(self.dna), self.getGenderColorList(self.dna)]
self.shuffleButton.setChoicePool(choicePool) self.shuffleButton.setChoicePool(choicePool)
self.accept(self.shuffleFetchMsg, self.changeColor) self.accept(self.shuffleFetchMsg, self.changeColor)
self.acceptOnce('MAT-newToonCreated', self.shuffleButton.cleanHistory) self.acceptOnce('MAT-newToonCreated', self.shuffleButton.cleanHistory)
@ -89,7 +92,7 @@ class ColorShop(StateData.StateData):
self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.416), frameColor=(1, 0, 0, 0)) self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.416), frameColor=(1, 0, 0, 0))
self.parentFrame.setPos(-0.36, 0, -0.5) self.parentFrame.setPos(-0.36, 0, -0.5)
self.parentFrame.reparentTo(base.a2dTopRight) self.parentFrame.reparentTo(base.a2dTopRight)
self.toonFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.073), hpr=(0, 0, 0), scale=1.3, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopToon, text_scale=TTLocalizer.CStoonFrame, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.toonFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, 0.1), hpr=(0, 0, 0), scale=1.3, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopToon, text_scale=TTLocalizer.CStoonFrame, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1))
self.allLButton = DirectButton(parent=self.toonFrame, relief=None, image=(shuffleArrowUp, self.allLButton = DirectButton(parent=self.toonFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -98,7 +101,7 @@ class ColorShop(StateData.StateData):
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapAllColor, extraArgs=[1]) shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapAllColor, extraArgs=[1])
self.headFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.3), hpr=(0, 0, 2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopHead, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.headFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.15), hpr=(0, 0, 2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopHead, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1))
self.headLButton = DirectButton(parent=self.headFrame, relief=None, image=(shuffleArrowUp, self.headLButton = DirectButton(parent=self.headFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -107,7 +110,7 @@ class ColorShop(StateData.StateData):
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapHeadColor, extraArgs=[1]) shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapHeadColor, extraArgs=[1])
self.bodyFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonScale, relief=None, pos=(0, 0, -0.5), hpr=(0, 0, -2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopBody, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.bodyFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonScale, relief=None, pos=(0, 0, -0.35), hpr=(0, 0, -2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopBody, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1))
self.armLButton = DirectButton(parent=self.bodyFrame, relief=None, image=(shuffleArrowUp, self.armLButton = DirectButton(parent=self.bodyFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -116,7 +119,16 @@ class ColorShop(StateData.StateData):
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapArmColor, extraArgs=[1]) shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapArmColor, extraArgs=[1])
self.legsFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.7), hpr=(0, 0, 3), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopLegs, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.gloveFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.55), hpr=(0, 0, 2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopGloves, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1))
self.gloveLButton = DirectButton(parent=self.gloveFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown,
shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonScale, image1_scale=halfButtonHoverScale, image2_scale=halfButtonHoverScale, pos=(-0.2, 0, 0), command=self.__swapGloveColor, extraArgs=[-1])
self.gloveRButton = DirectButton(parent=self.gloveFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown,
shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapGloveColor, extraArgs=[1])
self.legsFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.75), hpr=(0, 0, -2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopLegs, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1))
self.legLButton = DirectButton(parent=self.legsFrame, relief=None, image=(shuffleArrowUp, self.legLButton = DirectButton(parent=self.legsFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -142,6 +154,8 @@ class ColorShop(StateData.StateData):
self.headRButton.destroy() self.headRButton.destroy()
self.armLButton.destroy() self.armLButton.destroy()
self.armRButton.destroy() self.armRButton.destroy()
self.gloveLButton.destroy()
self.gloveRButton.destroy()
self.legLButton.destroy() self.legLButton.destroy()
self.legRButton.destroy() self.legRButton.destroy()
self.allLButton.destroy() self.allLButton.destroy()
@ -155,6 +169,8 @@ class ColorShop(StateData.StateData):
del self.headRButton del self.headRButton
del self.armLButton del self.armLButton
del self.armRButton del self.armRButton
del self.gloveLButton
del self.gloveRButton
del self.legLButton del self.legLButton
del self.legRButton del self.legRButton
del self.allLButton del self.allLButton
@ -169,8 +185,10 @@ class ColorShop(StateData.StateData):
self.__updateScrollButtons(choice, length, self.allLButton, self.allRButton) self.__updateScrollButtons(choice, length, self.allLButton, self.allRButton)
self.__swapHeadColor(offset) self.__swapHeadColor(offset)
oldArmColorIndex = colorList.index(self.toon.style.armColor) oldArmColorIndex = colorList.index(self.toon.style.armColor)
oldGloveColorIndex = colorList.index(self.toon.style.gloveColor)
oldLegColorIndex = colorList.index(self.toon.style.legColor) oldLegColorIndex = colorList.index(self.toon.style.legColor)
self.__swapArmColor(choice - oldArmColorIndex) self.__swapArmColor(choice - oldArmColorIndex)
self.__swapGloveColor(choice - oldGloveColorIndex)
self.__swapLegColor(choice - oldLegColorIndex) self.__swapLegColor(choice - oldLegColorIndex)
def __swapHeadColor(self, offset): def __swapHeadColor(self, offset):
@ -191,6 +209,15 @@ class ColorShop(StateData.StateData):
self.dna.armColor = newColor self.dna.armColor = newColor
self.toon.swapToonColor(self.dna) self.toon.swapToonColor(self.dna)
def __swapGloveColor(self, offset):
colorList = self.getGenderColorList(self.dna)
length = len(colorList)
self.gloveChoice = (self.gloveChoice + offset) % length
self.__updateScrollButtons(self.gloveChoice, length, self.gloveLButton, self.gloveRButton)
newColor = colorList[self.gloveChoice]
self.dna.gloveColor = newColor
self.toon.swapToonColor(self.dna)
def __swapLegColor(self, offset): def __swapLegColor(self, offset):
colorList = self.getGenderColorList(self.dna) colorList = self.getGenderColorList(self.dna)
length = len(colorList) length = len(colorList)
@ -224,17 +251,21 @@ class ColorShop(StateData.StateData):
newChoice = self.shuffleButton.getCurrChoice() newChoice = self.shuffleButton.getCurrChoice()
newHeadColorIndex = colorList.index(newChoice[0]) newHeadColorIndex = colorList.index(newChoice[0])
newArmColorIndex = colorList.index(newChoice[1]) newArmColorIndex = colorList.index(newChoice[1])
newLegColorIndex = colorList.index(newChoice[2]) newGloveColorIndex = colorList.index(newChoice[2])
newLegColorIndex = colorList.index(newChoice[3])
oldHeadColorIndex = colorList.index(self.toon.style.headColor) oldHeadColorIndex = colorList.index(self.toon.style.headColor)
oldArmColorIndex = colorList.index(self.toon.style.armColor) oldArmColorIndex = colorList.index(self.toon.style.armColor)
oldGloveColorIndex = colorList.index(self.toon.style.gloveColor)
oldLegColorIndex = colorList.index(self.toon.style.legColor) oldLegColorIndex = colorList.index(self.toon.style.legColor)
self.__swapHeadColor(newHeadColorIndex - oldHeadColorIndex) self.__swapHeadColor(newHeadColorIndex - oldHeadColorIndex)
if self.colorAll: if self.colorAll:
self.__swapArmColor(newHeadColorIndex - oldArmColorIndex) self.__swapArmColor(newHeadColorIndex - oldArmColorIndex)
self.__swapGloveColor(newHeadColorIndex - oldGloveColorIndex)
self.__swapLegColor(newHeadColorIndex - oldLegColorIndex) self.__swapLegColor(newHeadColorIndex - oldLegColorIndex)
else: else:
self.__swapArmColor(newArmColorIndex - oldArmColorIndex) self.__swapArmColor(newArmColorIndex - oldArmColorIndex)
self.__swapGloveColor(newGloveColorIndex - oldGloveColorIndex)
self.__swapLegColor(newLegColorIndex - oldLegColorIndex) self.__swapLegColor(newLegColorIndex - oldLegColorIndex)
def getCurrToonSetting(self): def getCurrToonSetting(self):
return [self.dna.headColor, self.dna.armColor, self.dna.legColor] return [self.dna.headColor, self.dna.armColor, self.dna.gloveColor, self.dna.legColor]

View file

@ -424,30 +424,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
'suspicious', self.doId, 'Invalid DNA string.') 'suspicious', self.doId, 'Invalid DNA string.')
def verifyDNA(self): def verifyDNA(self):
valid = True return True
if self.isPlayerControlled():
if self.dna.gloveColor != 0:
self.dna.gloveColor = 0
valid = False
bodyColors = (self.dna.headColor, self.dna.armColor, self.dna.legColor)
if (26 in bodyColors) or (0 in bodyColors):
if (bodyColors[1] != bodyColors[0]) or (bodyColors[2] != bodyColors[0]):
self.dna.armColor = bodyColors[0]
self.dna.legColor = bodyColors[0]
valid = False
if ((self.dna.getAnimal() != 'cat') and (26 in bodyColors)) or (
(self.dna.getAnimal() != 'bear') and (0 in bodyColors)):
if self.dna.getGender() == 'm':
color = ToonDNA.defaultBoyColorList[0]
else:
color = ToonDNA.defaultGirlColorList[0]
self.dna.headColor = color
self.dna.armColor = color
self.dna.legColor = color
valid = False
if not valid:
self.b_setDNAString(self.dna.makeNetString())
return valid
def getDNAString(self): def getDNAString(self):
return self.dna.makeNetString() return self.dna.makeNetString()
@ -1900,7 +1877,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
simbase.air.writeServerEvent('suspicious', self.doId, 'Toon teleporting to zone %s they do not have access to.' % zoneId) simbase.air.writeServerEvent('suspicious', self.doId, 'Toon teleporting to zone %s they do not have access to.' % zoneId)
if simbase.config.GetBool('want-ban-teleport', False): if simbase.config.GetBool('want-ban-teleport', False):
commentStr = 'Toon %s teleporting to a zone %s they do not have access to' % (self.doId, zoneId) commentStr = 'Toon %s teleporting to a zone %s they do not have access to' % (self.doId, zoneId)
#simbase.air.banManager.ban(self.doId, self.DISLid, commentStr) simbase.air.banManager.ban(self.doId, self.DISLid, commentStr)
def setTeleportOverride(self, flag): def setTeleportOverride(self, flag):
self.teleportOverride = flag self.teleportOverride = flag
@ -2384,7 +2361,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
commentStr = 'User %s has negative money %s' % (self.doId, money) commentStr = 'User %s has negative money %s' % (self.doId, money)
dislId = self.DISLid dislId = self.DISLid
if simbase.config.GetBool('want-ban-negative-money', False): if simbase.config.GetBool('want-ban-negative-money', False):
#simbase.air.banManager.ban(self.doId, dislId, commentStr) simbase.air.banManager.ban(self.doId, dislId, commentStr)
pass pass
self.money = money self.money = money
@ -3606,14 +3583,14 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
if 'invalid msgIndex in setSCSinging:' in eventName: if 'invalid msgIndex in setSCSinging:' in eventName:
if senderId == self.doId: if senderId == self.doId:
commentStr = 'Toon %s trying to call setSCSinging' % self.doId commentStr = 'Toon %s trying to call setSCSinging' % self.doId
#simbase.air.banManager.ban(self.doId, self.DISLid, commentStr) simbase.air.banManager.ban(self.doId, self.DISLid, commentStr)
else: else:
self.notify.warning('logSuspiciousEvent event=%s senderId=%s != self.doId=%s' % (eventName, senderId, self.doId)) self.notify.warning('logSuspiciousEvent event=%s senderId=%s != self.doId=%s' % (eventName, senderId, self.doId))
if simbase.config.GetBool('want-ban-setAnimState', True): if simbase.config.GetBool('want-ban-setAnimState', True):
if eventName.startswith('setAnimState: '): if eventName.startswith('setAnimState: '):
if senderId == self.doId: if senderId == self.doId:
commentStr = 'Toon %s trying to call setAnimState' % self.doId commentStr = 'Toon %s trying to call setAnimState' % self.doId
#simbase.air.banManager.ban(self.doId, self.DISLid, commentStr) simbase.air.banManager.ban(self.doId, self.DISLid, commentStr)
else: else:
self.notify.warning('logSuspiciousEvent event=%s senderId=%s != self.doId=%s' % (eventName, senderId, self.doId)) self.notify.warning('logSuspiciousEvent event=%s senderId=%s != self.doId=%s' % (eventName, senderId, self.doId))
@ -4044,7 +4021,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
if self.WantOldGMNameBan: if self.WantOldGMNameBan:
if self.isGenerated(): if self.isGenerated():
self._checkOldGMName() self._checkOldGMName()
#self._updateGMName() self._updateGMName()
def _checkOldGMName(self): def _checkOldGMName(self):
if '$' in set(self.name): if '$' in set(self.name):
@ -4074,7 +4051,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
if simbase.config.GetBool('want-ban-blacklist-module', False): if simbase.config.GetBool('want-ban-blacklist-module', False):
commentStr = 'User has blacklist module: %s attached to their game process' % module commentStr = 'User has blacklist module: %s attached to their game process' % module
dislId = self.DISLid dislId = self.DISLid
#simbase.air.banManager.ban(self.doId, dislId, commentStr) simbase.air.banManager.ban(self.doId, dislId, commentStr)
else: else:
self.air.writeServerEvent('suspicious', avId, 'Unknown module %s loaded into process.' % module) self.air.writeServerEvent('suspicious', avId, 'Unknown module %s loaded into process.' % module)

View file

@ -5376,6 +5376,7 @@ BodyShopLegs = 'Legs'
ColorShopToon = 'Toon Color' ColorShopToon = 'Toon Color'
ColorShopHead = 'Head' ColorShopHead = 'Head'
ColorShopBody = 'Body' ColorShopBody = 'Body'
ColorShopGloves = 'Gloves'
ColorShopLegs = 'Legs' ColorShopLegs = 'Legs'
ColorShopParts = 'Multi Color' ColorShopParts = 'Multi Color'
ColorShopAll = 'Single Color' ColorShopAll = 'Single Color'