NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

LargeCollidableObject.py (2142B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\environment\spaceObject\LargeCollidableObject.py
      2 import evetypes
      3 from eve.client.script.environment.spaceObject.spaceObject import SpaceObject
      4 from eveSpaceObject import spaceobjaudio
      5 from globalConfig.getFunctions import BillboardTakeoverEnabled
      6 from inventorycommon.const import groupBillboard
      7 
      8 class LargeCollidableObject(SpaceObject):
      9     __notifyevents__ = ['OnAudioDeactivated']
     10 
     11     def __init__(self):
     12         super(LargeCollidableObject, self).__init__()
     13         if self.IsBillboard():
     14             sm.RegisterNotify(self)
     15 
     16     def GetDNA(self):
     17         dna = SpaceObject.GetDNA(self)
     18         if dna and ':class?' not in dna:
     19             dna += ':class?stationary'
     20         return dna
     21 
     22     def Assemble(self):
     23         self.SetStaticRotation()
     24         if getattr(self.model, 'ChainAnimationEx', None) is not None:
     25             self.model.ChainAnimationEx('NormalLoop', 0, 0, 1.0)
     26         self.SetupSharedAmbientAudio()
     27         self.SetupBillboard()
     28         self.TriggerStateObject('default')
     29 
     30     def SetupAmbientAudio(self, defaultSoundUrl = None, model = None):
     31         super(LargeCollidableObject, self).SetupAmbientAudio(defaultSoundUrl, model)
     32         self.SetupBillboard()
     33 
     34     def IsBillboard(self):
     35         return evetypes.GetGroupID(self.GetTypeID()) == groupBillboard
     36 
     37     def OnAudioDeactivated(self):
     38         self.SetupBillboard()
     39 
     40     def SetupBillboard(self):
     41         if self.IsBillboard():
     42             machoNet = sm.GetService('machoNet')
     43             if BillboardTakeoverEnabled(machoNet):
     44                 audioEnabled = sm.GetService('audio').IsActivated()
     45                 spaceobjaudio.SetBillboardAudio(self.model, audioEnabled)
     46                 if hasattr(self.model, 'observers') and audioEnabled:
     47                     for observer in self.model.observers:
     48                         spaceobjaudio.PlayBillboardAudio(observer.observer, self.id)
     49 
     50     def Release(self, origin = None):
     51         if self.IsBillboard():
     52             spaceobjaudio.StopBillboardAudio(self.id)
     53         super(LargeCollidableObject, self).Release(origin)