Implemented right click option on MiniMap to hide or show objects

This commit is contained in:
Sean Devin
2013-08-14 09:55:47 +10:00
committed by Aleric Inglewood
parent 1ef90525b7
commit ffc44a7010
4 changed files with 42 additions and 6 deletions

View File

@@ -1113,16 +1113,16 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>MoyFastMiniMap</key>
<key>ShowMiniMapObjects</key>
<map>
<key>Comment</key>
<string>Don't show buildings on mini-map</string>
<string>Show buildings and megaprims on the mini-map</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>BeauchampFloaterGroupTitlesRect</key>
<map>

View File

@@ -112,6 +112,8 @@ LLNetMap::LLNetMap(const std::string& name) :
(new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter");
(new LLRotateMap())->registerListener(this, "MiniMap.Rotate");
(new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate");
(new LLShowObjects())->registerListener(this, "MiniMap.ShowObjects");
(new LLCheckShowObjects())->registerListener(this, "MiniMap.CheckShowObjects");
(new LLStopTracking())->registerListener(this, "MiniMap.StopTracking");
(new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking");
(new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile");
@@ -341,11 +343,13 @@ void LLNetMap::draw()
U8 *default_texture = mObjectRawImagep->getData();
memset( default_texture, 0, mObjectImagep->getWidth() * mObjectImagep->getHeight() * mObjectImagep->getComponents() );
// Draw buildings
gObjectList.renderObjectsForMap(*this);
if (gSavedSettings.getBOOL("ShowMiniMapObjects"))
{
gObjectList.renderObjectsForMap(*this); // Draw buildings.
}
mObjectImagep->setSubImage(mObjectRawImagep, 0, 0, mObjectImagep->getWidth(), mObjectImagep->getHeight());
map_timer.reset();
}
@@ -1137,6 +1141,21 @@ bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer<LLEvent> event, const LLS
return true;
}
bool LLNetMap::LLShowObjects::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL showobjects = gSavedSettings.getBOOL("ShowMiniMapObjects");
gSavedSettings.setBOOL("ShowMiniMapObjects", !showobjects);
return true;
}
bool LLNetMap::LLCheckShowObjects::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLNetMap *self = mPtr;
BOOL enabled = gSavedSettings.getBOOL("ShowMiniMapObjects");
self->findControl(userdata["control"].asString())->setValue(enabled);
return true;
}
bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLTracker::stopTracking(false);

View File

@@ -157,6 +157,18 @@ private:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
class LLCheckShowObjects : public LLMemberListener<LLNetMap>
{
public:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
class LLShowObjects : public LLMemberListener<LLNetMap>
{
public:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
class LLStopTracking : public LLMemberListener<LLNetMap>
{
public:

View File

@@ -24,6 +24,11 @@
<on_click function="MiniMap.Rotate" userdata="" />
<on_check function="MiniMap.CheckRotate" userdata="" />
</menu_item_check>
<menu_item_check bottom_delta="-18" enabled="false" height="18" label="Show Objects"
left="0" mouse_opaque="true" name="Show Objects" width="128">
<on_click function="MiniMap.ShowObjects" userdata="" />
<on_check function="MiniMap.CheckShowObjects" userdata="" />
</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">