summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-13 18:32:06 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-13 18:32:06 -0800
commit76959fdb455e5fc3f08b0e1f61f13f14c0d87303 (patch)
treeee9b5c6df9fe00a75b9bdd5b68218bb25ed3d98e
parent0f61d3e60f89f4a2b22732c5acf1ff85bbbe4f77 (diff)
PATH-284: Hooking up the characters button to open the characters floater.
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.cpp67
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.h2
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp7
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h1
4 files changed, 46 insertions, 31 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index 25642f0226..a64a9f5aa2 100644
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -153,6 +153,42 @@ void LLFloaterPathfindingCharacters::onClose(bool app_quitting)
}
}
+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();
+}
+
+void LLFloaterPathfindingCharacters::openCharactersViewer()
+{
+ LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_characters");
+}
+
LLFloaterPathfindingCharacters::EMessagingState LLFloaterPathfindingCharacters::getMessagingState() const
{
return mMessagingState;
@@ -533,37 +569,6 @@ 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 1e4acd084e..ecc605c300 100644
--- a/indra/newview/llfloaterpathfindingcharacters.h
+++ b/indra/newview/llfloaterpathfindingcharacters.h
@@ -67,6 +67,8 @@ public:
virtual void onClose(bool app_quitting);
virtual void draw();
+ static void openCharactersViewer();
+
EMessagingState getMessagingState() const;
BOOL isMessagingInProgress() const;
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index e361b62a6e..9a1651f537 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -28,6 +28,7 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterpathfindingconsole.h"
#include "llfloaterpathfindinglinksets.h"
+#include "llfloaterpathfindingcharacters.h"
#include "llsd.h"
#include "llhandle.h"
@@ -62,6 +63,7 @@ LLHandle<LLFloaterPathfindingConsole> LLFloaterPathfindingConsole::sInstanceHand
BOOL LLFloaterPathfindingConsole::postBuild()
{
+ childSetAction("view_characters_floater", boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this));
childSetAction("view_and_edit_linksets", boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this));
mShowNavMeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh");
@@ -487,6 +489,11 @@ void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
}
+void LLFloaterPathfindingConsole::onViewCharactersClicked()
+{
+ LLFloaterPathfindingCharacters::openCharactersViewer();
+}
+
void LLFloaterPathfindingConsole::onViewEditLinksetClicked()
{
LLFloaterPathfindingLinksets::openLinksetsEditor();
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index 5a7edeb126..2a813de657 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -90,6 +90,7 @@ private:
void onShowWorldToggle();
void onCharacterWidthSet();
void onCharacterTypeSwitch();
+ void onViewCharactersClicked();
void onViewEditLinksetClicked();
void generatePath();