Pick up a few changes from Alchemy for LookAt beacons

Implements lines from avatar to their lookat beacons
Implements namesystem so that Display Names can also be shown with beacons instead of just legacy

New options are available in the Security & Privacy tab of System preferences
This commit is contained in:
Inusaito Sayori
2014-05-24 05:26:32 -04:00
parent bbe7f6adfb
commit 0d94dd7bf8
5 changed files with 58 additions and 2 deletions

View File

@@ -58,6 +58,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>LookAtNameSystem</key>
<map>
<key>Comment</key>
<string>For name on lookat crosshairs. 0 = Old Style, 1 = Display Names and Username, 2 = Displayname only, 3 = Old Style (Display Name), less than 0 for off</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>PhoenixNameSystem</key>
<map>
<key>Comment</key>
@@ -91,6 +102,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>AlchemyLookAtLines</key>
<map>
<key>Comment</key>
<string>Render a line from Look At beacon to the originating avatar</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>AlchemyRegionRestartShake</key>
<map>
<key>Comment</key>

View File

@@ -187,6 +187,8 @@ void LLPrefsAscentSys::refreshValues()
mDisablePointAtAndBeam = gSavedSettings.getBOOL("DisablePointAtAndBeam");
mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt");
mShowLookAt = gSavedSettings.getBOOL("AscentShowLookAt");
mLookAtNames = gSavedSettings.getS32("LookAtNameSystem");
mLookAtLines = gSavedSettings.getBOOL("AlchemyLookAtLines");
mQuietSnapshotsToDisk = gSavedSettings.getBOOL("QuietSnapshotsToDisk");
mAnnounceBumps = gSavedSettings.getBOOL("AnnounceBumps");
mDetachBridge = gSavedSettings.getBOOL("SGDetachBridge");
@@ -230,7 +232,7 @@ void LLPrefsAscentSys::refresh()
ctrl->setValue(mPowerUser);
}
//Security ----------------------------------------------------------------------------
//Command Line ----------------------------------------------------------------------------
childSetValue("AscentCmdLinePos", mCmdLinePos);
childSetValue("AscentCmdLineGround", mCmdLineGround);
childSetValue("AscentCmdLineHeight", mCmdLineHeight);
@@ -250,6 +252,9 @@ void LLPrefsAscentSys::refresh()
//Security ----------------------------------------------------------------------------
getChildView("UISndRestart")->setValue(mRestartSound);
if (LLComboBox* combo = getChild<LLComboBox>("lookat_namesystem_combobox"))
combo->setValue(mLookAtNames);
//Build -------------------------------------------------------------------------------
childSetValue("alpha", mAlpha);
getChild<LLColorSwatchCtrl>("colorswatch")->setOriginal(mColor);
@@ -319,6 +324,8 @@ void LLPrefsAscentSys::cancel()
gSavedSettings.setBOOL("DisablePointAtAndBeam", mDisablePointAtAndBeam);
gSavedSettings.setBOOL("PrivateLookAt", mPrivateLookAt);
gSavedSettings.setBOOL("AscentShowLookAt", mShowLookAt);
gSavedSettings.setS32("LookAtNameSystem", mLookAtNames);
gSavedSettings.setBOOL("AlchemyLookAtLines", mLookAtLines);
gSavedSettings.setBOOL("QuietSnapshotsToDisk", mQuietSnapshotsToDisk);
gSavedSettings.setBOOL("AnnounceBumps", mAnnounceBumps);
gSavedSettings.setBOOL("SGDetachBridge", mDetachBridge);

View File

@@ -101,6 +101,8 @@ private:
bool mDisablePointAtAndBeam;
bool mPrivateLookAt;
bool mShowLookAt;
S32 mLookAtNames;
bool mLookAtLines;
bool mQuietSnapshotsToDisk;
bool mAnnounceBumps;
bool mDetachBridge;

View File

