def updateResolutionOverride(self):
     webPageWidth, webPageHeight = Utils.pixelSize(self.component)
     screenWidth = BigWorld.screenWidth()
     screenHeight = BigWorld.screenHeight()
     usedResolutionOverride = GUI.screenResolution()
     if usedResolutionOverride != (0, 0):
         webPageWidth *= BigWorld.screenWidth() / usedResolutionOverride[0]
         webPageHeight *= BigWorld.screenHeight() / usedResolutionOverride[1]
     self.webPage.setSize(webPageWidth, webPageHeight, self.exactWidth, self.exactHeight)
Example #2
0
 def updateResolutionOverride(self):
     webPageWidth, webPageHeight = Utils.pixelSize(self.component)
     screenWidth = BigWorld.screenWidth()
     screenHeight = BigWorld.screenHeight()
     usedResolutionOverride = GUI.screenResolution()
     if usedResolutionOverride != (0, 0):
         webPageWidth *= BigWorld.screenWidth() / usedResolutionOverride[0]
         webPageHeight *= BigWorld.screenHeight() / usedResolutionOverride[1]
     self.webPage.setSize(webPageWidth, webPageHeight, self.exactWidth, self.exactHeight)
Example #3
0
 def currentRadius(self):
     player = BigWorld.player()
     planeDir = BigWorld.player().getRotation().getAxisZ()
     self._Q.fromAngleAxis(self._lastCorrectMaxAngle,
                           BigWorld.player().getRotation().getAxisX())
     Dir = self._Q.rotateVec(planeDir)
     reductionPointVector = getReductionPointVector(player.weaponsSettings)
     worldPos = Dir * reductionPointVector.length * HUD_REDUCTION_POINT_SCALE + player.position
     screenPoint = BigWorld.worldToScreen(worldPos)
     screenPoint = Math.Vector3(
         clamp(0.0, screenPoint.x, BigWorld.screenWidth()),
         clamp(0.0, screenPoint.y, BigWorld.screenHeight()), 1.0)
     x = screenPoint.x - 0.5 * BigWorld.screenWidth()
     y = -screenPoint.y + 0.5 * BigWorld.screenHeight()
     return math.hypot(x, y)
Example #4
0
def onEnterWorld(self, prereqs):
    if self.isPlayerVehicle:
        global yaw, old_yaw, pitch, old_pitch, old_multiplier, dataHor, dataVert, turretYawLimits, scaleHor, scaleVert
        global minStep, maxPitch, minPitch, currentStep, minBound, maxBound, screenHeight, screenWidth, player
        global old_gunAnglesPacked, isAlive, cameraMode
        player = BigWorld.player()
        yaw = 0.0
        pitch = 0.0
        old_multiplier = 1.0
        old_gunAnglesPacked = None
        old_yaw = None
        old_pitch = None
        isAlive = self.isAlive
        screenHeight = BigWorld.screenHeight()
        screenWidth = BigWorld.screenWidth()
        currentStep = STEP
        verticalFov = FovExtended.instance().actualDefaultVerticalFov
        horizontalFov = FovExtended.calcHorizontalFov(verticalFov)
        scaleHor = screenWidth / horizontalFov if horizontalFov else screenWidth
        scaleVert = screenHeight / verticalFov if verticalFov else screenHeight
        gun = self.typeDescriptor.gun
        minBound, maxBound = gun['pitchLimits']['absolute']
        minStep = (maxBound - minBound) / 63
        turretYawLimits = gun['turretYawLimits']
        maxPitch =gun['pitchLimits']['maxPitch']
        minPitch = gun['pitchLimits']['minPitch']
        dataHor, dataVert = coordinate(yaw, pitch)
        cameraMode = None
        as_event('ON_ANGLES_AIMING')
 def __init__(self):
     self.rotation = 0
     self.showInArcade = config.get('armorPanel/protractor/showInArcade', False)
     self.useCameraRotation = config.get('armorPanel/protractor/useCameraRotation', True)
     self.circle_xscale = 1
     self.circle_x = 0
     self.atRMax = False
     self.atLMax = False
     self.middleLine_x = 0
     self.x = None
     self.y = None
     self.useProtractorTD = False
     self.useProtractorSPG = False
     self.rightArc = None
     self.heightSPG = 0.0
     self.midX = BigWorld.screenWidth() / 2
     self.midY = BigWorld.screenHeight() / 2
     self.leftArc = None
     self.enable = False
     self.realMidLine_right_alpha = 0.0
     self.realMidLine_left_alpha = 0.0
     self.leftLine_x = 0
     self.mask_x = 0
     self.rightLine_x = 0
     self.mask_width = 0
     self.middleLine_txt_text = ""
     self.leftLine_img = "LeftLine"
     self.rightLine_img = "RightLine"
     self.middleLine_img = "middleLine"
     self.xSpacing = config.get('armorPanel/protractor/xSpacing', 0)
     # self.m2pix = config.get('armorPanel/protractor/m2pix', 40.4761904762)
     self.protractorOffsetWhenTD = config.get('armorPanel/protractor/protractorOffsetWhenTD', 43)
