diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8de0df9d1d..612c4923e2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -26271,6 +26271,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSShowChatRangeSpheres + + Comment + Show chat range spheres (whisper, say, shout) in 3D world around avatar + Persist + 1 + Type + Boolean + Value + 0 + FSUseReadOfflineMsgsCap Comment diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 99a959bbe4..2b8f89ac6e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -96,6 +96,12 @@ #include "llpresetsmanager.h" #include "fsdata.h" +// Render chat range spheres in 3D world +#include "lfsimfeaturehandler.h" +#include "llrendersphere.h" +#include "lluicolortable.h" +// + #include #include #include @@ -1767,6 +1773,55 @@ void draw_axes() gGL.popMatrix(); } +// Render chat range spheres in 3D world +static void renderChatRangeSphere(const LLVector3& center, F32 radius, const LLColor4& color) +{ + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + { + gGL.translatef(center.mV[VX], center.mV[VY], center.mV[VZ]); + gDebugProgram.bind(); + LLGLEnable blend(GL_BLEND); + LLGLDepthTest depth(GL_TRUE, GL_TRUE); + gGL.color4fv(color.mV); + gGL.diffuseColor4fv(color.mV); + gGL.pushMatrix(); + { + gGL.scalef(radius, radius, radius); + glCullFace(GL_FRONT); + gSphere.render(); + glCullFace(GL_BACK); + gSphere.render(); + } + gGL.popMatrix(); + gUIProgram.bind(); + } + gGL.popMatrix(); +} + +static void drawChatRangeSpheres() +{ + static LLCachedControl show_spheres(gSavedSettings, "FSShowChatRangeSpheres", false); + if (!show_spheres() || !isAgentAvatarValid()) + { + return; + } + + LFSimFeatureHandler& simfeatures = LFSimFeatureHandler::instance(); + F32 whisper_range = (F32)simfeatures.whisperRange(); + F32 say_range = (F32)simfeatures.sayRange(); + F32 shout_range = (F32)simfeatures.shoutRange(); + + LLVector3 avatar_pos = gAgent.getPositionAgent(); + static LLUIColor whisper_color = LLUIColorTable::instance().getColor("MapWhisperRingColor", LLColor4::blue); + static LLUIColor say_color = LLUIColorTable::instance().getColor("MapChatRingColor", LLColor4::yellow); + static LLUIColor shout_color = LLUIColorTable::instance().getColor("MapShoutRingColor", LLColor4::red); + renderChatRangeSphere(avatar_pos, whisper_range, whisper_color); + renderChatRangeSphere(avatar_pos, say_range, say_color); + renderChatRangeSphere(avatar_pos, shout_range, shout_color); +} +// + void render_ui_3d() { LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; @@ -1799,6 +1854,10 @@ void render_ui_3d() draw_axes(); } + // Render chat range spheres in 3D world + drawChatRangeSpheres(); + // + gViewerWindow->renderSelections(false, false, true); // Non HUD call in render_hud_elements if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) diff --git a/indra/newview/skins/default/xui/en/floater_beacons.xml b/indra/newview/skins/default/xui/en/floater_beacons.xml index b28f1428a1..4f88c30b84 100644 --- a/indra/newview/skins/default/xui/en/floater_beacons.xml +++ b/indra/newview/skins/default/xui/en/floater_beacons.xml @@ -1,7 +1,7 @@ + +