Minimap cleanup
This commit is contained in:
@@ -7477,17 +7477,6 @@
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>UseOldTrackingDots</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Use old T-like tracking dots in mini-map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MiniMapScale</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -90,9 +90,6 @@ const F32 DOT_SCALE = 0.75f;
|
||||
const F32 MIN_PICK_SCALE = 2.f;
|
||||
const S32 MOUSE_DRAG_SLOP = 2; // How far the mouse needs to move before we think it's a drag
|
||||
|
||||
BOOL LLNetMap::sMiniMapRotate = TRUE;
|
||||
S32 LLNetMap::sMiniMapCenter = 1;
|
||||
|
||||
LLNetMap::LLNetMap(const std::string& name) :
|
||||
LLPanel(name),
|
||||
mScale(128.f),
|
||||
@@ -108,9 +105,6 @@ LLNetMap::LLNetMap(const std::string& name) :
|
||||
mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
|
||||
|
||||
sMiniMapCenter = gSavedSettings.getS32("MiniMapCenter");
|
||||
sMiniMapRotate = gSavedSettings.getBOOL("MiniMapRotate");
|
||||
|
||||
mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal();
|
||||
|
||||
// Register event listeners for popup menu
|
||||
@@ -204,7 +198,7 @@ void LLNetMap::draw()
|
||||
createObjectImage();
|
||||
}
|
||||
|
||||
if (sMiniMapCenter != MAP_CENTER_NONE)
|
||||
if (gSavedSettings.getS32( "MiniMapCenter") != MAP_CENTER_NONE)
|
||||
{
|
||||
mCurPanX = lerp(mCurPanX, mTargetPanX, LLCriticalDamp::getInterpolant(0.1f));
|
||||
mCurPanY = lerp(mCurPanY, mTargetPanY, LLCriticalDamp::getInterpolant(0.1f));
|
||||
@@ -237,8 +231,9 @@ void LLNetMap::draw()
|
||||
gGL.pushMatrix();
|
||||
|
||||
gGL.translatef( (F32) center_sw_left, (F32) center_sw_bottom, 0.f);
|
||||
|
||||
if (sMiniMapRotate)
|
||||
|
||||
BOOL rotate_map = gSavedSettings.getBOOL( "MiniMapRotate" );
|
||||
if (rotate_map)
|
||||
{
|
||||
// rotate subsequent draws to agent rotation
|
||||
rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] );
|
||||
@@ -314,11 +309,11 @@ void LLNetMap::draw()
|
||||
mUpdateNow = FALSE;
|
||||
|
||||
// Locate the centre of the object layer, accounting for panning
|
||||
LLVector3 new_center = globalPosToView(gAgent.getCameraPositionGlobal(), sMiniMapRotate);
|
||||
LLVector3 new_center = globalPosToView(gAgent.getCameraPositionGlobal(), rotate_map);
|
||||
new_center.mV[0] -= mCurPanX;
|
||||
new_center.mV[1] -= mCurPanY;
|
||||
new_center.mV[2] = 0.f;
|
||||
mObjectImageCenterGlobal = viewPosToGlobal(llround(new_center.mV[0]), llround(new_center.mV[1]), sMiniMapRotate);
|
||||
mObjectImageCenterGlobal = viewPosToGlobal(llround(new_center.mV[0]), llround(new_center.mV[1]), rotate_map);
|
||||
|
||||
// Create the base texture.
|
||||
U8 *default_texture = mObjectRawImagep->getData();
|
||||
@@ -387,7 +382,7 @@ void LLNetMap::draw()
|
||||
LLColor4 avColor = standard_color;
|
||||
// TODO: it'd be very cool to draw these in sorted order from lowest Z to highest.
|
||||
// just be careful to sort the avatar IDs along with the positions. -MG
|
||||
pos_map = globalPosToView(positions[i], sMiniMapRotate);
|
||||
pos_map = globalPosToView(positions[i], rotate_map);
|
||||
if (positions[i].mdV[VZ] == 0.f)
|
||||
{
|
||||
pos_map.mV[VZ] = 16000.f;
|
||||
@@ -447,25 +442,25 @@ void LLNetMap::draw()
|
||||
// Draw dot for autopilot target
|
||||
if (gAgent.getAutoPilot())
|
||||
{
|
||||
drawTracking(gAgent.getAutoPilotTargetGlobal(), sMiniMapRotate, gTrackColor);
|
||||
drawTracking(gAgent.getAutoPilotTargetGlobal(), rotate_map, gTrackColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
|
||||
if ( LLTracker::TRACKING_AVATAR == tracking_status )
|
||||
{
|
||||
drawTracking(LLAvatarTracker::instance().getGlobalPos(), sMiniMapRotate, gTrackColor);
|
||||
drawTracking(LLAvatarTracker::instance().getGlobalPos(), rotate_map, gTrackColor);
|
||||
}
|
||||
else if ( LLTracker::TRACKING_LANDMARK == tracking_status
|
||||
|| LLTracker::TRACKING_LOCATION == tracking_status )
|
||||
{
|
||||
drawTracking(LLTracker::getTrackedPositionGlobal(), sMiniMapRotate, gTrackColor);
|
||||
drawTracking(LLTracker::getTrackedPositionGlobal(), rotate_map, gTrackColor);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw dot for self avatar position
|
||||
pos_global = gAgent.getPositionGlobal();
|
||||
pos_map = globalPosToView(pos_global, sMiniMapRotate);
|
||||
pos_map = globalPosToView(pos_global, rotate_map);
|
||||
LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage;
|
||||
S32 dot_width = llround(mDotRadius * 2.f);
|
||||
you->draw(
|
||||
@@ -490,7 +485,7 @@ void LLNetMap::draw()
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
if (sMiniMapRotate)
|
||||
if (rotate_map)
|
||||
{
|
||||
gGL.color4fv(gColors.getColor("NetMapFrustum").mV);
|
||||
|
||||
@@ -629,7 +624,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(viewPosToGlobal(x, y, sMiniMapRotate));
|
||||
LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(viewPosToGlobal(x, y, gSavedSettings.getBOOL( "MiniMapRotate" )));
|
||||
if( region )
|
||||
{
|
||||
msg.assign("");
|
||||
@@ -995,7 +990,7 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask )
|
||||
|
||||
BOOL LLNetMap::handleDoubleClick( S32 x, S32 y, MASK mask )
|
||||
{
|
||||
LLVector3d pos_global = viewPosToGlobal(x, y, sMiniMapRotate);
|
||||
LLVector3d pos_global = viewPosToGlobal(x, y, gSavedSettings.getBOOL( "MiniMapRotate" ));
|
||||
BOOL new_target = FALSE;
|
||||
if (!LLTracker::isTracking(NULL))
|
||||
{
|
||||
|
||||
@@ -69,9 +69,6 @@ public:
|
||||
|
||||
static void mm_setcolor(LLUUID key,LLColor4 col); //moymod
|
||||
|
||||
static S32 sMiniMapCenter;
|
||||
static BOOL sMiniMapRotate;
|
||||
|
||||
private:
|
||||
|
||||
void setScale( F32 scale );
|
||||
|
||||
@@ -338,24 +338,6 @@ static bool handleUploadBakedTexOldChanged(const LLSD& newvalue)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleMiniMapCenterChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLNetMap::sMiniMapCenter = newvalue.asInteger();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleMiniMapRotateChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLNetMap::sMiniMapRotate = newvalue.asBoolean();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleUseOldTrackingDotsChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLWorldMapView::sUseOldTrackingDots = newvalue.asBoolean();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleNumpadControlChanged(const LLSD& newvalue)
|
||||
{
|
||||
if (gKeyboard)
|
||||
@@ -685,9 +667,6 @@ void settings_setup_listeners()
|
||||
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
|
||||
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
|
||||
gSavedSettings.getControl("MiniMapCenter")->getSignal()->connect(boost::bind(&handleMiniMapCenterChanged, _1));
|
||||
gSavedSettings.getControl("MiniMapRotate")->getSignal()->connect(boost::bind(&handleMiniMapRotateChanged, _1));
|
||||
gSavedSettings.getControl("UseOldTrackingDots")->getSignal()->connect(boost::bind(&handleUseOldTrackingDotsChanged, _1));
|
||||
|
||||
gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
|
||||
gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1));
|
||||
|
||||
@@ -75,7 +75,6 @@ const F32 GODLY_TELEPORT_HEIGHT = 200.f;
|
||||
const S32 SCROLL_HINT_WIDTH = 65;
|
||||
const F32 BIG_DOT_RADIUS = 5.f;
|
||||
BOOL LLWorldMapView::sHandledLastClick = FALSE;
|
||||
BOOL LLWorldMapView::sUseOldTrackingDots = FALSE;
|
||||
|
||||
LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL;
|
||||
LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL;
|
||||
@@ -147,8 +146,6 @@ void LLWorldMapView::initClass()
|
||||
|
||||
sStringsMap["loading"] = LLTrans::getString("texture_loading");
|
||||
sStringsMap["offline"] = LLTrans::getString("worldmap_offline");
|
||||
|
||||
sUseOldTrackingDots = gSavedSettings.getBOOL("UseOldTrackingDots");
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -1320,84 +1317,33 @@ static void drawDot(F32 x_pixels, F32 y_pixels,
|
||||
// static
|
||||
void LLWorldMapView::drawAvatar(F32 x_pixels,
|
||||
F32 y_pixels,
|
||||
const LLColor4& color,
|
||||
LLColor4 color,
|
||||
F32 relative_z,
|
||||
F32 dot_radius)
|
||||
{
|
||||
const F32 HEIGHT_THRESHOLD = 7.f;
|
||||
LLUIImagePtr dot_image = sAvatarSmallImage;
|
||||
if (sUseOldTrackingDots || relative_z == 16000.f)
|
||||
|
||||
if (relative_z == 16000.f) // Unknown altitude (0m or > 1020m)
|
||||
{
|
||||
F32 left = x_pixels - dot_radius;
|
||||
F32 right = x_pixels + dot_radius;
|
||||
F32 center = (left + right) * 0.5f;
|
||||
F32 top = y_pixels + dot_radius;
|
||||
F32 bottom = y_pixels - dot_radius;
|
||||
|
||||
if (relative_z == 16000.f)
|
||||
{
|
||||
// Unknown altitude (0m or > 1020m)
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
glColor4fv(color.mV);
|
||||
LLUI::setLineWidth(1.5f);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(left, y_pixels);
|
||||
glVertex2f(right, y_pixels);
|
||||
glEnd();
|
||||
LLUI::setLineWidth(1.0f);
|
||||
|
||||
}
|
||||
else if (relative_z > HEIGHT_THRESHOLD)
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
glColor4fv(color.mV);
|
||||
LLUI::setLineWidth(1.5f);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(left, top);
|
||||
glVertex2f(right, top);
|
||||
glVertex2f(center, top);
|
||||
glVertex2f(center, bottom);
|
||||
glEnd();
|
||||
LLUI::setLineWidth(1.0f);
|
||||
}
|
||||
else if (relative_z > -HEIGHT_THRESHOLD)
|
||||
{
|
||||
dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2,
|
||||
llround(y_pixels) - dot_image->getHeight()/2,
|
||||
color);
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
glColor4fv(color.mV);
|
||||
LLUI::setLineWidth(1.5f);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(center, top);
|
||||
glVertex2f(center, bottom);
|
||||
glVertex2f(left, bottom);
|
||||
glVertex2f(right, bottom);
|
||||
glEnd();
|
||||
LLUI::setLineWidth(1.0f);
|
||||
}
|
||||
F32 mag = color.length();
|
||||
color=color*0.5f + LLColor4(mag, mag, mag)*0.25f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (relative_z < -HEIGHT_THRESHOLD)
|
||||
else if (relative_z < -HEIGHT_THRESHOLD)
|
||||
{
|
||||
dot_image = sAvatarBelowImage;
|
||||
}
|
||||
else if (relative_z > HEIGHT_THRESHOLD)
|
||||
else if (relative_z > HEIGHT_THRESHOLD)
|
||||
{
|
||||
dot_image = sAvatarAboveImage;
|
||||
}
|
||||
|
||||
S32 dot_width = llround(dot_radius * 2.f);
|
||||
dot_image->draw(llround(x_pixels - dot_radius),
|
||||
llround(y_pixels - dot_radius),
|
||||
dot_width,
|
||||
dot_width,
|
||||
color);
|
||||
}
|
||||
dot_image->draw(llround(x_pixels - dot_radius),
|
||||
llround(y_pixels - dot_radius),
|
||||
dot_width,
|
||||
dot_width,
|
||||
color);
|
||||
}
|
||||
|
||||
// Pass relative Z of 0 to draw at same level.
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
S32 overlap );
|
||||
static void drawAvatar( F32 x_pixels,
|
||||
F32 y_pixels,
|
||||
const LLColor4& color,
|
||||
LLColor4 color,
|
||||
F32 relative_z = 0.f,
|
||||
F32 dot_radius = 3.f);
|
||||
static void drawIconName(F32 x_pixels,
|
||||
@@ -193,7 +193,6 @@ public:
|
||||
LLTextBox* mTextBoxScrollHint;
|
||||
|
||||
static BOOL sHandledLastClick;
|
||||
static BOOL sUseOldTrackingDots;
|
||||
S32 mSelectIDStart;
|
||||
|
||||
typedef std::vector<U64> handle_list_t;
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
<on_click function="MiniMap.Rotate" userdata="" />
|
||||
<on_check function="MiniMap.CheckRotate" userdata="" />
|
||||
</menu_item_check>
|
||||
<menu_item_check bottom_delta="-18" enabled="true" height="18" label="Rotate with avatar"
|
||||
left="0" mouse_opaque="true" name="Rotate with avatar" width="128">
|
||||
<on_click function="MiniMap.Rotate" userdata="1" />
|
||||
<on_check function="MiniMap.CheckRotate" userdata="1" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_call bottom_delta="-18" enabled = "false" height="18" label="Stop Tracking"
|
||||
left="0" mouse_opaque="true" name="Stop Tracking" width="128">
|
||||
|
||||
Reference in New Issue
Block a user