def _removeGameListeners(self): g_eventBus.removeListener(GameEvent.SCREEN_SHOT_MADE, self.__handleScreenShotMade) g_critMemHandler.onMemCrit -= self.__handleMemoryCriticalMessage ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowVehicleMessageByCode -= self.__onShowVehicleMessageByCode ctrl.onShowVehicleMessageByKey -= self.__onShowVehicleMessageByKey super(VehicleMessages, self)._removeGameListeners()
def __changeVehicleSetting(self, tag, entityName): result, error = g_sessionProvider.getEquipmentsCtrl().changeSettingByTag( tag, entityName=entityName, avatar=BigWorld.player() ) if not result and error: ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowVehicleErrorByKey(error.key, error.ctx)
def __changeVehicleSetting(self, tag, entityName): result, error = g_sessionProvider.getEquipmentsCtrl( ).changeSettingByTag(tag, entityName=entityName, avatar=BigWorld.player()) if not result and error: ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowVehicleErrorByKey(error.key, error.ctx)
def _removeGameListeners(self): ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowPlayerMessageByCode -= self.__onShowPlayerMessageByCode ctrl.onShowPlayerMessageByKey -= self.__onShowPlayerMessageByKey ctrl = g_sessionProvider.getEquipmentsCtrl() if ctrl: ctrl.onEquipmentUpdated -= self.__onCombatEquipmentUpdated arena = avatar_getter.getArena() if arena: arena.onCombatEquipmentUsed -= self.__onCombatEquipmentUsed super(PlayerMessages, self)._removeGameListeners()
def _addGameListeners(self): super(VehicleMessages, self)._addGameListeners() g_eventBus.addListener(GameEvent.SCREEN_SHOT_MADE, self.__handleScreenShotMade) for message in g_critMemHandler.messages: self.__handleMemoryCriticalMessage(message) g_critMemHandler.onMemCrit += self.__handleMemoryCriticalMessage ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowVehicleMessageByCode += self.__onShowVehicleMessageByCode ctrl.onShowVehicleMessageByKey += self.__onShowVehicleMessageByKey ctrl.onUIPopulated()
def _removeGameListeners(self): ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.onShowVehicleErrorByKey -= self.__onShowVehicleErrorByKey super(VehicleErrorMessages, self)._removeGameListeners()
def __showInfoMessage(self, msg, args = None): from gui.battle_control import g_sessionProvider if not self.isTimeWarpInProgress: ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.showInfoMessage(msg, True, args)
def __showInfoMessage(self, msg, args=None): from gui.battle_control import g_sessionProvider if not self.isTimeWarpInProgress: ctrl = g_sessionProvider.getBattleMessagesCtrl() if ctrl: ctrl.showInfoMessage(msg, True, args)