Example #6
0
 def __init__(self):
     self.rotation = 0
     self.showInArcade = config.get('armorPanel/protractor/showInArcade',
                                    False)
     self.useCameraRotation = config.get(
         'armorPanel/protractor/useCameraRotation', True)
     self.circle_xscale = 1
     self.circle_x = 0
     self.atRMax = False
     self.atLMax = False
     self.middleLine_x = 0
     self.x = None
     self.y = None
     self.useProtractorTD = False
     self.useProtractorSPG = False
     self.rightArc = None
     self.heightSPG = 0.0
     self.midX = BigWorld.screenWidth() / 2
     self.midY = BigWorld.screenHeight() / 2
     self.leftArc = None
     self.enable = False
     self.realMidLine_right_alpha = 0.0
     self.realMidLine_left_alpha = 0.0
     self.leftLine_x = 0
     self.mask_x = 0
     self.rightLine_x = 0
     self.mask_width = 0
     self.middleLine_txt_text = ""
     self.leftLine_img = "LeftLine"
     self.rightLine_img = "RightLine"
     self.middleLine_img = "middleLine"
     self.xSpacing = config.get('armorPanel/protractor/xSpacing', 0)
     # self.m2pix = config.get('armorPanel/protractor/m2pix', 40.4761904762)
     self.protractorOffsetWhenTD = config.get(
         'armorPanel/protractor/protractorOffsetWhenTD', 43)
Example #7
0
def new_RadialMenu_show(self):
    player = BigWorld.player()
    target = BigWorld.target()
    # Target substitution begins.
    config = g_config['plugins']['radialMenu']
    if target is None and config['useTargetScan']:
        targetScanner = getattr(player.inputHandler, 'XTargetScanner', None)
        if targetScanner is not None:
            target = targetScanner.scanTarget().target
    if target is None and config['useTargetInfo']:
        targetInfo = getattr(player.inputHandler, 'XTargetInfo', None)
        if targetInfo is not None and not targetInfo.isExpired:
            target = targetInfo.getVehicle()
    # Target substitution ends.
    self._RadialMenu__targetID = target.id if target is not None else None
    ctrl = self.sessionProvider.shared.crosshair
    guiScreenWidth, guiScreenHeight = GUI.screenResolution()
    screenRatio = float(guiScreenWidth / BigWorld.screenWidth()), float(
        guiScreenHeight / BigWorld.screenHeight())
    screenPosition = ctrl.getDisaredPosition() if ctrl is not None else (
        guiScreenWidth * 0.5, guiScreenHeight * 0.5)
    crosshairType = self._RadialMenu__getCrosshairType(player, target)
    if self.app is not None:
        self.app.registerGuiKeyHandler(self)
    self.as_showS(crosshairType, screenPosition, screenRatio)
    return
Example #8
0
 def __onMenuShow(self, mouseUsedForShow):
     if not self.__ingameMenuIsVisible():
         screenWidth = BigWorld.screenWidth()
         screenHeight = BigWorld.screenHeight()
         guiScreenWidth, guiScreenHeight = GUI.screenResolution()
         ratioWidth = float(guiScreenWidth / screenWidth)
         ratioHeight = float(guiScreenHeight / screenHeight)
         self.call('RadialMenu.setRatio', [ratioWidth, ratioHeight])
         crosshairType = self.__getCrosshairType()
         keys = self.__getKeysList(crosshairType)
         self.GUICtrl.setFireKeyCode(self.__getFireKeyCode())
         self.GUICtrl.setState(crosshairType)
         self.GUICtrl.updateKeys(keys)
         screenWidth, screenHeight = GUI.screenResolution()
         ctrl = g_sessionProvider.shared.crosshair
         if ctrl is not None:
             mouseLeft, mouseTop = ctrl.getOffset()
         else:
             mouseLeft, mouseTop = (0.0, 0.0)
         x = round(screenWidth / 2.0 * mouseLeft)
         y = -round(screenHeight / 2.0 * mouseTop)
         offset = (x, y)
         self.__showed = True
         self.GUICtrl.show(offset, mouseUsedForShow)
     return
