Example #1
0
def _hideMouseCursor(clipCursor = None):
    BigWorld.setCursor(BigWorld.dcursor())
    GUI.mcursor().visible = False
    GUI.mcursor().clipped = True if clipCursor is None else clipCursor
    CursorPositionData.POSITION = GUI.mcursor().position
    _triggerMouseOutEventsOnScaleform()
    return
Example #2
0
def _showMouseCursor(clipCursor = None):
    BigWorld.setCursor(GUI.mcursor())
    if not GUI.mcursor().visible:
        GUI.mcursor().position = CursorPositionData.POSITION
    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False if clipCursor is None else clipCursor
    return
Example #3
0
 def detachCursor(self, automaticallyHide):
     if self.__isActivated:
         LOG_DEBUG('Cursor detach')
         BigWorld.setCursor(None)
         self.__isActivated = False
     if automaticallyHide:
         self.hide()
Example #4
0
def showCursor():
    """not scaleform specific. show the bigworld mouse cursor"""
    import GUI
    import BigWorld
    c = GUI.mcursor()
    c.visible = 1
    BigWorld.setCursor(c)
Example #5
0
def launch(spaceName):
    global g_offlineModeEnabled
    global g_spaceID
    global g_videoCamera
    print 'Entering offline space', spaceName
    BigWorld.clearAllSpaces()
    BigWorld.worldDrawEnabled(False)
    _displayGUI(spaceName)
    g_spaceID = BigWorld.createSpace()
    BigWorld.addSpaceGeometryMapping(g_spaceID, None, spaceName)
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = False
    GUI.mcursor().clipped = True
    g_offlineModeEnabled = True
    BigWorld.callback(1.0, _offlineLoadCheck)
    rootSection = ResMgr.openSection(AvatarInputHandler._INPUT_HANDLER_CFG)
    videoSection = rootSection['videoMode']
    videoCameraSection = videoSection['camera']
    g_videoCamera = VideoCamera(videoCameraSection)
    g_videoCamera.enable(camMatrix=mathUtils.createTranslationMatrix((0.0, 0.0,
                                                                      0.0)))
    BigWorld.camera().spaceID = g_spaceID
    import game
    game.handleKeyEvent = handleKeyEvent
    game.handleMouseEvent = handleMouseEvent
    BigWorld.player = lambda: g_fakeAvatar
Example #6
0
def forceShowCursor(show):
    if show:
        BigWorld.setCursor(GUI.mcursor())
        GUI.mcursor().visible = True
    else:
        BigWorld.setCursor(BigWorld.dcursor())
        GUI.mcursor().visible = False
Example #7
0
def showCursor():
    """not scaleform specific. show the bigworld mouse cursor"""
    import GUI
    import BigWorld
    c = GUI.mcursor()
    c.visible = 1
    BigWorld.setCursor(c)
Example #8
0
def forceShowCursor(show):
    if show:
        BigWorld.setCursor(GUI.mcursor())
        GUI.mcursor().visible = True
    else:
        BigWorld.setCursor(BigWorld.dcursor())
        GUI.mcursor().visible = False
Example #9
0
def clear():
    for x in GUI.roots():
        GUI.delRoot(x)

    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    BigWorld.setCursor(GUI.mcursor())
Example #10
0
def launch(spaceName):
    global g_enablePostProcessing
    global g_offlineModeEnabled
    print 'Entering offline space', spaceName
    BigWorld.clearAllSpaces()
    BigWorld.worldDrawEnabled(False)
    _displayGUI(spaceName)
    spaceID = BigWorld.createSpace()
    BigWorld.addSpaceGeometryMapping(spaceID, None, spaceName)
    _loadCameraTransforms()
    camera = BigWorld.FreeCamera()
    camera.spaceID = spaceID
    BigWorld.camera(camera)
    _setCameraTransform(g_curCameraTransform)
    BigWorld.camera().fixed = True
    BigWorld.projection().fov = math.radians(75.0)
    BigWorld.setWatcher('Client Settings/Strafe Rate', 175.0)
    BigWorld.setWatcher('Client Settings/Camera Mass', 5.0)
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    g_offlineModeEnabled = True
    BigWorld.callback(1.0, _offlineLoadCheck)
    g_postProcessing.init()
    _enablePostProcessing(g_enablePostProcessing, 'arcade')
    return
