Пример #1
0
 def revert():
     if monitorChanged:
         g_monitorSettings.changeMonitor(cMonitor)
     if windowSizeChanged and not cIsFullScreen:
         g_monitorSettings.changeWindowSize(cWindowSize.width, cWindowSize.height)
     elif not monitorChanged and (videModeChanged or fullScreenChanged):
         BigWorld.changeVideoMode(cVideoMode.index, not cIsFullScreen)
Пример #2
0
 def revert():
     if monitorChanged:
         g_monitorSettings.changeMonitor(cMonitor)
     if windowSizeChanged and not cIsFullScreen:
         g_monitorSettings.changeWindowSize(cWindowSize.width, cWindowSize.height)
     elif not monitorChanged and (videModeChanged or fullScreenChanged):
         BigWorld.changeVideoMode(cVideoMode.index, not cIsFullScreen)
Пример #3
0
    def apply(self, restartApproved):
        if self._settings:
            LOG_DEBUG('Applying video settings: ', self._settings)
            cWindowSize = g_monitorSettings.currentWindowSize
            windowSizeWidth, windowSizeHeight = self.windowSize
            cIsFullScreen = g_monitorSettings.isFullscreen
            isFullscreen = self.fullscreen
            cVideoMode = g_monitorSettings.currentVideoMode
            videoMode = self.videoMode
            monitor = self.monitor
            cMonitor = g_monitorSettings.activeMonitor
            windowSizeChanged = cWindowSize is not None and windowSizeWidth is not None and windowSizeHeight is not None and (
                windowSizeWidth != cWindowSize.width
                or windowSizeHeight != cWindowSize.height)
            monitorChanged = monitor != cMonitor
            videModeChanged = cVideoMode is not None and videoMode is not None and videoMode.index != cVideoMode.index
            fullScreenChanged = isFullscreen != cIsFullScreen
            deviseRecreated = False
            if monitorChanged:
                g_monitorSettings.changeMonitor(monitor)
                deviseRecreated = isFullscreen or cIsFullScreen
            if windowSizeChanged and not isFullscreen:
                deviseRecreated = True
                g_monitorSettings.changeWindowSize(windowSizeWidth,
                                                   windowSizeHeight)
            elif (not monitorChanged or
                  restartApproved) and (videModeChanged or fullScreenChanged):
                deviseRecreated = True
                BigWorld.changeVideoMode(videoMode.index, not isFullscreen)
            self.clear()
            self._core.isDeviseRecreated = deviseRecreated
            if deviseRecreated:

                def wrapper(monitorChanged, windowSizeChanged, cMonitor,
                            cWindowSize, cVideoMode, cIsFullScreen):
                    def revert():
                        if monitorChanged:
                            g_monitorSettings.changeMonitor(cMonitor)
                        if windowSizeChanged and not cIsFullScreen:
                            g_monitorSettings.changeWindowSize(
                                cWindowSize.width, cWindowSize.height)
                        elif not monitorChanged and (videModeChanged
                                                     or fullScreenChanged):
                            BigWorld.changeVideoMode(cVideoMode.index,
                                                     not cIsFullScreen)

                    return revert

                @async
                def confirmator(callback=None):
                    BigWorld.callback(
                        0.0, lambda: DialogsInterface.showI18nConfirmDialog(
                            'graphicsChangeConfirmation', callback,
                            TimerConfirmDialogMeta(
                                'graphicsChangeConfirmation', timer=15)))

                return (confirmator,
                        wrapper(monitorChanged, windowSizeChanged, cMonitor,
                                cWindowSize, cVideoMode, cIsFullScreen))
        return super(VideoSettingsStorage, self).apply(restartApproved)
Пример #4
0
 def _set(self, value):
     windowSize = self.__getWindowSizeByIndex(value)
     if windowSize is None:
         LOG_ERROR('There is no window size by given index', value)
         return
     else:
         g_monitorSettings.changeWindowSize(windowSize)
         self.__lastSelectedWindowSize = windowSize
         return
Пример #5
0
 def _set(self, value):
     windowSize = self.__getWindowSizeByIndex(value)
     if windowSize is None:
         LOG_ERROR('There is no window size by given index', value)
         return
     else:
         g_monitorSettings.changeWindowSize(windowSize)
         self.__lastSelectedWindowSize = windowSize
         return
