From 3882945fb9cfbe2710b8f05c7bf8b8c079272191 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 26 Jan 2013 07:00:44 -0500 Subject: STORM-1838 Add code for right click menu on inventory calling cards. Add initial support to insert teleport request into existing IM window. --- indra/newview/llinventorybridge.cpp | 12 ++++++++ indra/newview/llnotificationhandlerutil.cpp | 32 +++++++++++++--------- indra/newview/lltoastnotifypanel.cpp | 21 ++++++++++++++ .../skins/default/xui/en/menu_inventory.xml | 14 ++++++---- .../skins/default/xui/en/menu_people_nearby.xml | 17 +++++++----- 5 files changed, 70 insertions(+), 26 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 14a228df1c..8a57e00252 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4602,6 +4602,16 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act LLAvatarActions::offerTeleport(item->getCreatorUUID()); } } + else if ("request_lure" == action) + { + LLViewerInventoryItem *item = getItem(); + if (item && (item->getCreatorUUID() != gAgent.getID()) && + (!item->getCreatorUUID().isNull())) + { + LLAvatarActions::teleportRequest(item->getCreatorUUID()); + } + } + else LLItemBridge::performAction(model, action); } @@ -4684,6 +4694,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Send Instant Message Separator")); items.push_back(std::string("Send Instant Message")); items.push_back(std::string("Offer Teleport...")); + items.push_back(std::string("Request Teleport...")); items.push_back(std::string("Conference Chat")); if (!good_card) @@ -4693,6 +4704,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!good_card || !user_online) { disabled_items.push_back(std::string("Offer Teleport...")); + disabled_items.push_back(std::string("Request Teleport...")); disabled_items.push_back(std::string("Conference Chat")); } } diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 16c51138a9..7efc231a66 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -111,9 +111,9 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif) } const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), - REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), - OBJECT_GIVE_ITEM("ObjectGiveItem"), - OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"), + REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), + OBJECT_GIVE_ITEM("ObjectGiveItem"), + OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"), PAYMENT_RECEIVED("PaymentReceived"), PAYMENT_SENT("PaymentSent"), ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), @@ -131,6 +131,7 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), TELEPORT_OFFERED_MATURITY_EXCEEDED("TeleportOffered_MaturityExceeded"), TELEPORT_OFFERED_MATURITY_BLOCKED("TeleportOffered_MaturityBlocked"), TELEPORT_OFFER_SENT("TeleportOfferSent"), + TELEPORT_REQUEST("TeleportRequest"), IM_SYSTEM_MESSAGE_TIP("IMSystemMessageTip"); @@ -154,6 +155,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName() || TELEPORT_OFFER_SENT == notification->getName() + || TELEPORT_REQUEST == notification->getName() || IM_SYSTEM_MESSAGE_TIP == notification->getName(); } @@ -175,27 +177,30 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) || USER_GIVE_ITEM == notification->getName() || TELEPORT_OFFERED == notification->getName() || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); + || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName() + || TELEPORT_REQUEST == notification->getName(); } // static bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName() - || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName() + || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() + || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName() + || TELEPORT_REQUEST == notification->getName(); } // static bool LLHandlerUtil::isNotificationReusable(const LLNotificationPtr& notification) { return OFFER_FRIENDSHIP == notification->getName() - || USER_GIVE_ITEM == notification->getName() - || TELEPORT_OFFERED == notification->getName() - || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName(); + || USER_GIVE_ITEM == notification->getName() + || TELEPORT_OFFERED == notification->getName() + || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() + || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName() + || TELEPORT_REQUEST == notification->getName(); } // static @@ -224,7 +229,8 @@ bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification) || USER_GIVE_ITEM == notification->getName() || TELEPORT_OFFERED == notification->getName() || TELEPORT_OFFERED_MATURITY_EXCEEDED == notification->getName() - || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName()) + || TELEPORT_OFFERED_MATURITY_BLOCKED == notification->getName() + || TELEPORT_REQUEST == notification->getName()) { // When ANY offer arrives, show toast, unless IM window is already open - EXT-5904 return ! isIMFloaterOpened(notification); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 602b924398..bf2559afaf 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -435,11 +435,28 @@ disable_button_map_t initFriendshipOfferedDisableButtonMap() return disable_map; } +disable_button_map_t initTeleportRequestDisableButtonMap() +{ + disable_button_map_t disable_map; + button_name_set_t buttons; + + buttons.insert("Yes"); + buttons.insert("No"); + buttons.insert("IM"); + + disable_map.insert(std::make_pair("Yes", buttons)); + disable_map.insert(std::make_pair("No", buttons)); + disable_map.insert(std::make_pair("IM", buttons)); + + return disable_map; +} + button_name_set_t getButtonDisableList(const std::string& notification_name, const std::string& button_name) { static disable_button_map_t user_give_item_disable_map = initUserGiveItemDisableButtonMap(); static disable_button_map_t teleport_offered_disable_map = initTeleportOfferedDisableButtonMap(); static disable_button_map_t friendship_offered_disable_map = initFriendshipOfferedDisableButtonMap(); + static disable_button_map_t teleport_request_disable_map = initTeleportRequestDisableButtonMap(); disable_button_map_t::const_iterator it; disable_button_map_t::const_iterator it_end; @@ -457,6 +474,10 @@ button_name_set_t getButtonDisableList(const std::string& notification_name, con { search_map = friendship_offered_disable_map; } + else if("TeleportRequest" == notification_name) + { + search_map = teleport_request_disable_map; + } it = search_map.find(button_name); it_end = search_map.end(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index ef315e1a8d..512205ba43 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -590,6 +590,14 @@ function="Inventory.DoToSelected" parameter="lure" /> + + + - - - diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 951f43f325..e7a27c39fa 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -70,13 +70,6 @@ - - - + + + + -- cgit v1.2.3