Example #11
0
def launch(spaceName):
    global g_offlineModeEnabled
    global g_spaceID
    global g_videoCamera
    print 'Entering offline space', spaceName
    BigWorld.clearAllSpaces()
    BigWorld.worldDrawEnabled(False)
    _displayGUI(spaceName)
    g_spaceID = BigWorld.createSpace()
    BigWorld.addSpaceGeometryMapping(g_spaceID, None, spaceName)
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = False
    GUI.mcursor().clipped = True
    g_offlineModeEnabled = True
    BigWorld.callback(1.0, _offlineLoadCheck)
    rootSection = ResMgr.openSection(AvatarInputHandler._INPUT_HANDLER_CFG)
    videoSection = rootSection['videoMode']
    videoCameraSection = videoSection['camera']
    g_videoCamera = VideoCamera(videoCameraSection)
    g_videoCamera.enable(camMatrix=mathUtils.createTranslationMatrix((0.0, 0.0, 0.0)))
    BigWorld.camera().spaceID = g_spaceID
    import game
    game.handleKeyEvent = handleKeyEvent
    game.handleMouseEvent = handleMouseEvent
    BigWorld.player = lambda : g_fakeAvatar
    return
Example #12
0
 def detachCursor(self):
     if self.__isActivated:
         LOG_DEBUG('Cursor is detached')
         BigWorld.setCursor(None)
         self.__isActivated = False
     self.hide()
     return
Example #13
0
 def detachCursor(self, automaticallyHide):
     if self.__isActivated:
         LOG_DEBUG('Cursor detach')
         BigWorld.setCursor(None)
         self.__isActivated = False
     if automaticallyHide:
         self.hide()
Example #14
0
def clear():
    for x in GUI.roots():
        GUI.delRoot(x)

    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    BigWorld.setCursor(GUI.mcursor())
def launch(spaceName):
    global g_offlineModeEnabled
    print 'Entering offline space', spaceName
    BigWorld.clearAllSpaces()
    BigWorld.worldDrawEnabled(False)
    _displayGUI(spaceName)
    spaceID = BigWorld.createSpace()
    visibilityMask = game_mode_emulator.gameModeVisibilityMask()
    BigWorld.addSpaceGeometryMapping(spaceID, None, spaceName, visibilityMask)
    _loadCameraTransforms()
    camera = BigWorld.FreeCamera()
    camera.spaceID = spaceID
    BigWorld.camera(camera)
    _setCameraTransform(g_curCameraTransform)
    BigWorld.camera().fixed = True
    BigWorld.projection().fov = math.radians(75.0)
    BigWorld.setWatcher('Client Settings/Strafe Rate', 175.0)
    BigWorld.setWatcher('Client Settings/Camera Mass', 5.0)
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    g_offlineModeEnabled = True
    BigWorld.callback(1.0, _offlineLoadCheck)
    createFakeAvatar()
    return
Example #16
0
def launch(spaceName):
    global g_enablePostProcessing
    global g_offlineModeEnabled
    print 'Entering offline space', spaceName
    BigWorld.clearAllSpaces()
    BigWorld.worldDrawEnabled(False)
    _displayGUI(spaceName)
    spaceID = BigWorld.createSpace()
    BigWorld.addSpaceGeometryMapping(spaceID, None, spaceName)
    _loadCameraTransforms()
    camera = BigWorld.FreeCamera()
    camera.spaceID = spaceID
    BigWorld.camera(camera)
    _setCameraTransform(g_curCameraTransform)
    BigWorld.camera().fixed = True
    BigWorld.projection().fov = math.radians(75.0)
    BigWorld.setWatcher('Client Settings/Strafe Rate', 175.0)
    BigWorld.setWatcher('Client Settings/Camera Mass', 5.0)
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    g_offlineModeEnabled = True
    BigWorld.callback(1.0, _offlineLoadCheck)
    g_postProcessing.init()
    _enablePostProcessing(g_enablePostProcessing, 'arcade')
    return
Example #17
0
def testWindow():
    BigWorld.camera(BigWorld.CursorCamera())
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
    clear()
    w = GUI.load('gui/tests/window.gui')
    GUI.addRoot(w)
    return w
Example #18
0
 def attachCursor(self, automaticallyShow):
     if automaticallyShow:
         self.show()
     if not self.__isActivated:
         mcursor = GUI.mcursor()
         mcursor.visible = False
         LOG_DEBUG('Cursor attach')
         BigWorld.setCursor(mcursor)
         self.__isActivated = True