Пример #6
0
 def revert():
     if monitorChanged:
         g_monitorSettings.changeMonitor(cMonitor)
     if windowSizeChanged and cWindowMode == BigWorld.WindowModeWindowed:
         g_monitorSettings.changeWindowSize(
             cWindowSize.width, cWindowSize.height)
     elif not monitorChanged and (videModeChanged
                                  or windowModeChanged):
         BigWorld.changeVideoMode(cVideoMode.index,
                                  cWindowMode)
Пример #7
0
    def apply(self, restartApproved):
        if self._settings:
            LOG_DEBUG('Applying video settings: ', self._settings)
            cWindowSize = g_monitorSettings.currentWindowSize
            windowSizeWidth, windowSizeHeight = self.windowSize
            cIsFullScreen = g_monitorSettings.isFullscreen
            isFullscreen = self.fullscreen
            cVideoMode = g_monitorSettings.currentVideoMode
            videoMode = self.videoMode
            monitor = self.monitor
            cMonitor = g_monitorSettings.activeMonitor
            windowSizeChanged = cWindowSize is not None and windowSizeWidth is not None and windowSizeHeight is not None and (windowSizeWidth != cWindowSize.width or windowSizeHeight != cWindowSize.height)
            monitorChanged = monitor != cMonitor
            videModeChanged = cVideoMode is not None and videoMode is not None and videoMode.index != cVideoMode.index
            fullScreenChanged = isFullscreen != cIsFullScreen
            deviseRecreated = False
            if monitorChanged:
                g_monitorSettings.changeMonitor(monitor)
                deviseRecreated = isFullscreen or cIsFullScreen
            if windowSizeChanged and not isFullscreen:
                deviseRecreated = True
                g_monitorSettings.changeWindowSize(windowSizeWidth, windowSizeHeight)
            elif (not monitorChanged or restartApproved) and (videModeChanged or fullScreenChanged):
                deviseRecreated = True
                BigWorld.changeVideoMode(videoMode.index, not isFullscreen)
            self.clear()
            self._core.isDeviseRecreated = deviseRecreated
            if deviseRecreated:

                def wrapper(monitorChanged, windowSizeChanged, cMonitor, cWindowSize, cVideoMode, cIsFullScreen):

                    def revert():
                        if monitorChanged:
                            g_monitorSettings.changeMonitor(cMonitor)
                        if windowSizeChanged and not cIsFullScreen:
                            g_monitorSettings.changeWindowSize(cWindowSize.width, cWindowSize.height)
                        elif not monitorChanged and (videModeChanged or fullScreenChanged):
                            BigWorld.changeVideoMode(cVideoMode.index, not cIsFullScreen)

                    return revert

                if isPlayerAccount():

                    @async
                    def confirmator(callback = None):
                        BigWorld.callback(0.0, lambda : DialogsInterface.showI18nConfirmDialog('graphicsChangeConfirmation', callback, TimerConfirmDialogMeta('graphicsChangeConfirmation', timer=15)))

                else:
                    confirmator = 'graphicsChangeConfirmation'
                return (confirmator, wrapper(monitorChanged, windowSizeChanged, cMonitor, cWindowSize, cVideoMode, cIsFullScreen))
        return super(VideoSettingsStorage, self).apply(restartApproved)
Пример #8
0
 def revert():
     if monitorChanged:
         g_monitorSettings.changeMonitor(cMonitor)
     if borderlessSizeChanged and cWindowMode == BigWorld.WindowModeBorderless:
         g_monitorSettings.changeBorderlessSize(
             cBorderlessSize.width, cBorderlessSize.height)
     elif windowSizeChanged and cWindowMode == BigWorld.WindowModeWindowed:
         g_monitorSettings.changeWindowSize(
             cWindowSize.width, cWindowSize.height)
     elif not monitorChanged and (videModeChanged
                                  or windowModeChanged):
         BigWorld.changeVideoMode(cVideoMode.index,
                                  cWindowMode)
     BigWorld.changeFullScreenAspectRatio(cAspectRation)
Пример #9
0
    def apply(self, restartApproved):
        if self._settings:
            LOG_DEBUG('Applying video settings: ', self._settings)
            cWindowSize = g_monitorSettings.currentWindowSize
            windowSizeWidth, windowSizeHeight = self.windowSize
            cBorderlessSize = g_monitorSettings.currentBorderlessSize
            borderlessSizeWidth, borderlessSizeHeight = self.borderlessSize
            cWindowMode = g_monitorSettings.windowMode
            windowMode = self.windowMode
            cMonitor = g_monitorSettings.activeMonitor
            monitor = self.monitor
            exclusiveFullscreenMonitorIndex = g_monitorSettings.noRestartExclusiveFullscreenMonitorIndex
            restartNeeded = windowMode == BigWorld.WindowModeExclusiveFullscreen and monitor != exclusiveFullscreenMonitorIndex
            cVideoMode = g_monitorSettings.currentVideoMode
            cAspectRation = float(cVideoMode.width) / cVideoMode.height
            videoMode = self.videoModeForAdapterOutputIndex(monitor)
            aspectRation = float(videoMode.width) / videoMode.height
            windowSizeChanged = cWindowSize is not None and windowSizeWidth is not None and windowSizeHeight is not None and (
                windowSizeWidth != cWindowSize.width
                or windowSizeHeight != cWindowSize.height)
            borderlessSizeChanged = cBorderlessSize is not None and borderlessSizeWidth is not None and borderlessSizeHeight is not None and (
                borderlessSizeWidth != cBorderlessSize.width
                or borderlessSizeHeight != cBorderlessSize.height)
            monitorChanged = monitor != cMonitor
            videModeChanged = cVideoMode is not None and videoMode is not None and videoMode.index != cVideoMode.index
            windowModeChanged = windowMode != cWindowMode
            deviseRecreated = False
            if monitorChanged:
                g_monitorSettings.changeMonitor(monitor)
                deviseRecreated = windowMode == BigWorld.WindowModeExclusiveFullscreen or cWindowMode == BigWorld.WindowModeExclusiveFullscreen
            if restartNeeded:
                deviseRecreated = False
                LOG_DEBUG(
                    "VideoSettingsStorage apply is expecting a restart so it didn't invoke changeVideoMode."
                )
            elif windowSizeChanged and windowMode == BigWorld.WindowModeWindowed:
                deviseRecreated = True
                g_monitorSettings.changeWindowSize(windowSizeWidth,
                                                   windowSizeHeight)
            elif borderlessSizeChanged and windowMode == BigWorld.WindowModeBorderless:
                deviseRecreated = True
                g_monitorSettings.changeBorderlessSize(borderlessSizeWidth,
                                                       borderlessSizeHeight)
            elif (not monitorChanged or
                  restartApproved) and (videModeChanged or windowModeChanged):
                deviseRecreated = True
                BigWorld.changeVideoMode(videoMode.index, windowMode)
            BigWorld.changeFullScreenAspectRatio(aspectRation)
            self.clear()
            self._core.isDeviseRecreated = deviseRecreated
            if deviseRecreated:

                def wrapper(monitorChanged, windowSizeChanged,
                            borderlessSizeChanged, cMonitor, cWindowSize,
                            cVideoMode, cWindowMode, cAspectRation):
                    def revert():
                        if monitorChanged:
                            g_monitorSettings.changeMonitor(cMonitor)
                        if borderlessSizeChanged and cWindowMode == BigWorld.WindowModeBorderless:
                            g_monitorSettings.changeBorderlessSize(
                                cBorderlessSize.width, cBorderlessSize.height)
                        elif windowSizeChanged and cWindowMode == BigWorld.WindowModeWindowed:
                            g_monitorSettings.changeWindowSize(
                                cWindowSize.width, cWindowSize.height)
                        elif not monitorChanged and (videModeChanged
                                                     or windowModeChanged):
                            BigWorld.changeVideoMode(cVideoMode.index,
                                                     cWindowMode)
                        BigWorld.changeFullScreenAspectRatio(cAspectRation)

                    return revert

                @async
                def confirmator(callback=None):
                    BigWorld.callback(
                        0.0, lambda: DialogsInterface.showI18nConfirmDialog(
                            'graphicsChangeConfirmation', callback,
                            TimerConfirmDialogMeta(
                                'graphicsChangeConfirmation', timer=15)))

                return (confirmator,
                        wrapper(monitorChanged, windowSizeChanged,
                                borderlessSizeChanged, cMonitor, cWindowSize,
                                cVideoMode, cWindowMode, cAspectRation))
        return super(VideoSettingsStorage, self).apply(restartApproved)