SL-16916: Update minimap context menu with new options and reworded existing options
Map rotation: Split minimap "Rotate Map" context menu option into two options: "North at top" and "Camera at top" Zoom: - Adjust minimap context menu zoom presets: New presets are "far", "medium", "close", and "very close" - Change default minimap zoom level from 128 to 64 - Currently selected minimap zoom level is now checked About Land: Add "About Land" button to minimap context menu Reword: Rearrange and adjust capitalization of the various context menu options Code change: Remove unused zoom handling code in LLFloaterMapmaster
parent
6013e68ea2
commit
f1b7ba6c28
|
|
@ -6819,7 +6819,7 @@
|
|||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>128.0</real>
|
||||
<real>64.0</real>
|
||||
</map>
|
||||
<key>MiniMapShowPropertyLines</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -248,32 +248,6 @@ void LLFloaterMap::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
updateMinorDirections();
|
||||
}
|
||||
|
||||
void LLFloaterMap::handleZoom(const LLSD& userdata)
|
||||
{
|
||||
std::string level = userdata.asString();
|
||||
|
||||
F32 scale = 0.0f;
|
||||
if (level == std::string("default"))
|
||||
{
|
||||
LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale");
|
||||
if(pvar)
|
||||
{
|
||||
pvar->resetToDefault();
|
||||
scale = gSavedSettings.getF32("MiniMapScale");
|
||||
}
|
||||
}
|
||||
else if (level == std::string("close"))
|
||||
scale = LLNetMap::MAP_SCALE_MAX;
|
||||
else if (level == std::string("medium"))
|
||||
scale = LLNetMap::MAP_SCALE_MID;
|
||||
else if (level == std::string("far"))
|
||||
scale = LLNetMap::MAP_SCALE_MIN;
|
||||
if (scale != 0.0f)
|
||||
{
|
||||
mMap->setScale(scale);
|
||||
}
|
||||
}
|
||||
|
||||
LLFloaterMap* LLFloaterMap::getInstance()
|
||||
{
|
||||
return LLFloaterReg::getTypedInstance<LLFloaterMap>("mini_map");
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ public:
|
|||
/*virtual*/ void draw();
|
||||
|
||||
private:
|
||||
void handleZoom(const LLSD& userdata);
|
||||
void setDirectionPos( LLTextBox* text_box, F32 rotation );
|
||||
void updateMinorDirections();
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include "llagentcamera.h"
|
||||
#include "llappviewer.h" // for gDisconnected
|
||||
#include "llcallingcard.h" // LLAvatarTracker
|
||||
#include "llfloaterland.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llparcel.h"
|
||||
#include "lltracker.h"
|
||||
|
|
@ -69,7 +70,10 @@
|
|||
static LLDefaultChildRegistry::Register<LLNetMap> r1("net_map");
|
||||
|
||||
const F32 LLNetMap::MAP_SCALE_MIN = 32;
|
||||
const F32 LLNetMap::MAP_SCALE_MID = 1024;
|
||||
const F32 LLNetMap::MAP_SCALE_FAR = 32;
|
||||
const F32 LLNetMap::MAP_SCALE_MEDIUM = 128;
|
||||
const F32 LLNetMap::MAP_SCALE_CLOSE = 256;
|
||||
const F32 LLNetMap::MAP_SCALE_VERY_CLOSE = 1024;
|
||||
const F32 LLNetMap::MAP_SCALE_MAX = 4096;
|
||||
|
||||
const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of scroll wheel (4%)
|
||||
|
|
@ -83,12 +87,13 @@ const F64 COARSEUPDATE_MAX_Z = 1020.0f;
|
|||
LLNetMap::LLNetMap (const Params & p)
|
||||
: LLUICtrl (p),
|
||||
mBackgroundColor (p.bg_color()),
|
||||
mScale( MAP_SCALE_MID ),
|
||||
mPixelsPerMeter( MAP_SCALE_MID / REGION_WIDTH_METERS ),
|
||||
mScale( MAP_SCALE_MEDIUM ),
|
||||
mPixelsPerMeter( MAP_SCALE_MEDIUM / REGION_WIDTH_METERS ),
|
||||
mObjectMapTPM(0.f),
|
||||
mObjectMapPixels(0.f),
|
||||
mCurPan(0.f, 0.f),
|
||||
mStartPan(0.f, 0.f),
|
||||
mPopupWorldPos(0.f, 0.f, 0.f),
|
||||
mMouseDown(0, 0),
|
||||
mPanning(false),
|
||||
mUpdateNow(false),
|
||||
|
|
@ -112,14 +117,19 @@ LLNetMap::~LLNetMap()
|
|||
BOOL LLNetMap::postBuild()
|
||||
{
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commitRegistrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enableRegistrar;
|
||||
|
||||
commitRegistrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2));
|
||||
enableRegistrar.add("Minimap.Zoom.Check", boost::bind(&LLNetMap::isZoomChecked, this, _2));
|
||||
commitRegistrar.add("Minimap.Zoom.Set", boost::bind(&LLNetMap::setZoom, this, _2));
|
||||
commitRegistrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2));
|
||||
commitRegistrar.add("Minimap.Center.Activate", boost::bind(&LLNetMap::activateCenterMap, this, _2));
|
||||
enableRegistrar.add("Minimap.MapOrientation.Check", boost::bind(&LLNetMap::isMapOrientationChecked, this, _2));
|
||||
commitRegistrar.add("Minimap.MapOrientation.Set", boost::bind(&LLNetMap::setMapOrientation, this, _2));
|
||||
commitRegistrar.add("Minimap.AboutLand", boost::bind(&LLNetMap::popupShowAboutLand, this, _2));
|
||||
|
||||
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder,
|
||||
LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mPopupMenu->setItemEnabled("Re-Center Map", false);
|
||||
mPopupMenu->setItemEnabled("Re-center map", false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -186,7 +196,7 @@ void LLNetMap::draw()
|
|||
}
|
||||
|
||||
bool can_recenter_map = !(centered || mCentering || auto_centering);
|
||||
mPopupMenu->setItemEnabled("Re-Center Map", can_recenter_map);
|
||||
mPopupMenu->setItemEnabled("Re-center map", can_recenter_map);
|
||||
|
||||
// Prepare a scissor region
|
||||
F32 rotation = 0;
|
||||
|
|
@ -962,9 +972,10 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
if (mPopupMenu)
|
||||
{
|
||||
mPopupWorldPos = viewPosToGlobal(x, y);
|
||||
mPopupMenu->buildDrawLabels();
|
||||
mPopupMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
mPopupMenu->setItemEnabled("Stop Tracking", LLTracker::isTracking(0));
|
||||
mPopupMenu->setItemEnabled("Stop tracking", LLTracker::isTracking(0));
|
||||
LLMenuGL::showPopup(this, mPopupMenu, x, y);
|
||||
}
|
||||
return TRUE;
|
||||
|
|
@ -1012,6 +1023,27 @@ BOOL LLNetMap::handleDoubleClick(S32 x, S32 y, MASK mask)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
F32 LLNetMap::getScaleForName(std::string scale_name)
|
||||
{
|
||||
if (scale_name == "very close")
|
||||
{
|
||||
return LLNetMap::MAP_SCALE_VERY_CLOSE;
|
||||
}
|
||||
else if (scale_name == "close")
|
||||
{
|
||||
return LLNetMap::MAP_SCALE_CLOSE;
|
||||
}
|
||||
else if (scale_name == "medium")
|
||||
{
|
||||
return LLNetMap::MAP_SCALE_MEDIUM;
|
||||
}
|
||||
else if (scale_name == "far")
|
||||
{
|
||||
return LLNetMap::MAP_SCALE_FAR;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLNetMap::outsideSlop( S32 x, S32 y, S32 start_x, S32 start_y, S32 slop )
|
||||
{
|
||||
|
|
@ -1058,39 +1090,70 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void LLNetMap::handleZoom(const LLSD& userdata)
|
||||
bool LLNetMap::isZoomChecked(const LLSD &userdata)
|
||||
{
|
||||
std::string level = userdata.asString();
|
||||
|
||||
F32 scale = 0.0f;
|
||||
if (level == std::string("default"))
|
||||
{
|
||||
LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale");
|
||||
if(pvar)
|
||||
{
|
||||
pvar->resetToDefault();
|
||||
scale = gSavedSettings.getF32("MiniMapScale");
|
||||
}
|
||||
}
|
||||
else if (level == std::string("close"))
|
||||
scale = LLNetMap::MAP_SCALE_MAX;
|
||||
else if (level == std::string("medium"))
|
||||
scale = LLNetMap::MAP_SCALE_MID;
|
||||
else if (level == std::string("far"))
|
||||
scale = LLNetMap::MAP_SCALE_MIN;
|
||||
if (scale != 0.0f)
|
||||
{
|
||||
setScale(scale);
|
||||
}
|
||||
std::string level = userdata.asString();
|
||||
F32 scale = getScaleForName(level);
|
||||
return scale == mScale;
|
||||
}
|
||||
|
||||
void LLNetMap::setZoom(const LLSD &userdata)
|
||||
{
|
||||
std::string level = userdata.asString();
|
||||
F32 scale = getScaleForName(level);
|
||||
if (scale != 0.0f)
|
||||
{
|
||||
setScale(scale);
|
||||
}
|
||||
}
|
||||
|
||||
void LLNetMap::handleStopTracking (const LLSD& userdata)
|
||||
{
|
||||
if (mPopupMenu)
|
||||
{
|
||||
mPopupMenu->setItemEnabled ("Stop Tracking", false);
|
||||
mPopupMenu->setItemEnabled ("Stop tracking", false);
|
||||
LLTracker::stopTracking (LLTracker::isTracking(NULL));
|
||||
}
|
||||
}
|
||||
|
||||
void LLNetMap::activateCenterMap(const LLSD &userdata) { mCentering = true; }
|
||||
|
||||
bool LLNetMap::isMapOrientationChecked(const LLSD &userdata)
|
||||
{
|
||||
const std::string command_name = userdata.asString();
|
||||
const bool rotate_map = gSavedSettings.getBOOL("MiniMapRotate");
|
||||
if (command_name == "north_at_top")
|
||||
{
|
||||
return !rotate_map;
|
||||
}
|
||||
|
||||
if (command_name == "camera_at_top")
|
||||
{
|
||||
return rotate_map;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLNetMap::setMapOrientation(const LLSD &userdata)
|
||||
{
|
||||
const std::string command_name = userdata.asString();
|
||||
if (command_name == "north_at_top")
|
||||
{
|
||||
gSavedSettings.setBOOL("MiniMapRotate", false);
|
||||
}
|
||||
else if (command_name == "camera_at_top")
|
||||
{
|
||||
gSavedSettings.setBOOL("MiniMapRotate", true);
|
||||
}
|
||||
}
|
||||
|
||||
void LLNetMap::popupShowAboutLand(const LLSD &userdata)
|
||||
{
|
||||
// Update parcel selection. It's important to deselect land first so the "About Land" floater doesn't refresh with the old selection.
|
||||
LLViewerParcelMgr::getInstance()->deselectLand();
|
||||
LLParcelSelectionHandle selection = LLViewerParcelMgr::getInstance()->selectParcelAt(mPopupWorldPos);
|
||||
gMenuHolder->setParcelSelection(selection);
|
||||
|
||||
LLFloaterReg::showInstance("about_land", LLSD(), false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,9 +62,12 @@ protected:
|
|||
public:
|
||||
virtual ~LLNetMap();
|
||||
|
||||
static const F32 MAP_SCALE_MIN;
|
||||
static const F32 MAP_SCALE_MID;
|
||||
static const F32 MAP_SCALE_MAX;
|
||||
static const F32 MAP_SCALE_MIN;
|
||||
static const F32 MAP_SCALE_FAR;
|
||||
static const F32 MAP_SCALE_MEDIUM;
|
||||
static const F32 MAP_SCALE_CLOSE;
|
||||
static const F32 MAP_SCALE_VERY_CLOSE;
|
||||
static const F32 MAP_SCALE_MAX;
|
||||
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
|
@ -108,6 +111,7 @@ private:
|
|||
|
||||
void createObjectImage();
|
||||
|
||||
F32 getScaleForName(std::string scale_name);
|
||||
static bool outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y, S32 slop);
|
||||
|
||||
private:
|
||||
|
|
@ -125,6 +129,7 @@ private:
|
|||
bool mCentering; // map is being re-centered around the agent
|
||||
LLVector2 mCurPan;
|
||||
LLVector2 mStartPan; // pan offset at start of drag
|
||||
LLVector3d mPopupWorldPos; // world position picked under mouse when context menu is opened
|
||||
LLCoordGL mMouseDown; // pointer position at start of drag
|
||||
|
||||
LLVector3d mObjectImageCenterGlobal;
|
||||
|
|
@ -147,9 +152,13 @@ public:
|
|||
void setSelected(uuid_vec_t uuids) { gmSelected=uuids; };
|
||||
|
||||
private:
|
||||
void handleZoom(const LLSD& userdata);
|
||||
bool isZoomChecked(const LLSD& userdata);
|
||||
void setZoom(const LLSD& userdata);
|
||||
void handleStopTracking(const LLSD& userdata);
|
||||
void activateCenterMap(const LLSD& userdata);
|
||||
bool isMapOrientationChecked(const LLSD& userdata);
|
||||
void setMapOrientation(const LLSD& userdata);
|
||||
void popupShowAboutLand(const LLSD& userdata);
|
||||
|
||||
LLMenuGL* mPopupMenu;
|
||||
uuid_vec_t gmSelected;
|
||||
|
|
|
|||
|
|
@ -8,72 +8,71 @@
|
|||
top="724"
|
||||
visible="false"
|
||||
width="128">
|
||||
<menu_item_call
|
||||
label="Zoom Close"
|
||||
name="Zoom Close">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Zoom"
|
||||
<menu_item_check
|
||||
label="Zoom very close"
|
||||
name="Zoom very close">
|
||||
<menu_item_check.on_check
|
||||
function="Minimap.Zoom.Check"
|
||||
parameter="very close" />
|
||||
<menu_item_check.on_click
|
||||
function="Minimap.Zoom.Set"
|
||||
parameter="very close" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Zoom close"
|
||||
name="Zoom close">
|
||||
<menu_item_check.on_check
|
||||
function="Minimap.Zoom.Check"
|
||||
parameter="close" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom Medium"
|
||||
name="Zoom Medium">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Zoom"
|
||||
<menu_item_check.on_click
|
||||
function="Minimap.Zoom.Set"
|
||||
parameter="close" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Zoom medium"
|
||||
name="Zoom medium">
|
||||
<menu_item_check.on_check
|
||||
function="Minimap.Zoom.Check"
|
||||
parameter="medium" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom Far"
|
||||
name="Zoom Far">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Zoom"
|
||||
<menu_item_check.on_click
|
||||
function="Minimap.Zoom.Set"
|
||||
parameter="medium" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Zoom far"
|
||||
name="Zoom far">
|
||||
<menu_item_check.on_check
|
||||
function="Minimap.Zoom.Check"
|
||||
parameter="far" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom Default"
|
||||
name="Zoom Default">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Zoom"
|
||||
parameter="default" />
|
||||
</menu_item_call>
|
||||
<menu_item_check.on_click
|
||||
function="Minimap.Zoom.Set"
|
||||
parameter="far" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_check
|
||||
label="Rotate Map"
|
||||
name="Rotate Map">
|
||||
label="North at top"
|
||||
name="North at top">
|
||||
<menu_item_check.on_check
|
||||
control="MiniMapRotate" />
|
||||
function="Minimap.MapOrientation.Check"
|
||||
parameter="north_at_top" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="MiniMapRotate" />
|
||||
function="Minimap.MapOrientation.Set"
|
||||
parameter="north_at_top" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_check
|
||||
label="Auto-center map"
|
||||
name="Auto-center map">
|
||||
label="Camera at top"
|
||||
name="Camera at top">
|
||||
<menu_item_check.on_check
|
||||
control="MiniMapAutoCenter" />
|
||||
function="Minimap.MapOrientation.Check"
|
||||
parameter="camera_at_top" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="MiniMapAutoCenter" />
|
||||
function="Minimap.MapOrientation.Set"
|
||||
parameter="camera_at_top" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_call
|
||||
label="Re-Center Map"
|
||||
name="Re-Center Map">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Center.Activate" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Stop Tracking"
|
||||
name="Stop Tracking">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Tracker"
|
||||
parameter="task_properties" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator />
|
||||
<menu_item_check
|
||||
label="Show Property Lines"
|
||||
name="Show Property Lines">
|
||||
label="Show parcel boundaries"
|
||||
name="Show parcel boundaries">
|
||||
<menu_item_check.on_check
|
||||
control="MiniMapShowPropertyLines" />
|
||||
<menu_item_check.on_click
|
||||
|
|
@ -81,6 +80,36 @@
|
|||
parameter="MiniMapShowPropertyLines" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_check
|
||||
label="Auto-center map"
|
||||
name="Auto-center map">
|
||||
<menu_item_check.on_check
|
||||
control="MiniMapAutoCenter" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="MiniMapAutoCenter" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_call
|
||||
label="Re-center map"
|
||||
name="Re-center map">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Center.Activate" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Stop tracking"
|
||||
name="Stop tracking">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.Tracker"
|
||||
parameter="task_properties" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator />
|
||||
<menu_item_call
|
||||
label="About Land"
|
||||
name="About Land">
|
||||
<menu_item_call.on_click
|
||||
function="Minimap.AboutLand" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="World Map"
|
||||
name="World Map">
|
||||
|
|
|
|||
Loading…
Reference in New Issue