当前位置: 首页>>代码示例>>Python>>正文


Python GardenGlobals.getNumberOfShovelBoxes方法代码示例

本文整理汇总了Python中toontown.estate.GardenGlobals.getNumberOfShovelBoxes方法的典型用法代码示例。如果您正苦于以下问题:Python GardenGlobals.getNumberOfShovelBoxes方法的具体用法?Python GardenGlobals.getNumberOfShovelBoxes怎么用?Python GardenGlobals.getNumberOfShovelBoxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toontown.estate.GardenGlobals的用法示例。


在下文中一共展示了GardenGlobals.getNumberOfShovelBoxes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from toontown.estate import GardenGlobals [as 别名]
# 或者: from toontown.estate.GardenGlobals import getNumberOfShovelBoxes [as 别名]
 def __init__(self, doneEvent, specialBoxActive = False):
     if specialBoxActive:
         instructions = TTLocalizer.GardeningChooseBeansItem
         instructionsPos = (0, 0.4)
     else:
         instructions = TTLocalizer.GardeningChooseBeans
         instructionsPos = (0, 0.35)
     DirectFrame.__init__(self, relief=None, state='normal', geom=DGG.getDefaultDialogGeom(), geom_color=ToontownGlobals.GlobalDialogColor, geom_scale=(1.5, 1.0, 1.0), frameSize=(-1, 1, -1, 1), pos=(0, 0, 0), text=instructions, text_wordwrap=20, text_scale=0.08, text_pos=instructionsPos)
     self.initialiseoptions(PlantingGUI)
     self.doneEvent = doneEvent
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     okImageList = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
     cancelImageList = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
     resetImageList = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
     self.cancelButton = DirectButton(parent=self, relief=None, image=cancelImageList, pos=(-0.3, 0, -0.35), text=TTLocalizer.PlantingGuiCancel, text_scale=0.06, text_pos=(0, -0.1), command=self.__cancel)
     self.okButton = DirectButton(parent=self, relief=None, image=okImageList, pos=(0.3, 0, -0.35), text=TTLocalizer.PlantingGuiOk, text_scale=0.06, text_pos=(0, -0.1), command=self.__doPlant)
     self.resetButton = DirectButton(parent=self, relief=None, image=resetImageList, pos=(0.0, 0, -0.35), text=TTLocalizer.PlantingGuiReset, text_scale=0.06, text_pos=(0, -0.1), command=self.__reset)
     buttons.removeNode()
     self.availableBoxes = base.localAvatar.getBoxCapability()
     self.maxBoxes = GardenGlobals.getNumberOfShovelBoxes()
     self.activeBoxesList = []
     self.specialBox = None
     self.specialBoxActive = specialBoxActive
     self.boxList = []
     self.jellyBeanPicker = None
     self.jellyBeanPickerInterval = None
     self.createBoxes()
     guiItems = loader.loadModel('phase_5.5/models/gui/catalog_gui')
     self.beanBank = DirectLabel(self, relief=None, image=guiItems.find('**/bean_bank'), text=str(base.localAvatar.getMoney() + base.localAvatar.getBankMoney()), text_align=TextNode.ARight, text_scale=0.11, text_fg=(0.95, 0.95, 0, 1), text_shadow=(0, 0, 0, 1), text_pos=(0.75, -0.81), text_font=ToontownGlobals.getSignFont(), pos=(-0.85, 0, 0.2), scale=0.5)
     self.matchBoxesToAvailableMoney()
     if PICKER_ALWAYS_UP:
         self.spiffyBeanBoxClicked(0)
     return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:35,代码来源:PlantingGUI.py

示例2: __init__

# 需要导入模块: from toontown.estate import GardenGlobals [as 别名]
# 或者: from toontown.estate.GardenGlobals import getNumberOfShovelBoxes [as 别名]
    def __init__(self, parent, recipe, **kw):
        left = 0
        right = 0.445
        bottom = 0
        top = 0.08
        borderWidth = 0.01
        optiondefs = [('relief', DGG.RIDGE, None),
         ('state', 'normal', None),
         ('pos', (0, 0, 0), None),
         ('frameSize', (left,
           right,
           bottom,
           top), None),
         ('borderWidth', (borderWidth, borderWidth), self.setBorderWidth)]
        self.defineoptions(kw, optiondefs)
        DirectFrame.__init__(self, parent)
        self.initialiseoptions(BeanRecipeGui)
        self.jellyBeanBoxList = []
        xIncrement = 0.052
        for i in range(len(recipe)):
            beanIndex = GardenGlobals.BeanColorLetters.index(recipe[i])
            self.createJellyBeanBox(beanIndex, borderWidth + xIncrement * i, borderWidth)

        for j in range(len(recipe), GardenGlobals.getNumberOfShovelBoxes()):
            self.createEmptyBeanBox(borderWidth + xIncrement * j, borderWidth)

        return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:29,代码来源:BeanRecipeGui.py


注:本文中的toontown.estate.GardenGlobals.getNumberOfShovelBoxes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。