Example #1
0
    def handleKey(self, isDown, key, mods):
        if key == Keys.KEY_ESCAPE:
            if self.__keyHandlers:
                for handler in self.__keyHandlers[:]:
                    if handler.handleEscKey(isDown):
                        return True

            if isDown:
                handler = avatar_getter.getInputHandler()
                if handler is not None and handler.ctrlModeName != CTRL_MODE_NAME.MAP_CASE:
                    event_dispatcher.showIngameMenu()
                    event_dispatcher.toggleFullStats(False)
            return True
        elif key in (Keys.KEY_LCONTROL, Keys.KEY_RCONTROL):
            if not self.__consumers:
                avatar_getter.setForcedGuiControlMode(isDown)
            return True
        elif key == Keys.KEY_TAB and (mods != Keys.MODIFIER_CTRL or not isDown):
            event_dispatcher.toggleFullStats(isDown)
            return True
        elif key == Keys.KEY_TAB and mods == Keys.MODIFIER_CTRL and isDown:
            if not self.__consumers:
                event_dispatcher.setNextPlayerPanelMode()
            return True
        else:
            return False
Example #2
0
 def leaveGuiControlMode(self, consumerID):
     if consumerID in self.__consumers:
         self.__consumers.remove(consumerID)
         if not self.__consumers:
             avatar_getter.setForcedGuiControlMode(False)
Example #3
0
 def enterGuiControlMode(self, consumerID, cursorVisible = True, enableAiming = True):
     if consumerID not in self.__consumers:
         if not self.__consumers:
             avatar_getter.setForcedGuiControlMode(True, cursorVisible=cursorVisible, enableAiming=enableAiming)
         self.__consumers.append(consumerID)
Example #4
0
 def setForcedGuiControlMode(self, flash, hold):
     flash.call('Cursor.Hold', [hold])
     from gui.battle_control import avatar_getter
     avatar_getter.setForcedGuiControlMode(hold)
 def _doPing(self, cellIdx):
     avatar_getter.setForcedGuiControlMode(True)
     g_sessionProvider.shared.chatCommands.sendAttentionToCell(cellIdx)
     avatar_getter.setForcedGuiControlMode(False)
Example #6
0
 def cursorVisibility(self, _, visible, x = None, y = None, customCall = False, enableAiming = True):
     if visible:
         g_cursorDelegator.syncMousePosition(self, x, y, customCall)
     else:
         g_cursorDelegator.restoreMousePosition()
     avatar_getter.setForcedGuiControlMode(visible, stopVehicle=False, enableAiming=enableAiming)