コード例 #1
0
ファイル: lightfxlightmanager.py プロジェクト: Difrex/wotsdk
    def __init__(self):
        self.__isEnabled = False
        self.__lightObject = BigWorld.WGLightFx()
        self.__lights = {}
        self.__isEnabled = self.__lightObject.initialize()
        if not self.__isEnabled:
            LOG_DEBUG('LightFx is not enabled')
            return
        else:
            self.__lightObject.reset()
            LightEffectsCache.load()
            for lightEffect in LightEffectsCache.allEffects().values():
                lightEffect.onStop += self.__onEffectStop

            numberOfDevices = self.__lightObject.getNumberOfDevices()
            for deviceIndex in range(numberOfDevices):
                numberOfLights = self.__lightObject.getNumberOfLights(deviceIndex)
                for lightIndex in range(numberOfLights):
                    lightDescription = self.__lightObject.getLightDescription(deviceIndex, lightIndex)
                    self.__lights[lightDescription] = (deviceIndex, lightIndex)

            self.__runningEffects = []
            self.__lastUpdateTime = None
            self.__periodicTimerID = None
            LightManager._chatActionsHandler = _ChatActionsHandler()
            self.__periodicUpdate()
            return
コード例 #2
0
    def __init__(self):
        self.__isEnabled = False
        self.__lightObject = BigWorld.WGLightFx()
        self.__lights = {}
        self.__isEnabled = self.__lightObject.initialize()
        if not self.__isEnabled:
            LOG_DEBUG('LightFx is not enabled')
            return
        else:
            self.__lightObject.reset()
            LightEffectsCache.load()
            for lightEffect in LightEffectsCache.allEffects().values():
                lightEffect.onStop += self.__onEffectStop

            numberOfDevices = self.__lightObject.getNumberOfDevices()
            for deviceIndex in range(numberOfDevices):
                numberOfLights = self.__lightObject.getNumberOfLights(deviceIndex)
                for lightIndex in range(numberOfLights):
                    lightDescription = self.__lightObject.getLightDescription(deviceIndex, lightIndex)
                    self.__lights[lightDescription] = (deviceIndex, lightIndex)

            self.__runningEffects = []
            self.__lastUpdateTime = None
            self.__periodicTimerID = None
            LightManager._chatActionsHandler = _ChatActionsHandler()
            self.__periodicUpdate()
            return
コード例 #3
0
 def startLightEffect(self, lightEffectName):
     if not self.isEnabled():
         return
     lightEffect = LightEffectsCache.getEffect(lightEffectName)
     if not lightEffect.isRunning():
         self.__runningEffects.append(lightEffect)
         lightEffect.start()
     for oneLightAction in lightEffect.lightActions.values():
         self.setLightAction(oneLightAction.lightDescription, oneLightAction.color, oneLightAction.action)
コード例 #4
0
ファイル: lightfxlightmanager.py プロジェクト: Difrex/wotsdk
 def startLightEffect(self, lightEffectName):
     if not self.isEnabled():
         return
     lightEffect = LightEffectsCache.getEffect(lightEffectName)
     if not lightEffect.isRunning():
         self.__runningEffects.append(lightEffect)
         lightEffect.start()
     for oneLightAction in lightEffect.lightActions.values():
         self.setLightAction(oneLightAction.lightDescription, oneLightAction.color, oneLightAction.action)
コード例 #5
0
ファイル: lightmanager.py プロジェクト: wotmods/WOTDecompiled
    def destroy(self):
        if not self.__isEnabled:
            return
        if self.__periodicTimerID is not None:
            BigWorld.cancelCallback(self.__periodicTimerID)
        for lightEffect in LightEffectsCache.allEffects().values():
            lightEffect.destroy()

        LightManager._chatActionsHandler.destroy()
コード例 #6
0
ファイル: lightmanager.py プロジェクト: jamesxia4/wot_client
    def destroy(self):
        if not self.__isEnabled:
            return
        if self.__periodicTimerID is not None:
            BigWorld.cancelCallback(self.__periodicTimerID)
        for lightEffect in LightEffectsCache.allEffects().values():
            lightEffect.destroy()

        LightManager._chatActionsHandler.destroy()
コード例 #7
0
 def stopLightEffect(self, lightEffectName):
     if not self.isEnabled():
         return
     lightEffect = LightEffectsCache.getEffect(lightEffectName)
     if lightEffect.isRunning():
         lightEffect.stop()
コード例 #8
0
ファイル: lightfxlightmanager.py プロジェクト: Difrex/wotsdk
 def stopLightEffect(self, lightEffectName):
     if not self.isEnabled():
         return
     lightEffect = LightEffectsCache.getEffect(lightEffectName)
     if lightEffect.isRunning():
         lightEffect.stop()