Пример #1
0
    def calcOneAmbientName(self, area):
        retval = None
        if area:
            parts = area.split('_')
            retval = SoundGlobals.getAmbientFromStr(parts[-1])

        return retval
    def calcOneAmbientName(self, area):
        retval = None
        if area:
            parts = area.split("_")
            retval = SoundGlobals.getAmbientFromStr(parts[-1])

        return retval
    def calcAmbientNames(self):
        for i in xrange(2):
            area = self.areaNode[i]
            ambientName = self.calcOneAmbientName(area)
            self.ambientNames[i] = ambientName

        if not self.ambientNames[0] and not self.ambientNames[1]:
            self.ambientNames[1] = SoundGlobals.getAmbientFromStr(self.modelPath)
            self.notify.debug("Assuming self.ambientNames[1] = %s" % self.ambientNames[1])
Пример #4
0
    def calcAmbientNames(self):
        for i in xrange(2):
            area = self.areaNode[i]
            ambientName = self.calcOneAmbientName(area)
            self.ambientNames[i] = ambientName

        if not self.ambientNames[0] and not self.ambientNames[1]:
            self.ambientNames[1] = SoundGlobals.getAmbientFromStr(
                self.modelPath)
            self.notify.debug('Assuming self.ambientNames[1] = %s' %
                              self.ambientNames[1])
 def requestSoundAndMusic(self):
     self.ambientName = SoundGlobals.getAmbientFromStr(self.modelPath)
     if not self.ambientName == SoundGlobals.AMBIENT_JUNGLE and self.ambientName == SoundGlobals.AMBIENT_CAVE or self.ambientName == SoundGlobals.AMBIENT_SWAMP:
         base.ambientMgr.requestFadeIn(self.ambientName, finalVolume = PiratesGlobals.DEFAULT_AMBIENT_VOLUME)
     
     if self.musicName:
         base.musicMgr.requestFadeOut(self.musicName)
         self.musicName = None
     
     if self.uniqueId == LocationIds.RAMBLESHACK_INSIDE and localAvatar.getTutorialState() < 2:
         self.musicName = SoundGlobals.MUSIC_COMBAT_A
         base.musicMgr.request(self.musicName, priority = 1, volume = 0.29999999999999999)
     elif 'tavern' in self.modelPath:
         self.musicName = random.choice((SoundGlobals.MUSIC_TAVERN_A, SoundGlobals.MUSIC_TAVERN_B, SoundGlobals.MUSIC_TAVERN_C))
         base.musicMgr.request(self.musicName, priority = 1, volume = 0.5)
 def calcOneAmbientName(self, area):
     return SoundGlobals.getAmbientFromStr(
         area.split('_')[-1]) or SoundGlobals.getAmbientFromStr(
             self.modelPath.split('_')[1])
Пример #7
0
 def calcOneAmbientName(self, area):
     if not SoundGlobals.getAmbientFromStr(area.split('_')[-1]):
         pass
     return SoundGlobals.getAmbientFromStr(self.modelPath.split('_')[1])