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
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
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
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)
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
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
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)
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
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}
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)
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
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)
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
def _get(self): setting = graphics.getGraphicsSetting(self.name) if setting is not None: return setting.value else: return