Example #1
0
    def __checkPresetForCurrent(self, presetIdx):
        for name, value in graphics.getGraphicsPresets(presetIdx).iteritems():
            graphicSetting = graphics.getGraphicsSetting(name)
            if graphicSetting is None or value != graphicSetting.value:
                return False

        return True
Example #2
0
    def __checkPresetForCurrent(self, presetIdx):
        for name, value in graphics.getGraphicsPresets(presetIdx).iteritems():
            graphicSetting = graphics.getGraphicsSetting(name)
            if graphicSetting is None or value != graphicSetting.value:
                return False

        return True
Example #3
0
    def __settingsDiffPreprocessing(self, diff):
        """
        This method will be invoked before any settings processing.
        Prepare settings to apply (splitting or concatenating and etc.)
        
        :param diff: [dict(settingName->settingValue)] new settings values
        :return: the same input dict with some modifications
        """
        smoothing = diff.pop('smoothing', None)
        if smoothing is not None:
            rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
            renderOptions = graphics.getGraphicsSetting(rppSetting)
            isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
            if rppSetting in diff:
                isAdvancedRender = diff[rppSetting] == _DEFERRED_RENDER_IDX
            if isAdvancedRender:
                diff[settings_constants.GRAPHICS.CUSTOM_AA] = smoothing
            else:
                diff[settings_constants.GRAPHICS.MULTISAMPLING] = smoothing
        for option in settings_constants.FEEDBACK.ALL():
            feedbackTab = diff.pop(option, None)
            if feedbackTab is not None:
                diff.update(feedbackTab)

        return diff
Example #4
0
 def getApplyMethod(self):
     data = graphics.getGraphicsSetting(self.name)
     if data is not None:
         if data.needRestart:
             return APPLY_METHOD.RESTART
         if data.delayed:
             return APPLY_METHOD.DELAYED
     return APPLY_METHOD.NORMAL
Example #5
0
 def getApplyMethod(self):
     data = graphics.getGraphicsSetting(self.name)
     if data is not None:
         if data.needRestart:
             return APPLY_METHOD.RESTART
         if data.delayed:
             return APPLY_METHOD.DELAYED
     return APPLY_METHOD.NORMAL
Example #6
0
 def preview(self, settingName, value):
     if settingName == 'smoothing':
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             g_settingsCore.previewSetting(settings_constants.GRAPHICS.CUSTOM_AA, value)
         else:
             g_settingsCore.previewSetting(settings_constants.GRAPHICS.MULTISAMPLING, value)
         return
     g_settingsCore.previewSetting(settingName, value)
Example #7
0
 def __settingsDiffPreprocessing(self, diff):
     if constants.GRAPHICS.SMOOTHING in diff:
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if rppSetting in diff:
             isAdvancedRender = diff[rppSetting] == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             diff[constants.GRAPHICS.CUSTOM_AA] = diff[constants.GRAPHICS.SMOOTHING]
         else:
             diff[constants.GRAPHICS.MULTISAMPLING] = diff[constants.GRAPHICS.SMOOTHING]
     return diff
Example #8
0
 def __settingsDiffPreprocessing(self, diff):
     smoothing = diff.pop('smoothing', None)
     if smoothing is not None:
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if rppSetting in diff:
             isAdvancedRender = diff[rppSetting] == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             diff[settings_constants.GRAPHICS.CUSTOM_AA] = smoothing
         else:
             diff[settings_constants.GRAPHICS.MULTISAMPLING] = smoothing
     return diff
Example #9
0
 def preview(self, settingName, value):
     if settingName == 'smoothing':
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             g_settingsCore.previewSetting(
                 settings_constants.GRAPHICS.CUSTOM_AA, value)
         else:
             g_settingsCore.previewSetting(
                 settings_constants.GRAPHICS.MULTISAMPLING, value)
         return
     g_settingsCore.previewSetting(settingName, value)
Example #10
0
 def __settingsDiffPreprocessing(self, diff):
     smoothing = diff.pop('smoothing', None)
     if smoothing is not None:
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if rppSetting in diff:
             isAdvancedRender = diff[rppSetting] == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             diff[settings_constants.GRAPHICS.CUSTOM_AA] = smoothing
         else:
             diff[settings_constants.GRAPHICS.MULTISAMPLING] = smoothing
     return diff
Example #11
0
    def _getOptions(self):
        data = graphics.getGraphicsSetting(self.name)
        if data is not None:
            options = []
            for idx, (label, supported, advanced, _) in enumerate(data.options):
                if supported:
                    options.append({'label': '#settings:graphicsQuality/%s' % str(label),
                     'data': idx,
                     'advanced': advanced})

            return options
        else:
            return
