API ReferenceGE Extensionscoresettings
Graphics Quality Group
Reusable class for applying named quality presets to groups of TorqueScript console variables.
Reusable class for applying named quality presets to groups of TorqueScript console variables.
Overview
core/settings/graphicsQualityGroup - A class factory (not an extension). Instantiated by graphic.lua to manage lighting, shadows, shaders, textures, and mesh quality groups. Each instance loads a quality-levels definition module and applies named presets.
Class Methods
| Method | Description |
|---|---|
C:init(filename, groupName) | Loads quality levels from the given module and sets group name |
C:applyLevel(levelString) | Applies the named preset (e.g. "High") to console variables |
C:getCurrentLevel() | Returns the quality-level table for the current level |
C:getCurrentLevelId() | Returns the current level name string |
C:apply(qualityLevel) | Sets each key/value pair via TorqueScriptLua.setVar; calls onApply if changes detected |
Constructor
local GraphicsQualityGroup = require('core/settings/graphicsQualityGroup')
local group = GraphicsQualityGroup('core/settings/lightingQuality', 'Lighting Quality')Returns a new instance bound to the quality-levels module.
Quality Level Module Format
Each module (e.g. lightingQuality.lua) exports:
local M = {}
M.qualityLevels = {
Low = { ["$pref::someVar"] = value, ... },
High = { ["$pref::someVar"] = value, ... },
}
M.onApply = function()
-- optional callback after vars change
end
return MUsage Example
-- Apply "Ultra" lighting quality
lightingQualityGroup:applyLevel('Ultra')
-- Check current level
local id = lightingQualityGroup:getCurrentLevelId() -- e.g. "Ultra"See Also
- Lighting Quality - Lighting quality level definitions
- Shadows Quality - Shadows quality level definitions
- Shader Quality - Shader quality level definitions
- Texture Quality - Texture quality level definitions
- Mesh Quality - Mesh quality level definitions