diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-02-09 18:40:23 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-02-09 18:40:23 -0800 |
commit | 50ba8b4ac1faffd7d0cd0b25351f1c5a8645e40f (patch) | |
tree | dd61760380e6ef6671c656fac0c4c71a1f24d859 /indra | |
parent | 3a9f437fdfff07264b5c71803541f4dff04f746f (diff) |
PATH-245: Adding initial functionality for rendering debug beacons for selected pathfinding characters.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.h | 2 |
2 files changed, 33 insertions, 8 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index f1f9ef6278..561ad9535b 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -92,7 +92,6 @@ BOOL LLFloaterPathfindingCharacters::postBuild() mShowBeaconCheckBox = findChild<LLCheckBoxCtrl>("show_beacon");
llassert(mShowBeaconCheckBox != NULL);
- mShowBeaconCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingCharacters::onShowBeaconToggled, this));
mTakeBtn = findChild<LLButton>("take_characters");
llassert(mTakeBtn != NULL)
@@ -345,11 +344,6 @@ void LLFloaterPathfindingCharacters::onSelectNoneCharactersClicked() selectNoneCharacters();
}
-void LLFloaterPathfindingCharacters::onShowBeaconToggled()
-{
- llwarns << "functionality has not yet been implemented to toggle show beacon" << llendl;
-}
-
void LLFloaterPathfindingCharacters::onTakeCharactersClicked()
{
handle_take();
@@ -531,7 +525,7 @@ void LLFloaterPathfindingCharacters::updateActionFields() void LLFloaterPathfindingCharacters::setEnableActionFields(BOOL pEnabled)
{
mLabelActions->setEnabled(pEnabled);
- mShowBeaconCheckBox->setEnabled(false && pEnabled);
+ mShowBeaconCheckBox->setEnabled(pEnabled);
mTakeBtn->setEnabled(pEnabled && tools_visible_take_object());
mTakeCopyBtn->setEnabled(pEnabled && enable_object_take_copy());
mReturnBtn->setEnabled(false && pEnabled);
@@ -539,6 +533,37 @@ void LLFloaterPathfindingCharacters::setEnableActionFields(BOOL pEnabled) mTeleportBtn->setEnabled(pEnabled && (mCharactersScrollList->getNumSelected() == 1));
}
+void LLFloaterPathfindingCharacters::draw()
+{
+ if (mShowBeaconCheckBox->get())
+ {
+ std::vector<LLScrollListItem*> selectedItems = mCharactersScrollList->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();
+}
+
//---------------------------------------------------------------------------
// CharactersGetResponder
//---------------------------------------------------------------------------
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 53d22a8951..1e4acd084e 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -65,6 +65,7 @@ public: virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
virtual void onClose(bool app_quitting);
+ virtual void draw();
EMessagingState getMessagingState() const;
BOOL isMessagingInProgress() const;
@@ -108,7 +109,6 @@ private: void onRefreshCharactersClicked();
void onSelectAllCharactersClicked();
void onSelectNoneCharactersClicked();
- void onShowBeaconToggled();
void onTakeCharactersClicked();
void onTakeCopyCharactersClicked();
void onReturnCharactersClicked();
|