diff options
| author | Hadet <hadet@terminus.local> | 2026-05-23 21:28:25 -0500 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-05-25 09:47:04 +0700 |
| commit | 3ac400d744971db9cf7bbfb6df3c1f0ef5662c82 (patch) | |
| tree | 53323b654c60b80af2d9d9e1123573b0b0424267 /indra/newview/llpanelgroupgeneral.cpp | |
| parent | 9b1fa446a1148485bfc075fb6c5c8b286e827589 (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
Diffstat (limited to 'indra/newview/llpanelgroupgeneral.cpp')
| -rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
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); + } +} |
