summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindinglinksets.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-16 16:49:31 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-16 16:49:31 -0800
commita73ec672d1bb163e156e2c9bc8a38be5fa2d2b0d (patch)
tree5f121371f5cdf56442fa07f61a62cb0914d84486 /indra/newview/llfloaterpathfindinglinksets.cpp
parentb1089ae35599427335e1391a747945d619f3158a (diff)
PATH-292: Adding an additional show beacons checkbox for the linksets floater.
Diffstat (limited to 'indra/newview/llfloaterpathfindinglinksets.cpp')
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index ae78004044..aa0c78527d 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -40,6 +40,7 @@
#include "llscrolllistitem.h"
#include "llscrolllistctrl.h"
#include "llcombobox.h"
+#include "llcheckboxctrl.h"
#include "llbutton.h"
#include "llresmgr.h"
#include "llviewerregion.h"
@@ -146,6 +147,9 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
llassert(mSelectNoneButton != NULL);
mSelectNoneButton->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onSelectNoneLinksetsClicked, this));
+ mShowBeaconCheckBox = findChild<LLCheckBoxCtrl>("show_beacon");
+ llassert(mShowBeaconCheckBox != NULL);
+
mTakeButton = findChild<LLButton>("take_linksets");
llassert(mTakeButton != NULL);
mTakeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onTakeClicked, this));
@@ -244,6 +248,37 @@ void LLFloaterPathfindingLinksets::onClose(bool app_quitting)
}
}
+void LLFloaterPathfindingLinksets::draw()
+{
+ if (mShowBeaconCheckBox->get())
+ {
+ std::vector<LLScrollListItem*> selectedItems = mLinksetsScrollList->getAllSelected();
+ if (!selectedItems.empty())
+ {
+ int numSelectedItems = selectedItems.size();
+
+ std::vector<LLViewerObject *> viewerObjects;
+ viewerObjects.reserve(numSelectedItems);
+
+ for (std::vector<LLScrollListItem*>::const_iterator selectedItemIter = selectedItems.begin();
+ selectedItemIter != selectedItems.end(); ++selectedItemIter)
+ {
+ const LLScrollListItem *selectedItem = *selectedItemIter;
+
+ const std::string &objectName = selectedItem->getColumn(0)->getValue().asString();
+
+ LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
+ if (viewerObject != NULL)
+ {
+ gObjectList.addDebugBeacon(viewerObject->getPositionAgent(), objectName, LLColor4(0.f, 0.f, 1.f, 0.8f), LLColor4(1.f, 1.f, 1.f, 1.f), 6);
+ }
+ }
+ }
+ }
+
+ LLFloater::draw();
+}
+
void LLFloaterPathfindingLinksets::openLinksetsEditor()
{
LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets");