FIRE-3850: Add avatar age reporting
parent
e1cc6f93d0
commit
4becb4bcac
|
|
@ -731,6 +731,30 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>RadarAvatarAgeAlert</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Toggles whether radar sends out chat alerts when it detects an avatar younger than a pre-defined age</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>RadarAvatarAgeAlertValue</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Defines how old an avatar may be at maximum for the age alert to get triggered</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>7</integer>
|
||||
</map>
|
||||
|
||||
<key>ShowRadarMinimap</key>
|
||||
<map>
|
||||
|
|
@ -21006,6 +21030,28 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<string>a3f48b85-c29f-1f97-ebb6-644b7c053512</string>
|
||||
</map>
|
||||
<key>PlayModeUISndRadarAgeAlert</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>If enabled: plays the sound when the age alert for an avatar is triggered.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>UISndRadarAgeAlert</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Sound file played when the age alert for an avatar is triggered (uuid for sound asset)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>a3f48b85-c29f-1f97-ebb6-644b7c053512</string>
|
||||
</map>
|
||||
<!-- End: Sounds for Prefs > Chat > Radar -->
|
||||
<key>FSSavedRenderFarClip</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -386,6 +386,7 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
|
|||
static S32 nameColumnIndex = mRadarList->getColumn("name")->mIndex;
|
||||
static S32 voiceLevelColumnIndex = mRadarList->getColumn("voice_level")->mIndex;
|
||||
static S32 flagsColumnIndex = mRadarList->getColumn("flags")->mIndex;
|
||||
static S32 ageColumnIndex = mRadarList->getColumn("age")->mIndex;
|
||||
|
||||
LLScrollListText* radarRangeCell = (LLScrollListText*)row->getColumn(rangeColumnIndex);
|
||||
radarRangeCell->setColor(LLColor4(options["range_color"]));
|
||||
|
|
@ -409,6 +410,12 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
|
|||
{
|
||||
flagsCell->setValue(flagsColumnValues[entry["flags"].asInteger()]);
|
||||
}
|
||||
|
||||
LLScrollListText* ageCell = (LLScrollListText*)row->getColumn(ageColumnIndex);
|
||||
if (options.has("age_color"))
|
||||
{
|
||||
ageCell->setColor(LLColor4(options["age_color"]));
|
||||
}
|
||||
}
|
||||
|
||||
LLStringUtil::format_map_t name_count_args;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@ FSRadar::FSRadar() :
|
|||
mRadarAlertRequest(false),
|
||||
mRadarFrameCount(0),
|
||||
mRadarLastBulkOffsetRequestTime(0),
|
||||
mRadarLastRequestTime(0.f)
|
||||
mRadarLastRequestTime(0.f),
|
||||
mAgeAlertCallbackConnection()
|
||||
{
|
||||
mRadarListUpdater = new FSRadarListUpdater(boost::bind(&FSRadar::updateRadarList, this));
|
||||
|
||||
|
|
@ -103,6 +104,7 @@ FSRadar::FSRadar() :
|
|||
gSavedSettings.getControl("NameTagShowUsernames")->getSignal()->connect(boost::bind(&FSRadar::updateNames, this));
|
||||
|
||||
gSavedSettings.getControl("RadarNameFormat")->getSignal()->connect(boost::bind(&FSRadar::updateNames, this));
|
||||
mAgeAlertCallbackConnection = gSavedSettings.getControl("RadarAvatarAgeAlertValue")->getSignal()->connect(boost::bind(&FSRadar::updateAgeAlertCheck, this));
|
||||
}
|
||||
|
||||
FSRadar::~FSRadar()
|
||||
|
|
@ -114,6 +116,11 @@ FSRadar::~FSRadar()
|
|||
{
|
||||
delete em_it->second;
|
||||
}
|
||||
|
||||
if (mAgeAlertCallbackConnection.connected())
|
||||
{
|
||||
mAgeAlertCallbackConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void FSRadar::radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& postMsg)
|
||||
|
|
@ -165,6 +172,7 @@ void FSRadar::updateRadarList()
|
|||
static const std::string str_region_entering = LLTrans::getString("entering_region");
|
||||
static const std::string str_region_entering_distance = LLTrans::getString("entering_region_distance");
|
||||
static const std::string str_region_leaving = LLTrans::getString("leaving_region");
|
||||
static const std::string str_avatar_age_alert = LLTrans::getString("avatar_age_alert");
|
||||
|
||||
static LLCachedControl<bool> RadarReportChatRangeEnter(gSavedSettings, "RadarReportChatRangeEnter");
|
||||
static LLCachedControl<bool> RadarReportChatRangeLeave(gSavedSettings, "RadarReportChatRangeLeave");
|
||||
|
|
@ -174,6 +182,7 @@ void FSRadar::updateRadarList()
|
|||
static LLCachedControl<bool> RadarReportSimRangeLeave(gSavedSettings, "RadarReportSimRangeLeave");
|
||||
static LLCachedControl<bool> RadarEnterChannelAlert(gSavedSettings, "RadarEnterChannelAlert");
|
||||
static LLCachedControl<bool> RadarLeaveChannelAlert(gSavedSettings, "RadarLeaveChannelAlert");
|
||||
static LLCachedControl<bool> RadarAvatarAgeAlert(gSavedSettings, "RadarAvatarAgeAlert");
|
||||
static LLCachedControl<F32> nearMeRange(gSavedSettings, "NearMeRange");
|
||||
static LLCachedControl<bool> limitRange(gSavedSettings, "LimitRadarByRange");
|
||||
static LLCachedControl<F32> RenderFarClip(gSavedSettings, "RenderFarClip");
|
||||
|
|
@ -484,13 +493,35 @@ void FSRadar::updateRadarList()
|
|||
entry["name"] = avName;
|
||||
entry["in_region"] = isInSameRegion;
|
||||
entry["flags"] = avFlag;
|
||||
entry["age"] = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) ? "---" : ( (avAge > -1 ? llformat("%d", avAge) : "") );
|
||||
entry["seen"] = avSeenStr;
|
||||
entry["range"] = (avRange > AVATAR_UNKNOWN_RANGE ? llformat("%3.2f", avRange) : llformat(">%3.2f", drawRadius));
|
||||
entry["typing"] = (avVo && avVo->isTyping());
|
||||
entry["sitting"] = (avVo && (avVo->getParent() || avVo->isMotionActive(ANIM_AGENT_SIT_GROUND) || avVo->isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED)));
|
||||
entry["has_notes"] = ent->hasNotes();
|
||||
|
||||
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
entry["age"] = (avAge > -1 ? llformat("%d", avAge) : "");
|
||||
if (ent->hasAlertAge())
|
||||
{
|
||||
entry_options["age_color"] = LLUIColorTable::instance().getColor("AvatarListItemAgeAlert", LLColor4::red).get().getValue();
|
||||
|
||||
if (RadarAvatarAgeAlert && !ent->hasAgeAlertPerformed())
|
||||
{
|
||||
make_ui_sound("UISndRadarAgeAlert");
|
||||
LLStringUtil::format_map_t args;
|
||||
args["AGE"] = llformat("%d", avAge);
|
||||
std::string message = formatString(str_avatar_age_alert, args);
|
||||
LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message));
|
||||
}
|
||||
ent->mAgeAlertPerformed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
entry["age"] = "---";
|
||||
}
|
||||
|
||||
//AO: Set any range colors / styles
|
||||
LLUIColor range_color;
|
||||
if (avRange > AVATAR_UNKNOWN_RANGE)
|
||||
|
|
@ -958,3 +989,12 @@ void FSRadar::updateName(const LLUUID& avatar_id)
|
|||
entry->updateName();
|
||||
}
|
||||
}
|
||||
|
||||
void FSRadar::updateAgeAlertCheck()
|
||||
{
|
||||
const entry_map_t::iterator it_end = mEntryList.end();
|
||||
for (entry_map_t::iterator it = mEntryList.begin(); it != it_end; ++it)
|
||||
{
|
||||
it->second->checkAge();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ private:
|
|||
void updateTracking();
|
||||
void checkTracking();
|
||||
void radarAlertMsg(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& postMsg);
|
||||
void updateAgeAlertCheck();
|
||||
|
||||
Updater* mRadarListUpdater;
|
||||
|
||||
|
|
@ -143,6 +144,8 @@ private:
|
|||
LLSD mAvatarStats;
|
||||
|
||||
radar_update_callback_t mUpdateSignal;
|
||||
|
||||
boost::signals2::connection mAgeAlertCallbackConnection;
|
||||
};
|
||||
|
||||
#endif // FS_RADAR_H
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ FSRadarEntry::FSRadarEntry(const LLUUID& avid)
|
|||
mIsLinden(false),
|
||||
mIgnore(false),
|
||||
mHasNotes(false),
|
||||
mAlertAge(false),
|
||||
mAgeAlertPerformed(false),
|
||||
mAvatarNameCallbackConnection()
|
||||
{
|
||||
if (mID.notNull())
|
||||
|
|
@ -119,6 +121,7 @@ void FSRadarEntry::processProperties(void* data, EAvatarProcessorType type)
|
|||
{
|
||||
mAge = ((LLDate::now().secondsSinceEpoch() - (avatar_data->born_on).secondsSinceEpoch()) / 86400);
|
||||
mStatus = avatar_data->flags;
|
||||
checkAge();
|
||||
}
|
||||
}
|
||||
else if (type == APT_NOTES)
|
||||
|
|
@ -181,3 +184,12 @@ std::string FSRadarEntry::getRadarName(const LLAvatarName& av_name)
|
|||
// else use legacy name lookups
|
||||
return av_name.getUserNameForDisplay(); // will be mapped to legacyname automatically by the name cache
|
||||
}
|
||||
|
||||
void FSRadarEntry::checkAge()
|
||||
{
|
||||
mAlertAge = (mAge > -1 && mAge <= gSavedSettings.getS32("RadarAvatarAgeAlertValue"));
|
||||
if (!mAlertAge || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
mAgeAlertPerformed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,8 +55,11 @@ public:
|
|||
bool getIsLinden() const { return mIsLinden; }
|
||||
bool getIgnore() const { return mIgnore; }
|
||||
bool hasNotes() const { return mHasNotes; }
|
||||
bool hasAlertAge() const { return mAlertAge; }
|
||||
bool hasAgeAlertPerformed() const { return mAgeAlertPerformed; }
|
||||
|
||||
void setZOffset(F32 offset) { mZOffset = offset; }
|
||||
void checkAge();
|
||||
|
||||
static std::string getRadarName(const LLAvatarName& av_name);
|
||||
|
||||
|
|
@ -80,6 +83,8 @@ private:
|
|||
bool mIsLinden;
|
||||
bool mIgnore;
|
||||
bool mHasNotes;
|
||||
bool mAlertAge;
|
||||
bool mAgeAlertPerformed;
|
||||
|
||||
LLAvatarNameCache::callback_connection_t mAvatarNameCallbackConnection;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -470,6 +470,9 @@
|
|||
<color
|
||||
name="AvatarListItemBeyondShoutRange"
|
||||
reference="Red" />
|
||||
<color
|
||||
name="AvatarListItemAgeAlert"
|
||||
reference="Red" />
|
||||
<color
|
||||
name="BackgroundChatColor"
|
||||
reference="DkGray" />
|
||||
|
|
|
|||
|
|
@ -470,6 +470,9 @@
|
|||
<color
|
||||
name="AvatarListItemBeyondShoutRange"
|
||||
reference="Red" />
|
||||
<color
|
||||
name="AvatarListItemAgeAlert"
|
||||
reference="Red" />
|
||||
<color
|
||||
name="BackgroundChatColor"
|
||||
reference="DkGray" />
|
||||
|
|
|
|||
|
|
@ -417,6 +417,9 @@
|
|||
<color
|
||||
name="AvatarListItemBeyondShoutRange"
|
||||
reference="SL-Silver" />
|
||||
<color
|
||||
name="AvatarListItemAgeAlert"
|
||||
reference="Red" />
|
||||
<color
|
||||
name="BackgroundChatColor"
|
||||
reference="DkGray" />
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<menu_item_check label="Verlassen der Chat-Reichweite melden" name="RadarReportChatRangeLeave"/>
|
||||
<menu_item_check label="Betreten der Region melden" name="RadarReportSimRangeEnter"/>
|
||||
<menu_item_check label="Verlassen der Region melden" name="RadarReportSimRangeLeave"/>
|
||||
<menu_item_check label="Auslösen des Alters-Alarms melden" name="RadarReportAgeAlert"/>
|
||||
<menu_item_check label="Eintrittsmeldungen an Skripte senden" name="RadarEnterChannelAlert"/>
|
||||
<menu_item_check label="Austrittsmeldungen an Skripte senden" name="RadarLeaveChannelAlert"/>
|
||||
<menu_item_check label="LSL-Brücke zur Verbesserung der Genauigkeit verwenden" name="FSRadarEnhanceByBridge"/>
|
||||
|
|
|
|||
|
|
@ -245,6 +245,20 @@
|
|||
<check_box name="RadarEnterChannelAlert" label="Betreten-Meldungen an Skripte weiterleiten"/>
|
||||
<check_box name="RadarLeaveChannelAlert" label="Verlassen-Meldungen an Skripte weiterleiten"/>
|
||||
<check_box name="FSRadarEnhanceByBridge" label="LSL-Brücke zur Verbesserung der Radar-Genauigkeit verwenden" tool_tip="Falls aktiviert, wird die LSL-Brücke verwendet, um die Entfernung zu Avataren zu bestimmen, die sich in einer Höhe von mehr als 1020m und außerhalb der Draw Distance befinden."/>
|
||||
<text name="AgeAlertLabel">
|
||||
Alters-Alarm:
|
||||
</text>
|
||||
<text name="RadarAvatarAgeAlertValueLabel">
|
||||
Schwellwert:
|
||||
</text>
|
||||
<spinner name="RadarAvatarAgeAlertValue" tool_tip="Färbt ebenfalls die Alters-Spalte im Radar ein. Zum Deaktivieren auf -1 setzen."/>
|
||||
<text name="RadarAvatarAgeAlertValueLabelSuffix">
|
||||
Tage
|
||||
</text>
|
||||
<check_box name="RadarAvatarAgeAlert" label="Radar meldet, wenn Avatare jünger als das angegebene Alter sind"/>
|
||||
<check_box width="140" name="PlayModeUISndRadarAgeAlert" label="Klang-UUID abspielen:"/>
|
||||
<button label="V" name="Prev_UISndRadarAgeAlert" tool_tip="Vorschau zu diesem Sound."/>
|
||||
<button label="S" name="Def_UISndRadarAgeAlert" tool_tip="Auf Standardwert zurücksetzen."/>
|
||||
</panel>
|
||||
|
||||
<!-- Chat: Keyword Alerts -->
|
||||
|
|
|
|||
|
|
@ -5970,9 +5970,12 @@ Setzen Sie den Editorpfad in Anführungszeichen
|
|||
<string name="entering_region_distance">
|
||||
hat die Region betreten ([DISTANCE] m).
|
||||
</string>
|
||||
<string name="leaving_region">
|
||||
<string name="leaving_region">
|
||||
hat die Region verlassen.
|
||||
</string>
|
||||
<string name="avatar_age_alert">
|
||||
hat den Alters-Alarm ausgelöst. Alter: [AGE] Tag(e)
|
||||
</string>
|
||||
|
||||
<string name="TotalScriptCountChangeIncrease">
|
||||
Skriptanzahl in Region hat sich von [OLD_VALUE] auf [NEW_VALUE] erhöht ([DIFFERENCE]).
|
||||
|
|
|
|||
|
|
@ -259,6 +259,15 @@
|
|||
function="ToggleControl"
|
||||
parameter="RadarReportSimRangeLeave"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Report Avatar Age Alert"
|
||||
name="RadarReportAgeAlert">
|
||||
<menu_item_check.on_check
|
||||
control="RadarAvatarAgeAlert"/>
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="RadarAvatarAgeAlert"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Report Enter Alerts to Scripts"
|
||||
name="RadarEnterChannelAlert">
|
||||
|
|
|
|||
|
|
@ -1251,7 +1251,7 @@
|
|||
label="Radar reports when avatars enter chat range"
|
||||
layout="topleft"
|
||||
left="24"
|
||||
top_pad="15"
|
||||
top_pad="5"
|
||||
height="20"
|
||||
width="400" />
|
||||
<check_box
|
||||
|
|
@ -1623,6 +1623,108 @@
|
|||
height="20"
|
||||
width="400" />
|
||||
|
||||
<text
|
||||
layout="topleft"
|
||||
follows="left|top"
|
||||
top_pad="10"
|
||||
left="20"
|
||||
height="14"
|
||||
width="120"
|
||||
name="AgeAlertLabel">
|
||||
Age Alert:
|
||||
</text>
|
||||
|
||||
<text
|
||||
follows="left|top"
|
||||
height="20"
|
||||
top_pad="2"
|
||||
left="28"
|
||||
name="RadarAvatarAgeAlertValueLabel"
|
||||
width="70">
|
||||
Threshold:
|
||||
</text>
|
||||
<spinner
|
||||
top_delta="-4"
|
||||
decimal_digits="0"
|
||||
control_name="RadarAvatarAgeAlertValue"
|
||||
follows="left|top"
|
||||
height="20"
|
||||
increment="1"
|
||||
initial_value="7"
|
||||
left_pad="0"
|
||||
min_val="-1"
|
||||
max_val="100000"
|
||||
name="RadarAvatarAgeAlertValue"
|
||||
tool_tip="Also colors the age column in the radar. Set to -1 to disable."
|
||||
width="60" />
|
||||
<text
|
||||
top_delta="4"
|
||||
follows="left|top"
|
||||
height="20"
|
||||
left_pad="5"
|
||||
name="RadarAvatarAgeAlertValueLabelSuffix"
|
||||
width="70">
|
||||
Days
|
||||
</text>
|
||||
|
||||
<check_box
|
||||
control_name="RadarAvatarAgeAlert"
|
||||
name="RadarAvatarAgeAlert"
|
||||
label="Radar reports avatars younger than the specified age"
|
||||
layout="topleft"
|
||||
left="24"
|
||||
top_pad="0"
|
||||
height="20"
|
||||
width="400" />
|
||||
<check_box
|
||||
enabled_control="RadarAvatarAgeAlert"
|
||||
layout="topleft"
|
||||
top_pad="-2"
|
||||
left="35"
|
||||
width="115"
|
||||
height="20"
|
||||
control_name="PlayModeUISndRadarAgeAlert"
|
||||
name="PlayModeUISndRadarAgeAlert"
|
||||
label="Play sound UUID:"/>
|
||||
<line_editor
|
||||
enabled_control="RadarAvatarAgeAlert"
|
||||
follows="left|top"
|
||||
left_pad="5"
|
||||
height="20"
|
||||
max_length_chars="256"
|
||||
name="UISndRadarAgeAlert"
|
||||
control_name="UISndRadarAgeAlert"
|
||||
width="220"/>
|
||||
<button
|
||||
enabled_control="RadarAvatarAgeAlert"
|
||||
follows="left|top"
|
||||
name="Prev_UISndRadarAgeAlert"
|
||||
height="20"
|
||||
label="P"
|
||||
layout="topleft"
|
||||
top_delta="-1"
|
||||
left_pad="1"
|
||||
width="17"
|
||||
tool_tip="Preview this sound.">
|
||||
<button.commit_callback
|
||||
function="PreviewUISound"
|
||||
parameter="UISndRadarAgeAlert"/>
|
||||
</button>
|
||||
<button
|
||||
enabled_control="RadarAvatarAgeAlert"
|
||||
follows="left|top"
|
||||
name="Def_UISndRadarAgeAlert"
|
||||
height="20"
|
||||
label="D"
|
||||
layout="topleft"
|
||||
left_pad="1"
|
||||
width="15"
|
||||
tool_tip="Reset to the default UUID.">
|
||||
<button.commit_callback
|
||||
function="ResetControl"
|
||||
parameter="UISndRadarAgeAlert"/>
|
||||
</button>
|
||||
|
||||
</panel>
|
||||
|
||||
<!-- Chat: Keyword Alerts -->
|
||||
|
|
|
|||
|
|
@ -2695,6 +2695,7 @@ Try enclosing path to the editor with double quotes.
|
|||
<string name="entering_region">entered the region.</string>
|
||||
<string name="entering_region_distance">entered the region ([DISTANCE] m).</string>
|
||||
<string name="leaving_region">left the region.</string>
|
||||
<string name="avatar_age_alert">triggered the age alert. Age: [AGE] day(s)</string>
|
||||
|
||||
<string name="TotalScriptCountChangeIncrease">Total scripts in region jumped from [OLD_VALUE] to [NEW_VALUE] ([DIFFERENCE]).</string>
|
||||
<string name="TotalScriptCountChangeDecrease">Total scripts in region dropped from [OLD_VALUE] to [NEW_VALUE] ([DIFFERENCE]).</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue