def sendAttentionToCell(self, cellIdx):
     if avatar_getter.isForcedGuiControlMode():
         command = self.proto.battleCmd.createByCellIdx(cellIdx)
         if command:
             self.__sendChatCommand(command)
         else:
             LOG_ERROR('Minimap command not found', cellIdx)
 def sendAttentionToBase(self, baseIdx, baseName, isAtk):
     if avatar_getter.isForcedGuiControlMode():
         command = self.proto.battleCmd.createByBaseIndex(baseIdx, baseName, isAtk)
         if command:
             self.__sendChatCommand(command)
         else:
             LOG_ERROR('Minimap command not found', baseIdx)
 def sendAttentionToPosition(self, position):
     if avatar_getter.isForcedGuiControlMode():
         command = self.proto.battleCmd.createByPosition(position)
         if command:
             self.__sendChatCommand(command)
         else:
             LOG_ERROR('Minimap command not found', position)
 def sendAttentionToCell(self, cellIdx):
     if avatar_getter.isForcedGuiControlMode():
         command = self.proto.battleCmd.createByCellIdx(cellIdx)
         if command:
             self.__sendChatCommand(command)
         else:
             LOG_ERROR('Minimap command not found', cellIdx)
Example #5
0
 def keyEvent(self, event):
     if event.key in self.usableKeys:
         key = event.key
         if not avatar_getter.isForcedGuiControlMode(
         ) or key in self.pressedKeys:
             isKeyDown = event.isKeyDown()
             if isKeyDown:
                 if self.config.main[USE_KEY_PAIRS]:
                     if key in KEY_ALIAS_CONTROL:
                         self.pressedKeys.update(KEY_ALIAS_CONTROL)
                     elif key in KEY_ALIAS_ALT:
                         self.pressedKeys.update(KEY_ALIAS_ALT)
                     elif key in KEY_ALIAS_SHIFT:
                         self.pressedKeys.update(KEY_ALIAS_SHIFT)
                 self.pressedKeys.add(key)
                 for keyName, keys in self.keysMap.iteritems():
                     if self.pressedKeys.issuperset(keys):
                         self.onKeyPressed(keyName, isKeyDown)
             else:
                 for keyName, keys in self.keysMap.iteritems():
                     if self.pressedKeys.issuperset(keys):
                         self.onKeyPressed(keyName, isKeyDown)
                 if self.config.main[USE_KEY_PAIRS]:
                     if key in KEY_ALIAS_CONTROL:
                         self.pressedKeys.difference_update(
                             KEY_ALIAS_CONTROL)
                     elif key in KEY_ALIAS_ALT:
                         self.pressedKeys.difference_update(KEY_ALIAS_ALT)
                     elif key in KEY_ALIAS_SHIFT:
                         self.pressedKeys.difference_update(KEY_ALIAS_SHIFT)
                 self.pressedKeys.discard(key)
Example #6
0
 def sendAttentionToCell(self, cellIdx):
     if avatar_getter.isForcedGuiControlMode():
         if not self.__cmdFactories:
             LOG_ERROR('Commands factory is not defined')
             return
         command = self.__cmdFactories.createByCellIdx(cellIdx)
         if command:
             self.__sendChatCommand(command)
         else:
             LOG_ERROR('Minimap command not found', cellIdx)