@@ -49,6 +49,7 @@
#include "llxmltree.h"
// <edit>
#include "llavatarnamecache.h"
#include "llresmgr.h"
#include "llhudrender.h"
#include "llviewerwindow.h"
@@ -532,10 +533,26 @@ void LLHUDEffectLookAt::render()
gGL.vertex3f(0.f, 0.f, -1.f);
gGL.vertex3f(0.f, 0.f, 1.f);
static const LLCachedControl<bool> lookAtLines(gSavedSettings, "AlchemyLookAtLines", false);
if (lookAtLines)
{
const std::string targname = (*mAttentions)[mTargetType].mName;
if (targname != "None" && targname != "Idle" && targname != "AutoListen")
{
LLVector3 dist = (mSourceObject->getWorldPosition() - mTargetPos) * 10/3;
gGL.vertex3f(0.f, 0.f, 0.f);
gGL.vertex3f(dist.mV[VX], dist.mV[VY], dist.mV[VZ] + 0.5f);
}
}
} gGL.end();
gGL.popMatrix();
// <edit>
const std::string text = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->getFullname();
static const LLCachedControl<S32> lookAtNames("LookAtNameSystem");
if (lookAtNames < 0) return;
std::string text;
LLAvatarNameCache::getPNSName(static_cast<LLVOAvatar*>(mSourceObject.get())->getID(), text, lookAtNames);
if (0 == text.compare(text.length() - 9, 9, " Resident"))
text.erase(text.length() - 9);
LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target;
offset.normalize();
LLVector3 shadow_offset = offset * 0.49f;

View File

@@ -87,6 +87,14 @@
<check_box bottom_delta="-20" control_name="DisablePointAtAndBeam" follows="top" initial_value="true" label="Disable Point At And Beam" tool_tip="Don't point at or show your edit beam when selecting an object." name="disable_point_at_and_beams_check"/>
<check_box bottom_delta="-20" control_name="PrivateLookAt" follows="top" initial_value="false" label="Do not Look At objects and/or avatars" tool_tip="Disables headturns and lookat beacons, causing your avatar to look straight ahead (unless scripted to do otherwise)." name="private_look_at_check"/>
<check_box bottom_delta="-20" control_name="AscentShowLookAt" follows="top" initial_value="false" label="Show others' LookAt beacons" tool_tip="Shows you where others are looking." name="show_look_at_check"/>
<combo_box bottom_delta="-1" left_delta="200" follows="top" height="18" control_name="LookAtNameSystem" name="lookat_namesystem_combobox" width="130" tool_tip="Style for displaying names on LookAt beacons">
<combo_item name="No Names" value="-1">No Names</combo_item>
<combo_item name="Old Names" value="0">Old Names</combo_item>
<combo_item name="Display Names (with Username)" value="1">Display Names (w/Username)</combo_item>
<combo_item name="Display Names only" value="2">Display Names only</combo_item>
<combo_item name="Old Names (with Display Names)" value="3">Old Names (w/Display)</combo_item>
</combo_box>
<check_box bottom_delta="-18" left="10" control_name="AlchemyLookAtLines" follows="top" label="Show a line from look at beacon to avatar" tool_tip="See a line connecting the camera focus point to the avatar. Useful to find where they are." name="lineslookat"/>
<check_box bottom_delta="-20" control_name="AnnounceBumps" follows="top" label="Announce in chat when people bump you" name="announce_bumps"/>
<check_box bottom_delta="-20" control_name="SGDetachBridge" follows="top" initial_value="false" label="Auto detach LSL Bridge" tool_tip="Automatically detach LSL Bridge of Phoenix or Firestorm viewer." name="detach_bridge"/>
<check_box bottom_delta="-20" control_name="QuietSnapshotsToDisk" follows="top" initial_value="false" label="Quiet Snapshots to Disk" tool_tip="Doesn't make a camera sound nor alert everyone when you take a snapshot to your computer." name="quiet_snapshots_check"/>