diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llpanelavatar.cpp | 11 | ||||
| -rw-r--r-- | indra/newview/llpanelavatar.h | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_profile_overflow.xml | 9 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile.xml | 30 | 
4 files changed, 29 insertions, 22 deletions
| diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 57b478ffef..a0ba2f739b 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -495,6 +495,7 @@ BOOL LLPanelAvatarProfile::postBuild()  			&LLPanelAvatarProfile::onMapButtonClick, this)), NULL);  	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; +	registrar.add("Profile.ShowOnMap",  boost::bind(&LLPanelAvatarProfile::onMapButtonClick, this));  	registrar.add("Profile.Pay",  boost::bind(&LLPanelAvatarProfile::pay, this));  	registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this));  	registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this)); @@ -504,6 +505,7 @@ BOOL LLPanelAvatarProfile::postBuild()  	registrar.add("Profile.CSR", boost::bind(&LLPanelAvatarProfile::csr, this));  	LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable; +	enable.add("Profile.EnableShowOnMap", boost::bind(&LLPanelAvatarProfile::enableShowOnMap, this));  	enable.add("Profile.EnableGod", boost::bind(&enable_god));  	enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this));  	enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this)); @@ -698,6 +700,15 @@ void LLPanelAvatarProfile::toggleBlock()  	LLAvatarActions::toggleBlock(getAvatarId());  } +bool LLPanelAvatarProfile::enableShowOnMap() +{ +	bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); + +	bool enable_map_btn = (is_buddy_online && is_agent_mappable(getAvatarId())) +		|| gAgent.isGodlike(); +	return enable_map_btn; +} +  bool LLPanelAvatarProfile::enableBlock()  {  	return LLAvatarActions::canBlock(getAvatarId()) && !LLAvatarActions::isBlocked(getAvatarId()); diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 2bd23b6e9c..bb8df2ff9c 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -202,6 +202,7 @@ protected:  	void unfreeze();  	void csr(); +	bool enableShowOnMap();  	bool enableBlock();  	bool enableUnblock();  	bool enableGod(); diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml index 5162a4902f..b0b7b554b0 100644 --- a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml +++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml @@ -6,6 +6,15 @@   name="profile_overflow_menu"   width="120">      <menu_item_call +     label="Map" +     layout="topleft" +     name="show_on_map"> +        <menu_item_call.on_click +         function="Profile.ShowOnMap" /> +        <menu_item_call.on_enable +         function="Profile.EnableShowOnMap" /> +    </menu_item_call> +    <menu_item_call       label="Pay"       layout="topleft"       name="pay"> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 9fcabc7722..30191aecb6 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -311,7 +311,7 @@           height="23"           label="Add Friend"           layout="topleft" -         left="1" +         left="2"           mouse_opaque="false"           name="add_friend"           pad_left="1"  @@ -319,7 +319,7 @@           tool_tip="Offer friendship to the Resident"           top="5"           use_ellipses="true" -         width="105" /> +         width="117" />          <button           follows="bottom|left"           height="23" @@ -328,8 +328,8 @@           name="im"           tool_tip="Open instant message session"           top="5" -         left_pad="0" -         width="19" /> +         left_pad="1" +         width="21" />          <button           follows="bottom|left"           height="23" @@ -337,26 +337,12 @@           layout="topleft"           name="call"           tool_tip="Call this Resident" -         left_pad="0" +         left_pad="1"           pad_left="1"            pad_right="1"           top="5"           use_ellipses="true" -         width="48" /> -        <button -         enabled="false" -         follows="bottom|left" -         height="23" -         label="Map" -         layout="topleft" -         name="show_on_map_btn" -         pad_left="1"  -         pad_right="1" -         tool_tip="Show the Resident on the map" -         top="5" -         left_pad="0" -         use_ellipses="true" -         width="33" /> +         width="51" />          <button           follows="bottom|left"           height="23" @@ -364,12 +350,12 @@           layout="topleft"           name="teleport"           tool_tip="Offer teleport" -         left_pad="0" +         left_pad="1"           pad_left="1"            pad_right="1"           top="5"           use_ellipses="true" -         width="81" /> +         width="92" />          <button           follows="bottom|right"           height="23" | 
