コード例 #1
0
 def handlePicking(self):
     messenger.send('wakeup')
     fullName = GardenGlobals.getFlowerVarietyName(self.species, self.variety)
     if self.isWilted():
         self.confirmDialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.ConfirmWiltedFlower % {'plant': fullName}, command=self.confirmCallback)
     elif not self.isFruiting():
         self.confirmDialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.ConfirmUnbloomingFlower % {'plant': fullName}, command=self.confirmCallback)
     elif base.localAvatar.isFlowerBasketFull():
         self.confirmDialog = TTDialog.TTDialog(style=TTDialog.CancelOnly, text=TTLocalizer.ConfirmBasketFull, command=self.confirmCallback)
     else:
         shovel = base.localAvatar.shovel
         skill = base.localAvatar.shovelSkill
         shovelPower = GardenGlobals.getShovelPower(shovel, skill)
         giveSkillUp = True
         beansRequired = GardenGlobals.getNumBeansRequired(self.species, self.variety)
         if not shovelPower == beansRequired:
             giveSkillUp = False
         if giveSkillUp:
             if skill == GardenGlobals.getMaxShovelSkill():
                 text = (TTLocalizer.ConfirmMaxedSkillFlower % {'plant': fullName},)
             else:
                 text = TTLocalizer.ConfirmSkillupFlower % {'plant': fullName}
             self.confirmDialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=text, command=self.confirmCallback)
         else:
             self.confirmDialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.ConfirmNoSkillupFlower % {'plant': fullName}, command=self.confirmCallback)
     self.confirmDialog.show()
     base.localAvatar.setInGardenAction(self)
     base.cr.playGame.getPlace().detectedGardenPlotUse()
コード例 #2
0
 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)
コード例 #3
0
 def handlePicking(self):
     messenger.send('wakeup')
     fullName = GardenGlobals.getFlowerVarietyName(self.species,
                                                   self.variety)
     if self.isWilted():
         self.confirmDialog = TTDialog.TTDialog(
             style=TTDialog.YesNo,
             text=TTLocalizer.ConfirmWiltedFlower % {'plant': fullName},
             command=self.confirmCallback)
     elif not self.isFruiting():
         self.confirmDialog = TTDialog.TTDialog(
             style=TTDialog.YesNo,
             text=TTLocalizer.ConfirmUnbloomingFlower % {'plant': fullName},
             command=self.confirmCallback)
     elif base.localAvatar.isFlowerBasketFull():
         self.confirmDialog = TTDialog.TTDialog(
             style=TTDialog.CancelOnly,
             text=TTLocalizer.ConfirmBasketFull,
             command=self.confirmCallback)
     else:
         shovel = base.localAvatar.shovel
         skill = base.localAvatar.shovelSkill
         shovelPower = GardenGlobals.getShovelPower(shovel, skill)
         giveSkillUp = True
         beansRequired = GardenGlobals.getNumBeansRequired(
             self.species, self.variety)
         if not shovelPower == beansRequired:
             giveSkillUp = False
         if giveSkillUp:
             if skill == GardenGlobals.getMaxShovelSkill():
                 text = (TTLocalizer.ConfirmMaxedSkillFlower % {
                     'plant': fullName
                 }, )
             else:
                 text = TTLocalizer.ConfirmSkillupFlower % {
                     'plant': fullName
                 }
             self.confirmDialog = TTDialog.TTDialog(
                 style=TTDialog.YesNo,
                 text=text,
                 command=self.confirmCallback)
         else:
             self.confirmDialog = TTDialog.TTDialog(
                 style=TTDialog.YesNo,
                 text=TTLocalizer.ConfirmNoSkillupFlower %
                 {'plant': fullName},
                 command=self.confirmCallback)
     self.confirmDialog.show()
     base.localAvatar.setInGardenAction(self)
     base.cr.playGame.getPlace().detectedGardenPlotUse()
コード例 #4
0
 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)