Example #19
0
 def attachCursor(self, automaticallyShow):
     if automaticallyShow:
         self.show()
     if not self.__isActivated:
         mcursor = GUI.mcursor()
         mcursor.visible = False
         LOG_DEBUG('Cursor attach')
         BigWorld.setCursor(mcursor)
         self.__isActivated = True
Example #20
0
 def detachCursor(self):
     mcursor = GUI.mcursor()
     if mcursor.active:
         _logger.debug('Cursor is detached')
         if self.__savedMCursorPos is not None:
             left, top = self.__savedMCursorPos
             GUI.syncMousePosition(left, top)
         BigWorld.setCursor(None)
     self.hide()
     BigWorld.callback(0.0, self.__restoreDeviceMousePosition)
     return
Example #21
0
 def detachCursor(self):
     """
     Mouse cursor detach and give control camera.
     """
     if self.__isActivated:
         LOG_DEBUG('Cursor is detached')
         BigWorld.setCursor(None)
         self.__isActivated = False
     self.hide()
     BigWorld.callback(0.0, self.__restoreDeviceMousePosition)
     return
Example #22
0
 def attachCursor(self, flags=_CTRL_FLAG.GUI_ENABLED):
     if flags & _CTRL_FLAG.CURSOR_VISIBLE > 0:
         self.show()
     else:
         self.hide()
     mcursor = GUI.mcursor()
     if not mcursor.active:
         mouseLeft, mouseTop = mcursor.position
         self.__saveDeviceMousePosition(mouseLeft, mouseTop)
         _logger.debug('Cursor is attached')
         BigWorld.setCursor(mcursor)
Example #23
0
 def detachCursor(self):
     """
     Mouse cursor detach and give control camera.
     """
     if self.__isActivated:
         LOG_DEBUG('Cursor is detached')
         BigWorld.setCursor(None)
         self.__isActivated = False
     self.hide()
     BigWorld.callback(0.0, self.__restoreDeviceMousePosition)
     return
Example #24
0
 def attachCursor(self, flags = _CTRL_FLAG.GUI_ENABLED):
     if not flags & _CTRL_FLAG.CURSOR_ATTACHED:
         raise AssertionError('Flag CURSOR_ATTACHED is not defined')
         if flags & _CTRL_FLAG.CURSOR_VISIBLE > 0:
             self.show()
         else:
             self.hide()
         mcursor = self.__isActivated or GUI.mcursor()
         mcursor.visible = False
         LOG_DEBUG('Cursor is attached')
         BigWorld.setCursor(mcursor)
         self.__isActivated = True
Example #25
0
 def detachCursor(self):
     """
     Mouse cursor detach and give control camera.
     """
     mcursor = GUI.mcursor()
     if mcursor.active:
         LOG_DEBUG('Cursor is detached')
         if self.__savedMCursorPos is not None:
             left, top = self.__savedMCursorPos
             GUI.syncMousePosition(left, top)
         BigWorld.setCursor(None)
     self.hide()
     BigWorld.callback(0.0, self.__restoreDeviceMousePosition)
     return
Example #26
0
def showCursor(show):
    global _mouseModeRefCount
    if show:
        _mouseModeRefCount += 1
        if _mouseModeRefCount > 0:
            BigWorld.setCursor(GUI.mcursor())
            GUI.mcursor().visible = True
    else:
        _mouseModeRefCount -= 1
        if _mouseModeRefCount == 0:
            BigWorld.setCursor(BigWorld.dcursor())
            GUI.mcursor().visible = False
        if _mouseModeRefCount < 0:
            WARNING_MSG('mouseModeRefCount is negative!')
Example #27
0
def showCursor(show):
    global _mouseModeRefCount
    if show:
        _mouseModeRefCount += 1
        if _mouseModeRefCount > 0:
            BigWorld.setCursor(GUI.mcursor())
            GUI.mcursor().visible = True
    else:
        _mouseModeRefCount -= 1
        if _mouseModeRefCount == 0:
            BigWorld.setCursor(BigWorld.dcursor())
            GUI.mcursor().visible = False
        if _mouseModeRefCount < 0:
            WARNING_MSG('mouseModeRefCount is negative!')
