本文整理汇总了Python中toontown.shtiker.KartPage.KartViewer.hide方法的典型用法代码示例。如果您正苦于以下问题:Python KartViewer.hide方法的具体用法?Python KartViewer.hide怎么用?Python KartViewer.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.shtiker.KartPage.KartViewer
的用法示例。
在下文中一共展示了KartViewer.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BuyAccessoryDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import hide [as 别名]
#.........这里部分代码省略.........
if len(self.unownedAccDict[self.curAccType]) < 1:
self.curAccIndex[self.curAccType] = -1
else:
self.curAccIndex[self.curAccType] = (self.curAccIndex[self.curAccType] + nDir) % len(self.unownedAccDict[self.curAccType])
if hasattr(self, 'accDescription'):
self.accDescription.destroy()
self.accCost.destroy()
self.showAccessory()
def __handleAccessoryTypeChange(self, type):
self.curAccType = type
try:
self.accDescription.destroy()
self.accCost.destroy()
except:
pass
for b in self.accButtonsDict:
self.accButtonsDict[b]['state'] = DGG.NORMAL
self.accButtonsDict[self.curAccType]['state'] = DGG.DISABLED
self.showAccessory()
def showAccessory(self):
self.arrowRightButton['state'] = DGG.DISABLED
self.arrowLeftButton['state'] = DGG.DISABLED
self.buyAccessoryButton['state'] = DGG.DISABLED
self.accDescription = DirectButton(
parent=self,
relief=None,
scale=self.modelScale,
text='',
text_pos=(0, -.33),
text_scale=KS_TEXT_SIZE_SMALL,
pressEffect=False,
text_wordwrap=TTLocalizer.KSGaccDescriptionWordwrap,
textMayChange=True)
self.buyAccessoryButton.configure(text_fg=(0, 0, 0.0, 1.0))
self.buyAccessoryButton.configure(text=TTLocalizer.KartShop_BuyAccessory)
self.buyAccessoryButton.configure(text_scale=KS_TEXT_SIZE_SMALL)
self.buyAccessoryButton['state'] = DGG.NORMAL
if len(self.unownedAccDict[self.curAccType]) < 1:
self.kartView.setDNA(None)
self.kartView.hide()
self.accDescription.configure(text=TTLocalizer.KartShop_NoAvailableAcc)
self.buyAccessoryButton['state'] = DGG.DISABLED
else:
if self.curAccIndex[self.curAccType] + 1 < len(self.unownedAccDict[self.curAccType]):
self.arrowRightButton['state'] = DGG.NORMAL
if self.curAccIndex[self.curAccType] > 0:
self.arrowLeftButton['state'] = DGG.NORMAL
curDNA = None
curDNA = list(base.localAvatar.getKartDNA())
for d in xrange(len(curDNA)):
if d == KartDNA.bodyType or d == KartDNA.accColor or d == KartDNA.bodyColor:
continue
else:
curDNA[d] = -1
curAcc = self.unownedAccDict[self.curAccType][self.curAccIndex[self.curAccType]]
curDNA[self.curAccType] = curAcc
self.kartView.refresh(curDNA)
self.accDescription.configure(text=AccessoryDict[curAcc][KartInfo.name])
cost = TTLocalizer.KartShop_Cost % AccessoryDict[curAcc][KartInfo.cost]
self.accCost = DirectButton(
parent=self,
relief=None,
scale=self.modelScale,
text=cost,
text_pos=(0, -.4),
text_scale=KS_TEXT_SIZE_SMALL,
text_fg=(0, 0, 0.0, 1.0),
pressEffect=False,
textMayChange=True)
if AccessoryDict[curAcc][KartInfo.cost] > base.localAvatar.getTickets():
self.buyAccessoryButton['state'] = DGG.DISABLED
self.buyAccessoryButton.configure(text_scale=KS_TEXT_SIZE_SMALL * 0.75)
self.buyAccessoryButton.configure(text=TTLocalizer.KartShop_NotEnoughTickets)
self.accCost.configure(text_fg=(0.95, 0, 0.0, 1.0))
if len(base.localAvatar.getKartAccessoriesOwned()) >= KartShopGlobals.MAX_KART_ACC:
self.buyAccessoryButton['state'] = DGG.DISABLED
self.buyAccessoryButton.configure(text_fg=(0.95, 0, 0.0, 1.0))
self.buyAccessoryButton.configure(text_scale=KS_TEXT_SIZE_SMALL * 0.8)
self.buyAccessoryButton.configure(text=TTLocalizer.KartShop_FullTrunk)
self.kartView.show()
return
def destroy(self):
if self.initialize:
try:
self.accDescription.destroy()
except:
pass
try:
self.kartView.destroy()
except:
pass
DirectFrame.destroy(self)