Example #9
0
    def doLayout(self, parent):
        PyGUIBase.doLayout(self, parent)
        y = 1.0
        totalHeight = 0
        itemHeight = 0
        screenWidth = BigWorld.screenWidth()
        for discard, i in self.component.items.children:
            i.position.y = y
            thisItemHeight = i.script.adjustFont(screenWidth)
            if itemHeight == 0 and thisItemHeight != 0:
                itemHeight = thisItemHeight
            y = y - itemHeight - ITEM_MARGIN
            totalHeight += itemHeight + ITEM_MARGIN

        self.component.items.height = totalHeight
        heightMode = self.component.items.heightMode
        self.component.items.heightMode = 'LEGACY'
        self.totalHeightScreenClip = float(self.component.items.height)
        self.component.items.heightMode = heightMode
        self.items.script.maxScroll[1] = max(0, self.totalHeightScreenClip - self.component.height)
        self.items.script.minScroll[1] = 0
        if self.items.script.maxScroll[1] == 0.0:
            self.scrollUp.visible = 0
            self.scrollDown.visible = 0
        self.maxVisibleItems = int(2.0 / itemHeight) if itemHeight > 0 else 1
Example #10
0
 def __onMenuShow(self, mouseUsedForShow):
     if not self.__ingameMenuIsVisible():
         screenWidth = BigWorld.screenWidth()
         screenHeight = BigWorld.screenHeight()
         guiScreenWidth, guiScreenHeight = GUI.screenResolution()
         ratioWidth = float(guiScreenWidth / screenWidth)
         ratioHeight = float(guiScreenHeight / screenHeight)
         self.call('RadialMenu.setRatio', [ratioWidth, ratioHeight])
         crosshairType = self.__getCrosshairType()
         keys = self.__getKeysList(crosshairType)
         self.GUICtrl.setFireKeyCode(self.__getFireKeyCode())
         self.GUICtrl.setState(crosshairType)
         self.GUICtrl.updateKeys(keys)
         screenWidth, screenHeight = GUI.screenResolution()
         ctrl = g_sessionProvider.shared.crosshair
         if ctrl is not None:
             mouseLeft, mouseTop = ctrl.getOffset()
         else:
             mouseLeft, mouseTop = (0.0, 0.0)
         x = round(screenWidth / 2.0 * mouseLeft)
         y = -round(screenHeight / 2.0 * mouseTop)
         offset = (x, y)
         self.__showed = True
         self.GUICtrl.show(offset, mouseUsedForShow)
     return
Example #11
0
    def doLayout(self, parent):
        PyGUIBase.doLayout(self, parent)
        y = 1.0
        totalHeight = 0
        itemHeight = 0
        screenWidth = BigWorld.screenWidth()
        for discard, i in self.component.items.children:
            i.position.y = y
            thisItemHeight = i.script.adjustFont(screenWidth)
            if itemHeight == 0 and thisItemHeight != 0:
                itemHeight = thisItemHeight
            y = y - itemHeight - ITEM_MARGIN
            totalHeight += itemHeight + ITEM_MARGIN

        self.component.items.height = totalHeight
        heightMode = self.component.items.heightMode
        self.component.items.heightMode = 'LEGACY'
        self.totalHeightScreenClip = float(self.component.items.height)
        self.component.items.heightMode = heightMode
        self.items.script.maxScroll[1] = max(
            0, self.totalHeightScreenClip - self.component.height)
        self.items.script.minScroll[1] = 0
        if self.items.script.maxScroll[1] == 0.0:
            self.scrollUp.visible = 0
            self.scrollDown.visible = 0
        self.maxVisibleItems = int(2.0 / itemHeight) if itemHeight > 0 else 1
Example #12
0
 def __resultGPU(self, name, result):
     cur = BigWorld.screenWidth() * BigWorld.screenHeight()
     hd = 2073600.0
     k = math.sqrt(hd / cur)
     rating = int(result * k)
     debug_utils.LOG_INFO(
         'GPU benchmark result:{0}, k:{1}, rating:{2}'.format(
             result, k, rating))
     return self.__resultCB(name, rating)
