本文整理汇总了Python中gui.shared.utils.plugins.PluginsCollection.fini方法的典型用法代码示例。如果您正苦于以下问题:Python PluginsCollection.fini方法的具体用法?Python PluginsCollection.fini怎么用?Python PluginsCollection.fini使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.shared.utils.plugins.PluginsCollection
的用法示例。
在下文中一共展示了PluginsCollection.fini方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Battle
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
#.........这里部分代码省略.........
self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams(disableAlly=BattleReplay.g_replayCtrl.isPlaying))
self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration])
g_tankActiveCamouflage[player.vehicleTypeDescriptor.type.compactDescr] = self.__arena.arenaType.vehicleCamouflageKind
keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE')
if not BigWorld.isKeyDown(keyCode):
VOIP.getVOIPManager().setMicMute(True)
ctrl = g_sessionProvider.getVehicleStateCtrl()
ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
self.__dynSquadListener = DynSquadViewListener(self.proxy)
g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
def beforeDelete(self):
LOG_DEBUG('[Battle] beforeDelete')
removeListener = g_eventBus.removeListener
removeListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
removeListener(events.GameEvent.GUI_VISIBILITY, self.showAll, scope=_SCOPE)
ctrl = g_sessionProvider.getVehicleStateCtrl()
ctrl.onVehicleStateUpdated -= self.__onVehicleStateUpdated
ctrl.onPostMortemSwitched -= self.__onPostMortemSwitched
player = BigWorld.player()
if player and player.inputHandler:
player.inputHandler.onPostmortemVehicleChanged -= self.onPostmortemVehicleChanged
player.inputHandler.onCameraChanged -= self.onCameraChanged
if self.colorManager:
self.colorManager.dispossessUI()
voice = VoiceChatInterface.g_instance
if voice:
voice.dispossessUI(self.proxy)
voice.onPlayerSpeaking -= self.setPlayerSpeaking
voice.onVoiceChatInitFailed -= self.onVoiceChatInitFailed
if self.__plugins is not None:
self.__plugins.stop()
self.__plugins.fini()
self.__plugins = None
if self.movingText is not None:
self.movingText.dispossessUI()
self.movingText = None
if self.__timerSound is not None:
self.__timerSound.stop()
self.__timerSound = None
if self.__soundManager is not None:
self.__soundManager.dispossessUI()
self.__soundManager = None
if self.colorManager is not None:
self.colorManager.dispossessUI()
self.colorManager = None
if self.component:
g_repeatKeyHandlers.discard(self.component.handleKeyEvent)
g_settingsCore.onSettingsChanged -= self.__accs_onSettingsChanged
g_settingsCore.interfaceScale.onScaleChanged -= self.__onRecreateDevice
self.__timersBar.destroy()
self.__teamBasesPanel.destroy()
self.__debugPanel.destroy()
self.__consumablesPanel.destroy()
self.__damagePanel.destroy()
self.__markersManager.destroy()
self.__ingameHelp.destroy()
self.__vErrorsPanel.destroy()
self.__vMsgsPanel.destroy()
self.__pMsgsPanel.destroy()
self.__radialMenu.destroy()
self.__minimap.destroy()
self.__ribbonsPanel.destroy()
self.__fragCorrelation.destroy()
self.__statsForm.destroy()
示例2: CrosshairPanel
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
#.........这里部分代码省略.........
"""
self.component.size = (width, height)
def setPosition(self, x, y):
"""Sets position of crosshair panel in pixels.
:param x: integer containing x coordinate of center in pixels.
:param y: integer containing y coordinate of center in pixels.
"""
self.as_recreateDeviceS(x, y)
def getScale(self):
"""Gets scale factor.
:return: float containing scale factor.
"""
return self.movie.stage.scaleX
def setScale(self, scale):
"""Sets scale factor.
:param scale: float containing new scale factor.
"""
self.movie.stage.scaleX = scale
self.movie.stage.scaleY = scale
def getZoom(self):
"""Gets current zoom factor of player's camera.
:return: float containing zoom factor.
"""
return self.__zoomFactor
def setZoom(self, zoomFactor):
"""Gets current zoom factor of player's camera.
:param zoomFactor: float containing zoom factor.
"""
if zoomFactor == self.__zoomFactor:
return
self.__zoomFactor = zoomFactor
if zoomFactor > 1:
zoomString = i18n.makeString(INGAME_GUI.AIM_ZOOM, zoom=zoomFactor)
else:
zoomString = ''
self.as_setZoomS(zoomString)
def getDistance(self):
"""Gets distance to desired target(point).
:return: integer containing distance in meters.
"""
return self.__distance
def setDistance(self, distance):
"""Sets distance to desired target(point).
:param distance: integer containing distance in meters.
"""
if distance != self.__distance:
self.__distance = distance
self.as_setDistanceS(i18n.makeString(INGAME_GUI.DISTANCE_METERS, meters=distance))
def clearDistance(self, immediate = True):
"""Removes distance string from UI.
:param immediate: if value equals True than removes distance string from UI immediately,
otherwise - hides this sting with animation.
"""
self.__distance = 0
self.as_clearDistanceS(immediate)
def setHasAmmo(self, hasAmmo):
"""Sets flag that indicates controlling vehicle has ammo.
:param hasAmmo: bool.
"""
if self.__hasAmmo != hasAmmo:
self.__hasAmmo = hasAmmo
if not hasAmmo:
self.as_updateAmmoStateS(i18n.makeString(INGAME_GUI.PLAYER_MESSAGES_POSTMORTEM_USERNOHASAMMO))
else:
self.as_updateAmmoStateS('')
def setGunMarkerPosition(self, position, relaxTime):
"""Sets new position of gun marker. This value is transferred to cpp component.
:param position: vector3
:param relaxTime: float.
"""
self.component.updateMarkerPos(position, relaxTime)
def _populate(self):
super(CrosshairPanel, self)._populate()
self.__plugins.init()
self.__plugins.start()
def _dispose(self):
self.__plugins.stop()
self.__plugins.fini()
super(CrosshairPanel, self)._dispose()
def __configure(self):
self.component.wg_inputKeyMode = 2
self.component.position.z = DEPTH_OF_Aim
self.component.focus = False
self.component.moveFocus = False
self.component.heightMode = 'PIXEL'
self.component.widthMode = 'PIXEL'
self.movie.backgroundAlpha = 0
示例3: MarkersManager
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
class MarkersManager(Flash):
def __init__(self, parentUI):
Flash.__init__(self, _MARKERS_MANAGER_SWF)
self.component.wg_inputKeyMode = 2
self.component.position.z = DEPTH_OF_VehicleMarker
self.component.drawWithRestrictedViewPort = False
self.movie.backgroundAlpha = 0
self.colorManager = ColorSchemeManager._ColorSchemeManager()
self.colorManager.populateUI(weakref.proxy(self))
self.__plugins = PluginsCollection(self)
plugins = {'equipments': _EquipmentsMarkerPlugin}
if arena_info.hasFlags():
plugins['flags'] = _FlagsMarkerPlugin
if arena_info.hasRepairPoints():
plugins['repairs'] = _RepairsMarkerPlugin
if arena_info.hasResourcePoints():
plugins['resources'] = _ResourceMarkerPlugin
if arena_info.hasGasAttack():
plugins['safe_zone'] = _GasAttackSafeZonePlugin
self.__plugins.addPlugins(plugins)
self.__ownUI = None
self.__parentUI = parentUI
self.__markers = {}
return
def setScaleProps(self, minScale = 40, maxScale = 100, defScale = 100, speed = 3.0):
if constants.IS_DEVELOPMENT:
self.__ownUI.scaleProperties = (minScale,
maxScale,
defScale,
speed)
def setAlphaProps(self, minAlpha = 40, maxAlpha = 100, defAlpha = 100, speed = 3.0):
if constants.IS_DEVELOPMENT:
self.__ownUI.alphaProperties = (minAlpha,
maxAlpha,
defAlpha,
speed)
def start(self):
self.active(True)
self.__ownUI = GUI.WGVehicleMarkersCanvasFlash(self.movie)
self.__ownUI.wg_inputKeyMode = 2
self.__ownUI.scaleProperties = GUI_SETTINGS.markerScaleSettings
self.__ownUI.alphaProperties = GUI_SETTINGS.markerBgSettings
self.__ownUIProxy = weakref.ref(self.__ownUI)
self.__ownUIProxy().markerSetScale(g_settingsCore.interfaceScale.get())
g_settingsCore.interfaceScale.onScaleChanged += self.updateMarkersScale
self.__parentUI.component.addChild(self.__ownUI, 'vehicleMarkersManager')
self.__markersCanvasUI = self.getMember('vehicleMarkersCanvas')
self.__plugins.init()
ctrl = g_sessionProvider.getFeedback()
if ctrl is not None:
ctrl.onVehicleMarkerAdded += self.__onVehicleMarkerAdded
ctrl.onVehicleMarkerRemoved += self.__onVehicleMarkerRemoved
ctrl.onVehicleFeedbackReceived += self.__onVehicleFeedbackReceived
functional = g_sessionProvider.getDynSquadFunctional()
if functional is not None:
functional.onPlayerBecomeSquadman += self.__onPlayerBecomeSquadman
self.__plugins.start()
g_eventBus.addListener(GameEvent.SHOW_EXTENDED_INFO, self.__handleShowExtendedInfo, scope=_SCOPE)
g_eventBus.addListener(GameEvent.GUI_VISIBILITY, self.__handleGUIVisibility, scope=_SCOPE)
return
def destroy(self):
g_eventBus.removeListener(GameEvent.SHOW_EXTENDED_INFO, self.__handleShowExtendedInfo, scope=_SCOPE)
g_eventBus.removeListener(GameEvent.GUI_VISIBILITY, self.__handleGUIVisibility, scope=_SCOPE)
self.__plugins.stop()
g_settingsCore.interfaceScale.onScaleChanged -= self.updateMarkersScale
ctrl = g_sessionProvider.getFeedback()
if ctrl is not None:
ctrl.onVehicleMarkerAdded -= self.__onVehicleMarkerAdded
ctrl.onVehicleMarkerRemoved -= self.__onVehicleMarkerRemoved
ctrl.onVehicleFeedbackReceived -= self.__onVehicleFeedbackReceived
functional = g_sessionProvider.getDynSquadFunctional()
if functional is not None:
functional.onPlayerBecomeSquadman -= self.__onPlayerBecomeSquadman
if self.__parentUI is not None:
setattr(self.__parentUI.component, 'vehicleMarkersManager', None)
self.__plugins.fini()
self.__parentUI = None
self.__ownUI = None
self.__markersCanvasUI = None
self.colorManager.dispossessUI()
self.close()
return
def _createVehicleMarker(self, isAlly, mProv):
markerLinkage = 'VehicleMarkerAlly' if isAlly else 'VehicleMarkerEnemy'
if arena_info.hasFlags():
markerID = self.__ownUI.addFalloutMarker(mProv, markerLinkage)
else:
markerID = self.__ownUI.addMarker(mProv, markerLinkage)
return markerID
def addVehicleMarker(self, vProxy, vInfo, guiProps):
vTypeDescr = vProxy.typeDescriptor
maxHealth = vTypeDescr.maxHealth
mProv = vProxy.model.node('HP_gui')
#.........这里部分代码省略.........
示例4: ConsumablesPanel
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
class ConsumablesPanel(object):
def __init__(self, parentUI):
self.__ui = parentUI
self.__flashObject = None
self.__cds = [None] * PANEL_MAX_LENGTH
self.__mask = 0
self.__keys = {}
self.__currentOrderIdx = -1
self.__plugins = PluginsCollection(self)
plugins = {}
if hasRage():
plugins['rageBar'] = _RageBarPlugin
self.__plugins.addPlugins(plugins)
return
def start(self):
self.__flashObject = self.__ui.getMember('_level0.consumablesPanel')
if self.__flashObject:
self.__flashObject.resync()
self.__flashObject.script = self
self.__plugins.init()
self.__plugins.start()
props = _FalloutSlotViewProps(useStandardLayout=not hasRage())
self.__flashObject.setProperties(isEventBattle(), props._asdict())
self.__addListeners()
else:
LOG_ERROR('Display object is not found in the swf file.')
def destroy(self):
self.__plugins.stop()
self.__plugins.fini()
self.__removeListeners()
self.__keys.clear()
self.__ui = None
if self.__flashObject is not None:
self.__flashObject.script = None
self.__flashObject = None
return
def bindCommands(self):
keys = {}
slots = []
for idx, bwKey, sfKey, handler in self.__getKeysGenerator():
if handler:
keys[bwKey] = handler
slots.append((idx, bwKey, sfKey))
self.__flashObject.setKeysToSlots(slots)
self.__keys.clear()
self.__keys = keys
def onClickedToSlot(self, bwKey):
self.__handleBWKey(int(bwKey))
def onPopUpClosed(self):
keys = {}
for idx, bwKey, _, handler in self.__getKeysGenerator():
if handler:
keys[bwKey] = handler
self.__keys.clear()
self.__keys = keys
ctrl = g_sessionProvider.getVehicleStateCtrl()
ctrl.onVehicleStateUpdated -= self.__onVehicleStateUpdated
@property
def flashObject(self):
return self.__flashObject
def __callFlash(self, funcName, args = None):
self.__ui.call('battle.consumablesPanel.%s' % funcName, args)
def __addListeners(self):
vehicleCtrl = g_sessionProvider.getVehicleStateCtrl()
vehicleCtrl.onPostMortemSwitched += self.__onPostMortemSwitched
vehicleCtrl.onRespawnBaseMoving += self.__onRespawnBaseMoving
ammoCtrl = g_sessionProvider.getAmmoCtrl()
ammoCtrl.onShellsAdded += self.__onShellsAdded
ammoCtrl.onShellsUpdated += self.__onShellsUpdated
ammoCtrl.onNextShellChanged += self.__onNextShellChanged
ammoCtrl.onCurrentShellChanged += self.__onCurrentShellChanged
ammoCtrl.onGunReloadTimeSet += self.__onGunReloadTimeSet
ammoCtrl.onGunReloadTimeSetInPercent += self.__onGunReloadTimeSetInPercent
eqCtrl = g_sessionProvider.getEquipmentsCtrl()
eqCtrl.onEquipmentAdded += self.__onEquipmentAdded
eqCtrl.onEquipmentUpdated += self.__onEquipmentUpdated
eqCtrl.onEquipmentCooldownInPercent += self.__onEquipmentCooldownInPercent
optDevicesCtrl = g_sessionProvider.getOptDevicesCtrl()
optDevicesCtrl.onOptionalDeviceAdded += self.__onOptionalDeviceAdded
optDevicesCtrl.onOptionalDeviceUpdated += self.__onOptionalDeviceUpdated
g_eventBus.addListener(GameEvent.CHOICE_CONSUMABLE, self.__handleConsumableChoice, scope=EVENT_BUS_SCOPE.BATTLE)
def __removeListeners(self):
g_eventBus.removeListener(GameEvent.CHOICE_CONSUMABLE, self.__handleConsumableChoice, scope=EVENT_BUS_SCOPE.BATTLE)
vehicleCtrl = g_sessionProvider.getVehicleStateCtrl()
vehicleCtrl.onPostMortemSwitched -= self.__onPostMortemSwitched
vehicleCtrl.onRespawnBaseMoving -= self.__onRespawnBaseMoving
vehicleCtrl.onVehicleStateUpdated -= self.__onVehicleStateUpdated
ammoCtrl = g_sessionProvider.getAmmoCtrl()
#.........这里部分代码省略.........
示例5: MarkersManager
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
class MarkersManager(Flash, IDynSquadEntityClient):
__SWF_FILE_NAME = 'VehicleMarkersManager.swf'
MARKER_POSITION_ADJUSTMENT = Vector3(0.0, 12.0, 0.0)
class DAMAGE_TYPE:
FROM_UNKNOWN = 0
FROM_ALLY = 1
FROM_ENEMY = 2
FROM_SQUAD = 3
FROM_PLAYER = 4
def __init__(self, parentUI):
Flash.__init__(self, self.__SWF_FILE_NAME)
self.component.wg_inputKeyMode = 2
self.component.position.z = DEPTH_OF_VehicleMarker
self.component.drawWithRestrictedViewPort = False
self.movie.backgroundAlpha = 0
self.colorManager = ColorSchemeManager._ColorSchemeManager()
self.colorManager.populateUI(weakref.proxy(self))
self.__plugins = PluginsCollection(self)
plugins = {'equipments': _EquipmentsMarkerPlugin}
if isEventBattle():
plugins.update({'flags': _FlagsMarkerPlugin,
'repairs': _RepairsMarkerPlugin})
self.__plugins.addPlugins(plugins)
self.__ownUI = None
self.__parentUI = parentUI
self.__markers = dict()
return
def updateSquadmanVeh(self, vID):
handle = getattr(BigWorld.entity(vID), 'marker', None)
if handle is not None:
self.invokeMarker(handle, 'setEntityName', [PLAYER_ENTITY_NAME.squadman.name()])
return
def showExtendedInfo(self, value):
self.__invokeCanvas('setShowExInfoFlag', [value])
for handle in self.__markers.iterkeys():
self.invokeMarker(handle, 'showExInfo', [value])
def setScaleProps(self, minScale = 40, maxScale = 100, defScale = 100, speed = 3.0):
if constants.IS_DEVELOPMENT:
self.__ownUI.scaleProperties = (minScale,
maxScale,
defScale,
speed)
def setAlphaProps(self, minAlpha = 40, maxAlpha = 100, defAlpha = 100, speed = 3.0):
if constants.IS_DEVELOPMENT:
self.__ownUI.alphaProperties = (minAlpha,
maxAlpha,
defAlpha,
speed)
def start(self):
self.active(True)
self.__ownUI = GUI.WGVehicleMarkersCanvasFlash(self.movie)
self.__ownUI.wg_inputKeyMode = 2
self.__ownUI.scaleProperties = GUI_SETTINGS.markerScaleSettings
self.__ownUI.alphaProperties = GUI_SETTINGS.markerBgSettings
self.__ownUIProxy = weakref.ref(self.__ownUI)
self.__ownUIProxy().markerSetScale(g_settingsCore.interfaceScale.get())
g_settingsCore.interfaceScale.onScaleChanged += self.updateMarkersScale
self.__parentUI.component.addChild(self.__ownUI, 'vehicleMarkersManager')
self.__markersCanvasUI = self.getMember('vehicleMarkersCanvas')
self.__plugins.init()
self.__plugins.start()
def destroy(self):
self.__plugins.stop()
g_settingsCore.interfaceScale.onScaleChanged -= self.updateMarkersScale
if self.__parentUI is not None:
setattr(self.__parentUI.component, 'vehicleMarkersManager', None)
self.__plugins.fini()
self.__parentUI = None
self.__ownUI = None
self.__markersCanvasUI = None
self.colorManager.dispossessUI()
self.close()
return
def createMarker(self, vProxy):
vInfo = dict(vProxy.publicInfo)
battleCtx = g_sessionProvider.getCtx()
if battleCtx.isObserver(vProxy.id):
return -1
isFriend = vInfo['team'] == BigWorld.player().team
vehID = vProxy.id
vInfoEx = g_sessionProvider.getArenaDP().getVehicleInfo(vehID)
vTypeDescr = vProxy.typeDescriptor
maxHealth = vTypeDescr.maxHealth
mProv = vProxy.model.node('HP_gui')
tags = set(vTypeDescr.type.tags & VEHICLE_CLASS_TAGS)
vClass = tags.pop() if len(tags) > 0 else ''
entityName = battleCtx.getPlayerEntityName(vehID, vInfoEx.team)
entityType = 'ally' if BigWorld.player().team == vInfoEx.team else 'enemy'
speaking = False
if GUI_SETTINGS.voiceChat:
speaking = VoiceChatInterface.g_instance.isPlayerSpeaking(vInfoEx.player.accountDBID)
#.........这里部分代码省略.........
示例6: Battle
# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import fini [as 别名]
#.........这里部分代码省略.........
ctrl = g_sessionProvider.getVehicleStateCtrl()
ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
if BattleReplay.g_replayCtrl.isPlaying:
self.__dynSquadListener = ReplayDynSquadViewListener(self.proxy)
elif BattleReplay.g_replayCtrl.isRecording:
self.__dynSquadListener = RecordDynSquadViewListener(self.proxy)
else:
self.__dynSquadListener = DynSquadViewListener(self.proxy)
g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
def beforeDelete(self):
LOG_DEBUG('[Battle] beforeDelete')
removeListener = g_eventBus.removeListener
removeListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
removeListener(events.GameEvent.GUI_VISIBILITY, self.showAll, scope=_SCOPE)
ctrl = g_sessionProvider.getVehicleStateCtrl()
if ctrl is not None:
ctrl.onVehicleStateUpdated -= self.__onVehicleStateUpdated
ctrl.onPostMortemSwitched -= self.__onPostMortemSwitched
player = BigWorld.player()
if player and player.inputHandler:
player.inputHandler.onPostmortemVehicleChanged -= self.onPostmortemVehicleChanged
player.inputHandler.onCameraChanged -= self.onCameraChanged
if self.colorManager:
self.colorManager.dispossessUI()
voice = VoiceChatInterface.g_instance
if voice:
voice.dispossessUI(self.proxy)
voice.onPlayerSpeaking -= self.setPlayerSpeaking
voice.onVoiceChatInitFailed -= self.onVoiceChatInitFailed
if self.__plugins is not None:
self.__plugins.stop()
self.__plugins.fini()
self.__plugins = None
if self.movingText is not None:
self.movingText.dispossessUI()
self.movingText = None
if self.__timerSound is not None:
self.__timerSound.stop()
self.__timerSound = None
if self.__soundManager is not None:
self.__soundManager.dispossessUI()
self.__soundManager = None
if self.colorManager is not None:
self.colorManager.dispossessUI()
self.colorManager = None
if self.component:
g_repeatKeyHandlers.discard(self.component.handleKeyEvent)
g_settingsCore.onSettingsChanged -= self.__accs_onSettingsChanged
g_settingsCore.interfaceScale.onScaleChanged -= self.__onRecreateDevice
self.__timersBar.destroy()
self.__battleEndWarningPanel.destroy()
self.__teamBasesPanel.destroy()
self.__consumablesPanel.destroy()
self.__damagePanel.destroy()
self.__markersManager.destroy()
self.__ingameHelp.destroy()
self.__vErrorsPanel.destroy()
self.__vMsgsPanel.destroy()
self.__pMsgsPanel.destroy()
self.__radialMenu.destroy()
self.__minimap.destroy()
self.__ribbonsPanel.destroy()
self.__fragCorrelation.destroy()
self.__statsForm.destroy()