def __doChangeSetting(self, item, entityName = None, avatar = None):
     result, error = item.canActivate(entityName, avatar)
     if result and avatar_getter.isPlayerOnArena(avatar):
         if item.getStage() == EQUIPMENT_STAGES.PREPARING:
             item.deactivate()
         else:
             forEach(lambda e: e.deactivate(), [ e for e in self._equipments.itervalues() if e.getStage() == EQUIPMENT_STAGES.PREPARING ])
             item.activate(entityName, avatar)
     return (result, error)
Example #2
0
 def __doChangeSetting(self, item, entityName = None, avatar = None):
     result, error = item.canActivate(entityName, avatar)
     if result and avatar_getter.isPlayerOnArena(avatar):
         if item.getStage() == EQUIPMENT_STAGES.PREPARING:
             item.deactivate()
         else:
             forEach(lambda e: e.deactivate(), [ e for e in self._equipments.itervalues() if e.getStage() == EQUIPMENT_STAGES.PREPARING ])
             item.activate(entityName, avatar)
     return (result, error)
 def __fillShells(self, ctrl):
     forEach(lambda args: self.__onShellsAdded(*args), ctrl.getOrderedShellsLayout())
     shellCD = ctrl.getNextShellCD()
     if shellCD is not None:
         self.__onNextShellChanged(shellCD)
     shellCD = ctrl.getCurrentShellCD()
     if shellCD is not None:
         self.__onCurrentShellChanged(shellCD)
     return
Example #4
0
 def __fillShells(self, ctrl):
     forEach(lambda args: self.__onShellsAdded(*args), ctrl.getOrderedShellsLayout())
     shellCD = ctrl.getNextShellCD()
     if shellCD is not None:
         self.__onNextShellChanged(shellCD)
     shellCD = ctrl.getCurrentShellCD()
     if shellCD is not None:
         self.__onCurrentShellChanged(shellCD)
     return
Example #5
0
 def _onClubUpdated(self, clubDbID, clubCompactDescr):
     if clubDbID == self.__clubDbID:
         if not clubCompactDescr:
             self.notify('onClubUpdated', None)
             if self.__clubsCtrl is not None:
                 self.__clubsCtrl._removeSubscription(clubDbID)
             return
         oldClub, newClub = self.__club, Club(clubDbID, clubCompactDescr)
         self.__club = newClub
         if oldClub is None:
             self.notify('onClubUpdated', newClub)
         elif oldClub.isChanged(newClub):
             forEach(lambda c: c(self, oldClub, newClub), self.__comparators)
Example #6
0
 def _onClubUpdated(self, clubDbID, clubCompactDescr):
     if clubDbID == self.__clubDbID:
         if not clubCompactDescr:
             self.notify('onClubUpdated', None)
             if self.__clubsCtrl is not None:
                 self.__clubsCtrl._removeSubscription(clubDbID)
             return
         oldClub, newClub = self.__club, Club(clubDbID, clubCompactDescr)
         self.__club = newClub
         if oldClub is None:
             self.notify('onClubUpdated', newClub)
         elif oldClub.isChanged(newClub):
             forEach(lambda c: c(self, oldClub, newClub), self.__comparators)
     return
Example #7
0
 def __doChangeSetting(self, item, entityName=None, avatar=None):
     result, error = item.canActivate(entityName, avatar)
     if result and avatar_getter.isPlayerOnArena(avatar):
         if item.getStage() == EQUIPMENT_STAGES.PREPARING:
             item.deactivate()
         else:
             curCtrl = BigWorld.player().inputHandler.ctrl
             if curCtrl is not None and curCtrl.isEnabled:
                 self.__preferredPosition = curCtrl.getDesiredShotPoint(
                     ignoreAimingMode=True)
             forEach(lambda e: e.deactivate(), [
                 e for e in self._equipments.itervalues()
                 if e.getStage() == EQUIPMENT_STAGES.PREPARING
             ])
             item.activate(entityName, avatar)
     return (result, error)
 def stopNotification(self):
     forEach(operator.methodcaller('stopNotification'), self.__notificators)
 def clearNotification(self):
     self.stopNotification()
     forEach(operator.methodcaller('clear'), self.__notificators)
     self.__notificators = []
 def clearNotification(self):
     self.stopNotification()
     forEach(operator.methodcaller('clear'), self.__notificators)
     self.__notificators = []
Example #11
0
 def _invoke(self, method, *args):
     forEach(operator.methodcaller(method, *args), self.__plugins.itervalues())
 def __fillOptionalDevices(self, ctrl):
     forEach(lambda args: self.__onOptionalDeviceAdded(*args), ctrl.getOrderedOptionalDevicesLayout())
 def stopNotification(self):
     forEach(operator.methodcaller('stopNotification'), self.__notificators)
 def startNotification(self):
     forEach(operator.methodcaller("startNotification"), self.__notificators)
Example #15
0
def sendEvent(eventName, *args, **kwargs):
    forEach(lambda mod: _callModMethod(mod, eventName, *args, **kwargs), _mods.itervalues())
Example #16
0
def fini():
    forEach(lambda mod: _callModMethod(mod, 'fini'), _mods.itervalues())
    _mods.clear()
Example #17
0
def init():
    global _mods
    _mods = _findValidMODs()
    forEach(lambda mod: _callModMethod(mod, 'init'), _mods.itervalues())
Example #18
0
 def _invoke(self, method, *args):
     forEach(operator.methodcaller(method, *args), self.__plugins.itervalues())
Example #19
0
 def __fillOptionalDevices(self, ctrl):
     forEach(lambda args: self.__onOptionalDeviceAdded(*args),
             ctrl.getOrderedOptionalDevicesLayout())
Example #20
0
 def __fillEquipments(self, ctrl):
     forEach(lambda args: self.__onEquipmentAdded(*args),
             ctrl.getOrderedEquipmentsLayout())
 def __fillEquipments(self, ctrl):
     forEach(lambda args: self.__onEquipmentAdded(*args), ctrl.getOrderedEquipmentsLayout())
Example #22
0
 def _invoke(self, method, *args):
     forEach(operator.methodcaller(method, *args), self._controllers)
Example #23
0
def init():
    global _mods
    _mods = _findValidMODs()
    forEach(lambda mod: _callModMethod(mod, 'init'), _mods.itervalues())
Example #24
0
def fini():
    forEach(lambda mod: _callModMethod(mod, 'fini'), _mods.itervalues())
    _mods.clear()
Example #25
0
def sendEvent(eventName, *args, **kwargs):
    forEach(lambda mod: _callModMethod(mod, eventName, *args, **kwargs),
            _mods.itervalues())
Example #26
0
 def _invoke(self, method, *args):
     forEach(operator.methodcaller(method, *args), self._controllers.itervalues())