summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHadet <hadet@terminus.local>2026-05-23 21:28:25 -0500
committerErik Kundiman <erik@megapahit.org>2026-05-25 09:47:04 +0700
commit3ac400d744971db9cf7bbfb6df3c1f0ef5662c82 (patch)
tree53323b654c60b80af2d9d9e1123573b0b0424267
parent9b1fa446a1148485bfc075fb6c5c8b286e827589 (diff)
Add Firestorm-based features: quick prefs, mouselook zoom, group nameplate tinting
- Quick Preferences floater with hover height and bandwidth sliders - Mouselook right-click zoom with scroll wheel adjustment - Group-based nameplate color tinting via group profile
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/app_settings/commands.xml11
-rw-r--r--indra/newview/app_settings/settings.xml28
-rw-r--r--indra/newview/llavatarpropertiesprocessor.cpp26
-rw-r--r--indra/newview/llavatarpropertiesprocessor.h25
-rw-r--r--indra/newview/llgroupcolormap.cpp150
-rw-r--r--indra/newview/llgroupcolormap.h64
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp76
-rw-r--r--indra/newview/llpanelgroupgeneral.h8
-rw-r--r--indra/newview/llquickprefs.cpp205
-rw-r--r--indra/newview/llquickprefs.h81
-rw-r--r--indra/newview/llstartup.cpp4
-rw-r--r--indra/newview/lltoolcomp.cpp55
-rw-r--r--indra/newview/lltoolcomp.h2
-rw-r--r--indra/newview/llviewerdisplay.cpp18
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp21
-rw-r--r--indra/newview/llvoavatar.cpp99
-rw-r--r--indra/newview/llvoavatar.h10
-rw-r--r--indra/newview/skins/default/xui/en/floater_quick_prefs.xml85
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml8
-rw-r--r--indra/newview/skins/default/xui/en/panel_group_general.xml51
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml2
23 files changed, 1023 insertions, 12 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 9a2778f853..7812735867 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -342,6 +342,7 @@ set(viewer_SOURCE_FILES
llgltfmateriallist.cpp
llgltfmaterialpreviewmgr.cpp
llgroupactions.cpp
+ llgroupcolormap.cpp # group-based nameplate tinting
llgroupiconctrl.cpp
llgrouplist.cpp
llgroupmgr.cpp
@@ -560,6 +561,7 @@ set(viewer_SOURCE_FILES
llpreviewtexture.cpp
llproductinforequest.cpp
llprogressview.cpp
+ llquickprefs.cpp # Firestorm port: Quick Preferences floater
llrecentpeople.cpp
llreflectionmap.cpp
llreflectionmapmanager.cpp
@@ -1036,6 +1038,7 @@ set(viewer_HEADER_FILES
llgltfmateriallist.h
llgltfmaterialpreviewmgr.h
llgroupactions.h
+ llgroupcolormap.h # group-based nameplate tinting
llgroupiconctrl.h
llgrouplist.h
llgroupmgr.h
@@ -1239,6 +1242,7 @@ set(viewer_HEADER_FILES
llpreviewtexture.h
llproductinforequest.h
llprogressview.h
+ llquickprefs.h # Firestorm port: Quick Preferences floater
llrecentpeople.h
llreflectionmap.h
llreflectionmapmanager.h
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 6a05466e06..9b80b40008 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -310,4 +310,15 @@
tooltip_ref="Command_ResyncAnimations_Tooltip"
execute_function="Tools.ResyncAnimations"
/>
+ <!-- Firestorm port: Quick Preferences toolbar button -->
+ <command name="quick_prefs"
+ available_in_toybox="true"
+ icon="Command_Preferences_Icon"
+ label_ref="Command_QuickPrefs_Label"
+ tooltip_ref="Command_QuickPrefs_Tooltip"
+ execute_function="Floater.ToggleOrBringToFront"
+ execute_parameters="quick_prefs"
+ is_running_function="Floater.IsOpen"
+ is_running_parameters="quick_prefs"
+ />
</commands>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index f1e5217afd..481cafafd1 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1337,6 +1337,34 @@
<key>Value</key>
<real>1.047197551</real>
</map>
+ <!-- NaCl/Firestorm port: mouselook right-click zoom -->
+ <key>_NACL_MLFovValues</key>
+ <map>
+ <key>Comment</key>
+ <string>Mouselook FOV zoom state: VX=normal FOV, VY=zoomed FOV, VZ=1 if currently zoomed</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Vector3</string>
+ <key>Value</key>
+ <array>
+ <real>1.047197551</real>
+ <real>1.047197551</real>
+ <real>0.0</real>
+ </array>
+ </map>
+ <key>FSScrollWheelExitsMouselook</key>
+ <map>
+ <key>Comment</key>
+ <string>If enabled, scrolling up while in mouselook (without right mouse held) exits mouselook</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <!-- End NaCl/Firestorm port -->
<key>CameraOffset</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index 9d9948731f..aa24c69831 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -527,12 +527,28 @@ void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg,
AvatarGroupsReply is automatically sent by the server in response to the
AvatarPropertiesRequest in addition to the AvatarPropertiesReply message.
*/
- LLUUID agent_id;
- LLUUID avatar_id;
- msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
- msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id);
+ LLAvatarGroups avatar_groups;
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, avatar_groups.agent_id);
+ msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_groups.avatar_id);
+
+ LL_DEBUGS("AvatarProperties") << "Received AvatarGroupsReply for "
+ << avatar_groups.avatar_id << LL_ENDL;
+
+ S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData);
+ for (S32 i = 0; i < group_count; ++i)
+ {
+ LLAvatarGroups::LLGroupData gd;
+ msg->getU64Fast( _PREHASH_GroupData, _PREHASH_GroupPowers, gd.group_powers, i);
+ msg->getBOOLFast( _PREHASH_GroupData, _PREHASH_AcceptNotices, gd.accept_notices, i);
+ msg->getStringFast( _PREHASH_GroupData, _PREHASH_GroupTitle, gd.group_title, i);
+ msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupID, gd.group_id, i);
+ msg->getStringFast( _PREHASH_GroupData, _PREHASH_GroupName, gd.group_name, i);
+ msg->getUUIDFast( _PREHASH_GroupData, _PREHASH_GroupInsigniaID, gd.group_insignia_id, i);
+ avatar_groups.group_list.push_back(gd);
+ }
- LL_DEBUGS("AvatarProperties") << "Received AvatarGroupsReply for " << avatar_id << LL_ENDL;
+ LLAvatarPropertiesProcessor* self = getInstance();
+ self->notifyObservers(avatar_groups.avatar_id, &avatar_groups, APT_GROUPS);
}
void LLAvatarPropertiesProcessor::notifyObservers(const LLUUID& id, void* data, EAvatarProcessorType type)
diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h
index 1592629fca..bfafe780ff 100644
--- a/indra/newview/llavatarpropertiesprocessor.h
+++ b/indra/newview/llavatarpropertiesprocessor.h
@@ -55,7 +55,8 @@ enum EAvatarProcessorType
APT_PICK_INFO,
APT_TEXTURES,
APT_CLASSIFIEDS,
- APT_CLASSIFIED_INFO
+ APT_CLASSIFIED_INFO,
+ APT_GROUPS // Group membership list with per-group role titles
};
// legacy data is supposed to match AvatarPropertiesReply,
@@ -117,6 +118,28 @@ struct LLAvatarData::LLGroupData
LLUUID group_insignia_id;
};
+/** Sent by the server automatically alongside AvatarPropertiesReply (UDP).
+ * Contains every group the avatar belongs to, including their selected
+ * role title in each group. The active group is the one whose group_title
+ * matches the avatar's current "Title" NameValue. */
+struct LLAvatarGroups
+{
+ LLUUID agent_id;
+ LLUUID avatar_id;
+
+ struct LLGroupData
+ {
+ U64 group_powers { 0 };
+ bool accept_notices{ false };
+ std::string group_title; // role title the avatar has selected in this group
+ LLUUID group_id;
+ std::string group_name;
+ LLUUID group_insignia_id;
+ };
+ typedef std::list<LLGroupData> group_list_t;
+ group_list_t group_list;
+};
+
struct LLPickData
{
LLUUID agent_id;
diff --git a/indra/newview/llgroupcolormap.cpp b/indra/newview/llgroupcolormap.cpp
new file mode 100644
index 0000000000..36fde1ce38
--- /dev/null
+++ b/indra/newview/llgroupcolormap.cpp
@@ -0,0 +1,150 @@
+/**
+ * @file llgroupcolormap.cpp
+ * @brief Per-group nameplate tint registry.
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llgroupcolormap.h"
+
+#include "lldir.h"
+#include "llsdserialize.h"
+#include "llsdutil_math.h" // ll_sd_from_color4 / ll_color4_from_sd
+#include "llvoavatar.h" // LLVOAvatar::invalidateNameTags()
+
+static constexpr char GROUP_COLOR_FILE[] = "settings_group_colors.xml";
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+
+LLGroupColorMap::LLGroupColorMap()
+{
+}
+
+// ---------------------------------------------------------------------------
+// Public API
+// ---------------------------------------------------------------------------
+
+void LLGroupColorMap::setGroupColor(const LLUUID& group_id, const LLColor4& color)
+{
+ if (group_id.isNull())
+ return;
+
+ // Treat fully-transparent as "no color" (remove entry)
+ if (color.mV[VW] < 0.01f)
+ {
+ clearGroupColor(group_id);
+ return;
+ }
+
+ mColors[group_id] = color;
+ saveToDisk();
+ invalidateAllNameTags();
+}
+
+LLColor4 LLGroupColorMap::getGroupColor(const LLUUID& group_id) const
+{
+ if (group_id.isNull())
+ return LLColor4::transparent;
+
+ auto it = mColors.find(group_id);
+ if (it != mColors.end())
+ return it->second;
+
+ return LLColor4::transparent;
+}
+
+bool LLGroupColorMap::hasGroupColor(const LLUUID& group_id) const
+{
+ if (group_id.isNull())
+ return false;
+ return mColors.find(group_id) != mColors.end();
+}
+
+void LLGroupColorMap::clearGroupColor(const LLUUID& group_id)
+{
+ if (mColors.erase(group_id) > 0)
+ {
+ saveToDisk();
+ invalidateAllNameTags();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Persistence
+// ---------------------------------------------------------------------------
+
+// static
+std::string LLGroupColorMap::getFilePath()
+{
+ std::string path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "");
+ if (!path.empty())
+ return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, GROUP_COLOR_FILE);
+ // Fall back to app_settings (before first login, path not yet set)
+ return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, GROUP_COLOR_FILE);
+}
+
+void LLGroupColorMap::loadFromDisk()
+{
+ mColors.clear();
+
+ const std::string filepath = getFilePath();
+ if (!gDirUtilp->fileExists(filepath))
+ return;
+
+ llifstream stream(filepath.c_str());
+ if (!stream.is_open())
+ {
+ LL_WARNS("GroupColor") << "Cannot open " << filepath << LL_ENDL;
+ return;
+ }
+
+ LLSD data;
+ if (LLSDSerialize::fromXMLDocument(data, stream) < 0)
+ {
+ LL_WARNS("GroupColor") << "Failed to parse " << filepath << LL_ENDL;
+ return;
+ }
+
+ // Format: map of { group_uuid_string : [r, g, b, a] }
+ for (LLSD::map_const_iterator it = data.beginMap(); it != data.endMap(); ++it)
+ {
+ LLUUID group_id(it->first);
+ if (group_id.isNull()) continue;
+ LLColor4 color = ll_color4_from_sd(it->second);
+ if (color.mV[VW] >= 0.01f)
+ mColors[group_id] = color;
+ }
+
+ LL_INFOS("GroupColor") << "Loaded " << mColors.size()
+ << " group color(s) from " << filepath << LL_ENDL;
+}
+
+void LLGroupColorMap::saveToDisk() const
+{
+ const std::string filepath = getFilePath();
+
+ LLSD data = LLSD::emptyMap();
+ for (const auto& [group_id, color] : mColors)
+ data[group_id.asString()] = ll_sd_from_color4(color);
+
+ llofstream stream(filepath.c_str());
+ if (!stream.is_open())
+ {
+ LL_WARNS("GroupColor") << "Cannot write " << filepath << LL_ENDL;
+ return;
+ }
+ LLSDSerialize::toPrettyXML(data, stream);
+}
+
+// ---------------------------------------------------------------------------
+// Invalidation
+// ---------------------------------------------------------------------------
+
+// static
+void LLGroupColorMap::invalidateAllNameTags()
+{
+ LLVOAvatar::invalidateNameTags();
+}
diff --git a/indra/newview/llgroupcolormap.h b/indra/newview/llgroupcolormap.h
new file mode 100644
index 0000000000..d6f661c43a
--- /dev/null
+++ b/indra/newview/llgroupcolormap.h
@@ -0,0 +1,64 @@
+/**
+ * @file llgroupcolormap.h
+ * @brief Per-group nameplate tint registry.
+ *
+ * Stores a client-side color for each group UUID. When the group color is
+ * set, every avatar whose *active* group tag matches that UUID gets their
+ * nameplate rendered in that color instead of the default.
+ *
+ * Data is persisted to <account_dir>/settings_group_colors.xml so colors
+ * survive relogs. The file is keyed by group UUID string → LLColor4 LLSD.
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 only.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLGROUPCOLORMAP_H
+#define LL_LLGROUPCOLORMAP_H
+
+#include "llsingleton.h"
+#include "lluuid.h"
+#include "v4color.h"
+#include <unordered_map>
+
+class LLGroupColorMap : public LLSingleton<LLGroupColorMap>
+{
+ LLSINGLETON(LLGroupColorMap);
+ ~LLGroupColorMap() = default;
+ LOG_CLASS(LLGroupColorMap);
+
+public:
+ // ---- Color CRUD ---------------------------------------------------------
+
+ /** Set (or clear) the nameplate tint for a group.
+ * Pass LLColor4::transparent (alpha == 0) to remove the color entry. */
+ void setGroupColor(const LLUUID& group_id, const LLColor4& color);
+
+ /** Return the tint for @p group_id, or LLColor4::transparent if none. */
+ LLColor4 getGroupColor(const LLUUID& group_id) const;
+
+ /** True if a non-transparent color is stored for this group. */
+ bool hasGroupColor(const LLUUID& group_id) const;
+
+ /** Remove the color entry for this group. */
+ void clearGroupColor(const LLUUID& group_id);
+
+ // ---- Persistence --------------------------------------------------------
+ void loadFromDisk();
+ void saveToDisk() const;
+
+ // ---- Cache invalidation -------------------------------------------------
+ /** Called after a color is changed so nametags rebuild on next idle. */
+ static void invalidateAllNameTags();
+
+private:
+ static std::string getFilePath();
+
+ // group_uuid → RGBA color (std::hash<LLUUID> is specialised in lluuid.h)
+ std::unordered_map<LLUUID, LLColor4> mColors;
+};
+
+#endif // LL_LLGROUPCOLORMAP_H
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 38ae818910..aaa5b2ce9c 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -28,6 +28,8 @@
#include "llpanelgroupgeneral.h"
+#include "llcolorswatch.h" // LLColorSwatchCtrl – group nameplate tinting
+#include "llgroupcolormap.h" // per-group nameplate tinting
#include "llavatarnamecache.h"
#include "llagent.h"
#include "llagentbenefits.h"
@@ -188,6 +190,22 @@ bool LLPanelGroupGeneral::postBuild()
mIncompleteMemberDataStr = getString("incomplete_member_data_str");
+ // Group nameplate tinting: wire up the color swatch
+ mGroupColorSwatch = getChild<LLColorSwatchCtrl>("group_nametag_color", recurse);
+ if (mGroupColorSwatch)
+ {
+ mGroupColorSwatch->setCanApplyImmediately(false);
+ mGroupColorSwatch->setCommitCallback([this](LLUICtrl*, const LLSD&) { onGroupColorChanged(); });
+ mGroupColorSwatch->setOnCancelCallback([this](LLUICtrl*, const LLSD&) { onGroupColorCancelled(); });
+ mGroupColorSwatch->setOnSelectCallback([this](LLUICtrl*, const LLSD&) { onGroupColorChanged(); });
+ refreshGroupColorSwatch();
+ }
+ LLButton* clear_color_btn = getChild<LLButton>("group_nametag_color_clear", recurse);
+ if (clear_color_btn)
+ {
+ clear_color_btn->setCommitCallback([this](LLUICtrl*, const LLSD&) { onGroupColorCleared(); });
+ }
+
// If the group_id is null, then we are creating a new group
if (mGroupID.isNull())
{
@@ -798,7 +816,65 @@ void LLPanelGroupGeneral::setGroupID(const LLUUID& id)
mInsignia->setImageAssetID(LLUUID::null);
+ // Refresh the nameplate color swatch to show the stored color for this group
+ refreshGroupColorSwatch();
+
resetDirty();
activate();
}
+
+// ---------------------------------------------------------------------------
+// Group nameplate tinting callbacks
+// ---------------------------------------------------------------------------
+
+void LLPanelGroupGeneral::onGroupColorChanged()
+{
+ if (!mGroupColorSwatch || mGroupID.isNull())
+ return;
+
+ LLColor4 color = mGroupColorSwatch->get();
+ LLGroupColorMap::getInstance()->setGroupColor(mGroupID, color);
+}
+
+void LLPanelGroupGeneral::onGroupColorCancelled()
+{
+ // Picker was cancelled — restore whatever is currently saved
+ refreshGroupColorSwatch();
+}
+
+void LLPanelGroupGeneral::onGroupColorCleared()
+{
+ if (mGroupID.isNull())
+ return;
+
+ LLGroupColorMap::getInstance()->clearGroupColor(mGroupID);
+ refreshGroupColorSwatch();
+}
+
+void LLPanelGroupGeneral::refreshGroupColorSwatch()
+{
+ if (!mGroupColorSwatch)
+ return;
+
+ if (mGroupID.isNull())
+ {
+ // No group selected — show a neutral white and disable
+ mGroupColorSwatch->set(LLColor4::white, false);
+ mGroupColorSwatch->setEnabled(false);
+ return;
+ }
+
+ mGroupColorSwatch->setEnabled(true);
+
+ LLColor4 stored = LLGroupColorMap::getInstance()->getGroupColor(mGroupID);
+ if (stored.mV[VW] >= 0.01f)
+ {
+ mGroupColorSwatch->set(stored, false);
+ }
+ else
+ {
+ // No color stored yet — show white as a neutral default
+ mGroupColorSwatch->set(LLColor4::white, false);
+ }
+}
diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h
index 37db2e96a0..613cc7b3a6 100644
--- a/indra/newview/llpanelgroupgeneral.h
+++ b/indra/newview/llpanelgroupgeneral.h
@@ -39,6 +39,7 @@ class LLCheckBoxCtrl;
class LLComboBox;
class LLSpinCtrl;
class LLAvatarName;
+class LLColorSwatchCtrl; // group nameplate tinting
class LLPanelGroupGeneral : public LLPanelGroupTab
{
@@ -99,6 +100,13 @@ private:
LLComboBox *mComboActiveTitle;
LLComboBox *mComboMature;
LLCheckBoxCtrl *mCtrlReceiveGroupChat; // <exodus/>
+
+ // Group nameplate tinting (client-side, stored in LLGroupColorMap)
+ LLColorSwatchCtrl* mGroupColorSwatch { nullptr };
+ void onGroupColorChanged();
+ void onGroupColorCancelled();
+ void onGroupColorCleared();
+ void refreshGroupColorSwatch();
};
#endif
diff --git a/indra/newview/llquickprefs.cpp b/indra/newview/llquickprefs.cpp
new file mode 100644
index 0000000000..800aa7abac
--- /dev/null
+++ b/indra/newview/llquickprefs.cpp
@@ -0,0 +1,205 @@
+/**
+ * @file llquickprefs.cpp
+ * @brief Quick Preferences floater: hover height and bandwidth sliders.
+ *
+ * Ported from Firestorm Viewer (quickprefs.cpp).
+ * Original authors: WoLf Loonie, Zi Ree, Ansariel Hiller @ Second Life.
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Phoenix Firestorm Viewer Source Code
+ * Copyright (C) 2011, WoLf Loonie @ Second Life
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llquickprefs.h"
+
+#include "llagent.h"
+#include "llsliderctrl.h"
+#include "lltextbox.h"
+#include "llviewercontrol.h"
+#include "llviewerregion.h"
+#include "llvoavatar.h" // for MIN_HOVER_Z / MAX_HOVER_Z
+#include "llvoavatarself.h" // for gAgentAvatarp, isAgentAvatarValid()
+
+// ---------------------------------------------------------------------------
+// Constructor / destructor
+// ---------------------------------------------------------------------------
+
+LLFloaterQuickPrefs::LLFloaterQuickPrefs(const LLSD& key)
+ : LLFloater(key)
+ , mAvatarZOffsetSlider(nullptr)
+{
+}
+
+LLFloaterQuickPrefs::~LLFloaterQuickPrefs()
+{
+ if (mRegionChangedSlot.connected())
+ {
+ mRegionChangedSlot.disconnect();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// postBuild – wire up all widgets
+// ---------------------------------------------------------------------------
+
+bool LLFloaterQuickPrefs::postBuild()
+{
+ // ---- Hover height slider ------------------------------------------------
+ mAvatarZOffsetSlider = getChild<LLSliderCtrl>("HoverHeightSlider");
+ mAvatarZOffsetSlider->setMinValue(MIN_HOVER_Z);
+ mAvatarZOffsetSlider->setMaxValue(MAX_HOVER_Z);
+
+ // Live preview while dragging
+ mAvatarZOffsetSlider->setCommitCallback(
+ boost::bind(&LLFloaterQuickPrefs::onAvatarZOffsetSliderMoved, this));
+
+ // Persist on release or typed entry
+ mAvatarZOffsetSlider->setSliderMouseUpCallback(
+ boost::bind(&LLFloaterQuickPrefs::onAvatarZOffsetFinalCommit, this));
+ mAvatarZOffsetSlider->setSliderEditorCommitCallback(
+ boost::bind(&LLFloaterQuickPrefs::onAvatarZOffsetFinalCommit, this));
+
+ // Pull current value from settings
+ syncAvatarZOffsetFromPreferenceSetting();
+
+ // Keep slider in sync when something else changes the setting (e.g. RLVa,
+ // the Edit Shape floater, or the standalone Hover Height floater).
+ if (gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ"))
+ {
+ gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")
+ ->getCommitSignal()
+ ->connect(boost::bind(
+ &LLFloaterQuickPrefs::syncAvatarZOffsetFromPreferenceSetting, this));
+ }
+ else
+ {
+ LL_WARNS("QuickPrefs") << "Control 'AvatarHoverOffsetZ' not found" << LL_ENDL;
+ }
+
+ // Watch for region changes so we can enable/disable the slider
+ if (!mRegionChangedSlot.connected())
+ {
+ mRegionChangedSlot = gAgent.addRegionChangedCallback(
+ boost::bind(&LLFloaterQuickPrefs::onRegionChanged, this));
+ }
+ onRegionChanged(); // evaluate current region immediately
+
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// onClose
+// ---------------------------------------------------------------------------
+
+void LLFloaterQuickPrefs::onClose(bool app_quitting)
+{
+ if (mRegionChangedSlot.connected())
+ {
+ mRegionChangedSlot.disconnect();
+ }
+ LLFloater::onClose(app_quitting);
+}
+
+// ---------------------------------------------------------------------------
+// Hover height callbacks
+// ---------------------------------------------------------------------------
+
+void LLFloaterQuickPrefs::onAvatarZOffsetSliderMoved()
+{
+ F32 value = mAvatarZOffsetSlider->getValueF32();
+ LLVector3 offset(0.0f, 0.0f, llclamp(value, MIN_HOVER_Z, MAX_HOVER_Z));
+
+ LL_INFOS("Avatar") << "QuickPrefs: setting hover from slider moved " << offset[VZ] << LL_ENDL;
+
+ if (gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled())
+ {
+ if (mAvatarZOffsetSlider->isMouseHeldDown())
+ {
+ // Live preview: send to avatar but don't persist yet
+ if (isAgentAvatarValid())
+ {
+ gAgentAvatarp->setHoverOffset(offset, false);
+ }
+ }
+ else
+ {
+ // Committed (e.g. arrow-key step): persist immediately
+ gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value);
+ }
+ }
+ else if (isAgentAvatarValid())
+ {
+ gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value);
+ }
+}
+
+void LLFloaterQuickPrefs::onAvatarZOffsetFinalCommit()
+{
+ F32 value = mAvatarZOffsetSlider->getValueF32();
+ LL_INFOS("Avatar") << "QuickPrefs: setting hover from slider final commit " << value << LL_ENDL;
+ gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",
+ llclamp(value, MIN_HOVER_Z, MAX_HOVER_Z));
+}
+
+// ---------------------------------------------------------------------------
+// Enable / disable based on region support
+// ---------------------------------------------------------------------------
+
+void LLFloaterQuickPrefs::updateAvatarZOffsetEditEnabled()
+{
+ bool enabled = gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled();
+
+ if (!enabled && isAgentAvatarValid())
+ {
+ enabled = true;
+ }
+
+ mAvatarZOffsetSlider->setEnabled(enabled);
+
+ if (enabled)
+ {
+ syncAvatarZOffsetFromPreferenceSetting();
+ }
+}
+
+void LLFloaterQuickPrefs::onRegionChanged()
+{
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region && region->simulatorFeaturesReceived())
+ {
+ updateAvatarZOffsetEditEnabled();
+ }
+ else if (region)
+ {
+ region->setSimulatorFeaturesReceivedCallback(
+ boost::bind(&LLFloaterQuickPrefs::onSimulatorFeaturesReceived, this, _1));
+ }
+}
+
+void LLFloaterQuickPrefs::onSimulatorFeaturesReceived(const LLUUID& region_id)
+{
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region && region->getRegionID() == region_id)
+ {
+ updateAvatarZOffsetEditEnabled();
+ }
+}
+
+void LLFloaterQuickPrefs::syncAvatarZOffsetFromPreferenceSetting()
+{
+ F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ");
+ mAvatarZOffsetSlider->setValue(value, false); // false = no commit signal
+}
diff --git a/indra/newview/llquickprefs.h b/indra/newview/llquickprefs.h
new file mode 100644
index 0000000000..0ef56a4299
--- /dev/null
+++ b/indra/newview/llquickprefs.h
@@ -0,0 +1,81 @@
+/**
+ * @file llquickprefs.h
+ * @brief Quick Preferences floater: hover height and bandwidth sliders.
+ *
+ * Ported from Firestorm Viewer (quickprefs.h / quickprefs.cpp).
+ * Original authors: WoLf Loonie, Zi Ree, Ansariel Hiller @ Second Life.
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Phoenix Firestorm Viewer Source Code
+ * Copyright (C) 2011, WoLf Loonie @ Second Life
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLQUICKPREFS_H
+#define LL_LLQUICKPREFS_H
+
+#include "llfloater.h"
+
+class LLSliderCtrl;
+class LLTextBox;
+
+/**
+ * @class LLFloaterQuickPrefs
+ *
+ * A lightweight "Quick Preferences" panel that lets the user adjust commonly
+ * tweaked settings on the fly without opening the full Preferences dialog:
+ * - Avatar hover height
+ * - Maximum network bandwidth
+ *
+ * Hover-height logic is ported 1:1 from Firestorm's FloaterQuickPrefs so that
+ * live-preview while dragging, final commit on mouse-up, and region-feature
+ * gating all work exactly the same way.
+ */
+class LLFloaterQuickPrefs : public LLFloater
+{
+public:
+ LLFloaterQuickPrefs(const LLSD& key);
+ virtual ~LLFloaterQuickPrefs();
+
+ bool postBuild() override;
+ void onClose(bool app_quitting) override;
+
+private:
+ // ---- Hover height -------------------------------------------------------
+ LLSliderCtrl* mAvatarZOffsetSlider;
+
+ /** Called every frame while the slider thumb is being dragged.
+ * Sends a live (non-persistent) hover offset to the avatar so the user
+ * gets immediate visual feedback. */
+ void onAvatarZOffsetSliderMoved();
+
+ /** Called when the drag ends (mouse-up) or the user types a value.
+ * Persists the value to AvatarHoverOffsetZ. */
+ void onAvatarZOffsetFinalCommit();
+
+ /** Enable/disable the slider based on whether the current region supports
+ * server-side hover height. */
+ void updateAvatarZOffsetEditEnabled();
+
+ /** Called when the region changes so we can re-evaluate the above. */
+ void onRegionChanged();
+ void onSimulatorFeaturesReceived(const LLUUID& region_id);
+
+ /** Pulls AvatarHoverOffsetZ from saved settings and pushes it to the slider
+ * without triggering a commit (avoids feedback loops). */
+ void syncAvatarZOffsetFromPreferenceSetting();
+
+ boost::signals2::connection mRegionChangedSlot;
+};
+
+#endif // LL_LLQUICKPREFS_H
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 98a97b9457..e5c272a264 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -207,6 +207,7 @@
#include "llstartuplistener.h"
#include "lltoolbarview.h"
#include "llexperiencelog.h"
+#include "llgroupcolormap.h" // group-based nameplate tinting
#include "llcleanup.h"
#include "llenvironment.h"
@@ -3344,6 +3345,9 @@ void LLStartUp::initExperiences()
boost::bind(&LLAgent::getRegionCapability, &gAgent, _1));
LLExperienceLog::instance().initialize();
+
+ // Load per-group nameplate colors for this account
+ LLGroupColorMap::getInstance()->loadFromDisk();
}
void LLStartUp::cleanupNameCache()
diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp
index c6e59a81c9..ff6c692699 100644
--- a/indra/newview/lltoolcomp.cpp
+++ b/indra/newview/lltoolcomp.cpp
@@ -52,6 +52,7 @@
#include "llagentcamera.h"
#include "llfloatertools.h"
#include "llviewercontrol.h"
+#include "llviewercamera.h" // NaCl: mouselook right-click zoom
extern LLControlGroup gSavedSettings;
@@ -791,10 +792,42 @@ bool LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask)
return false;
*/
+ // NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm).
+ // When right mouse is pressed without Alt, record the current FOV as the
+ // pre-zoom value (VX) and swap in the stored zoom target (VY).
+ // VZ == 1.0 means "currently zoomed", 0.0 means "not zoomed".
+ if (!(gKeyboard->currentMask(true) & MASK_ALT))
+ {
+ LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues");
+ F32 cameraAngle = gSavedSettings.getF32("CameraAngle");
+ mlFovValues.mV[VX] = cameraAngle; // save normal FOV
+ mlFovValues.mV[VZ] = 1.0f; // mark as zoomed
+ gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues);
+ gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VY]); // apply zoom FOV
+ }
+ // NaCl End
+
// Returning true will suppress the context menu
return true;
}
+// NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm).
+// Restore the pre-zoom FOV when the right mouse button is released.
+bool LLToolCompGun::handleRightMouseUp(S32 x, S32 y, MASK mask)
+{
+ LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues");
+ F32 cameraAngle = gSavedSettings.getF32("CameraAngle");
+ if (mlFovValues.mV[VZ] == 1.0f) // only restore if we entered zoom
+ {
+ mlFovValues.mV[VY] = cameraAngle; // save last zoomed FOV for next right-click
+ mlFovValues.mV[VZ] = 0.0f; // mark as not zoomed
+ gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues);
+ gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VX]); // restore normal FOV
+ }
+ return true;
+}
+// NaCl End
+
bool LLToolCompGun::handleMouseUp(S32 x, S32 y, MASK mask)
{
@@ -831,10 +864,28 @@ void LLToolCompGun::handleDeselect()
bool LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
- if (clicks > 0)
+ // NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm).
+ // If currently zoomed (right mouse held, VZ == 1.0), adjust the zoom level
+ // with the scroll wheel. Otherwise fall through to the original behaviour.
+ LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues");
+ F32 cameraAngle = gSavedSettings.getF32("CameraAngle");
+ mlFovValues.mV[VY] = cameraAngle;
+ if (mlFovValues.mV[VZ] > 0.0f)
+ {
+ // Scroll up (clicks > 0) = narrower FOV (zoom in); scroll down = wider (zoom out).
+ mlFovValues.mV[VY] = llclamp(
+ mlFovValues.mV[VY] + (F32)(clicks * 0.1f),
+ LLViewerCamera::getInstance()->getMinView(),
+ LLViewerCamera::getInstance()->getMaxView());
+ gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues);
+ gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VY]);
+ }
+ else if (clicks > 0 && gSavedSettings.getBOOL("FSScrollWheelExitsMouselook"))
{
+ // Not zoomed: scroll up exits mouselook (original behaviour, now gated by setting).
gAgentCamera.changeCameraToDefault();
-
}
+ // NaCl End
+
return true;
}
diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h
index 4b945967d1..d868b2e9bf 100644
--- a/indra/newview/lltoolcomp.h
+++ b/indra/newview/lltoolcomp.h
@@ -53,6 +53,7 @@ public:
virtual bool handleHover(S32 x, S32 y, MASK mask) { return mCur->handleHover( x, y, mask ); }
virtual bool handleScrollWheel(S32 x, S32 y, S32 clicks) { return mCur->handleScrollWheel( x, y, clicks ); }
virtual bool handleRightMouseDown(S32 x, S32 y, MASK mask) { return mCur->handleRightMouseDown( x, y, mask ); }
+ virtual bool handleRightMouseUp(S32 x, S32 y, MASK mask) { return mCur->handleRightMouseUp( x, y, mask ); } // NaCl: mouselook zoom
virtual LLViewerObject* getEditingObject() { return mCur->getEditingObject(); }
virtual LLVector3d getEditingPointGlobal() { return mCur->getEditingPointGlobal(); }
@@ -228,6 +229,7 @@ public:
virtual bool handleMouseDown(S32 x, S32 y, MASK mask) override;
virtual bool handleDoubleClick(S32 x, S32 y, MASK mask) override;
virtual bool handleRightMouseDown(S32 x, S32 y, MASK mask) override;
+ virtual bool handleRightMouseUp(S32 x, S32 y, MASK mask) override; // NaCl: mouselook zoom
virtual bool handleMouseUp(S32 x, S32 y, MASK mask) override;
virtual bool handleScrollWheel(S32 x, S32 y, S32 clicks) override;
virtual void onMouseCaptureLost() override;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index fe2d44a401..7d97151e9d 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -316,6 +316,24 @@ static void update_tp_display(bool minimized)
{
// Transition to REQUESTED. Viewer has sent some kind
// of TeleportRequest to the source simulator
+
+ // NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm).
+ // Reset the mouselook zoom state on teleport so we don't get stuck at
+ // the zoomed FOV after arriving at the destination.
+ if (gAgentCamera.cameraMouselook())
+ {
+ LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues");
+ bool wasZoomed = (mlFovValues.mV[VZ] > 0.0f);
+ mlFovValues.mV[VZ] = 0.0f; // clear "currently zoomed" flag
+ gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues);
+ if (wasZoomed)
+ {
+ // Restore the normal (pre-zoom) FOV
+ gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VX]);
+ }
+ }
+ // NaCl End
+
gTeleportDisplayTimer.reset();
const std::string& msg = LLAgent::sTeleportProgressMessages["requesting"];
LL_INFOS("Teleport") << "A teleport request has been sent, setting state to TELEPORT_REQUESTED" << LL_ENDL;
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 50cc2442cb..2a2542ff57 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -85,6 +85,7 @@
#include "llfloatergroups.h"
#include "llfloaterhelpbrowser.h"
#include "llfloaterhoverheight.h"
+#include "llquickprefs.h" // Quick Preferences floater (Firestorm port)
#include "mpfloatertuning.h"
#include "llfloaterhowto.h"
#include "llfloaterhud.h"
@@ -393,6 +394,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("help_browser", "floater_help_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHelpBrowser>);
LLFloaterReg::add("edit_hover_height", "floater_edit_hover_height.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHoverHeight>);
+ LLFloaterReg::add("quick_prefs", "floater_quick_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterQuickPrefs>); // Firestorm port
LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>);
LLFloaterReg::add("mpv_performance", "floater_mp_performance.xml", (LLFloaterBuildFunc)&
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8dab1e42d0..4632800e2d 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4784,6 +4784,19 @@ class LLViewMouselook : public view_listener_t
}
else
{
+ // NaCl: Right-click + scroll wheel zoom in mouselook (ported from Firestorm).
+ // If we were zoomed when the user toggles out of mouselook, restore the
+ // normal (pre-zoom) FOV before switching back to the default camera.
+ LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues");
+ F32 cameraAngle = gSavedSettings.getF32("CameraAngle");
+ if (mlFovValues.mV[VZ] > 0.0f)
+ {
+ mlFovValues.mV[VY] = cameraAngle; // preserve last zoomed FOV
+ mlFovValues.mV[VZ] = 0.0f;
+ gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues);
+ gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VX]); // restore normal FOV
+ }
+ // NaCl End
gAgentCamera.changeCameraToDefault();
}
return true;
@@ -7154,6 +7167,13 @@ void handle_hover_height()
LLFloaterReg::showInstance("edit_hover_height");
}
+// Firestorm port: Quick Preferences floater (hover height, bandwidth)
+void handle_quick_prefs()
+{
+ LLFloaterReg::toggleInstance("quick_prefs");
+}
+// End Firestorm port
+
void handle_edit_physics()
{
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_physics"));
@@ -9983,6 +10003,7 @@ void initialize_menus()
commit.add("EditShape", boost::bind(&handle_edit_shape));
commit.add("HoverHeight", boost::bind(&handle_hover_height));
commit.add("EditPhysics", boost::bind(&handle_edit_physics));
+ commit.add("QuickPrefs", boost::bind(&handle_quick_prefs)); // Firestorm port
// View menu
view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook");
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 384b45ca4c..16f2064d1b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -44,6 +44,7 @@
#include "llanimationstates.h"
#include "llavatarnamecache.h"
#include "llavatarpropertiesprocessor.h"
+#include "llgroupcolormap.h" // group-based nameplate tinting
#include "llavatarrendernotifier.h"
#include "llcontrolavatar.h"
#include "llexperiencecache.h"
@@ -674,6 +675,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mNameAlpha(0.f),
mRenderGroupTitles(sRenderGroupTitles),
mNameCloud(false),
+ mActiveGroupID(),
+ mGroupFetchPending(false),
mFirstTEMessageReceived( false ),
mFirstAppearanceMessageReceived( false ),
mCulled( false ),
@@ -3650,7 +3653,26 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
mNameAppearance = is_appearance;
mNameFriend = is_friend;
mNameCloud = is_cloud;
- mTitle = title ? title->getString() : "";
+
+ // Group-based nameplate tinting: when the title NameValue changes on a
+ // non-self avatar it means their active group (or role) changed. Fire
+ // a lightweight AvatarPropertiesRequest so the AvatarGroupsReply arrives
+ // and we can discover the active group UUID. We register ourselves as an
+ // observer for APT_GROUPS in processProperties() below.
+ const std::string new_title = title ? title->getString() : "";
+ if (!isSelf() && new_title != mTitle)
+ {
+ // Reset cached group UUID - it will be repopulated by the reply.
+ mActiveGroupID.setNull();
+ if (!mGroupFetchPending)
+ {
+ mGroupFetchPending = true;
+ LLAvatarPropertiesProcessor::getInstance()->addObserver(getID(), this);
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarLegacyPropertiesRequest(getID());
+ }
+ }
+
+ mTitle = new_title;
LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR);
new_name = true;
}
@@ -3883,7 +3905,80 @@ LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
// ...not using display names
color_name = "NameTagLegacy";
}
- return LLUIColorTable::getInstance()->getColor( color_name );
+
+ LLColor4 base_color = LLUIColorTable::getInstance()->getColor(color_name);
+
+ // Group-based nameplate tinting: override with the group color if one is set.
+ // For self, the active group UUID is always available via gAgent.
+ // For others, it is populated asynchronously via AvatarGroupsReply.
+ LLUUID active_group;
+ if (isSelf())
+ {
+ active_group = gAgent.getGroupID();
+ }
+ else
+ {
+ active_group = mActiveGroupID;
+ }
+
+ if (active_group.notNull())
+ {
+ LLColor4 group_color = LLGroupColorMap::getInstance()->getGroupColor(active_group);
+ if (group_color.mV[VW] >= 0.01f) // non-transparent = has a color set
+ {
+ return group_color;
+ }
+ }
+
+ return base_color;
+}
+
+// ---------------------------------------------------------------------------
+// Group-based nameplate tinting: observer callback
+// ---------------------------------------------------------------------------
+
+void LLVOAvatar::processProperties(void* data, EAvatarProcessorType type)
+{
+ if (type != APT_GROUPS)
+ return;
+
+ LLAvatarGroups* groups = static_cast<LLAvatarGroups*>(data);
+ if (!groups || groups->avatar_id != getID())
+ return;
+
+ // Un-register ourselves — we only need this one reply per title change.
+ LLAvatarPropertiesProcessor::getInstance()->removeObserver(getID(), this);
+ mGroupFetchPending = false;
+
+ // The active group is the one whose GroupTitle matches the avatar's
+ // current Title NameValue (mTitle). Each avatar can only have one
+ // selected role title displayed at a time, so this match is unambiguous.
+ for (const auto& gd : groups->group_list)
+ {
+ if (gd.group_title == mTitle)
+ {
+ mActiveGroupID = gd.group_id;
+ // Force nametag rebuild so new color is shown immediately.
+ clearNameTag();
+ return;
+ }
+ }
+
+ // No match found (e.g. avatar has no active group or title is blank).
+ mActiveGroupID.setNull();
+ clearNameTag();
+}
+
+// Request the group list for a non-self avatar so we can resolve their
+// active group UUID. Called from idleUpdateNameTagText on title change.
+void LLVOAvatar::sendAvatarGroupsRequest()
+{
+ if (!isSelf() && !mGroupFetchPending)
+ {
+ mGroupFetchPending = true;
+ LLAvatarPropertiesProcessor::getInstance()->addObserver(getID(), this);
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarLegacyPropertiesRequest(getID());
+ }
}
void LLVOAvatar::idleUpdateBelowWater()
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index fc3a97a25d..70e31363ff 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -36,6 +36,7 @@
#include <boost/signals2/trackable.hpp>
#include "llavatarappearance.h"
+#include "llavatarpropertiesprocessor.h" // LLAvatarPropertiesObserver (group tinting)
#include "llchat.h"
#include "lldrawpoolalpha.h"
#include "llviewerobject.h"
@@ -87,6 +88,7 @@ extern U32 gFrameCount;
class LLVOAvatar :
public LLAvatarAppearance,
public LLViewerObject,
+ public LLAvatarPropertiesObserver, // group-based nameplate tinting
public boost::signals2::trackable
{
LL_ALIGN_NEW;
@@ -292,6 +294,10 @@ public:
void idleUpdateNameTagAlpha(bool new_name, F32 alpha);
LLColor4 getNameTagColor(bool is_friend);
void clearNameTag();
+
+ // LLAvatarPropertiesObserver: receives APT_GROUPS reply for group-tint lookup
+ /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override;
+ void sendAvatarGroupsRequest();
static void invalidateNameTag(const LLUUID& agent_id);
// force all name tags to rebuild, useful when display names turned on/off
static void invalidateNameTags();
@@ -1122,6 +1128,10 @@ private:
F32 mNameAlpha;
S32 mRenderGroupTitles;
+ // Group-based nameplate tinting
+ LLUUID mActiveGroupID; // active group UUID; null until known
+ bool mGroupFetchPending; // true while AvatarPropertiesRequest is in flight
+
//--------------------------------------------------------------------
// Display the name (then optionally fade it out)
//--------------------------------------------------------------------
diff --git a/indra/newview/skins/default/xui/en/floater_quick_prefs.xml b/indra/newview/skins/default/xui/en/floater_quick_prefs.xml
new file mode 100644
index 0000000000..8b20fda6f5
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_quick_prefs.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<!--
+ floater_quick_prefs.xml
+ Quick Preferences panel – ported from Firestorm Viewer.
+ Provides on-the-fly access to avatar hover height and max bandwidth.
+-->
+<floater
+ positioning="cascading"
+ can_minimize="true"
+ can_close="true"
+ can_resize="false"
+ height="96"
+ width="320"
+ layout="topleft"
+ name="quick_prefs"
+ single_instance="true"
+ help_topic="quick_prefs"
+ save_rect="true"
+ save_visibility="false"
+ title="QUICK PREFERENCES">
+
+ <!-- ── Hover Height ─────────────────────────────────────────────────── -->
+ <text
+ type="string"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="10"
+ top="28"
+ width="100"
+ name="HoverHeightLabel"
+ tool_tip="Adjust your avatar's hover height above the ground">
+ Hover Height:
+ </text>
+
+ <slider
+ control_name="HoverHeightSlider"
+ decimal_digits="3"
+ enabled="false"
+ can_edit_text="true"
+ follows="left|right|top"
+ height="16"
+ increment="0.001"
+ initial_value="0.0"
+ label_width="0"
+ layout="topleft"
+ left="110"
+ right="-10"
+ top="30"
+ name="HoverHeightSlider"
+ tool_tip="Drag to set your avatar hover height (-3.0 to +3.0 m)" />
+
+ <!-- ── Max Bandwidth ────────────────────────────────────────────────── -->
+ <text
+ type="string"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="10"
+ top_pad="12"
+ width="100"
+ name="MaxBandwidthLabel"
+ tool_tip="Set the maximum network bandwidth in Kbps">
+ Max Bandwidth:
+ </text>
+
+ <slider
+ control_name="ThrottleBandwidthKBPS"
+ decimal_digits="0"
+ can_edit_text="true"
+ follows="left|right|top"
+ height="16"
+ increment="50"
+ initial_value="500"
+ max_val="3000"
+ min_val="50"
+ label_width="0"
+ layout="topleft"
+ left="110"
+ right="-10"
+ top_delta="-2"
+ name="max_bandwidth"
+ tool_tip="Network bandwidth in Kbps (50 – 3000)" />
+
+</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 5335e0f8bd..48ee13bf21 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -206,6 +206,14 @@
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call
+ label="Quick Preferences..."
+ layout="topleft"
+ name="Quick Preferences"
+ shortcut="alt|control|Q">
+ <menu_item_call.on_click
+ function="QuickPrefs" />
+ </menu_item_call>
+ <menu_item_call
label="Edit shape..."
layout="topleft"
name="Edit My Shape">
diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml
index d97411f5ab..e0fec0f5fd 100644
--- a/indra/newview/skins/default/xui/en/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_general.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel
label="General"
- height="420"
+ height="580"
width="304"
class="panel_group_general"
name="general_tab">
@@ -95,6 +95,53 @@ Hover your mouse over the options for more help.
visible="true"
width="120" />
</panel>
+
+ <!-- Nameplate tinting: isolated panel, placed after group_info_top -->
+ <panel
+ name="nametag_color_panel"
+ follows="left|right|top"
+ layout="topleft"
+ left="0"
+ top="129"
+ width="304"
+ height="36"
+ background_visible="false">
+ <text
+ type="string"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="5"
+ top="2"
+ width="160"
+ name="nametag_color_label"
+ text_color="EmphasisColor">
+ Nameplate Color:
+ </text>
+ <color_swatch
+ can_apply_immediately="false"
+ follows="left|top"
+ height="22"
+ label=""
+ label_height="0"
+ layout="topleft"
+ left="170"
+ top="2"
+ name="group_nametag_color"
+ tool_tip="Click to set nameplate color for this group"
+ width="54" />
+ <button
+ follows="left|top"
+ height="22"
+ label="Clear"
+ layout="topleft"
+ left="230"
+ top="2"
+ name="group_nametag_color_clear"
+ tool_tip="Remove the nameplate color for this group"
+ width="60" />
+ </panel>
+
<text_editor
type="string"
follows="left|top|right"
@@ -104,7 +151,7 @@ Hover your mouse over the options for more help.
max_length="511"
name="charter"
parse_urls="true"
- top="105"
+ top="170"
right="-4"
bg_readonly_color="DkGray2"
text_readonly_color="White"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 6e48577064..418dd7ef45 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -4219,6 +4219,7 @@ name="Command_360_Capture_Label">360 snapshot</string>
<string name="Command_Picks_Label">Picks</string>
<string name="Command_Places_Label">Places</string>
<string name="Command_Preferences_Label">Preferences</string>
+ <string name="Command_QuickPrefs_Label">Quick Prefs</string>
<string name="Command_Profile_Label">Profile</string>
<string name="Command_Report_Abuse_Label">Report Abuse</string>
<string name="Command_Search_Label">Search</string>
@@ -4254,6 +4255,7 @@ name="Command_360_Capture_Tooltip">Capture a 360 equirectangular image</string>
<string name="Command_Picks_Tooltip">Places to show as favorites in your profile</string>
<string name="Command_Places_Tooltip">Places you've saved</string>
<string name="Command_Preferences_Tooltip">Preferences</string>
+ <string name="Command_QuickPrefs_Tooltip">Quickly adjust hover height and bandwidth</string>
<string name="Command_Profile_Tooltip">Edit or view your profile</string>
<string name="Command_Report_Abuse_Tooltip">Report Abuse</string>
<string name="Command_Search_Tooltip">Find places, events, people</string>