本文整理汇总了Python中toontown.toon.ToonDNA.ToonDNA.makeNetString方法的典型用法代码示例。如果您正苦于以下问题:Python ToonDNA.makeNetString方法的具体用法?Python ToonDNA.makeNetString怎么用?Python ToonDNA.makeNetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.toon.ToonDNA.ToonDNA
的用法示例。
在下文中一共展示了ToonDNA.makeNetString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: requestBlackCatTransformation
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import makeNetString [as 别名]
def requestBlackCatTransformation(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av: return
if av.dna.getAnimal() == 'cat' and av.dna.headColor != 0x1a:
newDNA = ToonDNA()
newDNA.makeFromNetString(av.getDNAString())
newDNA.headColor = 0x1a
newDNA.armColor = 0x1a
newDNA.legColor = 0x1a
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId)
self.sendUpdate('doBlackCatTransformation', [avId])
示例2: requestBlackCatTransformation
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import makeNetString [as 别名]
def requestBlackCatTransformation(self):
if not self.air.newsManager.isHolidayRunning(ToontownGlobals.BLACK_CAT_DAY):
return
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av or av.getTutorialAck() or av.dna.getAnimal() != "cat" or av.dna.headColor == 0x1A:
return
newDNA = ToonDNA()
newDNA.makeFromNetString(av.getDNAString())
newDNA.updateToonProperties(armColor=26, legColor=26, headColor=26)
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), "transform-%d" % avId)
self.sendUpdateToAvatarId(avId, "doBlackCatTransformation", [])
示例3: requestTransformation
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import makeNetString [as 别名]
def requestTransformation(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if av is None:
return
if not hasattr(av, 'dna'):
return
if (av.dna.headColor != 0x00):
newDNA = ToonDNA()
newDNA.makeFromNetString(av.getDNAString())
newDNA.headColor = 0x00
newDNA.armColor = 0x00
newDNA.legColor = 0x00
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), 'transform-%d' % avId)
self.sendUpdate('doTransformation', [avId])
示例4: requestTransformation
# 需要导入模块: from toontown.toon.ToonDNA import ToonDNA [as 别名]
# 或者: from toontown.toon.ToonDNA.ToonDNA import makeNetString [as 别名]
def requestTransformation(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if av is None:
return
if not hasattr(av, "dna"):
return
if (av.dna.getAnimal() == "cat") and (av.dna.headColor != 0x1A):
newDNA = ToonDNA()
newDNA.makeFromNetString(av.getDNAString())
newDNA.headColor = 0x1A
newDNA.armColor = 0x1A
newDNA.legColor = 0x1A
taskMgr.doMethodLater(1.0, lambda task: av.b_setDNAString(newDNA.makeNetString()), "transform-%d" % avId)
self.sendUpdate("doTransformation", [avId])