Commit 90f55dcc authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Use static list of control names for preset manager and remove dependence on...

Use static list of control names for preset manager and remove dependence on XUI and the preferences floater
parent 688c5c6d
......@@ -244,6 +244,48 @@ void LLPresetsManager::settingChanged()
}
}
void LLPresetsManager::getGraphicsControlNames(std::vector<std::string>& names)
{
const std::vector<std::string> camera_controls = {
// From panel_preferences_graphics.xml
"AlwaysRenderFriends",
"RenderAnisotropic",
"RenderAvatarCloth",
"RenderAvatarLODFactor",
"RenderAvatarMaxComplexity",
"RenderAvatarMaxNonImpostors",
"RenderAvatarPhysicsLODFactor",
"RenderAvatarVP",
"RenderCompressTextures",
"RenderDeferred",
"RenderDeferredSSAO",
"RenderDepthOfField",
"RenderFSAASamples",
"RenderFarClip",
"RenderFlexTimeFactor",
"RenderFogRatio",
"RenderGamma",
"RenderGlowResolutionPow",
"RenderLocalLights",
"RenderMaxPartCount",
"RenderObjectBump",
"RenderQualityPerformance",
"RenderReflectionDetail",
"RenderShadowDetail",
"RenderTerrainDetail",
"RenderTerrainLODFactor",
"RenderTransparentWater",
"RenderTreeLODFactor",
"RenderVBOEnable",
"RenderVolumeLODFactor",
"RenderWaterRefResolution",
"TextureMemory",
"WLSkyDetail",
"WindLightUseAtmosShaders"
};
names = camera_controls;
}
void LLPresetsManager::getCameraControlNames(std::vector<std::string>& names)
{
const std::vector<std::string> camera_controls = boost::assign::list_of
......@@ -286,18 +328,13 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
if (IS_GRAPHIC)
{
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if (instance && !createDefault)
if (!createDefault)
{
gSavedSettings.setString("PresetGraphicActive", name);
instance->getControlNames(name_list);
LL_DEBUGS() << "saving preset '" << name << "'; " << name_list.size() << " names" << LL_ENDL;
name_list.clear();
getGraphicsControlNames(name_list);
name_list.push_back("PresetGraphicActive");
}
else
{
LL_WARNS("Presets") << "preferences floater instance not found" << LL_ENDL;
}
}
else if (IS_CAMERA)
{
......
......@@ -97,6 +97,7 @@ class LLPresetsManager final : public LLSingleton<LLPresetsManager>
private:
LOG_CLASS(LLPresetsManager);
void getGraphicsControlNames(std::vector<std::string>& names);
void getCameraControlNames(std::vector<std::string>& names);
static void settingChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment