Skip to content
Snippets Groups Projects
Commit 27dca7fa authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Add nearby list click to zoom option

parent 8034b5fb
No related branches found
No related tags found
No related merge requests found
...@@ -607,6 +607,17 @@ ...@@ -607,6 +607,17 @@
<key>Value</key> <key>Value</key>
<real>0.15</real> <real>0.15</real>
</map> </map>
<key>AlchemyNearbyPeopleClickAction</key>
<map>
<key>Comment</key>
<string>0 - IM, 1 - Profile, 2 - Zoom In, 3 - Teleport To</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>2</integer>
</map>
<key>AlchemyNearbyTypingIndicators</key> <key>AlchemyNearbyTypingIndicators</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "llpanelpeople.h" #include "llpanelpeople.h"
// newview // newview
#include "alavataractions.h"
#include "llaccordionctrl.h" #include "llaccordionctrl.h"
#include "llaccordionctrltab.h" #include "llaccordionctrltab.h"
#include "llagent.h" #include "llagent.h"
...@@ -686,7 +687,7 @@ BOOL LLPanelPeople::postBuild() ...@@ -686,7 +687,7 @@ BOOL LLPanelPeople::postBuild()
mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
mNearbyList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mNearbyList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onNearbyListDoubleClicked, this, _1));
mRecentList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1)); mRecentList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
mOnlineFriendList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mOnlineFriendList)); mOnlineFriendList->setCommitCallback(boost::bind(&LLPanelPeople::onAvatarListCommitted, this, mOnlineFriendList));
...@@ -1192,6 +1193,38 @@ void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list) ...@@ -1192,6 +1193,38 @@ void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list)
updateButtons(); updateButtons();
} }
void LLPanelPeople::onNearbyListDoubleClicked(LLUICtrl* ctrl)
{
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(ctrl);
if(!item)
{
return;
}
LLUUID clicked_id = item->getAvatarId();
if(gAgent.getID() == clicked_id)
{
return;
}
U32 nearby_list_click_behavior = gSavedSettings.getU32("AlchemyNearbyPeopleClickAction");
switch (nearby_list_click_behavior)
{
default:
case 0:
LLAvatarActions::startIM(clicked_id);
break;
case 1:
LLAvatarActions::showProfile(clicked_id);
break;
case 2:
handle_zoom_to_object(clicked_id);
break;
case 3:
ALAvatarActions::teleportTo(clicked_id);
break;
}
}
void LLPanelPeople::onAddFriendButtonClicked() void LLPanelPeople::onAddFriendButtonClicked()
{ {
LLUUID id = getCurrentItemID(); LLUUID id = getCurrentItemID();
...@@ -1417,21 +1450,46 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) ...@@ -1417,21 +1450,46 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata)
mNearbyList->setShowCompleteName(!hide_usernames); mNearbyList->setShowCompleteName(!hide_usernames);
mNearbyList->handleDisplayNamesOptionChanged(); mNearbyList->handleDisplayNamesOptionChanged();
} }
else if (chosen_item == "click_im")
{
gSavedSettings.setU32("AlchemyNearbyPeopleClickAction", E_CLICK_TO_IM);
}
else if (chosen_item == "click_profile")
{
gSavedSettings.setU32("AlchemyNearbyPeopleClickAction", E_CLICK_TO_PROFILE);
}
else if (chosen_item == "click_zoom")
{
gSavedSettings.setU32("AlchemyNearbyPeopleClickAction", E_CLICK_TO_ZOOM);
}
else if (chosen_item == "click_teleport")
{
gSavedSettings.setU32("AlchemyNearbyPeopleClickAction", E_CLICK_TO_TELEPORT);
}
} }
bool LLPanelPeople::onNearbyViewSortMenuItemCheck(const LLSD& userdata) bool LLPanelPeople::onNearbyViewSortMenuItemCheck(const LLSD& userdata)
{ {
std::string item = userdata.asString(); std::string item = userdata.asString();
U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder"); U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder");
U32 click_action = gSavedSettings.getU32("AlchemyNearbyPeopleClickAction");
if (item == "sort_by_recent_speakers") if (item == "sort_by_recent_speakers")
return sort_order == E_SORT_BY_RECENT_SPEAKERS; return sort_order == E_SORT_BY_RECENT_SPEAKERS;
if (item == "sort_name") else if (item == "sort_name")
return sort_order == E_SORT_BY_NAME; return sort_order == E_SORT_BY_NAME;
if (item == "sort_distance") else if (item == "sort_distance")
return sort_order == E_SORT_BY_DISTANCE; return sort_order == E_SORT_BY_DISTANCE;
if (item == "sort_arrival") else if (item == "sort_arrival")
return sort_order == E_SORT_BY_RECENT_ARRIVAL; return sort_order == E_SORT_BY_RECENT_ARRIVAL;
else if (item == "click_im")
return click_action == E_CLICK_TO_IM;
else if (item == "click_profile")
return click_action == E_CLICK_TO_PROFILE;
else if (item == "click_zoom")
return click_action == E_CLICK_TO_ZOOM;
else if (item == "click_teleport")
return click_action == E_CLICK_TO_TELEPORT;
return false; return false;
} }
......
...@@ -78,6 +78,13 @@ class LLPanelPeople ...@@ -78,6 +78,13 @@ class LLPanelPeople
E_SORT_BY_RECENT_ARRIVAL = 5 E_SORT_BY_RECENT_ARRIVAL = 5
} ESortOrder; } ESortOrder;
typedef enum e_click_actions {
E_CLICK_TO_IM = 0,
E_CLICK_TO_PROFILE = 1,
E_CLICK_TO_ZOOM = 2,
E_CLICK_TO_TELEPORT = 3
} EClickActions;
void removePicker(); void removePicker();
// methods indirectly called by the updaters // methods indirectly called by the updaters
...@@ -108,6 +115,7 @@ class LLPanelPeople ...@@ -108,6 +115,7 @@ class LLPanelPeople
void onMoreButtonClicked(); void onMoreButtonClicked();
void onAvatarListDoubleClicked(LLUICtrl* ctrl); void onAvatarListDoubleClicked(LLUICtrl* ctrl);
void onAvatarListCommitted(LLAvatarList* list); void onAvatarListCommitted(LLAvatarList* list);
void onNearbyListDoubleClicked(LLUICtrl* ctrl);
bool onGroupPlusButtonValidate(); bool onGroupPlusButtonValidate();
void onGroupMinusButtonClicked(); void onGroupMinusButtonClicked();
void onGroupPlusMenuItemClicked(const LLSD& userdata); void onGroupPlusMenuItemClicked(const LLSD& userdata);
......
...@@ -44,6 +44,47 @@ ...@@ -44,6 +44,47 @@
parameter="sort_arrival"/> parameter="sort_arrival"/>
</menu_item_check> </menu_item_check>
<menu_item_separator layout="topleft" /> <menu_item_separator layout="topleft" />
<menu_item_check
label="Click to IM"
name="click_im">
<menu_item_check.on_click
function="People.Nearby.ViewSort.Action"
parameter="click_im"/>
<menu_item_check.on_check
function="People.Nearby.ViewSort.CheckItem"
parameter="click_im"/>
</menu_item_check>
<menu_item_check
label="Click to view profile"
name="click_profile">
<menu_item_check.on_click
function="People.Nearby.ViewSort.Action"
parameter="click_profile"/>
<menu_item_check.on_check
function="People.Nearby.ViewSort.CheckItem"
parameter="click_profile"/>
</menu_item_check>
<menu_item_check
label="Click to zoom in"
name="click_zoom">
<menu_item_check.on_click
function="People.Nearby.ViewSort.Action"
parameter="click_zoom"/>
<menu_item_check.on_check
function="People.Nearby.ViewSort.CheckItem"
parameter="click_zoom"/>
</menu_item_check>
<menu_item_check
label="Click to teleport to"
name="click_teleport">
<menu_item_check.on_click
function="People.Nearby.ViewSort.Action"
parameter="click_teleport"/>
<menu_item_check.on_check
function="People.Nearby.ViewSort.CheckItem"
parameter="click_teleport"/>
</menu_item_check>
<menu_item_separator layout="topleft" />
<menu_item_check name="view_icons" label="View People Icons"> <menu_item_check name="view_icons" label="View People Icons">
<menu_item_check.on_click <menu_item_check.on_click
function="People.Nearby.ViewSort.Action" function="People.Nearby.ViewSort.Action"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment