示例#1
0
 def onAction(self, action):
     chatCommands = g_sessionProvider.getChatCommands()
     if action in self.TARGET_ACTIONS:
         chatCommands.sendTargetedCommand(action, self.__currentTarget.id)
     elif action == self.RELOADING_GUN_ACTION:
         chatCommands.sendReloadingCommand()
     else:
         chatCommands.sendCommand(action)
示例#2
0
 def onAction(self, action):
     chatCommands = g_sessionProvider.getChatCommands()
     if action in self.TARGET_ACTIONS:
         chatCommands.sendTargetedCommand(action, self.__currentTarget.id)
     elif action == self.RELOADING_GUN_ACTION:
         chatCommands.sendReloadingCommand()
     else:
         chatCommands.sendCommand(action)
示例#3
0
 def __onMapClickInSimpleMode(self, x, y, bHighlightCellNVehicleSpecific):
     localPos = (x - 0.5, y - 0.5)
     mapSize = Minimap.__MINIMAP_SIZE
     player = BigWorld.player()
     if bHighlightCellNVehicleSpecific:
         cellCount = Minimap.__MINIMAP_CELLS
         row = int(cellCount[0] * localPos[0] / mapSize[0])
         column = int(cellCount[1] * localPos[1] / mapSize[1])
         g_sessionProvider.getChatCommands().sendAttentionToCell(row * int(cellCount[1]) + column)
     elif 'SPG' in player.vehicleTypeDescriptor.type.tags:
         arenaDesc = BigWorld.player().arena.arenaType
         (bottomLeft, upperRight,) = arenaDesc.boundingBox
         spaceSize = upperRight - bottomLeft
         viewpoint = (upperRight + bottomLeft) * 0.5
         viewpointTranslate = Math.Matrix()
         viewpointTranslate.setTranslate((viewpoint.x, 0.0, viewpoint.y))
         pos = ((localPos[0] - mapSize[0] * 0.5) / mapSize[0], (localPos[1] - mapSize[1] * 0.5) / mapSize[1])
         worldPos = Math.Matrix(viewpointTranslate).applyPoint((pos[0] * spaceSize[0], 0.0, -pos[1] * spaceSize[1]))
         player.inputHandler.onMinimapClicked(worldPos)
示例#4
0
 def getCommandfactory(self):
     from gui.battle_control import g_sessionProvider
     cmdFc = g_sessionProvider.getChatCommands().proto.battleCmd
     if cmdFc is None:
         LOG_ERROR('Commands factory is not defined')
     return cmdFc
示例#5
0
 def getCommandfactory(self):
     from gui.battle_control import g_sessionProvider
     cmdFc = g_sessionProvider.getChatCommands().proto.battleCmd
     if cmdFc is None:
         LOG_ERROR('Commands factory is not defined')
     return cmdFc