示例#1
0
 def showHint(self, componentID):
     LOG_DEBUG_DEV_BOOTCAMP('BCHighlights_showHint', componentID)
     self.__activeHints.add(componentID)
     self.updateDescriptors(componentID)
     self.as_addHighlightS(componentID)
     if componentID not in self.HIGHLIGHT_NO_SOUNDS:
         soundID = 'bc_new_ui_element_button' if componentID in self.BUTTON_SOUNDS else 'bc_new_ui_element'
         activeSoundComponentID, activeSound = self.__soundsBySoundID.get(
             soundID, (None, None))
         if activeSound is not None and activeSound.isPlaying:
             LOG_DEBUG_DEV_BOOTCAMP(
                 'BCHighlights_showHint - skipping {0} (already playing from component {1})'
                 .format(soundID, activeSoundComponentID))
             return
         prevSoundID, snd = self.__soundsByComponentID.get(
             componentID, (None, None))
         if snd is None:
             snd = SoundGroups.g_instance.getSound2D(soundID)
             self.__soundsByComponentID[componentID] = (soundID, snd)
         else:
             raise prevSoundID == soundID or AssertionError
         self.__soundsBySoundID[soundID] = (componentID, snd)
         LOG_DEBUG_DEV_BOOTCAMP('BCHighlights_showHint - playing', soundID)
         snd.play()
     if componentID not in ('HangarButton', 'TechTreeButton', 'SecondTank'):
         from bootcamp.BootcampGarage import g_bootcampGarage
         g_bootcampGarage.resumeLesson()
     return
示例#2
0
 def onHighlightAnimationComplete(self, componentID):
     LOG_DEBUG_DEV_BOOTCAMP('BCHighlights_onHintAnimationComplete', componentID)
     from bootcamp.Bootcamp import g_bootcamp
     from bootcamp.BootcampGarage import g_bootcampGarage
     g_bootcampGarage.resumeLesson()
     if g_bootcampGarage is not None and g_bootcamp.isInGarageState():
         g_bootcampGarage.showNextHint()
     self.hideHint(componentID, shouldStop=False)
     return
示例#3
0
 def onAnimationsComplete(self):
     if not self.__animationInProgress:
         return
     else:
         from bootcamp.BootcampGarage import g_bootcampGarage
         g_bootcampGarage.resumeLesson()
         g_bootcampGarage.runViewAlias('hangar')
         if self.onAnimationsCompleteCallback is not None:
             self.onAnimationsCompleteCallback()
             self.onAnimationsCompleteCallback = None
         self.__animationInProgress = False
         return
示例#4
0
 def onMessageRemoved(self):
     from bootcamp.BootcampGarage import g_bootcampGarage
     g_bootcampGarage.resumeLesson()
     if self.__removedCallback is not None and not self.__isButtonClicked:
         from bootcamp.Bootcamp import g_bootcamp
         if g_bootcamp.getLessonNum() == 1:
             g_bootcamp.changeNation(g_bootcamp.nation,
                                     self.__removedCallback)
         else:
             self.__removedCallback()
             self.__removedCallback = None
     self.destroy()
     return