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.
This commit is contained in:
Lirusaito
2012-12-29 07:58:06 -05:00
parent 23469c00de
commit cf5838505f
6 changed files with 41 additions and 7 deletions

View File

@@ -843,6 +843,20 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AnnounceSnapshots</key>
<map>
<key>Comment</key>
<string>
Announce if someone nearby has taken a snapshot in chat
(Won't work on people who hide/quiet snapshots)
</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AnnounceStreamMetadata</key>
<map>
<key>Comment</key>

View File

@@ -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<LLComboBox>("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 ----------------------------------------------------------------------------

View File

@@ -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;

View File

@@ -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<bool> play_typing_sound("PlayTypingSound");
static LLCachedControl<bool> 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))

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel top="20" left="10" height="400" width="512" border="true" label="Vanity" name="ascvan">
<tab_container label="Singularity Vanity" bottom="0" height="440" width="497" name="Ascent Vanity" tab_min_width="90">
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Main (General)" name="General">
<tab_container label="Singularity Vanity" bottom="0" height="440" width="497" name="Ascent Vanity" tab_min_width="0">
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Main" name="General">
<check_box bottom_delta="-25" control_name="AscentStoreSettingsPerAccount" follows="top" height="16" initial_value="true" label="Where applicable, save Vanity settings per-account." left="10" tool_tip="Saves settings per-account, allowing easier customization for alts." name="use_account_settings_check"/>
<check_box bottom_delta="-20" control_name="AscentDisableTeleportScreens" follows="top" height="16" initial_value="true" label="Hide the Teleport progress screens" tool_tip="If checked, the viewer will hide the teleport progress screen, allowing you to continue to read IMs." name="disable_tp_screen_check"/>
<check_box bottom_delta="-20" control_name="OptionPlayTpSound" follows="top" height="16" initial_value="true" label="Play the Teleport sound when moving between sims" tool_tip="Viewer will play the wooshing TP noise on teleport." name="tp_sound_check"/>
@@ -9,6 +9,7 @@
<check_box bottom_delta="-20" control_name="SGDisableChatAnimation" follows="top" height="16" initial_value="false" label="Disable chat, whisper and shout animations" tool_tip="Remove chat animations from your own avatar. Effect visible to everyone" name="disable_chat_animation"/>
<check_box bottom_delta="-20" control_name="LiruAddNotReplace" follows="top" height="16" label="Add attachments and wearables instead of replacing them" tool_tip="When double clicking or pressing enter in inventory with wearables or objects selected they will be added to your outfit, instead of replacing the wearable or object currently at their target destination." name="add_not_replace"/>
<check_box bottom_delta="-20" control_name="TurnAroundWhenWalkingBackwards" follows="top" height="16" label="Turn around when walking backwards" tool_tip="Certain AOs may turn you around even with this disabled." name="turn_around"/>
<check_box bottom_delta="-20" control_name="AnnounceSnapshots" follows="top" height="16" label="Announce when someone takes a snapshot" tool_tip="Won't announce for people who hide the fact that they are taking a snapshot." name="announce_snapshots"/>
<check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
</panel>
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors">

View File

@@ -2946,6 +2946,9 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="CurrentlySetToAnItemNotOnThisAccount">Currently set to an item not on this account</string>
<string name="NotLoggedIn">Not logged in</string>
<!-- Non-standard LLChat strings -->
<string name="took_a_snapshot">took a snapshot</string>
<!-- Avatar busy/away mode -->
<string name="AvatarSetNotAway">Not Away</string>
<string name="AvatarSetAway">Away</string>