當前位置: 首頁>>代碼示例>>Python>>正文


Python ToonDNA.getRandomTop方法代碼示例

本文整理匯總了Python中toontown.toon.ToonDNA.getRandomTop方法的典型用法代碼示例。如果您正苦於以下問題:Python ToonDNA.getRandomTop方法的具體用法?Python ToonDNA.getRandomTop怎麽用?Python ToonDNA.getRandomTop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在toontown.toon.ToonDNA的用法示例。


在下文中一共展示了ToonDNA.getRandomTop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __swapTorso

# 需要導入模塊: from toontown.toon import ToonDNA [as 別名]
# 或者: from toontown.toon.ToonDNA import getRandomTop [as 別名]
 def __swapTorso(self, offset):
     gender = self.toon.style.getGender()
     if not self.clothesPicked:
         length = len(ToonDNA.toonTorsoTypes[6:])
         torsoOffset = 6
     elif gender == "m":
         length = len(ToonDNA.toonTorsoTypes[:3])
         torsoOffset = 0
         if self.toon.style.topTex not in ToonDNA.MakeAToonBoyShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             shirtTex, shirtColor, sleeveTex, sleeveColor = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         if self.toon.style.botTex not in ToonDNA.MakeAToonBoyBottoms:
             botTex, botTexColor = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON)
             self.toon.style.botTex = botTex
             self.toon.style.botTexColor = botTexColor
     else:
         length = len(ToonDNA.toonTorsoTypes[3:6])
         if self.toon.style.torso[1] == "d":
             torsoOffset = 3
         else:
             torsoOffset = 0
         if self.toon.style.topTex not in ToonDNA.MakeAToonGirlShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             shirtTex, shirtColor, sleeveTex, sleeveColor = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         if self.toon.style.botTex not in ToonDNA.MakeAToonGirlBottoms:
             if self.toon.style.torso[1] == "d":
                 botTex, botTexColor = ToonDNA.getRandomBottom(
                     gender, ToonDNA.MAKE_A_TOON, girlBottomType=ToonDNA.SKIRT
                 )
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 3
             else:
                 botTex, botTexColor = ToonDNA.getRandomBottom(
                     gender, ToonDNA.MAKE_A_TOON, girlBottomType=ToonDNA.SHORTS
                 )
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 0
     self.torsoChoice = (self.torsoChoice + offset) % length
     self.__updateScrollButtons(self.torsoChoice, length, self.torsoStart, self.torsoLButton, self.torsoRButton)
     torso = ToonDNA.toonTorsoTypes[torsoOffset + self.torsoChoice]
     self.dna.torso = torso
     self.toon.swapToonTorso(torso)
     self.toon.loop("neutral", 0)
     self.toon.swapToonColor(self.dna)
開發者ID:BmanGames,項目名稱:ToontownStride,代碼行數:56,代碼來源:BodyShop.py

示例2: _BodyShop__swapTorso

# 需要導入模塊: from toontown.toon import ToonDNA [as 別名]
# 或者: from toontown.toon.ToonDNA import getRandomTop [as 別名]
 def _BodyShop__swapTorso(self, offset):
     gender = self.toon.style.getGender()
     if not self.clothesPicked:
         length = len(ToonDNA.toonTorsoTypes[6:])
         torsoOffset = 6
     elif gender == 'm':
         length = len(ToonDNA.toonTorsoTypes[:3])
         torsoOffset = 0
         if self.dna.armColor not in ToonDNA.defaultBoyColorList:
             self.dna.armColor = ToonDNA.defaultBoyColorList[0]
         
         if self.dna.legColor not in ToonDNA.defaultBoyColorList:
             self.dna.legColor = ToonDNA.defaultBoyColorList[0]
         
         if self.dna.headColor not in ToonDNA.defaultBoyColorList:
             self.dna.headColor = ToonDNA.defaultBoyColorList[0]
         
         if self.toon.style.topTex not in ToonDNA.MakeAToonBoyShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             (shirtTex, shirtColor, sleeveTex, sleeveColor) = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         
         if self.toon.style.botTex not in ToonDNA.MakeAToonBoyBottoms:
             (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON)
             self.toon.style.botTex = botTex
             self.toon.style.botTexColor = botTexColor
         
     else:
         length = len(ToonDNA.toonTorsoTypes[3:6])
         if self.toon.style.torso[1] == 'd':
             torsoOffset = 3
         else:
             torsoOffset = 0
         if self.dna.armColor not in ToonDNA.defaultGirlColorList:
             self.dna.armColor = ToonDNA.defaultGirlColorList[0]
         
         if self.dna.legColor not in ToonDNA.defaultGirlColorList:
             self.dna.legColor = ToonDNA.defaultGirlColorList[0]
         
         if self.dna.headColor not in ToonDNA.defaultGirlColorList:
             self.dna.headColor = ToonDNA.defaultGirlColorList[0]
         
         if self.toon.style.topTex not in ToonDNA.MakeAToonGirlShirts:
             randomShirt = ToonDNA.getRandomTop(gender, ToonDNA.MAKE_A_TOON)
             (shirtTex, shirtColor, sleeveTex, sleeveColor) = randomShirt
             self.toon.style.topTex = shirtTex
             self.toon.style.topTexColor = shirtColor
             self.toon.style.sleeveTex = sleeveTex
             self.toon.style.sleeveTexColor = sleeveColor
         
         if self.toon.style.botTex not in ToonDNA.MakeAToonGirlBottoms:
             if self.toon.style.torso[1] == 'd':
                 (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON, girlBottomType = ToonDNA.SKIRT)
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 3
             else:
                 (botTex, botTexColor) = ToonDNA.getRandomBottom(gender, ToonDNA.MAKE_A_TOON, girlBottomType = ToonDNA.SHORTS)
                 self.toon.style.botTex = botTex
                 self.toon.style.botTexColor = botTexColor
                 torsoOffset = 0
         
     self.torsoChoice = (self.torsoChoice + offset) % length
     self._BodyShop__updateScrollButtons(self.torsoChoice, length, self.torsoStart, self.torsoLButton, self.torsoRButton)
     torso = ToonDNA.toonTorsoTypes[torsoOffset + self.torsoChoice]
     self.dna.torso = torso
     self.toon.swapToonTorso(torso)
     self.toon.loop('neutral', 0)
     self.toon.swapToonColor(self.dna)
開發者ID:OldToontown,項目名稱:OldToontown,代碼行數:74,代碼來源:BodyShop.py


注:本文中的toontown.toon.ToonDNA.getRandomTop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。