NPC Tuple magic word

This commit is contained in:
John 2015-08-07 13:02:07 +03:00
parent 21c051ce42
commit e31d7fae8e
2 changed files with 17 additions and 1 deletions

View file

@ -4843,7 +4843,7 @@ def dna(part, value):
return 'Bottom texture color index set to: ' + str(dna.botTexColor)
if part == 'show':
return dna.asTuple()
return dna.asNpcTuple() if value else dna.asTuple()
if part == 'showrandom':
return NPCToons.getRandomDNA(time.time(), value)
return 'Invalid part: ' + part

View file

@ -2703,6 +2703,22 @@ class ToonDNA:
self.sleeveTexColor,
self.botTex,
self.botTexColor)
def asNpcTuple(self):
return (self.head,
self.torso,
self.legs,
self.gender,
allColorsList.index(self.armColor),
allColorsList.index(self.gloveColor),
allColorsList.index(self.legColor),
allColorsList.index(self.headColor),
self.topTex,
self.topTexColor,
self.sleeveTex,
self.sleeveTexColor,
self.botTex,
self.botTexColor)
def getType(self):
if self.type == 't':