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
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
def detachCursor(self, automaticallyHide): if self.__isActivated: LOG_DEBUG('Cursor detach') BigWorld.setCursor(None) self.__isActivated = False if automaticallyHide: self.hide()
def showCursor(): """not scaleform specific. show the bigworld mouse cursor""" import GUI import BigWorld c = GUI.mcursor() c.visible = 1 BigWorld.setCursor(c)
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
def forceShowCursor(show): if show: BigWorld.setCursor(GUI.mcursor()) GUI.mcursor().visible = True else: BigWorld.setCursor(BigWorld.dcursor()) GUI.mcursor().visible = False
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_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
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
def detachCursor(self): if self.__isActivated: LOG_DEBUG('Cursor is detached') BigWorld.setCursor(None) self.__isActivated = False self.hide() return
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
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
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
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
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
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)
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
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
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!')
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)
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
def showCursor(): import GUI import BigWorld c = GUI.mcursor() c.visible = 1 BigWorld.setCursor(c)
def setup(): BigWorld.camera(BigWorld.CursorCamera()) BigWorld.setCursor(GUI.mcursor()) GUI.mcursor().visible = True
def detachCursor(self): if self.__activated: BigWorld.setCursor(None) self.__activated = False return
def activateCursor(self): if not self.__activated: mcursor = GUI.mcursor() mcursor.visible = False BigWorld.setCursor(mcursor) self.__activated = True
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')
def detachCursor(self): if self.__activated: BigWorld.setCursor(None) self.__activated = False