当前位置: 首页>>代码示例>>Python>>正文


Python PluginsCollection.update方法代码示例

本文整理汇总了Python中gui.shared.utils.plugins.PluginsCollection.update方法的典型用法代码示例。如果您正苦于以下问题:Python PluginsCollection.update方法的具体用法?Python PluginsCollection.update怎么用?Python PluginsCollection.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.shared.utils.plugins.PluginsCollection的用法示例。


在下文中一共展示了PluginsCollection.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MarkersManager

# 需要导入模块: from gui.shared.utils.plugins import PluginsCollection [as 别名]
# 或者: from gui.shared.utils.plugins.PluginsCollection import update [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')
#.........这里部分代码省略.........
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:103,代码来源:markers.py


注:本文中的gui.shared.utils.plugins.PluginsCollection.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。