Merge remote-tracking branch 'slb/master'
Conflicts: indra/newview/llnetmap.cpp indra/newview/llnetmap.h indra/newview/skins/default/xui/en-us/menu_mini_map.xml
This commit is contained in:
@@ -37,8 +37,6 @@ extern F32 const gPrehashVersionNumber;
|
||||
extern char const* const _PREHASH_X;
|
||||
extern char const* const _PREHASH_Y;
|
||||
extern char const* const _PREHASH_Z;
|
||||
extern char const* const _PREHASH_SizeX;
|
||||
extern char const* const _PREHASH_SizeY;
|
||||
extern char const* const _PREHASH_AddFlags;
|
||||
extern char const* const _PREHASH_FailureInfo;
|
||||
extern char const* const _PREHASH_MapData;
|
||||
|
||||
@@ -10068,6 +10068,98 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>MiniMapChatRings</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display chat distance rings on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MiniMapWhisperRing</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display whisper distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MiniMapWhisperRingColor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Color for whisper distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Color4</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>0.0</real>
|
||||
<real>1.0</real>
|
||||
<real>0.0</real>
|
||||
<real>0.5</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>MiniMapChatRing</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display chat distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MiniMapChatRingColor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Color for chat distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Color4</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>1.0</real>
|
||||
<real>1.0</real>
|
||||
<real>0.0</real>
|
||||
<real>0.5</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>MiniMapShoutRing</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display shout distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MiniMapShoutRingColor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Color for shout distance ring on mini map</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Color4</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>1.0</real>
|
||||
<real>0.0</real>
|
||||
<real>0.0</real>
|
||||
<real>0.5</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>MiniMapScale</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -66,7 +66,6 @@ LLPrefsAscentVan::LLPrefsAscentVan()
|
||||
getChild<LLUICtrl>("show_self_tag_color_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
|
||||
getChild<LLUICtrl>("customize_own_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
|
||||
getChild<LLUICtrl>("show_friend_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
|
||||
getChild<LLUICtrl>("display_client_new_line_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
|
||||
getChild<LLUICtrl>("use_status_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2));
|
||||
|
||||
getChild<LLUICtrl>("custom_tag_label_box")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitTextModified, this, _1, _2));
|
||||
|
||||
@@ -89,6 +89,9 @@ 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
|
||||
|
||||
const F32 WIDTH_PIXELS = 2.f;
|
||||
const S32 CIRCLE_STEPS = 100;
|
||||
|
||||
LLNetMap::LLNetMap(const std::string& name) :
|
||||
LLPanel(name),
|
||||
mScale(128.f),
|
||||
@@ -114,6 +117,10 @@ LLNetMap::LLNetMap(const std::string& name) :
|
||||
(new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate");
|
||||
(new LLShowObjects())->registerListener(this, "MiniMap.ShowObjects");
|
||||
(new LLCheckShowObjects())->registerListener(this, "MiniMap.CheckShowObjects");
|
||||
(new LLChatRings())->registerListener(this, "MiniMap.ChatRings");
|
||||
(new LLWhisperRing())->registerListener(this, "MiniMap.WhisperRing");
|
||||
(new LLChatRing())->registerListener(this, "MiniMap.ChatRing");
|
||||
(new LLShoutRing())->registerListener(this, "MiniMap.ShoutRing");
|
||||
(new LLStopTracking())->registerListener(this, "MiniMap.StopTracking");
|
||||
(new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking");
|
||||
(new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile");
|
||||
@@ -196,6 +203,10 @@ void LLNetMap::draw()
|
||||
{
|
||||
static LLFrameTimer map_timer;
|
||||
|
||||
static const LLCachedControl<LLColor4> map_whisper_ring_color("MiniMapWhisperRingColor", LLColor4(0.f,1.f,0.f,0.5f));
|
||||
static const LLCachedControl<LLColor4> map_chat_ring_color("MiniMapChatRingColor", LLColor4(0.f,0.f,1.f,0.5f));
|
||||
static const LLCachedControl<LLColor4> map_shout_ring_color("MiniMapShoutRingColor", LLColor4(1.f,0.f,0.f,0.5f));
|
||||
|
||||
if (mObjectImagep.isNull())
|
||||
{
|
||||
createObjectImage();
|
||||
@@ -492,6 +503,18 @@ void LLNetMap::draw()
|
||||
dot_width,
|
||||
dot_width);
|
||||
|
||||
// Draw chat range ring(s)
|
||||
//static LLUICachedControl<bool> chat_rings("MiniMapChatRings");
|
||||
static LLUICachedControl<bool> whisper_ring("MiniMapWhisperRing");
|
||||
static LLUICachedControl<bool> chat_ring("MiniMapChatRing");
|
||||
static LLUICachedControl<bool> shout_ring("MiniMapShoutRing");
|
||||
if(whisper_ring)
|
||||
drawRing(LLWorld::getInstance()->getWhisperDistance(), pos_map, map_whisper_ring_color);
|
||||
if(chat_ring)
|
||||
drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color);
|
||||
if(shout_ring)
|
||||
drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color);
|
||||
|
||||
// Draw frustum
|
||||
// <FS:CR> Aurora Sim
|
||||
//F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
@@ -588,6 +611,22 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated)
|
||||
return pos_local;
|
||||
}
|
||||
|
||||
void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLColor4& color)
|
||||
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
F32 meters_to_pixels = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
//F32 meters_to_pixels = mScale / REGION_WIDTH_METERS;
|
||||
// </FS:CR> Aurora Sim
|
||||
F32 radius_pixels = radius * meters_to_pixels;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
gGL.translatef((F32)pos_map.mV[VX], (F32)pos_map.mV[VY], 0.f);
|
||||
gl_ring(radius_pixels, WIDTH_PIXELS, color, color, CIRCLE_STEPS, FALSE);
|
||||
gGL.popMatrix();
|
||||
}
|
||||
|
||||
void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated,
|
||||
const LLColor4& color, BOOL draw_arrow )
|
||||
{
|
||||
@@ -1156,6 +1195,67 @@ bool LLNetMap::LLCheckShowObjects::handleEvent(LLPointer<LLEvent> event, const L
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLNetMap::LLChatRings::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings");
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled);
|
||||
gSavedSettings.setBOOL("MiniMapWhisperRing", !all_enabled);
|
||||
gSavedSettings.setBOOL("MiniMapChatRing", !all_enabled);
|
||||
gSavedSettings.setBOOL("MiniMapShoutRing", !all_enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLNetMap::LLWhisperRing::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings");
|
||||
BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing");
|
||||
BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing");
|
||||
BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing");
|
||||
|
||||
gSavedSettings.setBOOL("MiniMapWhisperRing", !whisper_enabled);
|
||||
|
||||
if(all_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled);
|
||||
else if(!whisper_enabled && chat_enabled && shout_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", TRUE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLNetMap::LLChatRing::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings");
|
||||
BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing");
|
||||
BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing");
|
||||
BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing");
|
||||
|
||||
gSavedSettings.setBOOL("MiniMapChatRing", !chat_enabled);
|
||||
|
||||
if(all_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled);
|
||||
else if(whisper_enabled && !chat_enabled && shout_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", TRUE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLNetMap::LLShoutRing::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings");
|
||||
BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing");
|
||||
BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing");
|
||||
BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing");
|
||||
|
||||
gSavedSettings.setBOOL("MiniMapShoutRing", !shout_enabled);
|
||||
|
||||
if(all_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled);
|
||||
else if(whisper_enabled && chat_enabled && !shout_enabled)
|
||||
gSavedSettings.setBOOL("MiniMapChatRings", TRUE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLNetMap::LLStopTracking::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
LLTracker::stopTracking(false);
|
||||
|
||||
@@ -82,6 +82,8 @@ private:
|
||||
LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated);
|
||||
LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated);
|
||||
|
||||
void drawRing(const F32 radius, LLVector3 pos_map, const LLColor4& color);
|
||||
|
||||
void drawTracking( const LLVector3d& pos_global,
|
||||
BOOL rotated,
|
||||
const LLColor4& color,
|
||||
@@ -163,12 +165,36 @@ private:
|
||||
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
|
||||
};
|
||||
|
||||
class LLChatRings : 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 LLWhisperRing : public LLMemberListener<LLNetMap>
|
||||
{
|
||||
public:
|
||||
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
|
||||
};
|
||||
|
||||
class LLChatRing : public LLMemberListener<LLNetMap>
|
||||
{
|
||||
public:
|
||||
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
|
||||
};
|
||||
|
||||
class LLShoutRing : public LLMemberListener<LLNetMap>
|
||||
{
|
||||
public:
|
||||
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
|
||||
};
|
||||
|
||||
class LLStopTracking : public LLMemberListener<LLNetMap>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -94,6 +94,12 @@ const F32 LLWorld::mScale = 1.f;
|
||||
F32 LLWorld::mWidthInMeters = mWidth * mScale;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
//TODO: This will use chat ranges
|
||||
// according to opensim settings
|
||||
const F32 LLWorld::mWhisperDistance = 10;
|
||||
const F32 LLWorld::mSayDistance = 20;
|
||||
const F32 LLWorld::mShoutDistance = 100;
|
||||
|
||||
//
|
||||
// Functions
|
||||
//
|
||||
|
||||
@@ -125,6 +125,10 @@ public:
|
||||
F32 getRegionMinHeight() const { return -mWidthInMeters; }
|
||||
F32 getRegionMaxHeight() const { return MAX_OBJECT_Z; }
|
||||
|
||||
F32 getWhisperDistance() const { return mWhisperDistance; }
|
||||
F32 getSayDistance() const { return mSayDistance; }
|
||||
F32 getShoutDistance() const { return mShoutDistance; }
|
||||
|
||||
void updateRegions(F32 max_update_time);
|
||||
void updateVisibilities();
|
||||
void updateParticles();
|
||||
@@ -198,6 +202,10 @@ private:
|
||||
static F32 mWidthInMeters;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
static const F32 mWhisperDistance;
|
||||
static const F32 mSayDistance;
|
||||
static const F32 mShoutDistance;
|
||||
|
||||
F32 mLandFarClip; // Far clip distance for land.
|
||||
LLPatchVertexArray mLandPatch;
|
||||
S32 mLastPacketsIn;
|
||||
|
||||
@@ -29,6 +29,26 @@
|
||||
<on_click function="MiniMap.ShowObjects" userdata="" />
|
||||
<on_check function="MiniMap.CheckShowObjects" userdata="" />
|
||||
</menu_item_check>
|
||||
<menu bottom_delta="0" color="MenuDefaultBgColor" drop_shadow="true" height="175" left="0"
|
||||
mouse_opaque="false" name="Chat Distance Rings" opaque="true" tear_off="false" width="125">
|
||||
<menu_item_check label="Show All" name="Show All">
|
||||
<on_check control="MiniMapChatRings" />
|
||||
<on_click function="MiniMap.ChatRings" userdata="MiniMapChatRings" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator />
|
||||
<menu_item_check label="Show Whisper Ring" name="Show Whisper Ring">
|
||||
<on_check control="MiniMapWhisperRing" />
|
||||
<on_click function="MiniMap.WhisperRing" userdata="MiniMapWhisperRing" />
|
||||
</menu_item_check>
|
||||
<menu_item_check label="Show Chat Ring" name="Show Chat Ring">
|
||||
<on_check control="MiniMapChatRing" />
|
||||
<on_click function="MiniMap.ChatRing" userdata="MiniMapChatRing" />
|
||||
</menu_item_check>
|
||||
<menu_item_check label="Show Shout Ring" name="Show Shout Ring">
|
||||
<on_check control="MiniMapShoutRing" />
|
||||
<on_click function="MiniMap.ShoutRing" userdata="MiniMapShoutRing" />
|
||||
</menu_item_check>
|
||||
</menu>
|
||||
<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">
|
||||
@@ -46,9 +66,7 @@
|
||||
<on_enable function="MiniMap.EnableProfile" />
|
||||
</menu_item_call>
|
||||
<menu bottom_delta="0" color="MenuDefaultBgColor" drop_shadow="true" height="175" left="0"
|
||||
mouse_opaque="false" name="Mark" opaque="true" tear_off="false"
|
||||
width="125">
|
||||
<on_enable function="MiniMap.EnableProfile" />
|
||||
mouse_opaque="false" name="Mark" opaque="true" tear_off="false" width="125">
|
||||
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Red"
|
||||
left="0" mouse_opaque="true" name="Red" width="128">
|
||||
<on_click function="MiniMap.setred" />
|
||||
|
||||
Reference in New Issue
Block a user