Example #13
0
    def enable(self, doEnable):
        if self.__isEnabled == doEnable:
            return
        from cameras import FovExtended
        if not doEnable:
            self.__isEnabled = False
            BigWorld.camera(self.__savedCamera)
            BigWorld.wg_enableSuperShot(False, False)
            for k, v in self.__savedWatchers.iteritems():
                BigWorld.setWatcher(k, v)

            FovExtended.instance().enabled = True
            LOG_DEBUG('Vertical screenshot camera is disabled')
            return
        self.__isEnabled = True
        self.__savedCamera = BigWorld.camera()
        FovExtended.instance().enabled = False
        arenaBB = BigWorld.wg_getSpaceBounds()
        centerXZ = Math.Vector2(0.5 * (arenaBB[0] + arenaBB[2]),
                                0.5 * (arenaBB[1] + arenaBB[3]))
        halfSizesXZ = Math.Vector2(0.5 * (arenaBB[2] - arenaBB[0]),
                                   0.5 * (arenaBB[3] - arenaBB[1]))
        camFov = math.radians(15.0)
        camPos = Math.Vector3(centerXZ.x, 0, centerXZ.z)
        aspectRatio = 1.0
        if not BigWorld.isVideoWindowed():
            aspectRatio = BigWorld.getFullScreenAspectRatio()
        else:
            aspectRatio = BigWorld.screenWidth() / BigWorld.screenHeight()
        camPos.y = max(halfSizesXZ.x / math.sin(0.5 * camFov * aspectRatio),
                       halfSizesXZ.y / math.sin(0.5 * camFov))
        camMatr = Math.Matrix()
        camMatr.setRotateYPR(Math.Vector3(0.0, math.pi * 0.5, 0.0))
        camMatr.translation = camPos
        camMatr.invert()
        self.__cam = BigWorld.FreeCamera()
        self.__cam.set(camMatr)
        BigWorld.camera(self.__cam)
        BigWorld.wg_enableSuperShot(True, False)
        self.__savedWatchers = {}
        for name in self.__watcherNames:
            try:
                self.__savedWatchers[name] = BigWorld.getWatcher(name)
                if name.startswith('Visibility'):
                    BigWorld.setWatcher(name, False)
            except TypeError:
                LOG_WARNING('Failed to get/set watcher', name)

        BigWorld.setWatcher('Client Settings/std fog/enabled', False)
        BigWorld.projection().fov = camFov
        BigWorld.setWatcher('Render/Fov', camFov)
        BigWorld.setWatcher('Render/Near Plane', max(0.1, camPos.y - 1000.0))
        BigWorld.setWatcher('Render/Far Plane', camPos.y + 1000.0)
        BigWorld.setWatcher('Render/Objects Far Plane/Enabled', False)
        BigWorld.setWatcher('Render/Shadows/qualityPreset', 7)
        BigWorld.setWatcher('Client Settings/Script tick', False)
        LOG_DEBUG('Vertical screenshot camera is enabled')
Example #14
0
    def enable(self, doEnable):
        if self.__isEnabled == doEnable:
            return
        from cameras import FovExtended
        if not doEnable:
            self.__isEnabled = False
            BigWorld.camera(self.__savedCamera)
            BigWorld.wg_enableSuperShot(False, False)
            for k, v in self.__savedWatchers.iteritems():
                BigWorld.setWatcher(k, v)

            FovExtended.instance().enabled = True
            LOG_DEBUG('Vertical screenshot camera is disabled')
            return
        self.__isEnabled = True
        self.__savedCamera = BigWorld.camera()
        FovExtended.instance().enabled = False
        arenaBB = BigWorld.wg_getSpaceBounds()
        centerXZ = Math.Vector2(0.5 * (arenaBB[0] + arenaBB[2]), 0.5 * (arenaBB[1] + arenaBB[3]))
        halfSizesXZ = Math.Vector2(0.5 * (arenaBB[2] - arenaBB[0]), 0.5 * (arenaBB[3] - arenaBB[1]))
        camFov = math.radians(15.0)
        camPos = Math.Vector3(centerXZ.x, 0, centerXZ.z)
        aspectRatio = 1.0
        if not BigWorld.isVideoWindowed():
            aspectRatio = BigWorld.getFullScreenAspectRatio()
        else:
            aspectRatio = BigWorld.screenWidth() / BigWorld.screenHeight()
        camPos.y = max(halfSizesXZ.x / math.sin(0.5 * camFov * aspectRatio), halfSizesXZ.y / math.sin(0.5 * camFov))
        camMatr = Math.Matrix()
        camMatr.setRotateYPR(Math.Vector3(0.0, math.pi * 0.5, 0.0))
        camMatr.translation = camPos
        camMatr.invert()
        self.__cam = BigWorld.FreeCamera()
        self.__cam.set(camMatr)
        BigWorld.camera(self.__cam)
        BigWorld.wg_enableSuperShot(True, False)
        self.__savedWatchers = {}
        for name in self.__watcherNames:
            try:
                self.__savedWatchers[name] = BigWorld.getWatcher(name)
                if name.startswith('Visibility'):
                    BigWorld.setWatcher(name, False)
            except TypeError:
                LOG_WARNING('Failed to get/set watcher', name)

        BigWorld.setWatcher('Client Settings/std fog/enabled', False)
        BigWorld.projection().fov = camFov
        BigWorld.setWatcher('Render/Fov', camFov)
        BigWorld.setWatcher('Render/Near Plane', max(0.1, camPos.y - 1000.0))
        BigWorld.setWatcher('Render/Far Plane', camPos.y + 1000.0)
        BigWorld.setWatcher('Render/Objects Far Plane/Enabled', False)
        BigWorld.setWatcher('Render/Shadows/qualityPreset', 7)
        BigWorld.setWatcher('Client Settings/Script tick', False)
        LOG_DEBUG('Vertical screenshot camera is enabled')
Example #15
0
 def _getValue(name, setting, force=False):
     if name == _BOOTCAMP_MINIMAP_SIZE_SETTINGS_KEY and setting == KEY_SETTINGS:
         fds = AccountSettings._readSection(
             AccountSettings._readUserSection(), setting)
         if not fds.has_key(name):
             value = 2 if BigWorld.screenWidth(
             ) < BootcampAccountSettings.__SCREEN_WIDTH and BigWorld.screenHeight(
             ) < BootcampAccountSettings.__SCREEN_HEIGHT else 3
             fds.write(name, base64.b64encode(pickle.dumps(value)))
             return value
     return AccountSettings._getValue(name, setting, force)
Example #16
0
 def getScopeRadius(self, direction):
     dirNorm = direction.getNormalized(
     ) * self._context.targetLockShootDistance
     if dirNorm.angle(Vector3(0, 1, 0)):
         axis = dirNorm.cross(Vector3(0, 1, 0)).getNormalized()
     else:
         axis = dirNorm.cross(Vector3(1, 0, 0)).getNormalized()
     dirNorm += axis * dirNorm.length * math.tan(
         self._context.turretControlAimConeAngle
     ) + self._context.basePosition
     res = BigWorld.worldToScreen(dirNorm) - Vector3(
         0.5 * BigWorld.screenWidth(), 0.5 * BigWorld.screenHeight(), 1)
     return res.length
Example #17
0
 def handleMouseEvent(self, comp, event):
     width = float(BigWorld.screenWidth())
     height = float(BigWorld.screenHeight())
     if self.isDragging:
         self.scrollTo(event.cursorPosition[0] + self.cursorDragOffset[0], event.cursorPosition[1] + self.cursorDragOffset[1])
     elif event.dz != 0:
         amt = 1.0 + event.dz / 1000.0
         w, h = self.component.size
         if not BigWorld.isKeyDown(Keys.KEY_LCONTROL):
             self.component.size = (w * amt, h * amt)
         else:
             self.component.size = (w * amt, h)
         self.calcScrollBounds()
     return True
Example #18
0
 def handleMouseEvent(self, comp, event):
     width = float(BigWorld.screenWidth())
     height = float(BigWorld.screenHeight())
     if self.isDragging:
         self.scrollTo(event.cursorPosition[0] + self.cursorDragOffset[0],
                       event.cursorPosition[1] + self.cursorDragOffset[1])
     elif event.dz != 0:
         amt = 1.0 + event.dz / 1000.0
         w, h = self.component.size
         if not BigWorld.isKeyDown(Keys.KEY_LCONTROL):
             self.component.size = (w * amt, h * amt)
         else:
             self.component.size = (w * amt, h)
         self.calcScrollBounds()
     return True
