diff options
author | Jonathan Yap <none@none> | 2013-01-26 07:00:44 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-01-26 07:00:44 -0500 |
commit | 3882945fb9cfbe2710b8f05c7bf8b8c079272191 (patch) | |
tree | 27622d29ff9070deaa278576d47a346446317a27 /indra | |
parent | 0afbc85efadfb3e3e825a5cade9f76876fbdf1a4 (diff) |
STORM-1838 Add code for right click menu on inventory calling cards.
Add initial support to insert teleport request into existing IM window.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 32 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 21 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 14 | ||||
-rw-r--r-- | indra/newview/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 @@ -591,6 +591,14 @@ parameter="lure" /> </menu_item_call> <menu_item_call + label="Request Teleport..." + layout="topleft" + name="Request Teleport..."> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="request_lure" /> + </menu_item_call> + <menu_item_call label="Start Conference Chat" layout="topleft" name="Conference Chat"> @@ -598,12 +606,6 @@ function="Inventory.BeginIMSession" parameter="selected" /> </menu_item_call> - <menu_item_call - label="Request Teleport" - name="Request Teleport"> - <menu_item_call.on_click - function="Avatar.TeleportRequest" /> - </menu_item_call> <menu_item_separator layout="topleft" name="Gesture Separator" /> 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 @@ <menu_item_call.on_click function="Avatar.Pay" /> </menu_item_call> - <menu_item_call - label="Request Teleport" - layout="topleft" - name="Request Teleport"> - <menu_item_call.on_click - function="Avatar.TeleportRequest" /> - </menu_item_call> <menu_item_check label="Block/Unblock" layout="topleft" @@ -99,4 +92,14 @@ function="Avatar.EnableItem" parameter="can_offer_teleport"/> </menu_item_call> + <menu_item_call + label="Request Teleport" + layout="topleft" + name="Request Teleport"> + <menu_item_call.on_click + function="Avatar.TeleportRequest"/> + <menu_item_call.on_enable + function="Avatar.EnableItem" + parameter="can_offer_teleport" /> + </menu_item_call> </context_menu> |