diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index dfc1896d7..01aec311a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1324,6 +1324,17 @@ This should be as low as possible, but too low may break functionality Value 1 + AnnounceBumps + + Comment + Announce if someone bumps into you. + Persist + 1 + Type + Boolean + Value + 0 + AnnounceSnapshots Comment diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index c9c64a6aa..85d3bf5f2 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -252,6 +252,7 @@ void LLPrefsAscentSys::refreshValues() mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt"); mShowLookAt = gSavedSettings.getBOOL("AscentShowLookAt"); mQuietSnapshotsToDisk = gSavedSettings.getBOOL("QuietSnapshotsToDisk"); + mAnnounceBumps = gSavedSettings.getBOOL("AnnounceBumps"); mDetachBridge = gSavedSettings.getBOOL("SGDetachBridge"); mRevokePermsOnStandUp = gSavedSettings.getBOOL("RevokePermsOnStandUp"); mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); @@ -409,6 +410,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("PrivateLookAt", mPrivateLookAt); gSavedSettings.setBOOL("AscentShowLookAt", mShowLookAt); gSavedSettings.setBOOL("QuietSnapshotsToDisk", mQuietSnapshotsToDisk); + gSavedSettings.setBOOL("AnnounceBumps", mAnnounceBumps); gSavedSettings.setBOOL("SGDetachBridge", mDetachBridge); gSavedSettings.setBOOL("RevokePermsOnStandUp", mRevokePermsOnStandUp); gSavedSettings.setBOOL("DisableClickSit", mDisableClickSit); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 59f9fdbac..455a072a1 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -103,6 +103,7 @@ private: bool mPrivateLookAt; bool mShowLookAt; bool mQuietSnapshotsToDisk; + bool mAnnounceBumps; bool mDetachBridge; bool mRevokePermsOnStandUp; bool mDisableClickSit; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ea4fdfa6b..4adce648c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6915,6 +6915,32 @@ void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_ } } +void chat_mean_collision(const LLUUID& id, const LLAvatarName& avname, const EMeanCollisionType& type, const F32& mag) +{ + LLStringUtil::format_map_t args; + if (type == MEAN_BUMP) + args["ACT"] = LLTrans::getString("bump"); + else if (type == MEAN_LLPUSHOBJECT) + args["ACT"] = LLTrans::getString("llpushobject"); + else if (type == MEAN_SELECTED_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("selected_object_collide"); + else if (type == MEAN_SCRIPTED_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("scripted_object_collide"); + else if (type == MEAN_PHYSICAL_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("physical_object_collide"); + else + return; // How did we get here? I used to know you so well. + std::string name; + LLAvatarNameCache::getPNSName(avname, name); + args["NAME"] = name; + args["MAG"] = llformat("%f", mag); + LLChat chat(LLTrans::getString("BumpedYou", args)); + chat.mFromName = name; + chat.mURL = llformat("secondlife:///app/agent/%s/about", id.asString().c_str()); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat); +} + void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **user_data) { if (gAgent.inPrelude()) @@ -6944,6 +6970,8 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use msgsystem->getU8Fast(_PREHASH_MeanCollision, _PREHASH_Type, u8type); type = (EMeanCollisionType)u8type; + static const LLCachedControl chat_collision("AnnounceBumps"); + if (chat_collision) LLAvatarNameCache::get(perp, boost::bind(chat_mean_collision, _1, _2, type, mag)); BOOL b_found = FALSE; diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index 5dc137cd1..299ea3ed3 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -87,6 +87,7 @@ + diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index b23b8e948..dc19757cb 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -352,6 +352,15 @@ Make sure you entered the correct Login URI. An example of a Login URI is: \"htt Return objects on your behalf (unknown)! + + [NAME] [ACT] with magnitude [MAG] + + bumped you + pushed you with a script + hit you with an object + hit you with a scripted object + hit you with a physical object + PG