Skip to content
Snippets Groups Projects
Commit 3b4d841e authored by Todd Stinson's avatar Todd Stinson
Browse files

Introducing a hacky way to get some reporting on the downloading status of the...

Introducing a hacky way to get some reporting on the downloading status of the navmesh into the console.  This needs to be seriously refactored.
parent 3f330d29
No related branches found
No related tags found
No related merge requests found
...@@ -307,6 +307,18 @@ void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 pTerrainMaterial) ...@@ -307,6 +307,18 @@ void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 pTerrainMaterial)
mTerrainMaterialD->setValue(LLSD(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) LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
: LLFloater(pSeed), : LLFloater(pSeed),
mShowNavMeshCheckBox(NULL), mShowNavMeshCheckBox(NULL),
...@@ -324,6 +336,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) ...@@ -324,6 +336,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mTerrainMaterialD(NULL), mTerrainMaterialD(NULL),
mNavMeshDownloadObserver() mNavMeshDownloadObserver()
{ {
mNavMeshDownloadObserver.setPathfindingConsole(this);
} }
LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole() LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole()
......
...@@ -98,6 +98,9 @@ class LLFloaterPathfindingConsole ...@@ -98,6 +98,9 @@ class LLFloaterPathfindingConsole
BOOL getShowPathToggle() const {return mShowPathCheckBox->get(); } BOOL getShowPathToggle() const {return mShowPathCheckBox->get(); }
void setHasNavMeshReceived();
void setHasNoNavMesh();
protected: protected:
private: private:
......
...@@ -31,10 +31,13 @@ ...@@ -31,10 +31,13 @@
#include "llagent.h" #include "llagent.h"
#include "llviewerregion.h" #include "llviewerregion.h"
#include "llsdutil.h" #include "llsdutil.h"
#include "llfloaterpathfindingconsole.h"
//=============================================================================== //===============================================================================
LLNavMeshStation::LLNavMeshStation() LLNavMeshStation::LLNavMeshStation()
{ {
} }
//=============================================================================== //===============================================================================
class LLNavMeshUploadResponder : public LLCurl::Responder class LLNavMeshUploadResponder : public LLCurl::Responder
{ {
...@@ -98,7 +101,6 @@ class LLNavMeshDownloadResponder : public LLCurl::Responder ...@@ -98,7 +101,6 @@ class LLNavMeshDownloadResponder : public LLCurl::Responder
void result( const LLSD& content ) void result( const LLSD& content )
{ {
llinfos<<"Content received"<<llendl;
//TODO# some sanity checking //TODO# some sanity checking
if ( content.has("error") ) if ( content.has("error") )
{ {
...@@ -115,10 +117,12 @@ class LLNavMeshDownloadResponder : public LLCurl::Responder ...@@ -115,10 +117,12 @@ class LLNavMeshDownloadResponder : public LLCurl::Responder
{ {
const LLSD::Binary& stuff = content["navmesh_data"].asBinary(); const LLSD::Binary& stuff = content["navmesh_data"].asBinary();
LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff ); LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff );
pObserver->getPathfindingConsole()->setHasNavMeshReceived();
} }
else else
{ {
llwarns<<"no mesh data "<<llendl; llwarns<<"no mesh data "<<llendl;
pObserver->getPathfindingConsole()->setHasNoNavMesh();
} }
} }
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "llhandle.h" #include "llhandle.h"
//=============================================================================== //===============================================================================
class LLCurlRequest; class LLCurlRequest;
class LLFloaterPathfindingConsole;
//=============================================================================== //===============================================================================
class LLNavMeshObserver class LLNavMeshObserver
{ {
...@@ -51,14 +52,19 @@ class LLNavMeshDownloadObserver ...@@ -51,14 +52,19 @@ class LLNavMeshDownloadObserver
{ {
public: public:
//Ctor //Ctor
LLNavMeshDownloadObserver() { mObserverHandle.bind(this); } LLNavMeshDownloadObserver()
: mPathfindingConsole(NULL)
{ mObserverHandle.bind(this); }
//Dtor //Dtor
virtual ~LLNavMeshDownloadObserver() {} virtual ~LLNavMeshDownloadObserver() {}
//Accessor for the observers handle //Accessor for the observers handle
const LLHandle<LLNavMeshDownloadObserver>& getObserverHandle() const { return mObserverHandle; } const LLHandle<LLNavMeshDownloadObserver>& getObserverHandle() const { return mObserverHandle; }
LLFloaterPathfindingConsole *getPathfindingConsole() {return mPathfindingConsole;}
void setPathfindingConsole(LLFloaterPathfindingConsole *pPathfindingConsole) {mPathfindingConsole = pPathfindingConsole;}
protected: protected:
LLRootHandle<LLNavMeshDownloadObserver> mObserverHandle; LLRootHandle<LLNavMeshDownloadObserver> mObserverHandle;
LLFloaterPathfindingConsole *mPathfindingConsole;
}; };
//=============================================================================== //===============================================================================
class LLNavMeshStation : public LLSingleton<LLNavMeshStation> class LLNavMeshStation : public LLSingleton<LLNavMeshStation>
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
width="833"> width="833">
<floater.string name="navmesh_fetch_initial"></floater.string> <floater.string name="navmesh_fetch_initial"></floater.string>
<floater.string name="navmesh_fetch_inprogress">Downloading the navmesh ...</floater.string> <floater.string name="navmesh_fetch_inprogress">Downloading the navmesh ...</floater.string>
<floater.string name="navmesh_fetch_complete">Navmesh received.</floater.string> <floater.string name="navmesh_fetch_complete_available">Navmesh received.</floater.string>
<floater.string name="navmesh_region_not_enabled">Pathfinding is not enabled for this region</floater.string> <floater.string name="navmesh_fetch_complete_none">No navmesh for region.</floater.string>
<floater.string name="navmesh_library_not_implemented">Cannot find pathing library implementation</floater.string> <floater.string name="navmesh_region_not_enabled">Pathfinding is not enabled for this region.</floater.string>
<floater.string name="navmesh_library_not_implemented">Cannot find pathing library implementation.</floater.string>
<text <text
height="13" height="13"
word_wrap="true" word_wrap="true"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment