Take that colorful coons!

This commit is contained in:
John 2015-08-04 19:59:47 +03:00
parent edb6fa9d40
commit 86223ef6df
6 changed files with 20 additions and 24 deletions

View file

@ -673,7 +673,7 @@ class NameShop(StateData.StateData):
self.nameResult['text'] = self.names[0]
def findTempName(self):
colorstring = TTLocalizer.NumToColor[self.toon.style.headColor]
colorstring = TTLocalizer.ColorfulToon
animaltype = TTLocalizer.AnimalToSpecies[self.toon.style.getAnimal()]
tempname = colorstring + ' ' + animaltype
if not TTLocalizer.NScolorPrecede:

View file

@ -626,7 +626,7 @@ class ToontownRPCHandler(ToontownRPCHandlerBase):
{
'name': 'Toon Name',
'species': 'cat',
'head-color': 'Red',
'head-color': (1, 0, 0, 1),
'max-hp': 15,
'online': True
}
@ -642,7 +642,7 @@ class ToontownRPCHandler(ToontownRPCHandlerBase):
dna.makeFromNetString(fields['setDNAString'][0])
result['species'] = ToonDNA.getSpeciesName(dna.head)
result['head-color'] = TTLocalizer.NumToColor[dna.headColor]
result['head-color'] = dna.headColor
result['max-hp'] = fields['setMaxHp'][0]
result['online'] = (avId in self.air.friendsManager.onlineToons)

View file

@ -4616,7 +4616,7 @@ def badName():
"""
target = spellbook.getTarget()
_name = target.getName()
colorString = TTLocalizer.NumToColor[target.dna.headColor]
colorString = TTLocalizer.ColorfulToon
animalType = TTLocalizer.AnimalToSpecies[target.dna.getAnimal()]
target.b_setName(colorString + ' ' + animalType)
target.sendUpdate('setWishNameState', ['REJECTED'])

View file

@ -2452,7 +2452,9 @@ class ToonDNA:
dg.addUint8(self.sleeveTexColor)
dg.addUint8(self.botTex)
dg.addUint8(self.botTexColor)
dg.addString(str((self.armColor, self.gloveColor, self.legColor, self.headColor)))
for colors in (self.armColor, self.gloveColor, self.legColor, self.headColor):
for color in colors[:-1]:
dg.addFloat64(color)
elif self.type == 'u':
notify.error('undefined avatar')
else:
@ -2485,12 +2487,10 @@ class ToonDNA:
sleeveTexColor = dgi.getUint8()
botTex = dgi.getUint8()
botTexColor = dgi.getUint8()
colors = ast.literal_eval(dgi.getString())
armColor = colors[0]
gloveColor = colors[1]
legColor = colors[2]
headColor = colors[3]
print armColor, gloveColor, legColor, headColor
armColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
gloveColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
legColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
headColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
if topTex >= len(Shirts):
return False
if topTexColor >= len(ClothesColors):
@ -2518,14 +2518,10 @@ class ToonDNA:
return True
def isValid(self, color):
print 'isvalid %s' % (color,)
if color + (1.0,) in allColorsList:
print 'all colors'
if color in allColorsList:
return True
hsv = colorsys.rgb_to_hsv(*color)
print 'hsv %s' % (hsv,)
print str(0.36 <= hsv[1] <= 0.7 and 0.5 <= hsv[2] <= 0.8)
hsv = colorsys.rgb_to_hsv(*color[:-1])
return 0.36 <= hsv[1] <= 0.7 and 0.5 <= hsv[2] <= 0.8
def makeFromNetString(self, string):
@ -2550,14 +2546,12 @@ class ToonDNA:
self.sleeveTexColor = dgi.getUint8()
self.botTex = dgi.getUint8()
self.botTexColor = dgi.getUint8()
colors = ast.literal_eval(dgi.getString())
self.armColor = colors[0]
self.gloveColor = colors[1]
self.legColor = colors[2]
self.headColor = colors[3]
self.armColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
self.gloveColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
self.legColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
self.headColor = (dgi.getFloat64(), dgi.getFloat64(), dgi.getFloat64(), 1.0)
else:
notify.error('unknown avatar type: ', self.type)
return None
def defaultColor(self):
return 25

View file

@ -8723,6 +8723,8 @@ TVPacks = ['QuackityHQ']
GagPopup = '%s: %s\nGags: %s'
ColorfulToon = 'Colorful'
Blacklist = [
"$1ut",
"$h1t",

View file

@ -499,7 +499,7 @@ class CreateAvatarFSM(OperationFSM):
def enterCreateAvatar(self):
dna = ToonDNA()
dna.makeFromNetString(self.dna)
colorString = TTLocalizer.NumToColor[dna.headColor]
colorString = TTLocalizer.ColorfulToon
animalType = TTLocalizer.AnimalToSpecies[dna.getAnimal()]
name = ' '.join((colorString, animalType))
toonFields = {