From 3b4d841ee254186d881490cfadbdfbac6dcdf6ad Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 23 Jan 2012 18:27:10 -0800 Subject: Introducing a hacky way to get some reporting on the downloading status of the navmesh into the console. This needs to be seriously refactored. --- indra/newview/llfloaterpathfindingconsole.cpp | 13 +++++++++++++ indra/newview/llfloaterpathfindingconsole.h | 3 +++ indra/newview/llnavmeshstation.cpp | 6 +++++- indra/newview/llnavmeshstation.h | 8 +++++++- .../skins/default/xui/en/floater_pathfinding_console.xml | 7 ++++--- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 7b8ede410c..63b863937e 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -307,6 +307,18 @@ void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 pTerrainMaterial) mTerrainMaterialD->setValue(LLSD(pTerrainMaterial)); } +void LLFloaterPathfindingConsole::setHasNavMeshReceived() +{ + std::string str = getString("navmesh_fetch_complete_available"); + mPathfindingStatus->setText((LLStringExplicit)str); +} + +void LLFloaterPathfindingConsole::setHasNoNavMesh() +{ + std::string str = getString("navmesh_fetch_complete_none"); + mPathfindingStatus->setText((LLStringExplicit)str); +} + LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mShowNavMeshCheckBox(NULL), @@ -324,6 +336,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mTerrainMaterialD(NULL), mNavMeshDownloadObserver() { + mNavMeshDownloadObserver.setPathfindingConsole(this); } LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole() diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index ffa1efd349..7d8369c806 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -98,6 +98,9 @@ public: BOOL getShowPathToggle() const {return mShowPathCheckBox->get(); } + void setHasNavMeshReceived(); + void setHasNoNavMesh(); + protected: private: diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index bb08f00f40..48f54649f8 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -31,10 +31,13 @@ #include "llagent.h" #include "llviewerregion.h" #include "llsdutil.h" +#include "llfloaterpathfindingconsole.h" + //=============================================================================== LLNavMeshStation::LLNavMeshStation() { } + //=============================================================================== class LLNavMeshUploadResponder : public LLCurl::Responder { @@ -98,7 +101,6 @@ public: void result( const LLSD& content ) { - llinfos<<"Content received"<extractNavMeshSrcFromLLSD( stuff ); + pObserver->getPathfindingConsole()->setHasNavMeshReceived(); } else { llwarns<<"no mesh data "<getPathfindingConsole()->setHasNoNavMesh(); } } } diff --git a/indra/newview/llnavmeshstation.h b/indra/newview/llnavmeshstation.h index ce884c1466..566f6d2d8d 100644 --- a/indra/newview/llnavmeshstation.h +++ b/indra/newview/llnavmeshstation.h @@ -31,6 +31,7 @@ #include "llhandle.h" //=============================================================================== class LLCurlRequest; +class LLFloaterPathfindingConsole; //=============================================================================== class LLNavMeshObserver { @@ -51,14 +52,19 @@ class LLNavMeshDownloadObserver { public: //Ctor - LLNavMeshDownloadObserver() { mObserverHandle.bind(this); } + LLNavMeshDownloadObserver() + : mPathfindingConsole(NULL) + { mObserverHandle.bind(this); } //Dtor virtual ~LLNavMeshDownloadObserver() {} //Accessor for the observers handle const LLHandle& getObserverHandle() const { return mObserverHandle; } + LLFloaterPathfindingConsole *getPathfindingConsole() {return mPathfindingConsole;} + void setPathfindingConsole(LLFloaterPathfindingConsole *pPathfindingConsole) {mPathfindingConsole = pPathfindingConsole;} protected: LLRootHandle mObserverHandle; + LLFloaterPathfindingConsole *mPathfindingConsole; }; //=============================================================================== class LLNavMeshStation : public LLSingleton diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index f9730e2ece..7b751d525f 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -13,9 +13,10 @@ width="833"> Downloading the navmesh ... - Navmesh received. - Pathfinding is not enabled for this region - Cannot find pathing library implementation + Navmesh received. + No navmesh for region. + Pathfinding is not enabled for this region. + Cannot find pathing library implementation.