From a9b6989fad493ccc2bb8aae0ffe1e11783635261 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 1 Aug 2010 03:26:57 -0500 Subject: Revamped the LightShare option in Preferences > Advanced. Instead of a checkbox, it's now a combo box with "Never", "Ask me every time", or "Always". --- linden/indra/newview/app_settings/settings.xml | 26 +++++++++------------- linden/indra/newview/lightshare.cpp | 12 +++++----- linden/indra/newview/lightshare.h | 8 +++++++ linden/indra/newview/llprefsadvanced.cpp | 2 -- .../xui/en-us/panel_preferences_advanced.xml | 25 +++++++++++++++++---- 5 files changed, 47 insertions(+), 26 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index e2871ad..25474a7 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -310,6 +310,17 @@ Value 0 + LightShareAllowed + + Comment + Allow LightShare (Windlight settings broadcast from the region): Never (0), Ask (1), or Always (2). + Persist + 1 + Type + U32 + Value + 0 + LightShareIgnoreTimer Comment @@ -12275,21 +12286,6 @@ Value 1 - - - UseServersideWindlightSettings - - Comment - Whether or not to use Windlight settings presented by the server. - Persist - 1 - Type - Boolean - Value - 1 - - - UseStartScreen Comment diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index 28b3d97..b422236 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp @@ -101,7 +101,7 @@ WindlightMessage::~WindlightMessage() // static void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) { - if( !gSavedSettings.getBOOL("UseServersideWindlightSettings") ) + if( gSavedSettings.getU32("UseLightShare") <= LIGHTSHARE_NEVER ) return; WindlightMessage* wl = new WindlightMessage(msg); @@ -112,9 +112,10 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) std::string water = LLWaterParamManager::instance()->mCurParams.mName; std::string sky = LLWLParamManager::instance()->mCurParams.mName; - // If they are using region settings already, just apply the new - // settings, don't bother asking. - if( sky == sSkyPresetName && water == sWaterPresetName ) + // If they are using region settings already, or LightShare is + // always allowed, just apply the new settings, don't bother asking. + if( gSavedSettings.getU32("UseLightShare") == LIGHTSHARE_ALWAYS || + (sky == sSkyPresetName && water == sWaterPresetName) ) { wl->apply(); delete wl; @@ -137,7 +138,8 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) return; } - if( sMostRecent == NULL ) + if( gSavedSettings.getU32("UseLightShare") == LIGHTSHARE_ASK && + sMostRecent == NULL ) { // No most recent, so store this and create notification // asking the user whether to apply or not. diff --git a/linden/indra/newview/lightshare.h b/linden/indra/newview/lightshare.h index f179458..e3cccf0 100644 --- a/linden/indra/newview/lightshare.h +++ b/linden/indra/newview/lightshare.h @@ -47,6 +47,14 @@ class WindlightMessage { public: + // The meanings of the LightShareAllowed user setting. + enum LIGHTSHARE_ALLOWED + { + LIGHTSHARE_NEVER = 0, + LIGHTSHARE_ASK = 1, + LIGHTSHARE_ALWAYS = 2, + }; + // Constructs a new WindlightMessage instance from a GenericMessage // with the "Windlight" method, such as those sent by a // Lightshare-enabled OpenSim region. diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index 6489f52..675a87f 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -58,7 +58,6 @@ BOOL LLPrefsAdvanced::postBuild() childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens")); childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens")); childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag")); - childSetValue("windlight_check", gSavedSettings.getBOOL("UseServersideWindlightSettings")); childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); childSetValue("speed_rez_check", gSavedSettings.getBOOL("SpeedRez")); @@ -84,7 +83,6 @@ void LLPrefsAdvanced::apply() gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval_spinner").asReal()); gSavedSettings.setBOOL("AppearanceAnimate", childGetValue("appearance_anim_check")); - gSavedSettings.setBOOL("UseServersideWindlightSettings", childGetValue("windlight_check")); gSavedSettings.setBOOL("LanguageIsPublic", childGetValue("language_is_public")); // Need to force a rebake when ClothingLayerProtection toggled for it take effect -- MC diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml index af8cb1e..1b463a2 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml @@ -26,11 +26,28 @@ font="SansSerifSmall" height="16" initial_value="false" label="Enable shadows (WARNING: unstable and requires Ultra graphics)" left="12" mouse_opaque="true" name="shadows_check" radio_style="false" width="217" /> + + + + Allow region Windlight settings (LightShare): + + + + Never + + + Ask me every time + + + Always + + + + - -- cgit v1.1