當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。