From cf5838505f343904200d075d4268731ac815d382 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 29 Dec 2012 07:58:06 -0500 Subject: [PATCH] In-world feature request: Announce in chat when someone has taken a snapshot. AnnounceSnapshots debug setting. "Announce when someone takes a snapshot" added to Vanity Main Preferences. took_a_snapshot translatable string added to strings.xml Also in this commit: Turned PlayTypingSound check into LLCachedControl. In preparation for the crippling of all old viewers, the Vanity Main tab shall henceforth only be called Main, not Main (General) This change has been made in the code comments and the UI itself. --- indra/newview/app_settings/settings.xml | 14 ++++++++++++++ indra/newview/ascentprefsvan.cpp | 8 +++++--- indra/newview/ascentprefsvan.h | 3 ++- indra/newview/llvoavatar.cpp | 15 ++++++++++++++- .../xui/en-us/panel_preferences_ascent_vanity.xml | 5 +++-- indra/newview/skins/default/xui/en-us/strings.xml | 3 +++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5bca1ce16..4c0f5db9c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -843,6 +843,20 @@ This should be as low as possible, but too low may break functionality Value 1 + AnnounceSnapshots + + Comment + +Announce if someone nearby has taken a snapshot in chat +(Won't work on people who hide/quiet snapshots) + + Persist + 1 + Type + Boolean + Value + 0 + AnnounceStreamMetadata Comment diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index e51e3c0e2..ac6a2a28e 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -176,7 +176,7 @@ void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) // Store current settings for cancel void LLPrefsAscentVan::refreshValues() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- mUseAccountSettings = gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"); mShowTPScreen = !gSavedSettings.getBOOL("AscentDisableTeleportScreens"); mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound"); @@ -184,6 +184,7 @@ void LLPrefsAscentVan::refreshValues() mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation"); mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace"); mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards"); + mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceStreamMetadata"); mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); //Tags\Colors ---------------------------------------------------------------------------- @@ -224,7 +225,7 @@ void LLPrefsAscentVan::refreshValues() // Update controls based on current settings void LLPrefsAscentVan::refresh() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- //Tags\Colors ---------------------------------------------------------------------------- LLComboBox* combo = getChild("tag_spoofing_combobox"); @@ -253,7 +254,7 @@ void LLPrefsAscentVan::refresh() // Reset settings to local copy void LLPrefsAscentVan::cancel() { - //General -------------------------------------------------------------------------------- + //Main ----------------------------------------------------------------------------------- gSavedSettings.setBOOL("AscentStoreSettingsPerAccount", mUseAccountSettings); gSavedSettings.setBOOL("AscentDisableTeleportScreens", !mShowTPScreen); gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound); @@ -261,6 +262,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("SGDisableChatAnimation", mDisableChatAnimation); gSavedSettings.setBOOL("LiruAddNotReplace", mAddNotReplace); gSavedSettings.setBOOL("TurnAroundWhenWalkingBackwards", mTurnAround); + gSavedSettings.setBOOL("AnnounceSnapshots", mAnnounceSnapshots); gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); //Tags\Colors ---------------------------------------------------------------------------- diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index fd2cd7044..271d2af59 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -52,7 +52,7 @@ protected: static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); static void onCommitTextModified(LLUICtrl* ctrl, void* userdata); static void onManualClientUpdate(void* data); - //General + //Main BOOL mUseAccountSettings; BOOL mShowTPScreen; BOOL mPlayTPSound; @@ -60,6 +60,7 @@ protected: bool mDisableChatAnimation; bool mAddNotReplace; bool mTurnAround; + bool mAnnounceSnapshots; bool mAnnounceStreamMetadata; //Tags\Colors BOOL mAscentUseTag; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bbaa976da..9e6fbb461 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5606,7 +5606,9 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL if ( start ) // start animation { - if (anim_id == ANIM_AGENT_TYPE && gSavedSettings.getBOOL("PlayTypingSound")) + static LLCachedControl play_typing_sound("PlayTypingSound"); + static LLCachedControl announce_snapshots("AnnounceSnapshots"); + if (anim_id == ANIM_AGENT_TYPE && play_typing_sound) { if (gAudiop) { @@ -5632,6 +5634,17 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL { sitDown(TRUE); } + else if(anim_id == ANIM_AGENT_SNAPSHOT && announce_snapshots) + { + std::string name; + LLAvatarNameCache::getPNSName(mID, name); + LLChat chat; + chat.mFromName = name; + chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + "."; + chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str()); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat); + } if (startMotion(anim_id)) diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index ea9031f65..46a679fe2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -1,7 +1,7 @@ - - + + @@ -9,6 +9,7 @@ + diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 1570f8114..43a32c59d 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -2946,6 +2946,9 @@ Where tag = tag string to match. Removes bot's matching the tag. Currently set to an item not on this account Not logged in + + took a snapshot + Not Away Away