diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-06-19 20:09:35 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-19 20:09:35 -0700 |
commit | 37e6aa609f2ccd49e6225bad5186ec6ba49b9cb7 (patch) | |
tree | 5f2020a8e3b81a65884486b18875b24acf1a4a50 /indra/newview/llpanelnavmeshrebake.cpp | |
parent | b98cbe00fe885cebebe1ec5fd123c969b5d2c29f (diff) |
PATH-723: Pulling in whether the user has access to view the rebake navmesh button or not.
Diffstat (limited to 'indra/newview/llpanelnavmeshrebake.cpp')
-rw-r--r-- | indra/newview/llpanelnavmeshrebake.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/indra/newview/llpanelnavmeshrebake.cpp b/indra/newview/llpanelnavmeshrebake.cpp index 0cc0d6c50a..283d6dfff5 100644 --- a/indra/newview/llpanelnavmeshrebake.cpp +++ b/indra/newview/llpanelnavmeshrebake.cpp @@ -76,6 +76,12 @@ BOOL LLPanelNavMeshRebake::postBuild() mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLPanelNavMeshRebake::handleRegionBoundaryCrossed, this)); } + if (!mAgentStateSlot.connected()) + { + mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLPanelNavMeshRebake::handleAgentState, this, _1)); + } + LLPathfindingManager::getInstance()->requestGetAgentState(); + return LLPanel::postBuild(); } @@ -98,10 +104,12 @@ BOOL LLPanelNavMeshRebake::handleToolTip( S32 x, S32 y, MASK mask ) } LLPanelNavMeshRebake::LLPanelNavMeshRebake() - : mNavMeshRebakeButton( NULL ), + : mCanRebakeRegion(TRUE), + mNavMeshRebakeButton( NULL ), mNavMeshBakingButton( NULL ), mNavMeshSlot(), - mRegionCrossingSlot() + mRegionCrossingSlot(), + mAgentStateSlot() { // make sure we have the only instance of this class static bool b = true; @@ -130,15 +138,16 @@ void LLPanelNavMeshRebake::setMode(ERebakeNavMeshMode pRebakeNavMeshMode) void LLPanelNavMeshRebake::onNavMeshRebakeClick() { -#if 0 - mNavMeshRebakeButton->setVisible( FALSE ); - mNavMeshBakingButton->setVisible( TRUE ); - mNavMeshBakingButton->setForcePressedState( TRUE ); -#endif setMode(kRebakeNavMesh_RequestSent); LLPathfindingManager::getInstance()->requestRebakeNavMesh(boost::bind(&LLPanelNavMeshRebake::handleRebakeNavMeshResponse, this, _1)); } +void LLPanelNavMeshRebake::handleAgentState(BOOL pCanRebakeRegion) +{ + mCanRebakeRegion = pCanRebakeRegion; + llinfos << "STINSON DEBUG: canRebakeRegion => " << (pCanRebakeRegion ? "TRUE" : "FALSE") << llendl; +} + void LLPanelNavMeshRebake::handleRebakeNavMeshResponse(bool pResponseStatus) { setMode(pResponseStatus ? kRebakeNavMesh_NotAvailable : kRebakeNavMesh_Available); @@ -176,6 +185,7 @@ void LLPanelNavMeshRebake::handleNavMeshStatus(const LLPathfindingNavMeshStatus void LLPanelNavMeshRebake::handleRegionBoundaryCrossed() { createNavMeshStatusListenerForCurrentRegion(); + LLPathfindingManager::getInstance()->requestGetAgentState(); } void LLPanelNavMeshRebake::createNavMeshStatusListenerForCurrentRegion() |