Map rotation setting on right click, from Imprudence.

This commit is contained in:
Siana Gearz
2011-01-08 23:01:30 +01:00
parent 29aef502ea
commit 26a8ffb536
3 changed files with 35 additions and 0 deletions

View File

@@ -111,6 +111,8 @@ LLNetMap::LLNetMap(const std::string& name) :
(new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel");
(new LLCenterMap())->registerListener(this, "MiniMap.Center"); (new LLCenterMap())->registerListener(this, "MiniMap.Center");
(new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter");
(new LLRotateMap())->registerListener(this, "MiniMap.Rotate");
(new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate");
(new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking");
(new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking");
(new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile");
@@ -1108,6 +1110,22 @@ bool LLNetMap::LLCheckCenterMap::handleEvent(LLPointer<LLEvent> event, const LLS
return true; return true;
} }
bool LLNetMap::LLRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL rotate = gSavedSettings.getBOOL("MiniMapRotate");
gSavedSettings.setBOOL("MiniMapRotate", !rotate);
return true;
}
bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLNetMap *self = mPtr;
BOOL enabled = gSavedSettings.getBOOL("MiniMapRotate");
self->findControl(userdata["control"].asString())->setValue(enabled);
return true;
}
bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
LLTracker::stopTracking(NULL); LLTracker::stopTracking(NULL);

View File

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

View File

@@ -19,6 +19,11 @@
<on_click function="MiniMap.Center" userdata="1" /> <on_click function="MiniMap.Center" userdata="1" />
<on_check function="MiniMap.CheckCenter" userdata="1" /> <on_check function="MiniMap.CheckCenter" userdata="1" />
</menu_item_check> </menu_item_check>
<menu_item_check bottom_delta="-18" enabled="true" height="18" label="Rotate Mini-Map"
left="0" mouse_opaque="true" name="Rotate Mini-Map" width="128">
<on_click function="MiniMap.Rotate" userdata="" />
<on_check function="MiniMap.CheckRotate" userdata="" />
</menu_item_check>
<menu_item_separator /> <menu_item_separator />
<menu_item_call bottom_delta="-18" enabled = "false" height="18" label="Stop Tracking" <menu_item_call bottom_delta="-18" enabled = "false" height="18" label="Stop Tracking"
left="0" mouse_opaque="true" name="Stop Tracking" width="128"> left="0" mouse_opaque="true" name="Stop Tracking" width="128">