diff options
| author | Richard Linden <none@none> | 2011-02-23 16:44:04 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2011-02-23 16:44:04 -0800 |
| commit | 20ad5181babd7662bddf95b94bb25cc522d6186d (patch) | |
| tree | 9c22029f28fb8c049a53fa27c6aa0f132368d3a7 /indra/newview/llviewermenu.cpp | |
| parent | 66de8ba97f058a4017f56d100a40a1d3b4e843c0 (diff) | |
SOCIAL-551 WIP Add buttons to open people and profile windows
bottom tray button now toggles profile window
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7cc04e0338..dd6b034dc8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5788,6 +5788,44 @@ class LLShowAgentProfile : public view_listener_t } }; +class LLToggleAgentProfile : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLUUID agent_id; + if (userdata.asString() == "agent") + { + agent_id = gAgent.getID(); + } + else if (userdata.asString() == "hit object") + { + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (objectp) + { + agent_id = objectp->getID(); + } + } + else + { + agent_id = userdata.asUUID(); + } + + LLVOAvatar* avatar = find_avatar_from_object(agent_id); + if (avatar) + { + if (!LLAvatarActions::profileVisible(avatar->getID())) + { + LLAvatarActions::showProfile(avatar->getID()); + } + else + { + LLAvatarActions::hideProfile(avatar->getID()); + } + } + return true; + } +}; + class LLLandEdit : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8184,6 +8222,7 @@ void initialize_menus() view_listener_t::addMenu(new LLShowHelp(), "ShowHelp"); view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); + view_listener_t::addMenu(new LLToggleAgentProfile(), "ToggleAgentProfile"); view_listener_t::addMenu(new LLToggleControl(), "ToggleControl"); view_listener_t::addMenu(new LLCheckControl(), "CheckControl"); view_listener_t::addMenu(new LLGoToObject(), "GoToObject"); |
