def handleMakeAPirate(self, clothing = []):
     self.notify.debug('done make-a-pirate')
     done = self.map.getDoneStatus()
     if done == 'cancel':
         #localAvatar.b_setLocation(0, 0)
         self.map.exit()
         self.map.unload()
         self.map = 0
     elif done == 'created':
         dna = self.map.pirate.style
         localAvatar = Human()
         localAvatar.setDNA(dna)
         localAvatar.generateHuman(dna.gender, base.cr.humanHigh)
         base.camera.reparentTo(localAvatar)
         #localAvatar.motionFSM.off()
         #localAvatar.motionFSM.on()
         #if clothing:
         #    clothes = []
         #    for clothId in clothing:
         #        clothType = None
         #        if clothId == 'HAT':
         #            clothType = ItemGlobals.HAT
         #        elif clothId == 'SHIRT':
         #            clothType = ItemGlobals.SHIRT
         #        elif clothId == 'VEST':
         #            clothType = ItemGlobals.VEST
         #        elif clothId == 'COAT':
         #            clothType = ItemGlobals.COAT
         #        elif clothId == 'PANT':
         #            clothType = ItemGlobals.PANT
         #        elif clothId == 'BELT':
         #            clothType = ItemGlobals.BELT
         #        elif clothId == 'SHOE':
         #            clothType = ItemGlobals.SHOE
         #        
         #        if clothType and clothing[clothId][0]:
         #            clothes.append([
         #                clothType,
         #                clothing[clothId][0],
         #                clothing[clothId][2]])
         #            continue
             
             #if clothes:
             #    localAvatar.sendRequestMAPClothes(clothes)
             
         print "AVATAR STATE SET TO FSM!"
         base.transitions.fadeIn(1.0)
         self.acceptOnce('avatarPopulated', self.avatarPopulated)
         if self.map.nameGui.customName:
             localAvatar.setWishName()
             base.cr.avatarManager.sendRequestPopulateAvatar(localAvatar.doId, localAvatar.style, 0, 0, 0, 0, 0)
         else:
             name = self.map.nameGui.getNumericName()
             base.cr.avatarManager.sendRequestPopulateAvatar(localAvatar.doId, localAvatar.style, 1, name[0], name[1], name[2], name[3])
         self.map.exit()
         self.map.unload()
         self.map = 0
     else:
         self.notify.error('Invalid doneStatus from MakeAPirate: ' + str(done))
    def handleMakeAPirate(self, clothing=[]):
        self.notify.debug('done make-a-pirate')
        done = self.map.getDoneStatus()
        if done == 'cancel':
            #localAvatar.b_setLocation(0, 0)
            self.map.exit()
            self.map.unload()
            self.map = 0
        elif done == 'created':
            dna = self.map.pirate.style
            localAvatar = Human()
            localAvatar.setDNA(dna)
            localAvatar.generateHuman(dna.gender, base.cr.humanHigh)
            base.camera.reparentTo(localAvatar)
            #localAvatar.motionFSM.off()
            #localAvatar.motionFSM.on()
            #if clothing:
            #    clothes = []
            #    for clothId in clothing:
            #        clothType = None
            #        if clothId == 'HAT':
            #            clothType = ItemGlobals.HAT
            #        elif clothId == 'SHIRT':
            #            clothType = ItemGlobals.SHIRT
            #        elif clothId == 'VEST':
            #            clothType = ItemGlobals.VEST
            #        elif clothId == 'COAT':
            #            clothType = ItemGlobals.COAT
            #        elif clothId == 'PANT':
            #            clothType = ItemGlobals.PANT
            #        elif clothId == 'BELT':
            #            clothType = ItemGlobals.BELT
            #        elif clothId == 'SHOE':
            #            clothType = ItemGlobals.SHOE
            #
            #        if clothType and clothing[clothId][0]:
            #            clothes.append([
            #                clothType,
            #                clothing[clothId][0],
            #                clothing[clothId][2]])
            #            continue

            #if clothes:
            #    localAvatar.sendRequestMAPClothes(clothes)

            print "AVATAR STATE SET TO FSM!"
            base.transitions.fadeIn(1.0)
            self.acceptOnce('avatarPopulated', self.avatarPopulated)
            if self.map.nameGui.customName:
                localAvatar.setWishName()
                base.cr.avatarManager.sendRequestPopulateAvatar(
                    localAvatar.doId, localAvatar.style, 0, 0, 0, 0, 0)
            else:
                name = self.map.nameGui.getNumericName()
                base.cr.avatarManager.sendRequestPopulateAvatar(
                    localAvatar.doId, localAvatar.style, 1, name[0], name[1],
                    name[2], name[3])
            self.map.exit()
            self.map.unload()
            self.map = 0
        else:
            self.notify.error('Invalid doneStatus from MakeAPirate: ' +
                              str(done))