Example #12
0
def _requestGraphicsSettings(callback):
    settings = {'CUSTOM_AA_MODE': graphics.getCustomAAMode(),
     'MULTISAMPLING': graphics.getMultisamplingType()}
    settingNames = ('TEXTURE_QUALITY', 'LIGHTING_QUALITY', 'SHADOWS_QUALITY', 'SNIPER_MODE_GRASS_ENABLED', 'EFFECTS_QUALITY', 'SNIPER_MODE_EFFECTS_QUALITY', 'FLORA_QUALITY', 'POST_PROCESSING_QUALITY', 'VEHICLE_DUST_ENABLED', 'RENDER_PIPELINE')
    for settingName in settingNames:
        setting = graphics.getGraphicsSetting(settingName)
        if setting is not None:
            settings[settingName] = setting.value
        else:
            LOG_DEBUG('Settings "%s" not found!' % settingName)

    callback({'settings': settings})
    return
    def graphicsSettings(self, cmd):
        settings = {}
        settingNames = ('TEXTURE_QUALITY', 'LIGHTING_QUALITY',
                        'SHADOWS_QUALITY', 'SNIPER_MODE_GRASS_ENABLED',
                        'EFFECTS_QUALITY', 'SNIPER_MODE_EFFECTS_QUALITY',
                        'FLORA_QUALITY', 'POST_PROCESSING_QUALITY',
                        'VEHICLE_DUST_ENABLED', 'CUSTOM_AA_MODE',
                        'MSAA_QUALITY', 'RENDER_PIPELINE')
        for settingName in settingNames:
            setting = graphics.getGraphicsSetting(settingName)
            if setting is not None:
                settings[settingName] = setting.value
            LOG_DEBUG('Settings "%s" not found!' % settingName)

        return {'request_id': 'graphics_settings', 'settings': settings}
Example #14
0
 def preview(self, settingName, value):
     """
     Preview settings with given value. Preview setting can be reverted to the original
     value by settingObj.revert() call.
     
     :param settingName: setting name to preview
     :param value: setting value to preview
     """
     if settingName == 'smoothing':
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             g_settingsCore.previewSetting(settings_constants.GRAPHICS.CUSTOM_AA, value)
         else:
             g_settingsCore.previewSetting(settings_constants.GRAPHICS.MULTISAMPLING, value)
         return
     g_settingsCore.previewSetting(settingName, value)
Example #15
0
    def _getOptions(self):
        data = graphics.getGraphicsSetting(self.name)
        if data is not None:
            options = []
            for idx, (label, supported, advanced,
                      _) in enumerate(data.options):
                if supported:
                    options.append({
                        'label':
                        '#settings:graphicsQuality/%s' % str(label),
                        'data':
                        idx,
                        'advanced':
                        advanced
                    })

            return options
        else:
            return
Example #16
0
 def preview(self, settingName, value):
     """
     Preview settings with given value. Preview setting can be reverted to the original
     value by settingObj.revert() call.
     
     :param settingName: setting name to preview
     :param value: setting value to preview
     """
     if settingName == 'smoothing':
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             self.settingsCore.previewSetting(
                 settings_constants.GRAPHICS.CUSTOM_AA, value)
         else:
             self.settingsCore.previewSetting(
                 settings_constants.GRAPHICS.MULTISAMPLING, value)
         return
     self.settingsCore.previewSetting(settingName, value)
Example #17
0
 def __settingsDiffPreprocessing(self, diff):
     """
     This method will be invoked before any settings processing.
     Prepare settings to apply (splitting or concatenating and etc.)
     
     :param diff: [dict(settingName->settingValue)] new settings values
     :return: the same input dict with some modifications
     """
     smoothing = diff.pop('smoothing', None)
     if smoothing is not None:
         rppSetting = graphics.GRAPHICS_SETTINGS.RENDER_PIPELINE
         renderOptions = graphics.getGraphicsSetting(rppSetting)
         isAdvancedRender = renderOptions.value == _DEFERRED_RENDER_IDX
         if rppSetting in diff:
             isAdvancedRender = diff[rppSetting] == _DEFERRED_RENDER_IDX
         if isAdvancedRender:
             diff[settings_constants.GRAPHICS.CUSTOM_AA] = smoothing
         else:
             diff[settings_constants.GRAPHICS.MULTISAMPLING] = smoothing
     return diff
Example #18
0
 def _get(self):
     setting = graphics.getGraphicsSetting(self.name)
     if setting is not None:
         return setting.value
     else:
         return
Example #19
0
 def _get(self):
     setting = graphics.getGraphicsSetting(self.name)
     if setting is not None:
         return setting.value
     else:
         return