Example #19
0
 def __updateCursorPosition(self):
     player = BigWorld.player()
     reductionPointVector = getReductionPointVector(player.weaponsSettings)
     direction = self._cameraStrategy.cursorDirection
     if self._backRevert < 0:
         p = player.getRotation().getAxisZ()
         angle = p.angle(direction)
         p *= -1
         axis = p.cross(direction)
         self._Q.fromAngleAxis(angle, axis)
         direction = self._Q.rotateVec(p)
     worldPos = direction * reductionPointVector.length * HUD_REDUCTION_POINT_SCALE + player.position
     screenPoint = BigWorld.worldToScreen(worldPos)
     screenPoint = Math.Vector3(
         clamp(0.0, screenPoint.x, BigWorld.screenWidth()),
         clamp(0.0, screenPoint.y, BigWorld.screenHeight()), 1.0)
     self.mousePosition()
Example #20
0
 def show(self):
     player = BigWorld.player()
     target = BigWorld.target()
     self.__targetID = target.id if target is not None else None
     screenWidth = BigWorld.screenWidth()
     screenHeight = BigWorld.screenHeight()
     guiScreenWidth, guiScreenHeight = GUI.screenResolution()
     ratioWidth = float(guiScreenWidth / screenWidth)
     ratioHeight = float(guiScreenHeight / screenHeight)
     ratio = (ratioWidth, ratioHeight)
     crosshairType = self.__getCrosshairType(player, target)
     ctrl = g_sessionProvider.shared.crosshair
     if ctrl is not None:
         position = ctrl.getPosition()
     else:
         position = (guiScreenWidth >> 1, guiScreenHeight >> 1)
     self.as_showS(crosshairType, position, ratio)
     return
Example #21
0
 def show(self):
     player = BigWorld.player()
     target = BigWorld.target()
     self.__targetID = target.id if target is not None else None
     screenWidth = BigWorld.screenWidth()
     screenHeight = BigWorld.screenHeight()
     guiScreenWidth, guiScreenHeight = GUI.screenResolution()
     ratioWidth = float(guiScreenWidth / screenWidth)
     ratioHeight = float(guiScreenHeight / screenHeight)
     ratio = (ratioWidth, ratioHeight)
     crosshairType = self.__getCrosshairType(player, target)
     ctrl = g_sessionProvider.shared.crosshair
     if ctrl is not None:
         position = ctrl.getPosition()
     else:
         position = (guiScreenWidth >> 1, guiScreenHeight >> 1)
     self.as_showS(crosshairType, position, ratio)
     return
 def show(self):
     player = BigWorld.player()
     target = BigWorld.target()
     self.__targetID = target.id if target is not None else None
     screenWidth = BigWorld.screenWidth()
     screenHeight = BigWorld.screenHeight()
     guiScreenWidth, guiScreenHeight = GUI.screenResolution()
     ratioWidth = float(guiScreenWidth / screenWidth)
     ratioHeight = float(guiScreenHeight / screenHeight)
     ratio = (ratioWidth, ratioHeight)
     crosshairType = self.__getCrosshairType(player, target)
     ctrl = self.sessionProvider.shared.crosshair
     if ctrl is not None:
         position = ctrl.getDisaredPosition()
     else:
         position = (guiScreenWidth * 0.5, guiScreenHeight * 0.5)
     if self.app is not None:
         self.app.registerGuiKeyHandler(self)
     self.as_showS(crosshairType, position, ratio)
     return
 def getDamageAngle(authorID):
     import gui.HUDconsts as hudConst
     author = BigWorld.entities.get(authorID)
     if author:
         screenPos = BigWorld.worldToScreen(author.position)
         screenCenterPos = Math.Vector3(BigWorld.screenWidth() / 2,
                                        BigWorld.screenHeight() / 2, 0)
         deltaPos = screenPos - screenCenterPos
         side = deltaPos.z
         deltaPos.z = 0
         deltaPos.normalise()
         pos = deltaPos * hudConst.CIRCLE_HUD_DAMAGE_DIRECTION_R
         if side < 0:
             pos *= -1
         angle = math.atan2(
             pos.x, pos.y
         ) - hudConst.CIRCLE_HUD_DAMAGE_DIRECTION_PICTURE_ROTATION + math.pi
         angle = 2 * math.pi - angle
         return angle
     return 0
Example #24
0
def xvm_screenHCenter():
    return BigWorld.screenWidth() // 2
Example #25
0
def xvm_screenWidth():
    return BigWorld.screenWidth()
Example #26
0
def xvm_XFromRight(x=0):
    screenWidth = BigWorld.screenWidth()
    try:
        return screenWidth - float(x)
    except ValueError:
        return screenWidth
Example #27
0
def xvm_screenWidth():
    return BigWorld.screenWidth()
Example #28
0
def xvm_screenHCenter():
    return BigWorld.screenWidth() // 2