FIRE-12530: Added avatar distance and name plus target trackers in mouselook; Original implementation by Ayamo Nozaki (Exodus Viewer), added with modifications for Firestorm
parent
e75a7983cc
commit
d02e503b71
|
|
@ -2458,6 +2458,15 @@ BOOL LLPanelPreference::postBuild()
|
|||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:Ansariel> Exodus' mouselook combat feature
|
||||
if (hasChild("FSMouselookCombatFeatures", TRUE))
|
||||
{
|
||||
gSavedSettings.getControl("EnableMouselook")->getSignal()->connect(boost::bind(&LLPanelPreference::updateMouselookCombatFeatures, this));
|
||||
gSavedSettings.getControl("FSMouselookCombatFeatures")->getSignal()->connect(boost::bind(&LLPanelPreference::updateMouselookCombatFeatures, this));
|
||||
updateMouselookCombatFeatures();
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
////////////////////// PanelVoice ///////////////////
|
||||
if (hasChild("voice_unavailable", TRUE))
|
||||
{
|
||||
|
|
@ -2670,6 +2679,15 @@ void LLPanelPreference::onChatWindowChanged()
|
|||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:Ansariel> Exodus' mouselook combat feature
|
||||
void LLPanelPreference::updateMouselookCombatFeatures()
|
||||
{
|
||||
bool enabled = gSavedSettings.getBOOL("EnableMouselook") && gSavedSettings.getBOOL("FSMouselookCombatFeatures");
|
||||
getChild<LLCheckBoxCtrl>("ExodusMouselookIFF")->setEnabled(enabled);
|
||||
getChild<LLSliderCtrl>("ExodusMouselookIFFRange")->setEnabled(enabled);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
void LLPanelPreference::cancel()
|
||||
{
|
||||
for (control_values_map_t::iterator iter = mSavedValues.begin();
|
||||
|
|
|
|||
|
|
@ -279,6 +279,8 @@ private:
|
|||
void onEnableGrowlChanged();
|
||||
// <FS:Ansariel> Flash chat toolbar button notification
|
||||
void onChatWindowChanged();
|
||||
// <FS:Ansariel> Exodus' mouselook combat feature
|
||||
void updateMouselookCombatFeatures();
|
||||
|
||||
typedef std::map<std::string, LLColor4> string_color_map_t;
|
||||
string_color_map_t mSavedColors;
|
||||
|
|
|
|||
|
|
@ -1710,6 +1710,18 @@ void LLNetMap::handleClearMarks()
|
|||
{
|
||||
sAvatarMarksMap.clear();
|
||||
}
|
||||
|
||||
bool LLNetMap::getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color)
|
||||
{
|
||||
avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id);
|
||||
if (found != sAvatarMarksMap.end())
|
||||
{
|
||||
color = found->second;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//</FS:Ansariel>
|
||||
|
||||
void LLNetMap::handleCam()
|
||||
|
|
|
|||
|
|
@ -100,6 +100,9 @@ public:
|
|||
// <FS:Ansariel> Synchronize double click handling throughout instances
|
||||
void performDoubleClickAction(LLVector3d pos_global);
|
||||
|
||||
// <FS:Ansariel> Mark avatar feature
|
||||
static bool getAvatarMarkColor(const LLUUID& avatar_id, LLColor4& color);
|
||||
|
||||
private:
|
||||
const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
|
||||
void renderPoint(const LLVector3 &pos, const LLColor4U &color,
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ public:
|
|||
|
||||
static const std::string& getLabel() { return instance()->mLabel; }
|
||||
static const std::string& getToolTip() { return instance()->mToolTip; }
|
||||
|
||||
// <FS:Ansariel> Exodus' mouselook combat feature
|
||||
void drawMarker(const LLVector3d& pos_global, const LLColor4& color);
|
||||
|
||||
protected:
|
||||
LLTracker();
|
||||
~LLTracker();
|
||||
|
|
@ -119,7 +123,7 @@ protected:
|
|||
void stopTrackingLocation(BOOL clear_ui = FALSE);
|
||||
void stopTrackingLandmark(BOOL clear_ui = FALSE);
|
||||
|
||||
void drawMarker(const LLVector3d& pos_global, const LLColor4& color);
|
||||
//void drawMarker(const LLVector3d& pos_global, const LLColor4& color); <FS:Ansariel> Exodus' mouselook combat feature
|
||||
void setLandmarkVisited();
|
||||
void cacheLandmarkPosition();
|
||||
void purgeBeaconText();
|
||||
|
|
|
|||
|
|
@ -228,6 +228,8 @@
|
|||
|
||||
#include "utilitybar.h" // <FS:Zi> Support for the classic V1 style buttons in some skins
|
||||
#include "exopostprocess.h" // <FS:Ansariel> Exodus Vignette
|
||||
#include "llnetmap.h"
|
||||
#include "lggcontactsets.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
|
|
@ -2686,6 +2688,104 @@ void LLViewerWindow::draw()
|
|||
|
||||
// Draw tool specific overlay on world
|
||||
LLToolMgr::getInstance()->getCurrentTool()->draw();
|
||||
|
||||
// <exodus> Draw HUD stuff.
|
||||
bool inMouselook = gAgentCamera.cameraMouselook();
|
||||
static LLCachedControl<bool> fsMouselookCombatFeatures(gSavedSettings, "FSMouselookCombatFeatures", true);
|
||||
if (inMouselook && fsMouselookCombatFeatures)
|
||||
{
|
||||
S32 windowWidth = gViewerWindow->getWorldViewRectScaled().getWidth();
|
||||
S32 windowHeight = gViewerWindow->getWorldViewRectScaled().getHeight();
|
||||
|
||||
static const std::string unknown_agent = LLTrans::getString("Mouselook_Unknown_Avatar");
|
||||
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
|
||||
static LLCachedControl<F32> renderIFFRange(gSavedSettings, "ExodusMouselookIFFRange", 380.f);
|
||||
static LLCachedControl<bool> renderIFF(gSavedSettings, "ExodusMouselookIFF", true);
|
||||
static LLUICachedControl<F32> userPresetX("ExodusMouselookTextOffsetX", 0.f);
|
||||
static LLUICachedControl<F32> userPresetY("ExodusMouselookTextOffsetY", -150.f);
|
||||
static LLUICachedControl<U32> userPresetHAlign("ExodusMouselookTextHAlign", 2);
|
||||
|
||||
LLVector3d myPosition = gAgentCamera.getCameraPositionGlobal();
|
||||
LLQuaternion myRotation = LLViewerCamera::getInstance()->getQuaternion();
|
||||
|
||||
myRotation.set(-myRotation.mQ[VX], -myRotation.mQ[VY], -myRotation.mQ[VZ], myRotation.mQ[VW]);
|
||||
|
||||
uuid_vec_t avatars;
|
||||
std::vector<LLVector3d> positions;
|
||||
LLWorld::getInstance()->getAvatars(&avatars, &positions, gAgent.getPositionGlobal(), renderIFFRange);
|
||||
|
||||
bool crosshairRendered = false;
|
||||
|
||||
S32 length = avatars.size();
|
||||
if (length)
|
||||
{
|
||||
for (S32 i = 0; i < length; i++)
|
||||
{
|
||||
LLUUID& targetKey = avatars[i];
|
||||
if (targetKey == gAgentID)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
LLVector3d targetPosition = positions[i];
|
||||
if (targetPosition.isNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
LLColor4 targetColor = map_avatar_color.get();
|
||||
targetColor = LGGContactSets::getInstance()->colorize(targetKey, targetColor, LGG_CS_MINIMAP);
|
||||
|
||||
//color based on contact sets prefs
|
||||
if (LGGContactSets::getInstance()->hasFriendColorThatShouldShow(targetKey, LGG_CS_MINIMAP))
|
||||
{
|
||||
targetColor = LGGContactSets::getInstance()->getFriendColor(targetKey);
|
||||
}
|
||||
|
||||
LLColor4 mark_color;
|
||||
if (LLNetMap::getAvatarMarkColor(targetKey, mark_color))
|
||||
{
|
||||
targetColor = mark_color;
|
||||
}
|
||||
|
||||
if (renderIFF)
|
||||
{
|
||||
LLTracker::instance()->drawMarker(targetPosition, targetColor);
|
||||
}
|
||||
|
||||
if (inMouselook && !crosshairRendered)
|
||||
{
|
||||
LLVector3d magicVector = (targetPosition - myPosition) * myRotation;
|
||||
magicVector.setVec(-magicVector.mdV[VY], magicVector.mdV[VZ], magicVector.mdV[VX]);
|
||||
|
||||
if (magicVector.mdV[VX] > -0.75 && magicVector.mdV[VX] < 0.75 && magicVector.mdV[VZ] > 0.0 && magicVector.mdV[VY] > -1.5 && magicVector.mdV[VY] < 1.5) // Do not fuck with these, cheater. :(
|
||||
{
|
||||
LLAvatarName avatarName;
|
||||
std::string targetName = unknown_agent;
|
||||
if (LLAvatarNameCache::get(targetKey, &avatarName))
|
||||
{
|
||||
targetName = avatarName.getCompleteName();
|
||||
}
|
||||
|
||||
LLFontGL::getFontSansSerifBold()->renderUTF8(
|
||||
llformat("%s, %.2fm", targetName.c_str(), (targetPosition - myPosition).magVec()),
|
||||
0, (windowWidth / 2.f) + userPresetX, (windowHeight / 2.f) + userPresetY, targetColor,
|
||||
(LLFontGL::HAlign)((S32)userPresetHAlign), LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT
|
||||
);
|
||||
|
||||
crosshairRendered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!renderIFF && inMouselook && crosshairRendered)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// </exodus>
|
||||
|
||||
// Only show Mouselookinstructions if FSShowMouselookInstruction is TRUE
|
||||
static LLCachedControl<bool> fsShowMouselookInstructions(gSavedSettings, "FSShowMouselookInstructions");
|
||||
if( fsShowMouselookInstructions && (gAgentCamera.cameraMouselook() || LLFloaterCamera::inFreeCameraMode()) )
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@
|
|||
<check_box label="Mouselook verlassen, nachdem Fokus wiederlangt wurde" name="exit_mouselook_focus_on_focus" tool_tip="Verlässt den Mouselook-Modus, wenn Firestorm den Fokus wiederlangt hat, nachdem es im Hintergrund lief."/>
|
||||
<check_box label="Zeige Mouselook-Hilfestellungen" name="mouselook_instructions_visible" tool_tip="Zeigt Hilfestellungen zum Mouselook-Modus an."/>
|
||||
<check_box label="Zeige Fadenkreuz im Mouselook" name="ShowCrosshairs" tool_tip="Aktiviert die Fadenkreuz-Funktion innerhalb des Mouselook-Modus."/>
|
||||
<check_box label="Combat-Funktionen aktivieren" name="FSMouselookCombatFeatures"/>
|
||||
<check_box label="Ziel-Markierungen aktivieren" name="ExodusMouselookIFF"/>
|
||||
<slider label="Reichweite (m)" name="ExodusMouselookIFFRange"/>
|
||||
<text name="Mouse Sensitivity" width="195">
|
||||
Mausempfindlichkeit für Mouselook:
|
||||
</text>
|
||||
|
|
|
|||
|
|
@ -5848,4 +5848,8 @@ Setzen Sie den Editorpfad in Anführungszeichen
|
|||
<string name="Inbox_Folderview_New">
|
||||
Neu
|
||||
</string>
|
||||
|
||||
<string name="Mouselook_Unknown_Avatar">
|
||||
Unbekannter Avatar
|
||||
</string>
|
||||
</strings>
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@
|
|||
label="Don't use the mouse wheel to control zoom level of the camera"
|
||||
layout="topleft"
|
||||
name="FSDisableMouseWheelCameraZoom"
|
||||
top_pad="5"
|
||||
top_pad="2"
|
||||
width="315"/>
|
||||
<text
|
||||
follows="left|top"
|
||||
|
|
@ -201,8 +201,8 @@
|
|||
height="16"
|
||||
label="Show avatar in Mouselook"
|
||||
layout="topleft"
|
||||
left_delta="5"
|
||||
top_pad="7"
|
||||
left_delta="10"
|
||||
top_pad="2"
|
||||
name="first_person_avatar_visible"
|
||||
width="256" />
|
||||
<check_box
|
||||
|
|
@ -213,6 +213,7 @@
|
|||
label="Show user interface in Mouselook"
|
||||
layout="topleft"
|
||||
name="first_person_ui_visible"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="FSEnableRightclickMenuInMouselook"
|
||||
|
|
@ -223,6 +224,7 @@
|
|||
layout="topleft"
|
||||
name="FSEnableRightclickMenuInMouselook"
|
||||
tool_tip="Opens pie/context menu in mouselook mode upon ALT + right mouse button"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="FSLeaveMouselookOnFocus"
|
||||
|
|
@ -234,6 +236,7 @@
|
|||
layout="topleft"
|
||||
name="exit_mouselook_focus_on_focus"
|
||||
tool_tip="Leaves the mouselook if Firestorm regains focus after it has been running in the background."
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="FSShowMouselookInstructions"
|
||||
|
|
@ -245,6 +248,7 @@
|
|||
layout="topleft"
|
||||
name="mouselook_instructions_visible"
|
||||
tool_tip="Show Mouselook Instructions"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="ShowCrosshairs"
|
||||
|
|
@ -252,18 +256,55 @@
|
|||
enabled_control="EnableMouselook"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Show Mouselook Crosshairs"
|
||||
label="Show Mouselook crosshairs"
|
||||
layout="topleft"
|
||||
name="ShowCrosshairs"
|
||||
tool_tip="Display crosshairs when in mouselook mode"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="FSMouselookCombatFeatures"
|
||||
follows="left|top"
|
||||
enabled_control="EnableMouselook"
|
||||
height="16"
|
||||
label="Enable combat features"
|
||||
layout="topleft"
|
||||
name="FSMouselookCombatFeatures"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<check_box
|
||||
control_name="ExodusMouselookIFF"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
label="Draw target markers"
|
||||
layout="topleft"
|
||||
left_delta="10"
|
||||
name="ExodusMouselookIFF"
|
||||
top_pad="2"
|
||||
width="256" />
|
||||
<slider
|
||||
control_name="ExodusMouselookIFFRange"
|
||||
follows="left|top"
|
||||
height="15"
|
||||
can_edit_text="true"
|
||||
decimal_digits="0"
|
||||
increment="5"
|
||||
layout="topleft"
|
||||
label="Range (m):"
|
||||
label_width="150"
|
||||
show_text="true"
|
||||
left_delta="5"
|
||||
max_val="500"
|
||||
name="ExodusMouselookIFFRange"
|
||||
top_pad="2"
|
||||
width="333" />
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left_delta="3"
|
||||
left_delta="-10"
|
||||
name="Mouse Sensitivity"
|
||||
top_pad="7"
|
||||
width="160">
|
||||
|
|
|
|||
|
|
@ -2623,4 +2623,6 @@ Try enclosing path to the editor with double quotes.
|
|||
<string name="FriendOfflineNotification">is offline.</string>
|
||||
|
||||
<string name="Inbox_Folderview_New">New</string>
|
||||
|
||||
<string name="Mouselook_Unknown_Avatar">Unknown agent</string>
|
||||
</strings>
|
||||
|
|
|
|||
Loading…
Reference in New Issue