def __handleFlowerPlantingDone(self, willPlant = 0, recipeStr = '', special = -1): self.ignore(self.plantingGuiDoneEvent) self.ignore('stoppedAsleep') self.plantingGui.destroy() self.plantingGui = None base.localAvatar.showGardeningGui() base.localAvatar.removeShovelRelatedDoId(self.doId) successPlanting = False if willPlant: recipeKey = GardenGlobals.getRecipeKey(recipeStr, special) if recipeKey >= 0: species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe(recipeKey) if species >= 0 and variety >= 0: self.sendUpdate('plantFlower', [species, variety]) successPlanting = True else: self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special)) burntBeans = len(recipeStr) self.sendUpdate('plantNothing', [burntBeans]) if successPlanting: flowerName = GardenGlobals.getFlowerVarietyName(species, variety) stringToShow = TTLocalizer.getResultPlantedSomethingSentence(flowerName) elif willPlant: self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupFlowerPlantingGuiAgain) else: self.finishInteraction() return
def doResultDialog(self): self.startInteraction() curTrack, curLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex) species = GardenGlobals.getTreeTypeIndex(curTrack, curLevel) treeName = GardenGlobals.PlantAttributes[species]['name'] stringToShow = TTLocalizer.getResultPlantedSomethingSentence(treeName) self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
def doResultDialog(self): self.startInteraction() itemName = GardenGlobals.PlantAttributes[self.typeIndex]['name'] stringToShow = TTLocalizer.getResultPlantedSomethingSentence(itemName) self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
def doResultDialog(self): self.startInteraction() flowerName = GardenGlobals.getFlowerVarietyName( self.species, self.variety) stringToShow = TTLocalizer.getResultPlantedSomethingSentence( flowerName) self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
def __handleItemPlantingDone(self, willPlant=0, recipeStr='', selectedSpecial=-1): self.ignore(self.plantingGuiDoneEvent) self.ignore('stoppedAsleep') self.plantingGui.destroy() self.plantingGui = None base.localAvatar.showGardeningGui() base.localAvatar.removeShovelRelatedDoId(self.doId) gardenSpecials = base.localAvatar.getGardenSpecials() special = -1 if selectedSpecial >= 0: special = gardenSpecials[selectedSpecial][0] successPlanting = False successToonStatue = False if willPlant: recipeKey = GardenGlobals.getRecipeKey(recipeStr, special) if recipeKey >= 0: species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe( recipeKey) if species >= 0 and variety >= 0: if GardenGlobals.PlantAttributes[species][ 'plantType'] == GardenGlobals.STATUARY_TYPE: successPlanting = True if species >= 205 and species <= 208: successToonStatue = True else: self.sendUpdate('plantStatuary', [species]) else: self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special)) burntBeans = len(recipeStr) self.sendUpdate('plantNothing', [burntBeans]) if successPlanting: itemName = GardenGlobals.PlantAttributes[species]['name'] stringToShow = TTLocalizer.getResultPlantedSomethingSentence( itemName) elif willPlant: self.resultDialog = TTDialog.TTDialog( style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupItemPlantingGuiAgain) else: self.finishInteraction() if successToonStatue: self.popupToonStatueSelectionGui(species) return
def __handleItemPlantingDone(self, willPlant = 0, recipeStr = '', selectedSpecial = -1): self.ignore(self.plantingGuiDoneEvent) self.ignore('stoppedAsleep') self.plantingGui.destroy() self.plantingGui = None base.localAvatar.showGardeningGui() base.localAvatar.removeShovelRelatedDoId(self.doId) gardenSpecials = base.localAvatar.getGardenSpecials() special = -1 if selectedSpecial >= 0: special = gardenSpecials[selectedSpecial][0] successPlanting = False successToonStatue = False if willPlant: recipeKey = GardenGlobals.getRecipeKey(recipeStr, special) if recipeKey >= 0: species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe(recipeKey) if species >= 0 and variety >= 0: if GardenGlobals.PlantAttributes[species]['plantType'] == GardenGlobals.STATUARY_TYPE: successPlanting = True if species >= 205 and species <= 208: successToonStatue = True else: self.sendUpdate('plantStatuary', [species]) else: self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special)) burntBeans = len(recipeStr) self.sendUpdate('plantNothing', [burntBeans]) if successPlanting: itemName = GardenGlobals.PlantAttributes[species]['name'] stringToShow = TTLocalizer.getResultPlantedSomethingSentence(itemName) elif willPlant: self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupItemPlantingGuiAgain) else: self.finishInteraction() if successToonStatue: self.popupToonStatueSelectionGui(species) return
def __handleFlowerPlantingDone(self, willPlant=0, recipeStr='', special=-1): self.ignore(self.plantingGuiDoneEvent) self.ignore('stoppedAsleep') self.plantingGui.destroy() self.plantingGui = None base.localAvatar.showGardeningGui() base.localAvatar.removeShovelRelatedDoId(self.doId) successPlanting = False if willPlant: recipeKey = GardenGlobals.getRecipeKey(recipeStr, special) if recipeKey >= 0: species, variety = GardenGlobals.getSpeciesVarietyGivenRecipe( recipeKey) if species >= 0 and variety >= 0: self.sendUpdate('plantFlower', [species, variety]) successPlanting = True else: self.notify.debug('%s %d is not a valid recipe' % (recipeStr, special)) burntBeans = len(recipeStr) self.sendUpdate('plantNothing', [burntBeans]) if successPlanting: flowerName = GardenGlobals.getFlowerVarietyName(species, variety) stringToShow = TTLocalizer.getResultPlantedSomethingSentence( flowerName) elif willPlant: self.resultDialog = TTDialog.TTDialog( style=TTDialog.Acknowledge, text=TTLocalizer.ResultPlantedNothing, command=self.popupFlowerPlantingGuiAgain) else: self.finishInteraction() return
def doResultDialog(self): self.startInteraction() flowerName = GardenGlobals.getFlowerVarietyName(self.species, self.variety) stringToShow = TTLocalizer.getResultPlantedSomethingSentence(flowerName) self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)
def doResultDialog(self): self.startInteraction() itemName = GardenGlobals.PlantAttributes[self.typeIndex]['name'] stringToShow = TTLocalizer.getResultPlantedSomethingSentence(itemName) self.resultDialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=stringToShow, command=self.resultsCallback)