예제 #1
0
    def start(self):
        g_guiResetters.add(self.__onRecreateDevice)
        import aims
        aims.clearState()
        ownVehicle = BigWorld.entity(BigWorld.player().playerVehicleID)
        vehTypeDesc = ownVehicle.typeDescriptor.type
        self.__isSPG = 'SPG' in vehTypeDesc.tags
        self.__isATSPG = 'AT-SPG' in vehTypeDesc.tags
        for control in self.__ctrls.itervalues():
            control.create()

        self.__addBattleCtrlListeners()
        g_cursorDelegator.detachCursor()
        if not self.__curCtrl.isManualBind():
            BigWorld.player().positionControl.bindToVehicle(True)
        self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty())
        self.onCameraChanged('arcade')
        tmp = self.__curCtrl.getPreferredAutorotationMode()
        if tmp is not None:
            self.__isAutorotation = tmp
            self.__prevModeAutorotation = True
        else:
            self.__isAutorotation = True
            self.__prevModeAutorotation = None
        BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation)
        self.__targeting.enable(True)
        self.__isStarted = True
        self.__isGUIVisible = True
        self.__killerVehicleID = None
        arena = BigWorld.player().arena
        arena.onPeriodChange += self.__onArenaStarted
        from account_helpers.settings_core.SettingsCore import g_settingsCore
        g_settingsCore.onSettingsChanged += self.__onSettingsChanged
        self.__onArenaStarted(arena.period)
예제 #2
0
    def start(self):
        g_guiResetters.add(self.__onRecreateDevice)
        import aims
        aims.clearState()
        self.__identifySPG()
        for control in self.__ctrls.itervalues():
            control.create()

        self.__addBattleCtrlListeners()
        g_cursorDelegator.detachCursor()
        if not self.__curCtrl.isManualBind():
            BigWorld.player().positionControl.bindToVehicle(True)
        self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty())
        self.onCameraChanged('arcade')
        tmp = self.__curCtrl.getPreferredAutorotationMode()
        if tmp is not None:
            self.__isAutorotation = tmp
            self.__prevModeAutorotation = True
        else:
            self.__isAutorotation = True
            self.__prevModeAutorotation = None
        BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation)
        self.__targeting.enable(True)
        self.__isStarted = True
        self.__isGUIVisible = True
        self.__killerVehicleID = None
        arena = BigWorld.player().arena
        arena.onPeriodChange += self.__onArenaStarted
        from account_helpers.settings_core.SettingsCore import g_settingsCore
        g_settingsCore.onSettingsChanged += self.__onSettingsChanged
        self.__onArenaStarted(arena.period)
예제 #3
0
 def detachCursor(self, isDetached, enableAiming):
     if not self.__isStarted:
         return 
     self.__detachCount += -1 if isDetached else 1
     assert self.__detachCount <= 0
     if self.__detachCount == -1 and isDetached:
         self.__targeting.enable(False)
         g_cursorDelegator.activateCursor()
         if enableAiming:
             self.setAimingMode(False, AIMING_MODE.USER_DISABLED)
     elif not self.__detachCount:
         self.__targeting.enable(True)
         g_cursorDelegator.detachCursor()
예제 #4
0
 def detachCursor(self, isDetached, enableAiming):
     if not self.__isStarted:
         return
     self.__detachCount += -1 if isDetached else 1
     assert self.__detachCount <= 0
     if self.__detachCount == -1 and isDetached:
         self.__targeting.enable(False)
         g_cursorDelegator.activateCursor()
         if enableAiming:
             self.setAimingMode(False, AIMING_MODE.USER_DISABLED)
     elif not self.__detachCount:
         self.__targeting.enable(True)
         g_cursorDelegator.detachCursor()
예제 #5
0
 def detachCursor(self):
     return g_cursorDelegator.detachCursor()
예제 #6
0
 def detachCursor(self):
     return g_cursorDelegator.detachCursor()