Example #28
0
 def attachCursor(self, flags = _CTRL_FLAG.GUI_ENABLED):
     """
     Mouse cursor activate. Gets mouse cursor, it hide and activate. Client
     uses Scaleform custom mouse cursor - movie clip witch receive notifications
     about mouse movement, left mouse button press and mouse wheel events.
     :param flags: determine whether Flash cursor should be shown
     """
     if not flags & _CTRL_FLAG.CURSOR_ATTACHED:
         raise AssertionError('Flag CURSOR_ATTACHED is not defined')
         if flags & _CTRL_FLAG.CURSOR_VISIBLE > 0:
             self.show()
         else:
             self.hide()
         mcursor = GUI.mcursor()
         mcursor.visible = mcursor.active or False
         mouseLeft, mouseTop = mcursor.position
         self.__saveDeviceMousePosition(mouseLeft, mouseTop)
         LOG_DEBUG('Cursor is attached')
         BigWorld.setCursor(mcursor)
Example #29
0
 def attachCursor(self, flags = _CTRL_FLAG.GUI_ENABLED):
     """
     Mouse cursor activate. Gets mouse cursor, it hide and activate. Client
     uses Scaleform custom mouse cursor - movie clip witch receive notifications
     about mouse movement, left mouse button press and mouse wheel events.
     :param flags: determine whether Flash cursor should be shown
     """
     if not flags & _CTRL_FLAG.CURSOR_ATTACHED:
         raise AssertionError('Flag CURSOR_ATTACHED is not defined')
         if flags & _CTRL_FLAG.CURSOR_VISIBLE > 0:
             self.show()
         else:
             self.hide()
         mcursor = self.__isActivated or GUI.mcursor()
         mcursor.visible = False
         mouseLeft, mouseTop = mcursor.position
         self.__saveDeviceMousePosition(mouseLeft, mouseTop)
         LOG_DEBUG('Cursor is attached')
         BigWorld.setCursor(mcursor)
         self.__isActivated = True
Example #30
0
def showCursor():
    import GUI
    import BigWorld
    c = GUI.mcursor()
    c.visible = 1
    BigWorld.setCursor(c)
Example #31
0
def setup():
    BigWorld.camera(BigWorld.CursorCamera())
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
Example #32
0
 def detachCursor(self):
     if self.__activated:
         BigWorld.setCursor(None)
         self.__activated = False
     return
Example #33
0
 def activateCursor(self):
     if not self.__activated:
         mcursor = GUI.mcursor()
         mcursor.visible = False
         BigWorld.setCursor(mcursor)
         self.__activated = True
Example #34
0
        game
        localReSort
        globalReSort
        mouseEvents
        mouseButtonFocus
        
        To execute a test, type GUITest.testname() into the Python console.             
        You can use GUITest.clear() to remove all GUI components from the screen.
"""
import math
import BigWorld, GUI, Math
import Keys
import random
from functools import partial
BigWorld.camera(BigWorld.CursorCamera())
BigWorld.setCursor(GUI.mcursor())
GUI.mcursor().visible = True

def clear():
    for x in GUI.roots():
        GUI.delRoot(x)

    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    BigWorld.setCursor(GUI.mcursor())


def _setAllModeCombinations(c, name):
    setattr(c, name, 'PIXEL')
    setattr(c, name, 'LEGACY')
    setattr(c, name, 'PIXEL')
Example #35
0
def setup():
    BigWorld.camera(BigWorld.CursorCamera())
    BigWorld.setCursor(GUI.mcursor())
    GUI.mcursor().visible = True
Example #36
0
 def activateCursor(self):
     if not self.__activated:
         mcursor = GUI.mcursor()
         mcursor.visible = False
         BigWorld.setCursor(mcursor)
         self.__activated = True
Example #37
0
 def detachCursor(self):
     if self.__activated:
         BigWorld.setCursor(None)
         self.__activated = False
Example #38
0
        game
        localReSort
        globalReSort
        mouseEvents
        mouseButtonFocus
        
        To execute a test, type GUITest.testname() into the Python console.             
        You can use GUITest.clear() to remove all GUI components from the screen.
"""
import math
import BigWorld, GUI, Math
import Keys
import random
from functools import partial
BigWorld.camera(BigWorld.CursorCamera())
BigWorld.setCursor(GUI.mcursor())
GUI.mcursor().visible = True

def clear():
    for x in GUI.roots():
        GUI.delRoot(x)

    GUI.mcursor().visible = True
    GUI.mcursor().clipped = False
    BigWorld.setCursor(GUI.mcursor())


def _setAllModeCombinations(c, name):
    setattr(c, name, 'PIXEL')
    setattr(c, name, 'LEGACY')
    setattr(c, name, 'PIXEL')