diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-06-22 16:12:32 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-22 16:12:32 -0700 |
commit | 328322436c046bf229de83041b29ebe5ce7c4029 (patch) | |
tree | 05a0ebb9b5a7c4eab9885c4cf177c471c61c9d2f /indra/newview | |
parent | 1ca92d37ddac87c09df9716e09cd7c37d94f85e7 (diff) |
PATH-764,PATH-765: Adding in a context menu option on right-click of an object to show in the linksets floater if all objects are non-characters, or to show in the characters floater if all objects are characters.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingobjects.cpp | 75 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingobjects.h | 6 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_object.xml | 334 |
8 files changed, 271 insertions, 174 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 09fd17855c..caf9fe382b 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -74,9 +74,10 @@ BOOL LLFloaterPathfindingCharacters::isPhysicsCapsuleEnabled(LLUUID& id, LLVecto return (isShowPhysicsCapsule() && getCapsuleRenderData(pos, rot )); } -void LLFloaterPathfindingCharacters::openCharactersViewer() +void LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects() { - LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_characters"); + LLFloaterPathfindingCharacters *charactersFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingCharacters>("pathfinding_characters"); + charactersFloater->showFloaterWithSelectionObjects(); } LLHandle<LLFloaterPathfindingCharacters> LLFloaterPathfindingCharacters::getInstanceHandle() diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index a181a66ebd..56e08b7603 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -46,7 +46,7 @@ public: BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot ) const; - static void openCharactersViewer(); + static void openCharactersWithSelectedObjects(); static LLHandle<LLFloaterPathfindingCharacters> getInstanceHandle(); protected: diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index a7b856b271..ae814b0087 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -60,9 +60,10 @@ // LLFloaterPathfindingLinksets //--------------------------------------------------------------------------- -void LLFloaterPathfindingLinksets::openLinksetsEditor() +void LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects() { - LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets"); + LLFloaterPathfindingLinksets *linksetsFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingLinksets>("pathfinding_linksets"); + linksetsFloater->showFloaterWithSelectionObjects(); } LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index c9ae5a059a..8e82992dbf 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -46,7 +46,7 @@ class LLVector3; class LLFloaterPathfindingLinksets : public LLFloaterPathfindingObjects { public: - static void openLinksetsEditor(); + static void openLinksetsWithSelectedObjects(); protected: friend class LLFloaterReg; diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 14fa0ac428..cd6d0851b9 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -173,6 +173,8 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed) mMessagingRequestId(0U), mObjectList(), mObjectsSelection(), + mHasObjectsToBeSelected(false), + mObjectsToBeSelected(), mSelectionUpdateSlot(), mRegionBoundaryCrossingSlot() { @@ -318,17 +320,19 @@ void LLFloaterPathfindingObjects::handleUpdateObjectList(LLPathfindingManager::r void LLFloaterPathfindingObjects::rebuildObjectsScrollList() { - std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected(); - int numSelectedItems = selectedItems.size(); - uuid_vec_t selectedUUIDs; - if (numSelectedItems > 0) + if (!mHasObjectsToBeSelected) { - selectedUUIDs.reserve(selectedItems.size()); - for (std::vector<LLScrollListItem*>::const_iterator itemIter = selectedItems.begin(); - itemIter != selectedItems.end(); ++itemIter) + std::vector<LLScrollListItem*> selectedItems = mObjectsScrollList->getAllSelected(); + int numSelectedItems = selectedItems.size(); + if (numSelectedItems > 0) { - const LLScrollListItem *listItem = *itemIter; - selectedUUIDs.push_back(listItem->getUUID()); + mObjectsToBeSelected.reserve(selectedItems.size()); + for (std::vector<LLScrollListItem*>::const_iterator itemIter = selectedItems.begin(); + itemIter != selectedItems.end(); ++itemIter) + { + const LLScrollListItem *listItem = *itemIter; + mObjectsToBeSelected.push_back(listItem->getUUID()); + } } } @@ -346,8 +350,19 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() } } - mObjectsScrollList->selectMultiple(selectedUUIDs); - mObjectsScrollList->setScrollPos(origScrollPosition); + mObjectsScrollList->selectMultiple(mObjectsToBeSelected); + if (mHasObjectsToBeSelected) + { + mObjectsScrollList->scrollToShowSelected(); + } + else + { + mObjectsScrollList->setScrollPos(origScrollPosition); + } + + mObjectsToBeSelected.clear(); + mHasObjectsToBeSelected = false; + updateControlsOnScrollListChange(); } @@ -401,6 +416,44 @@ S32 LLFloaterPathfindingObjects::getBeaconWidth() const return DEFAULT_BEACON_WIDTH; } +void LLFloaterPathfindingObjects::showFloaterWithSelectionObjects() +{ + mObjectsToBeSelected.clear(); + + LLObjectSelectionHandle selectedObjectsHandle = LLSelectMgr::getInstance()->getSelection(); + if (selectedObjectsHandle.notNull()) + { + LLObjectSelection *selectedObjects = selectedObjectsHandle.get(); + if (!selectedObjects->isEmpty()) + { + for (LLObjectSelection::valid_iterator objectIter = selectedObjects->valid_begin(); + objectIter != selectedObjects->valid_end(); ++objectIter) + { + LLSelectNode *object = *objectIter; + LLViewerObject *viewerObject = object->getObject(); + mObjectsToBeSelected.push_back(viewerObject->getID()); + } + } + } + mHasObjectsToBeSelected = true; + + if (!isShown()) + { + openFloater(); + setVisibleAndFrontmost(); + } + else + { + rebuildObjectsScrollList(); + if (isMinimized()) + { + setMinimized(FALSE); + } + setVisibleAndFrontmost(); + } + setFocus(TRUE); +} + BOOL LLFloaterPathfindingObjects::isShowBeacons() const { return mShowBeaconCheckBox->get(); diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 88790db12d..6d5d6d24b2 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -36,6 +36,7 @@ #include "llpathfindingobject.h" #include "llpathfindingobjectlist.h" #include "llselectmgr.h" +#include "lluuid.h" #include "v4color.h" class LLAvatarName; @@ -90,6 +91,8 @@ protected: virtual const LLColor4 &getBeaconTextColor() const; virtual S32 getBeaconWidth() const; + void showFloaterWithSelectionObjects(); + BOOL isShowBeacons() const; void clearAllObjects(); void selectAllObjects(); @@ -158,6 +161,9 @@ private: LLObjectSelectionHandle mObjectsSelection; + bool mHasObjectsToBeSelected; + uuid_vec_t mObjectsToBeSelected; + boost::signals2::connection mSelectionUpdateSlot; boost::signals2::connection mRegionBoundaryCrossingSlot; LLAgent::god_level_change_slot_t mGodLevelChangeSlot; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d244b19b4f..020de5a255 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -60,6 +60,8 @@ #include "llfloatergodtools.h" #include "llfloaterinventory.h" #include "llfloaterland.h" +#include "llfloaterpathfindingcharacters.h" +#include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" #include "llfloaterreporter.h" #include "llfloatersearch.h" @@ -2735,6 +2737,16 @@ bool enable_object_build() return !enable_object_edit(); } +bool enable_object_select_in_pathfinding_linksets() +{ + return LLSelectMgr::getInstance()->selectGetNonCharacter(); +} + +bool enable_object_select_in_pathfinding_characters() +{ + return LLSelectMgr::getInstance()->selectGetCharacter(); +} + class LLSelfRemoveAllAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8485,6 +8497,10 @@ void initialize_menus() enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); enable.add("EnableEdit", boost::bind(&enable_object_edit)); enable.add("VisibleBuild", boost::bind(&enable_object_build)); + commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects)); + enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets)); + commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects)); + enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters)); view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel"); diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index 719509301b..52b9524b11 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -1,179 +1,199 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <context_menu - layout="topleft" - name="Object Pie"> - <menu_item_call - enabled="false" - label="Touch" - name="Object Touch"> - <menu_item_call.on_click - function="Object.Touch" /> - <menu_item_call.on_enable - function="Object.EnableTouch" - name="EnableTouch" - parameter="Touch" /> - </menu_item_call> - <menu_item_call - label="Edit" - name="Edit..."> - <menu_item_call.on_click - function="Object.Edit" /> + layout="topleft" + name="Object Pie"> + <menu_item_call + enabled="false" + label="Touch" + name="Object Touch"> + <menu_item_call.on_click + function="Object.Touch" /> <menu_item_call.on_enable - function="EnableEdit"/> - </menu_item_call> - <menu_item_call + function="Object.EnableTouch" + name="EnableTouch" + parameter="Touch" /> + </menu_item_call> + <menu_item_call + label="Edit" + name="Edit..."> + <menu_item_call.on_click + function="Object.Edit" /> + <menu_item_call.on_enable + function="EnableEdit"/> + </menu_item_call> + <menu_item_call label="Build" name="Build"> - <menu_item_call.on_click + <menu_item_call.on_click function="Object.Build" /> - <menu_item_call.on_enable - function="EnableEdit"/> - </menu_item_call> - <menu_item_call - enabled="false" - label="Open" - name="Open"> - <menu_item_call.on_click - function="Object.Open" /> - <menu_item_call.on_enable - function="Object.EnableOpen" /> - </menu_item_call> - <menu_item_call - enabled="false" - label="Sit Here" - name="Object Sit"> - <menu_item_call.on_click - function="Object.SitOrStand" /> - <menu_item_call.on_enable - function="Object.EnableSit" /> - </menu_item_call> - <menu_item_call - enabled="false" - label="Stand Up" - name="Object Stand Up"> - <menu_item_call.on_click - function="Object.SitOrStand" /> - <menu_item_call.on_enable - function="Object.EnableStandUp" /> - </menu_item_call> - <menu_item_call - label="Object Profile" - name="Object Inspect"> - <menu_item_call.on_click - function="Object.Inspect" /> - <menu_item_call.on_enable - function="Object.EnableInspect" /> - </menu_item_call> + <menu_item_call.on_enable + function="EnableEdit"/> + </menu_item_call> <menu_item_call - label="Zoom In" - name="Zoom In"> + label="Show in linksets" + name="show_in_linksets"> <menu_item_call.on_click - function="Object.ZoomIn" /> + function="Pathfinding.Linksets.Select" /> + <menu_item_call.on_enable + function="EnableSelectInPathfindingLinksets"/> + <menu_item_call.on_visible + function="EnableSelectInPathfindingLinksets"/> + </menu_item_call> + <menu_item_call + label="Show in characters" + name="show_in_characters"> + <menu_item_call.on_click + function="Pathfinding.Characters.Select" /> + <menu_item_call.on_enable + function="EnableSelectInPathfindingCharacters"/> + <menu_item_call.on_visible + function="EnableSelectInPathfindingCharacters"/> </menu_item_call> -<menu_item_separator layout="topleft" /> - <context_menu - label="Put On" - name="Put On" > - <menu_item_call + <menu_item_call enabled="false" - label="Wear" - name="Wear"> - <menu_item_call.on_click - function="Object.AttachToAvatar" /> - <menu_item_call.on_enable - function="Object.EnableWear" /> - </menu_item_call> - <menu_item_call + label="Open" + name="Open"> + <menu_item_call.on_click + function="Object.Open" /> + <menu_item_call.on_enable + function="Object.EnableOpen" /> + </menu_item_call> + <menu_item_call enabled="false" - label="Add" - name="Add"> - <menu_item_call.on_click - function="Object.AttachAddToAvatar" /> - <menu_item_call.on_enable - function="Object.EnableWear" /> - </menu_item_call> - <context_menu - label="Attach" - name="Object Attach" /> - <context_menu - label="Attach HUD" - name="Object Attach HUD" /> - </context_menu> - <context_menu - label="Manage" - name="Remove"> - <menu_item_call - enabled="false" - label="Report Abuse" - name="Report Abuse..."> - <menu_item_call.on_click - function="Object.ReportAbuse" /> - <menu_item_call.on_enable - function="Object.EnableReportAbuse" /> - </menu_item_call> - <menu_item_call - enabled="false" - label="Block" - name="Object Mute"> - <menu_item_call.on_click - function="Object.Mute" /> - <menu_item_call.on_enable - function="Object.EnableMute" /> - </menu_item_call> - <menu_item_call + label="Sit Here" + name="Object Sit"> + <menu_item_call.on_click + function="Object.SitOrStand" /> + <menu_item_call.on_enable + function="Object.EnableSit" /> + </menu_item_call> + <menu_item_call enabled="false" - label="Return" - name="Return..."> - <menu_item_call.on_click - function="Object.Return" /> - <menu_item_call.on_enable - function="Object.EnableReturn" /> - </menu_item_call> - </context_menu> - <menu_item_separator layout="topleft" /> - <menu_item_call - label="Take" - layout="topleft" - name="Pie Object Take"> + label="Stand Up" + name="Object Stand Up"> + <menu_item_call.on_click + function="Object.SitOrStand" /> + <menu_item_call.on_enable + function="Object.EnableStandUp" /> + </menu_item_call> + <menu_item_call + label="Object Profile" + name="Object Inspect"> + <menu_item_call.on_click + function="Object.Inspect" /> + <menu_item_call.on_enable + function="Object.EnableInspect" /> + </menu_item_call> + <menu_item_call + label="Zoom In" + name="Zoom In"> + <menu_item_call.on_click + function="Object.ZoomIn" /> + </menu_item_call> + <menu_item_separator layout="topleft" /> + <context_menu + label="Put On" + name="Put On" > + <menu_item_call + enabled="false" + label="Wear" + name="Wear"> <menu_item_call.on_click - function="Object.Take"/> + function="Object.AttachToAvatar" /> <menu_item_call.on_enable - function="Object.VisibleTake"/> - </menu_item_call> - <menu_item_call - enabled="false" - label="Take Copy" - name="Take Copy"> + function="Object.EnableWear" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Add" + name="Add"> <menu_item_call.on_click - function="Tools.TakeCopy" /> + function="Object.AttachAddToAvatar" /> <menu_item_call.on_enable - function="Tools.EnableTakeCopy" /> - </menu_item_call> - <menu_item_call - enabled="false" - label="Pay" - name="Pay..."> - <menu_item_call.on_click - function="PayObject" /> - <menu_item_call.on_enable - function="EnablePayObject" /> -</menu_item_call> - <menu_item_call - enabled="false" - label="Buy" - name="Buy..."> + function="Object.EnableWear" /> + </menu_item_call> + <context_menu + label="Attach" + name="Object Attach" /> + <context_menu + label="Attach HUD" + name="Object Attach HUD" /> + </context_menu> + <context_menu + label="Manage" + name="Remove"> + <menu_item_call + enabled="false" + label="Report Abuse" + name="Report Abuse..."> + <menu_item_call.on_click + function="Object.ReportAbuse" /> + <menu_item_call.on_enable + function="Object.EnableReportAbuse" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Block" + name="Object Mute"> <menu_item_call.on_click - function="Object.Buy" /> + function="Object.Mute" /> <menu_item_call.on_enable - function="Object.EnableBuy" /> - </menu_item_call> - <menu_item_call - enabled="false" - label="Delete" - name="Delete"> + function="Object.EnableMute" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Return" + name="Return..."> <menu_item_call.on_click - function="Object.Delete" /> + function="Object.Return" /> <menu_item_call.on_enable - function="Object.EnableDelete" /> + function="Object.EnableReturn" /> + </menu_item_call> + </context_menu> + <menu_item_separator layout="topleft" /> + <menu_item_call + label="Take" + layout="topleft" + name="Pie Object Take"> + <menu_item_call.on_click + function="Object.Take"/> + <menu_item_call.on_enable + function="Object.VisibleTake"/> + </menu_item_call> + <menu_item_call + enabled="false" + label="Take Copy" + name="Take Copy"> + <menu_item_call.on_click + function="Tools.TakeCopy" /> + <menu_item_call.on_enable + function="Tools.EnableTakeCopy" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Pay" + name="Pay..."> + <menu_item_call.on_click + function="PayObject" /> + <menu_item_call.on_enable + function="EnablePayObject" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Buy" + name="Buy..."> + <menu_item_call.on_click + function="Object.Buy" /> + <menu_item_call.on_enable + function="Object.EnableBuy" /> + </menu_item_call> + <menu_item_call + enabled="false" + label="Delete" + name="Delete"> + <menu_item_call.on_click + function="Object.Delete" /> + <menu_item_call.on_enable + function="Object.EnableDelete" /> </menu_item_call> </context_menu> |